story.scheherazade.virgil
Class PredicateSelector

java.lang.Object
  extended by story.scheherazade.virgil.PredicateSelector
All Implemented Interfaces:
SCHSelector, SCHSelectorWithBrowser

public class PredicateSelector
extends java.lang.Object
implements SCHSelectorWithBrowser


Constructor Summary
PredicateSelector(Virgil virgil, PlannerRepository planners, ElementBrowser browser, Verbalizer verbalizer, SCHSelector parentSelector, int recursionDepth, java.lang.String prompt)
          Set up a selector.
 
Method Summary
 void buildForm(GenericScheherID selectedFrame)
          Prepare the data structures for the argument selector form.
 javax.swing.JComponent getPanel()
          Get the JComponent of the GUI front-end of the selector.
 java.lang.Object getSelection()
          Get the selected predicate.
 SCHVariableType getType()
           
 void initialize(StoryInterpreter story, TimelineID timeline, PredicateSelectorMode mode, boolean inheritSupertimelines, PredicateSelectorParams config)
          Clear the selector and reboot it with a "choose a condition/action type" combo box.
 void redoLayout()
          Lay out everything again.
 boolean selectionReady()
          Returns whether the predicate has been successfully entered by the user yet.
 void setSelection(java.lang.Object selection)
          Set the selection.
 void subSelectorCancelling()
          Indicates to the selector that a subordinate selector (such as the parameters within a ConditionSelector) has been told by the user to cancel the selection process.
 void subSelectorSet(SCHSelector subSelector)
          One of the sub-selectors in the form is telling us that a new value has been entered.
 void subSelectorSubmitting()
          Indicates to the selector that a subordinate selector (such as the parameters within a ConditionSelector) has been told by the user that their value is final.
 void takeBrowser()
          Take control of the ElementBrowser.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PredicateSelector

public PredicateSelector(Virgil virgil,
                         PlannerRepository planners,
                         ElementBrowser browser,
                         Verbalizer verbalizer,
                         SCHSelector parentSelector,
                         int recursionDepth,
                         java.lang.String prompt)
                  throws Scheherexception
Set up a selector.

Throws:
Scheherexception
Method Detail

initialize

public void initialize(StoryInterpreter story,
                       TimelineID timeline,
                       PredicateSelectorMode mode,
                       boolean inheritSupertimelines,
                       PredicateSelectorParams config)
                throws Scheherexception
Clear the selector and reboot it with a "choose a condition/action type" combo box.

Throws:
Scheherexception

takeBrowser

public void takeBrowser()
                 throws Scheherexception
Description copied from interface: SCHSelectorWithBrowser
Take control of the ElementBrowser.

Specified by:
takeBrowser in interface SCHSelectorWithBrowser
Throws:
Scheherexception

redoLayout

public void redoLayout()
Lay out everything again. Need to call this when a particular component needs more space than it was originally allocated

Specified by:
redoLayout in interface SCHSelector

buildForm

public void buildForm(GenericScheherID selectedFrame)
               throws Scheherexception
Prepare the data structures for the argument selector form. Executed when the user selects a condition/action type.

Throws:
Scheherexception

getPanel

public javax.swing.JComponent getPanel()
Description copied from interface: SCHSelector
Get the JComponent of the GUI front-end of the selector.

Specified by:
getPanel in interface SCHSelector

subSelectorSubmitting

public void subSelectorSubmitting()
Description copied from interface: SCHSelector
Indicates to the selector that a subordinate selector (such as the parameters within a ConditionSelector) has been told by the user that their value is final.

Specified by:
subSelectorSubmitting in interface SCHSelector

subSelectorCancelling

public void subSelectorCancelling()
Description copied from interface: SCHSelector
Indicates to the selector that a subordinate selector (such as the parameters within a ConditionSelector) has been told by the user to cancel the selection process.

This is ONLY ever triggered when the PredicateSelector is initialized with the CANCEL_BUTTON parameter set to true (and, of course, the user chooses to click that button).

Specified by:
subSelectorCancelling in interface SCHSelector

setSelection

public void setSelection(java.lang.Object selection)
                  throws Scheherexception
Description copied from interface: SCHSelector
Set the selection. Throws an exception if the selection is not valid for the selector.

Specified by:
setSelection in interface SCHSelector
Throws:
Scheherexception

subSelectorSet

public void subSelectorSet(SCHSelector subSelector)
One of the sub-selectors in the form is telling us that a new value has been entered. That triggers an update of our assembler button.

Specified by:
subSelectorSet in interface SCHSelector

selectionReady

public boolean selectionReady()
Returns whether the predicate has been successfully entered by the user yet.

Specified by:
selectionReady in interface SCHSelector

getSelection

public java.lang.Object getSelection()
                              throws Scheherexception
Get the selected predicate. Throws an error if it's not yet ready.

Specified by:
getSelection in interface SCHSelector
Throws:
Scheherexception

getType

public SCHVariableType getType()
                        throws Scheherexception
Specified by:
getType in interface SCHSelector
Throws:
Scheherexception


Copyright © 2011 David K. Elson. All Rights Reserved.