Class MatchesTextArea

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, IEntryEventListener, IProjectEventListener, IMatcher, IPaneMenu

public class MatchesTextArea extends EntryInfoThreadPane<List<NearString>> implements IMatcher, IPaneMenu
This is a Match pane, that displays fuzzy matches.
See Also:
  • Constructor Details

    • MatchesTextArea

      public MatchesTextArea(IMainWindow mw)
      Creates new form MatchGlossaryPane
  • Method Details

    • onEntryActivated

      public void onEntryActivated(SourceTextEntry newEntry)
      Description copied from interface: IEntryEventListener
      Called on new entry activated or current entry deactivated.
      Specified by:
      onEntryActivated in interface IEntryEventListener
      Overrides:
      onEntryActivated in class EntryInfoThreadPane<List<NearString>>
      Parameters:
      newEntry - new entry instance which activated, or null if entry deactivated
    • getActiveMatch

      public NearString getActiveMatch()
      Get selected match. Must be called from UI thread only.
      Specified by:
      getActiveMatch in interface IMatcher
    • substituteNumbers

      public String substituteNumbers(String source, String sourceMatch, String targetMatch)
      Attempts to substitute numbers in a match with numbers from the source segment. For substitution to be done, the number of numbers must be the same between source and matches, and the numbers must be the same between the source match and the target match. The order of the numbers can be different between the source match and the target match. Numbers will be substituted at the correct location.
      Specified by:
      substituteNumbers in interface IMatcher
      Parameters:
      source - The source segment
      sourceMatch - The source of the match
      targetMatch - The target of the match
      Returns:
      The target match with numbers possibly substituted
    • setActiveMatch

      public void setActiveMatch(int activeMatch)
      Sets the index of an active match. It basically highlights the fuzzy match string selected. (numbers start from 0)
      Specified by:
      setActiveMatch in interface IMatcher
      Parameters:
      activeMatch - new active match Must be called from UI thread only.
    • clear

      public void clear()
      Clears up the pane.
      Overrides:
      clear in class EntryInfoPane<List<NearString>>
    • setNextActiveMatch

      public void setNextActiveMatch()
      Make the next match active
      Specified by:
      setNextActiveMatch in interface IMatcher
    • setPrevActiveMatch

      public void setPrevActiveMatch()
      Make the previous match active
      Specified by:
      setPrevActiveMatch in interface IMatcher
    • populatePaneMenu

      public void populatePaneMenu(JPopupMenu menu)
      Specified by:
      populatePaneMenu in interface IPaneMenu