public class TimeRuler extends javax.swing.JComponent implements TimeSpanWidget
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static int |
LABEL_BOTTOM |
static int |
LABEL_NONE |
static int |
LABEL_TOP |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
TimeRuler(java.util.Date startDate,
java.util.Date stopDate)
Creates a new TimeRuler object.
|
TimeRuler(java.util.Date startDate,
java.util.Date stopDate,
TimeUnit interval)
Creates a new TimeRuler object.
|
Modifier and Type | Method and Description |
---|---|
protected TimeSpan |
calculateSpan()
Recalculates the span of time represented by this TimeRuler.
|
javax.swing.JComponent |
getComponent()
Return the Graphical User Interface component used for displaying this
TimeRuler.
|
TimeUnit |
getDisplayedInterval()
Get the actual increment displayed by this time ruler
|
TimeSpan |
getDisplayedSpan()
Get the span of time displayed by this TimeRuler.
|
int |
getLabelLocation()
Gets the label location
|
java.lang.String |
getLabelString()
Returns the labelString for the TimeRuler.
|
TimeSpan |
getMeasuredSpan()
Deprecated.
|
protected javax.swing.JPanel |
makeTicPanel()
Creates the panel used for drawing the tic marks, and returns it.
|
protected void |
paintComponent(java.awt.Graphics g)
Repaints the TimeRuler on the canvas.
|
void |
setLabelLocation(int labelLocation)
Sets the placement of the overall time label.
|
void |
setTimeInterval(TimeUnit interval)
Sets the interval used to mark out regular intervals.
|
void |
setTimeSpan(TimeSpan span)
Sets the time this TimeRuler measures.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, updateUI
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, hide, 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
public static final int LABEL_NONE
public static final int LABEL_TOP
public static final int LABEL_BOTTOM
public TimeRuler(java.util.Date startDate, java.util.Date stopDate)
startDate
- The start date of this TimeSpanstopDate
- The stop date of this TimeSpanpublic TimeRuler(java.util.Date startDate, java.util.Date stopDate, TimeUnit interval)
startDate
- The start date of this TimeSpanstopDate
- The stop date of this TimeSpaninterval
- The interval of measureprotected TimeSpan calculateSpan()
public javax.swing.JComponent getComponent()
getComponent
in interface TimeSpanWidget
public TimeUnit getDisplayedInterval()
public TimeSpan getDisplayedSpan()
getDisplayedSpan
in interface TimeSpanWidget
public int getLabelLocation()
public java.lang.String getLabelString()
@Deprecated public TimeSpan getMeasuredSpan()
protected javax.swing.JPanel makeTicPanel()
protected void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
g
- the graphics context to render intopublic void setLabelLocation(int labelLocation)
labelLocation
- the position of the label for the ruler, relative
to the ticMarkspublic void setTimeInterval(TimeUnit interval)
interval
- the interval used to mark out regular intervalspublic void setTimeSpan(TimeSpan span)
getMeasuredSpan
should be used.setTimeSpan
in interface TimeSpanWidget
span
- the new TimeSpan for this ruler