Class TSSel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- com.jstatcom.model.ModelPanel
-
- com.jstatcom.ts.TSSel
-
- All Implemented Interfaces:
- Card, SymbolScope, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
public final class TSSel extends ModelPanel
Configurable selection tool for time series. It manages the selection of endogenous, exogenous and deterministic variables and builds the corresponding data objects to be reused by other components via the symboltable. Selection is only allowed for series with the same periodicity and at least 2 observations time overlap.If the underlying symbols are referenced,
JSCTypeDefobjects with the correct types should be specified for the corresponding data:- dRange -
JSCTypes.DRANGE - endogenous names -
JSCTypes.SARRAY - exogenous names -
JSCTypes.SARRAY - deterministic names -
JSCTypes.SARRAY - all names -
JSCTypes.SARRAY - endogenous data -
JSCTypes.NARRAY - exogenous data -
JSCTypes.NARRAY - deterministic data -
JSCTypes.NARRAY - all data -
JSCTypes.NARRAY
It can be configured by specifying several selection options as well as the names of the various data objects.
Data objects are only created if the respective name has been specified. The selected data is automatically truncated if there are missings at the beginning or the end. The objects are created and stored in the following order:
- dRange
- endogenous names
- exogenous names
- deterministic names
- all names
- endogenous data
- exogenous data
- deterministic data
- all data
The ordering might be important when installing symbol listeners. If the listener reacts to a change in a variable, then it should only reference variables that have been created before, e.g. a listener to "all data" can reference "all names" in its action method, but not vice versa. When "all names" changes, "all data" is still empty.
A save way around this problem is to install a listener to the
selectionChangedproperty of theTSSel. APropertyChangeEventfor "selectionChanged" is fired only after all data objects have been created.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Field Summary
-
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor and Description TSSel()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetAllDataName()Gets the allDataName property (String) value.java.lang.StringgetAllStringsName()Gets the allStringsName property (String) value.java.lang.StringgetDateRangeName()Gets the dateRangeName property (String) value.booleangetDatesEditable()java.lang.StringgetDeterministicDataName()Gets the deterministicDataName property (String) value.booleangetDeterministicEnabled()Gets whether deterministic series can be selected.java.lang.StringgetDeterministicStringsName()Gets the deterministicStringsName property (String) value.java.lang.StringgetEndogenousDataName()Gets the endogenousDataName property (String) value.java.lang.StringgetEndogenousStringsName()Gets the endogenousStringsName property (String) value.java.lang.StringgetExogenousDataName()Gets the exogenousDataName property (String) value.booleangetExogenousEnabled()Gets whether exogenous series can be selected.java.lang.StringgetExogenousStringsName()Gets the exogenousStringsName property (String) value.SelectiongetSelection()Gets the current selection set by this component.intgetSelectionMode()Gets the current selection mode.booleanisCheckNaN()Gets whether it is checked whether missing values are in the selection.booleanisOneEndogenousOnly()booleanisUpperScope()Gets whetherScope.UPPERorScope.GLOBALis used.voidsetAllDataName(java.lang.String allDataName)Sets the name of the object holding the data array for all series.voidsetAllStringsName(java.lang.String allStringsName)Sets the name of dataobject that holds the string array of all names.voidsetCheckNaN(boolean checkNaN)Sets whether it is checked whether missing values are in the selection.voidsetDateRangeName(java.lang.String dateRangeName)Sets the name of dataobject that holds the date range of the selected series.voidsetDatesEditable(boolean newDatesEditable)Enables/disables editing of date range.voidsetDeterministicDataName(java.lang.String deterministicDataName)Sets the name of the object holding the deterministic data array.voidsetDeterministicEnabled(boolean arg1)Enables/disables the selection of deterministic variables.voidsetDeterministicStringsName(java.lang.String deterministicStringsName)Sets the name of dataobject that holds the string array of deterministic names.voidsetEnabled(boolean enabled)Enables/disables the component.voidsetEndogenousDataName(java.lang.String endogenousDataName)Sets the name of the object holding the endogenous data array.voidsetEndogenousStringsName(java.lang.String endogenousStringsName)Sets the name of dataobject that holds the string array of endogenous names.voidsetExogenousDataName(java.lang.String exogenousDataName)Sets the name of the object holding the exogenous data array.voidsetExogenousEnabled(boolean arg1)Enables/disables selection of exogenous variables.voidsetExogenousStringsName(java.lang.String exogenousStringsName)Sets the name of dataobject that holds the string array of exogenous names.voidsetOneEndogenousOnly(boolean newOneEndogenousOnly)Sets whether only one endogenous variable should be selectable or more.voidsetSelection(Selection sel)Sets the selection of this component according tosel.voidsetSelectionChanged()Sets the selection changed property and firesPropertyChangeEventif the value changed.voidsetSelectionMode(int selectionMode)Sets the selection mode to be a valid mode forJList.voidsetUpperScope(boolean isUpper)Sets whetherUPPERor defaultGLOBALscope should be used.-
Methods inherited from class com.jstatcom.model.ModelPanel
addNotify, findParentScope, global, local, shown, upper
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Method Detail
-
getAllDataName
public java.lang.String getAllDataName()
Gets the allDataName property (String) value.- Returns:
- the allDataName property value.
- See Also:
setAllDataName(java.lang.String)
-
getAllStringsName
public java.lang.String getAllStringsName()
Gets the allStringsName property (String) value.- Returns:
- the allStringsName property value.
- See Also:
setAllStringsName(java.lang.String)
-
getDatesEditable
public boolean getDatesEditable()
- Returns:
- boolean editable/not editable
- See Also:
setDatesEditable(boolean)
-
getDeterministicDataName
public java.lang.String getDeterministicDataName()
Gets the deterministicDataName property (String) value.- Returns:
- The deterministicDataName property value.
- See Also:
setDeterministicDataName(java.lang.String)
-
getDeterministicEnabled
public boolean getDeterministicEnabled()
Gets whether deterministic series can be selected.- Returns:
- boolean
- See Also:
setDeterministicEnabled(boolean)
-
getDeterministicStringsName
public java.lang.String getDeterministicStringsName()
Gets the deterministicStringsName property (String) value.- Returns:
- The deterministicStringsName property value.
- See Also:
setDeterministicStringsName(java.lang.String)
-
getEndogenousDataName
public java.lang.String getEndogenousDataName()
Gets the endogenousDataName property (String) value.- Returns:
- The endogenousDataName property value.
- See Also:
setEndogenousDataName(java.lang.String)
-
getEndogenousStringsName
public java.lang.String getEndogenousStringsName()
Gets the endogenousStringsName property (String) value.- Returns:
- The endogenousStringsName property value.
- See Also:
setEndogenousStringsName(java.lang.String)
-
getExogenousDataName
public java.lang.String getExogenousDataName()
Gets the exogenousDataName property (String) value.- Returns:
- The exogenousDataName property value.
- See Also:
setExogenousDataName(java.lang.String)
-
getDateRangeName
public java.lang.String getDateRangeName()
Gets the dateRangeName property (String) value.- Returns:
- The dateRangeName property value.
- See Also:
setDateRangeName(java.lang.String)
-
getExogenousEnabled
public boolean getExogenousEnabled()
Gets whether exogenous series can be selected.- Returns:
- boolean
- See Also:
setExogenousEnabled(boolean)
-
getExogenousStringsName
public java.lang.String getExogenousStringsName()
Gets the exogenousStringsName property (String) value.- Returns:
- The exogenousStringsName property value.
- See Also:
setExogenousStringsName(java.lang.String)
-
getSelectionMode
public int getSelectionMode()
Gets the current selection mode.- Returns:
- int a valid
JListselection mode
-
isOneEndogenousOnly
public boolean isOneEndogenousOnly()
- Returns:
- boolean
- See Also:
setOneEndogenousOnly(boolean)
-
setAllDataName
public void setAllDataName(java.lang.String allDataName)
Sets the name of the object holding the data array for all series.- Parameters:
allDataName- The new value for the property.- Throws:
java.lang.IllegalArgumentException- if argument is not a valid symbolname- See Also:
getAllDataName()
-
setAllStringsName
public void setAllStringsName(java.lang.String allStringsName)
Sets the name of dataobject that holds the string array of all names.- Parameters:
allStringsName- The new value for the property.- Throws:
java.lang.IllegalArgumentException- if argument is not a valid symbolname- See Also:
getAllStringsName()
-
setDatesEditable
public void setDatesEditable(boolean newDatesEditable)
Enables/disables editing of date range.- Parameters:
newDatesEditable- true to enable range editing
-
setDeterministicDataName
public void setDeterministicDataName(java.lang.String deterministicDataName)
Sets the name of the object holding the deterministic data array.- Parameters:
deterministicDataName- The new value for the property.- Throws:
java.lang.IllegalArgumentException- if argument is not a valid symbolname- See Also:
getDeterministicDataName()
-
setDeterministicEnabled
public void setDeterministicEnabled(boolean arg1)
Enables/disables the selection of deterministic variables. This property merely sets the list displaying the deterministic variables toenabledordisabled. It has no effect on the data creation, but it should communicate to the user, that deterministic variables are ignored in the respective modeling context.- Parameters:
arg1- true to enable selection of determinisic variables
-
setDeterministicStringsName
public void setDeterministicStringsName(java.lang.String deterministicStringsName)
Sets the name of dataobject that holds the string array of deterministic names.- Parameters:
deterministicStringsName- The new value for the property.- Throws:
java.lang.IllegalArgumentException- if argument is not a valid symbolname- See Also:
getDeterministicStringsName()
-
setEnabled
public void setEnabled(boolean enabled)
Enables/disables the component. If disabled, time series cannot be selected anymore.- Overrides:
setEnabledin classjavax.swing.JComponent- Parameters:
enabled- boolean
-
setEndogenousDataName
public void setEndogenousDataName(java.lang.String endogenousDataName)
Sets the name of the object holding the endogenous data array.- Parameters:
endogenousDataName- The new value for the property.- Throws:
java.lang.IllegalArgumentException- if argument is not a valid symbolname- See Also:
getEndogenousDataName()
-
setEndogenousStringsName
public void setEndogenousStringsName(java.lang.String endogenousStringsName)
Sets the name of dataobject that holds the string array of endogenous names.- Parameters:
endogenousStringsName- The new value for the property.- Throws:
java.lang.IllegalArgumentException- if argument is not a valid symbolname- See Also:
getEndogenousStringsName()
-
setExogenousDataName
public void setExogenousDataName(java.lang.String exogenousDataName)
Sets the name of the object holding the exogenous data array.- Parameters:
exogenousDataName- The new value for the property.- Throws:
java.lang.IllegalArgumentException- if argument is not a valid symbolname- See Also:
getExogenousDataName()
-
setExogenousEnabled
public void setExogenousEnabled(boolean arg1)
Enables/disables selection of exogenous variables. This property merely sets the list displaying the exogenous variables toenabledordisabled. It has no effect on the data creation, but it should communicate to the user, that exogenous variables are ignored in the respective modeling context.- Parameters:
arg1- true to enable selection of exogenous variables
-
setExogenousStringsName
public void setExogenousStringsName(java.lang.String exogenousStringsName)
Sets the name of dataobject that holds the string array of exogenous names.- Parameters:
exogenousStringsName- The new value for the property.- Throws:
java.lang.IllegalArgumentException- if argument is not a valid symbolname- See Also:
getExogenousStringsName()
-
setDateRangeName
public void setDateRangeName(java.lang.String dateRangeName)
Sets the name of dataobject that holds the date range of the selected series.- Parameters:
dateRangeName- The new value for the property.- Throws:
java.lang.IllegalArgumentException- if argument is not a valid symbolname- See Also:
getDateRangeName()
-
setOneEndogenousOnly
public void setOneEndogenousOnly(boolean newOneEndogenousOnly)
Sets whether only one endogenous variable should be selectable or more. Useful for univariate models with possibly exogenous variables.- Parameters:
newOneEndogenousOnly- true if only one endogenous variable should be selectable
-
setSelectionChanged
public void setSelectionChanged()
Sets the selection changed property and firesPropertyChangeEventif the value changed.
-
setSelectionMode
public void setSelectionMode(int selectionMode)
Sets the selection mode to be a valid mode forJList.- Parameters:
selectionMode- int
-
setUpperScope
public void setUpperScope(boolean isUpper)
Sets whetherUPPERor defaultGLOBALscope should be used.- Parameters:
isUpper- iftrue Scope.UPPERis used, otherwiseScope.GLOBAL
-
isUpperScope
public boolean isUpperScope()
Gets whetherScope.UPPERorScope.GLOBALis used.- Returns:
truetrue Scope.UPPERis used, otherwiseScope.GLOBAL
-
isCheckNaN
public boolean isCheckNaN()
Gets whether it is checked whether missing values are in the selection. In this case the selection will not be allowed. The default istrue.- Returns:
trueif NaN's are not allowed
-
setCheckNaN
public void setCheckNaN(boolean checkNaN)
Sets whether it is checked whether missing values are in the selection. In this case the selection will not be allowed. The default istrue.- Parameters:
checkNaN-trueif NaN's are not allowed,falseseries with missing values can be selected
-
setSelection
public void setSelection(Selection sel)
Sets the selection of this component according tosel. The method does nothingif (sel == null).- Parameters:
sel- holds the selection
-
getSelection
public Selection getSelection()
Gets the current selection set by this component.- Returns:
- selection instance
-
-
DMelt 3.0 © DataMelt by jWork.ORG