Class Phase2D.TraitCommand
Object
TraitCommand
- All Implemented Interfaces:
Scheduler.ScheduledCommand, Command
- Enclosing class:
Phase2D
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) intThe axis that this command affects.(package private) intThe index of the trait to show on the axis.(package private) ContextMenuCheckBoxItem[]The list of traits to toggle.static final intThe index of the horizontal axis.static final intThe index of the vertical axis. -
Constructor Summary
ConstructorsConstructorDescriptionTraitCommand(ContextMenuCheckBoxItem[] traitItems, int trait, int axis) Construct a new command to toggle the inclusion of a trait on either one of the phase plane axes. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Toggle the inclusion of the trait on the axis.(package private) int[]toggleState(int[] states, ContextMenuCheckBoxItem[] items) Toggle the inclusion of traits that are selected initemson the current axis.
-
Field Details
-
X_AXIS
public static final int X_AXISThe index of the horizontal axis.- See Also:
-
Y_AXIS
public static final int Y_AXISThe index of the vertical axis.- See Also:
-
trait
int traitThe index of the trait to show on the axis. -
axis
int axisThe axis that this command affects. -
traitItems
ContextMenuCheckBoxItem[] traitItemsThe list of traits to toggle.
-
-
Constructor Details
-
TraitCommand
Construct a new command to toggle the inclusion of a trait on either one of the phase plane axes.- Parameters:
traitItems- the list of traits to toggletrait- the index of the trait to show/hide on the axisaxis- the index of the axis
-
-
Method Details
-
execute
public void execute()Toggle the inclusion of the trait on the axis.- Specified by:
executein interfaceCommand- Specified by:
executein interfaceScheduler.ScheduledCommand
-
toggleState
Toggle the inclusion of traits that are selected initemson the current axis.- Parameters:
states- the list of trait indices that are displayed on current axisitems- the list of context menu items- Returns:
- the updated list of trait indices
-