Class TierEdit<T>

All Implemented Interfaces:
IExtendable, Serializable, UndoableEdit
Direct Known Subclasses:
IPALookupEdit, RecordSegmentEdit

public class TierEdit<T> extends SessionUndoableEdit

A change to the value of a Tier. The record parameter is optional, however if it is not null additional operations (such as syllabification and alignment) will be performed on dependent tiers. If the tier is not currently in the record it is added when this edit is performed.

An EditorEventType.TierChange event will be issued for each altered tier with valueAdjusting set to true. If this edit's valueAdjusting is false, another event will also be issued for each tier with valueAdjusting set to false. This should be the end of a sequence of change events on the same tier. By default valueAdjusting is true.

If the tier is blind and the provided transcriber is not Transcriber.VALIDATOR Blind transcriptions are modified instead of tier value. When modifying blind transcriptions EditorEventType.TierChangeData.oldValue() and EditorEventType.TierChangeData.newValue() will be the values for the provided transcriber and not the value returned by Tier.getValue().

Secondary behaviours may be added to tier edits by supplying an implementation of TierEdit.DependentTierChanges as an extension on the tier object. Secondary actions are responsible for firing TierChange events for any modified tiers. Multiple secondary actions may be added using TierEdit.DependentTierChangeChain.

See Also:
  • Constructor Details

  • Method Details

    • getUndoPresentationName

      public String getUndoPresentationName()
      Specified by:
      getUndoPresentationName in interface UndoableEdit
      Overrides:
      getUndoPresentationName in class AbstractUndoableEdit
    • getRedoPresentationName

      public String getRedoPresentationName()
      Specified by:
      getRedoPresentationName in interface UndoableEdit
      Overrides:
      getRedoPresentationName in class AbstractUndoableEdit
    • getTranscriber

      public Transcriber getTranscriber()
    • getRecord

      public Record getRecord()
    • getOldValue

      public T getOldValue()
    • getTier

      public Tier<T> getTier()
    • getNewValue

      public T getNewValue()
    • isValueAdjusting

      public boolean isValueAdjusting()
    • setValueAdjusting

      public void setValueAdjusting(boolean valueAdjusting)
    • putAdditionalTierChange

      public void putAdditionalTierChange(String tierName, Object value)
    • getAdditionalTierChange

      public Object getAdditionalTierChange(String tierName)
    • isFireHardChangeOnUndo

      @Deprecated public boolean isFireHardChangeOnUndo()
      Deprecated.
      opposite of valueAdjusting
      Returns:
      !isValueIsAdjusting()z
    • setFireHardChangeOnUndo

      @Deprecated public void setFireHardChangeOnUndo(boolean fireHardChangeOnUndo)
      Deprecated.
      use setValueAdjusting
      Parameters:
      fireHardChangeOnUndo -
    • fireTierChange

      public <R> void fireTierChange(Tier<R> tier, R oldValue, R newValue)
      Fire tier change events for given tier oldLoc value and new value
      Type Parameters:
      R - type of provided tier and values
      Parameters:
      tier -
      oldValue -
      newValue -
    • doIt

      public void doIt()
      Description copied from class: SessionUndoableEdit
      'Do' the specified action. The method is called by the EditorUnsoSupport when new edits are posted.
      Specified by:
      doIt in class SessionUndoableEdit
    • undo

      public void undo()
      Specified by:
      undo in interface UndoableEdit
      Overrides:
      undo in class AbstractUndoableEdit
    • performDependentTierChanges

      protected void performDependentTierChanges()
      Called on doIt() and undo() this will apply any dependent tier changes such as phone alignment or segment adjustments.