Class MatchSpec

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
InterMatchSpec, IntraMatchSpec, PairMatchSpec

public abstract class MatchSpec extends JPanel
Abstract class defining general characteristics of a component which can perform some sort of matching action and present itself graphically.
Since:
18 Mar 2004
Author:
Mark Taylor (Starlink)
See Also:
  • Field Details

    • MATCHTYPE_INFO

      public static final uk.ac.starlink.table.ValueInfo MATCHTYPE_INFO
    • ENGINE_INFO

      public static final uk.ac.starlink.table.ValueInfo ENGINE_INFO
  • Constructor Details

    • MatchSpec

      public MatchSpec()
  • Method Details

    • calculate

      public abstract void calculate(uk.ac.starlink.table.join.ProgressIndicator indicator) throws IOException, InterruptedException
      Performs the match calculation. This method is called from a thread other than the event dispatch thread, so it can take its time, and must not call Swing things.
      Parameters:
      indicator - a progress indicator which the calculation should try to update
      Throws:
      IOException - if there's some trouble
      InterruptedException - if the user interrupts the calculation
    • matchSuccess

      public abstract void matchSuccess(Component parent)
      This method is called from the event dispatch thread if the calculation terminates normally.
      Parameters:
      parent - window controlling the invocation
    • checkArguments

      public abstract void checkArguments()
      Invoked from the event dispatch thread before calculate(uk.ac.starlink.table.join.ProgressIndicator) is called. A check should be made that it is sensible to call calculate; if not an exception should be thrown.
      Throws:
      IllegalStateException - (with a message suitable for presentation to the user) if calculate cannot be called in the current state
    • matchFailure

      public void matchFailure(Throwable th, Component parent)
      This method is called from the event dispatch thread if the calculation terminates with an exception.
      Parameters:
      th - exception characterising the failure
      parent - window controlling the invocation
    • getPanel

      public JComponent getPanel()
      Returns a graphical component which can be presented to the user representing the match to be carried out. The user may interact with this to modify the match characteristics.
      Returns:
      graphical component
    • getTupleSelectors

      public abstract TupleSelector[] getTupleSelectors()
      Returns the components used to supply input value expressions.
      Returns:
      array of tuple selectors
    • getOutputSettings

      public abstract uk.ac.starlink.ttools.task.Setting[] getOutputSettings(uk.ac.starlink.task.Task task)
      Returns stilts command settings specific to this MatchSpec that control match output table generation.
      Parameters:
      task - stilts match task
      Returns:
      output settings array
    • addActionListener

      public void addActionListener(ActionListener l)
      Adds a listener to be notified if the settings of this object change in a way that might change the details of the match being specified.
      Parameters:
      l - listener to add
    • removeActionListener

      public void removeActionListener(ActionListener l)
      Removes a previously added listener.
      Parameters:
      l - listener to remove
    • getDefaultFixActions

      public uk.ac.starlink.table.JoinFixAction[] getDefaultFixActions(int nTable)
      Returns a standard set of FixActions for a given number of tables.
      Parameters:
      nTable - number of tables
      Returns:
      nTable-element array of sensible FixActions
    • showSuccessMessage

      public static void showSuccessMessage(Component parent, String[] lines, Action plotAct)
      Displays a modal dialogue containing a message, and possibly the option to plot the match result.
      Parameters:
      parent - parent component
      lines - lines of text summarising the result
      plotAct - an action which can generate a plot of the match result