com.jstatcom.ts
Class TSActionTypes
- java.lang.Object
-
- javax.swing.AbstractAction
-
- com.jstatcom.ts.TSActionTypes
-
- All Implemented Interfaces:
- TSListAccessor, java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
public abstract class TSActionTypes extends javax.swing.AbstractAction implements TSListAccessor
This class holds default actions used by theTSList. The defined actions overrideexecute(TSList tsList)to provide the a specific function on the underlyingTSList, for example deleting all selected entries, changing the types of selected entires, etc.. The actions can be invoked via keys and/or items in theDefaultTSListPopupthat is opened via a RIGHT click over theTSList.New actions may be provided by subclassing this abstract class and setting the new action instance to the default
DefaultTSListPopup. Also, existing actions may be removed from there.If new actions should also be accessible via keys, they can be added to the
DefaultTSKeyListener.This class implements the typesave enum pattern (Joshua Bloch, "Effective Java", Item 21) . If you compare
TSActionTypes, always use the==operator.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static TSActionTypesCREATE_DUMMYCreates dummy variables by invoking a dialog.static TSActionTypesDELETEDeletes selected time series after asking to confirm.static TSActionTypesDETERMINISTICSets type of selectedTSto deterministic.static TSActionTypesEDIT_TSInvokes theTSEditorDialog.static TSActionTypesENDOGENOUSSets type of selectedTSto endogenous.static TSActionTypesEXOGENOUSSets type of selectedTSto exogenous.static TSActionTypesRENAMERenames time series by showing an input dialog.static TSActionTypesSAVE_DATSaves selected time series in aDatfile.static TSActionTypesSHOW_DESCRIPTIONShows the description for prohject of the 1st selected time series.static TSActionTypesTRANSFORMTransforms time series by invoking a dialog.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidactionPerformed(java.awt.event.ActionEvent e)Tries to retrieve TSList and triggers doAction.abstract voiddoAction(TSList tsList)This defines the operation that is actually carried out by the action.voidenableForTSList(TSList tsList)Enables/disables the action according to the state of the underlying list.booleanequals(java.lang.Object o)Override prevention method to enforcea.equals(b)if and onlyif a==b.inthashCode()Override prevention method invokes super method.java.lang.StringtoString()Returns the name of the actiontype, do not use for comparisons.
-
-
-
Field Detail
-
DELETE
public static final TSActionTypes DELETE
Deletes selected time series after asking to confirm.
-
RENAME
public static final TSActionTypes RENAME
Renames time series by showing an input dialog.
-
TRANSFORM
public static final TSActionTypes TRANSFORM
Transforms time series by invoking a dialog.
-
CREATE_DUMMY
public static final TSActionTypes CREATE_DUMMY
Creates dummy variables by invoking a dialog.
-
SHOW_DESCRIPTION
public static final TSActionTypes SHOW_DESCRIPTION
Shows the description for prohject of the 1st selected time series.
-
SAVE_DAT
public static final TSActionTypes SAVE_DAT
Saves selected time series in aDatfile.
-
EDIT_TS
public static final TSActionTypes EDIT_TS
Invokes theTSEditorDialog.
-
ENDOGENOUS
public static final TSActionTypes ENDOGENOUS
Sets type of selectedTSto endogenous.
-
EXOGENOUS
public static final TSActionTypes EXOGENOUS
Sets type of selectedTSto exogenous.
-
DETERMINISTIC
public static final TSActionTypes DETERMINISTIC
Sets type of selectedTSto deterministic.
-
-
Method Detail
-
actionPerformed
public final void actionPerformed(java.awt.event.ActionEvent e)
Tries to retrieve TSList and triggers doAction.- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener- Parameters:
e- an action event
-
doAction
public abstract void doAction(TSList tsList)
This defines the operation that is actually carried out by the action. The method must be overridden if you define a new action.- Parameters:
tsList- the TSList to operate on
-
enableForTSList
public void enableForTSList(TSList tsList)
Enables/disables the action according to the state of the underlying list. The default is that the action is disabled if nothing is selected. This can be changed by overriding the method. Apart from that, the currently available TSList is set.- Specified by:
enableForTSListin interfaceTSListAccessor- Parameters:
tsList- theTSListto be referenced by the action
-
equals
public final boolean equals(java.lang.Object o)
Override prevention method to enforcea.equals(b)if and onlyif a==b.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- object to compare with- Returns:
trueif equal,falseotherwise
-
hashCode
public final int hashCode()
Override prevention method invokes super method.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hash code
-
toString
public final java.lang.String toString()
Returns the name of the actiontype, do not use for comparisons.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation
-
-
DMelt 3.0 © DataMelt by jWork.ORG