T
- the type of the granularity used by the dateline modelpublic abstract class AbstractTimelineControlPanel<T extends IGranularity> extends JPanel implements ChangeListener, ActionListener, IDatelineModelListener
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Modifier | Constructor and Description |
---|---|
protected |
AbstractTimelineControlPanel(Timeline timeline,
boolean showGranularity)
Constructs a new control panel.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent evt) |
protected abstract void |
applySettings()
Applies the settings made in the control panel to the timeline.
|
protected abstract SpinnerModel |
createEndTimeModel()
Creates the model for the end time spinner.
|
protected abstract ComboBoxModel |
createGranularityModel()
Creates the model for the granularity combo box.
|
protected abstract SpinnerModel |
createStartTimeModel()
Creates the model for the start time spinner.
|
protected Border |
createTitledBorder(String title)
Constructs the titled border for the panel.
|
void |
datelineModelChanged(DatelineModelEvent evt)
The listener's callback method that gets invoked when the model's time
span or time zone changes.
|
void |
datelineModelWillChange(DatelineModelEvent evt)
The listener's callback method that gets invoked when the model's time
span or time zone will change.
|
JButton |
getApplyButton()
Returns the button used for applying the settings to the timeline.
|
SpinnerModel |
getEndTimeModel()
Returns the spinner model used for the end time.
|
JSpinner |
getEndTimeSpinner()
Returns the spinner used for editing the end time.
|
JLabel |
getFromLabel()
Returns the label used for labelling the from spiner.
|
T |
getGranularity()
Returns the granularity shown in the combo box (not the one used by the
timeline).
|
JComboBox |
getGranularityBox()
Returns the combo box used for selecting the granularity.
|
JLabel |
getGranularityLabel()
Returns the label used for labelling the granularity combo box.
|
ComboBoxModel |
getGranularityModel()
Returns the combo box model used by the granularity combo box.
|
SpinnerModel |
getStartTimeModel()
Returns the spinner model used for the start time.
|
JSpinner |
getStartTimeSpinner()
Returns the spinner used for editing the start time.
|
Timeline |
getTimeline()
Returns the timeline that is being controlled by the panel.
|
abstract ITimeSpan |
getTimeSpan()
Returns the time span shown by the panel (not the timeline)
|
JLabel |
getToLabel()
Returns the label used for labelling the to spiner.
|
abstract boolean |
isValidSettings()
Checks whether the current settings are valid (end time is larger or
equal to start time).
|
void |
setGranularity(T value)
Sets a granularity to be shown in the granularity selector / combo box.
|
protected abstract void |
setTimeSpan(ITimeSpan span)
Sets the time span shown by the panel (not on the timeline, updates the
start and end spinner).
|
void |
stateChanged(ChangeEvent evt) |
abstract void |
updateControlPanel()
Updates the control panel to reflect the current settings of the
timeline.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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
protected AbstractTimelineControlPanel(Timeline timeline, boolean showGranularity)
timeline
- the timeline controlled by the panelshowGranularity
- if TRUE the controls for changing the granularity will be
shownpublic void datelineModelChanged(DatelineModelEvent evt)
IDatelineModelListener
datelineModelChanged
in interface IDatelineModelListener
evt
- the event that occured on the datelinepublic void datelineModelWillChange(DatelineModelEvent evt)
IDatelineModelListener
datelineModelWillChange
in interface IDatelineModelListener
evt
- the event that occured on the datelinepublic abstract void updateControlPanel()
protected abstract SpinnerModel createStartTimeModel()
protected abstract SpinnerModel createEndTimeModel()
protected abstract ComboBoxModel createGranularityModel()
protected abstract void setTimeSpan(ITimeSpan span)
span
- the timeline's time spanpublic abstract ITimeSpan getTimeSpan()
public abstract boolean isValidSettings()
public void setGranularity(T value)
value
- the value to show in the combo boxpublic T getGranularity()
public void stateChanged(ChangeEvent evt)
stateChanged
in interface ChangeListener
public void actionPerformed(ActionEvent evt)
actionPerformed
in interface ActionListener
protected abstract void applySettings()
public SpinnerModel getEndTimeModel()
public JSpinner getEndTimeSpinner()
public SpinnerModel getStartTimeModel()
public JSpinner getStartTimeSpinner()
public JComboBox getGranularityBox()
public ComboBoxModel getGranularityModel()
public Timeline getTimeline()
public JButton getApplyButton()
public JLabel getFromLabel()
public JLabel getGranularityLabel()
public JLabel getToLabel()
Copyright © 2006–2016 Dirk Lemmermann Software & Consulting. All rights reserved.