com.isti.util.gui
Class IstiTimeRangePanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycom.isti.util.gui.IstiAbstractTimeRangePanel
                      extended bycom.isti.util.gui.IstiTimeRangePanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, UpdateListener

public class IstiTimeRangePanel
extends IstiAbstractTimeRangePanel
implements UpdateListener

Class IstiTimeRangePanel implements the time range panel.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected static boolean debugFlag
           
static java.lang.String DEFAULT_END_TITLE
           
static java.lang.Double DEFAULT_MAX_DURATION_VALUE
           
static java.lang.String DEFAULT_MIN_MAX_TITLE
           
static java.lang.String DEFAULT_START_END_TITLE
           
static java.lang.String DEFAULT_START_TITLE
           
protected  java.lang.String durationTextTipText
           
protected  java.lang.String durationTimeSliderTipText
           
protected  java.lang.String endTimeSliderTipText
           
static double FLOAT_MS_PER_HOUR
           
protected static java.awt.Color FOREGROUND_COLOR
           
protected static boolean ignoreSlidersWhileValueIsAdjusting
           
protected  java.lang.String maxOffsetTipText
           
protected  java.lang.String maxTimeSliderTipText
           
protected  java.lang.String minOffsetTipText
           
protected  java.lang.String minTimeSliderTipText
           
static long MS_PER_HOUR
           
protected  java.lang.String offsetTipText
           
protected  java.lang.String offsetTipTextSuffix
           
protected static boolean showLabelsFlag
           
protected  java.lang.String sliderTipTextSuffix
           
protected  java.lang.String startTimeSliderTipText
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
IstiTimeRangePanel()
          Constructs a time range panel.
IstiTimeRangePanel(java.lang.String minMaxTitle, java.lang.String startEndTitle)
          Constructs a time range panel.
IstiTimeRangePanel(java.lang.String minMaxTitle, java.lang.String startEndTitle, java.util.TimeZone value)
          Constructs a time range panel.
IstiTimeRangePanel(java.lang.String minMaxTitle, java.lang.String startEndTitle, java.util.TimeZone value, java.lang.String startTitle, java.lang.String endTitle, java.lang.Double maxDurationValue)
          Constructs a time range panel.
IstiTimeRangePanel(java.util.TimeZone value)
          Constructs a time range panel.
IstiTimeRangePanel(java.util.TimeZone value, java.lang.Double maxDurationValue)
          Constructs a time range panel.
 
Method Summary
protected  void checkValues(boolean startTimeUpdateFlag, boolean endTimeUpdateFlag)
          Checks the values and makes sure the start time is not greater than the end time.
 java.util.Date getEndDate()
          Gets the end date.
 long getEndTime()
          Gets the end time (number of milliseconds since January 1, 1970, 00:00:00 GMT.)
 java.util.Date getMaxDate()
          Gets the maximum date;
 long getMaxTime()
          Gets the maximum time (number of milliseconds since January 1, 1970, 00:00:00 GMT.)
 java.util.Date getMinDate()
          Gets the minimum date;
 long getMinTime()
          Gets the minimum time (number of milliseconds since January 1, 1970, 00:00:00 GMT.)
 java.util.Date getStartDate()
          Gets the start date.
 long getStartTime()
          Gets the start time (number of milliseconds since January 1, 1970, 00:00:00 GMT.)
 java.util.TimeZone getTimeZone()
          Gets the time zone.
 boolean isShowLabels()
          Determines if the labels are shown.
static void main(java.lang.String[] args)
           
protected  void printValues(java.lang.String title)
          Print the current values.
 void processUpdate(java.awt.Component component, java.lang.Object e)
          Process an update.
 void requestFocus()
          Requests that the panel get the input focus.
 void setEndDate(java.util.Date endDate)
          Sets the end date.
 void setEndTime(long endTime)
          Sets the end time.
 void setMaxDate(java.util.Date maxDate)
          Sets the maximum date.
 void setMaxTime(long time)
          Sets the maximum time (number of milliseconds since January 1, 1970, 00:00:00 GMT.)
 void setMinDate(java.util.Date minDate)
          Sets the minimum date.
 void setMinMaxPanelVisible(boolean b)
          Sets the min/max panel visible.
 void setMinTime(long time)
          Sets the minimum time (number of milliseconds since January 1, 1970, 00:00:00 GMT.)
 void setShowLabels(boolean b)
          Enables or disables showing the labels.
protected static boolean setSliderValue(javax.swing.JSlider slider, int value)
          Sets the slider value for the specified slider.
 void setStartDate(java.util.Date startDate)
          Sets the start date.
 void setStartTime(long startTime)
          Sets the start time.
 void setTimeZone(java.util.TimeZone value)
          Sets the time zone with the given time zone value.
protected  void updateDurationTimes(java.awt.Component component)
          Update the duration times.
protected  void updateTimeOffsets()
          Updates the time offsets.
 
Methods inherited from class com.isti.util.gui.IstiAbstractTimeRangePanel
convertOffsetToTime, convertTimeToOffset, getEndTimeOffset, getStartTimeOffset
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MS_PER_HOUR

public static final long MS_PER_HOUR
See Also:
Constant Field Values

FLOAT_MS_PER_HOUR

public static final double FLOAT_MS_PER_HOUR
See Also:
Constant Field Values

FOREGROUND_COLOR

protected static final java.awt.Color FOREGROUND_COLOR

showLabelsFlag

protected static boolean showLabelsFlag

ignoreSlidersWhileValueIsAdjusting

protected static boolean ignoreSlidersWhileValueIsAdjusting

debugFlag

protected static boolean debugFlag

DEFAULT_MIN_MAX_TITLE

public static final java.lang.String DEFAULT_MIN_MAX_TITLE
See Also:
Constant Field Values

DEFAULT_START_TITLE

public static final java.lang.String DEFAULT_START_TITLE
See Also:
Constant Field Values

DEFAULT_END_TITLE

public static final java.lang.String DEFAULT_END_TITLE
See Also:
Constant Field Values

DEFAULT_START_END_TITLE

public static final java.lang.String DEFAULT_START_END_TITLE
See Also:
Constant Field Values

DEFAULT_MAX_DURATION_VALUE

public static final java.lang.Double DEFAULT_MAX_DURATION_VALUE

maxTimeSliderTipText

protected final java.lang.String maxTimeSliderTipText

minTimeSliderTipText

protected final java.lang.String minTimeSliderTipText

sliderTipTextSuffix

protected final java.lang.String sliderTipTextSuffix

startTimeSliderTipText

protected final java.lang.String startTimeSliderTipText

endTimeSliderTipText

protected final java.lang.String endTimeSliderTipText

durationTimeSliderTipText

protected final java.lang.String durationTimeSliderTipText

offsetTipTextSuffix

protected final java.lang.String offsetTipTextSuffix

minOffsetTipText

protected final java.lang.String minOffsetTipText

maxOffsetTipText

protected final java.lang.String maxOffsetTipText

offsetTipText

protected final java.lang.String offsetTipText

durationTextTipText

protected final java.lang.String durationTextTipText
Constructor Detail

IstiTimeRangePanel

public IstiTimeRangePanel()
Constructs a time range panel.


IstiTimeRangePanel

public IstiTimeRangePanel(java.lang.String minMaxTitle,
                          java.lang.String startEndTitle)
Constructs a time range panel.

Parameters:
minMaxTitle - the title for the min/max panel.
startEndTitle - the title for the start/end panel.

IstiTimeRangePanel

public IstiTimeRangePanel(java.lang.String minMaxTitle,
                          java.lang.String startEndTitle,
                          java.util.TimeZone value)
Constructs a time range panel.

Parameters:
minMaxTitle - the title for the min/max panel.
startEndTitle - the title for the start/end panel.
value - the given time zone.

IstiTimeRangePanel

public IstiTimeRangePanel(java.lang.String minMaxTitle,
                          java.lang.String startEndTitle,
                          java.util.TimeZone value,
                          java.lang.String startTitle,
                          java.lang.String endTitle,
                          java.lang.Double maxDurationValue)
Constructs a time range panel.

Parameters:
minMaxTitle - the title for the min/max panel.
startEndTitle - the title for the start/end panel.
value - the given time zone.
startTitle - the title for the start time panel.
endTitle - the title for the end time panel.
maxDurationValue - the max duration value or null for no max.

IstiTimeRangePanel

public IstiTimeRangePanel(java.util.TimeZone value)
Constructs a time range panel.

Parameters:
value - the given time zone.

IstiTimeRangePanel

public IstiTimeRangePanel(java.util.TimeZone value,
                          java.lang.Double maxDurationValue)
Constructs a time range panel.

Parameters:
value - the given time zone.
maxDurationValue - the max duration value or null for no max.
Method Detail

isShowLabels

public boolean isShowLabels()
Determines if the labels are shown.

Returns:
true if the labels are shown, false otherwise.

setShowLabels

public void setShowLabels(boolean b)
Enables or disables showing the labels.

Parameters:
b - If true the labels are shown; otherwise the labels are not shown.

setTimeZone

public void setTimeZone(java.util.TimeZone value)
Sets the time zone with the given time zone value.

Parameters:
value - the given time zone.

main

public static void main(java.lang.String[] args)

checkValues

protected void checkValues(boolean startTimeUpdateFlag,
                           boolean endTimeUpdateFlag)
Checks the values and makes sure the start time is not greater than the end time.

Parameters:
startTimeUpdateFlag - true if the start time was updated, false otherwise.
endTimeUpdateFlag - true if the end time was updated, false otherwise.

setSliderValue

protected static boolean setSliderValue(javax.swing.JSlider slider,
                                        int value)
Sets the slider value for the specified slider.

Parameters:
slider - the slider.
value - the value.
Returns:
true if the value was valid and was set, false otherwise.

printValues

protected void printValues(java.lang.String title)
Print the current values.

Parameters:
title - the title.

getEndDate

public java.util.Date getEndDate()
Gets the end date.

Returns:
the end date.

getEndTime

public long getEndTime()
Gets the end time (number of milliseconds since January 1, 1970, 00:00:00 GMT.)

Specified by:
getEndTime in class IstiAbstractTimeRangePanel
Returns:
the end time or 0 if it is greater than or equal to the maximum.

getMaxDate

public java.util.Date getMaxDate()
Gets the maximum date;

Returns:
the maximum date or null if not defined.

getMaxTime

public long getMaxTime()
Gets the maximum time (number of milliseconds since January 1, 1970, 00:00:00 GMT.)

Specified by:
getMaxTime in class IstiAbstractTimeRangePanel
Returns:
the maximum time.

getMinDate

public java.util.Date getMinDate()
Gets the minimum date;

Returns:
the minimum date or null if not defined.

getMinTime

public long getMinTime()
Gets the minimum time (number of milliseconds since January 1, 1970, 00:00:00 GMT.)

Specified by:
getMinTime in class IstiAbstractTimeRangePanel
Returns:
the minimum time.

getStartDate

public java.util.Date getStartDate()
Gets the start date.

Returns:
the start date.

getStartTime

public long getStartTime()
Gets the start time (number of milliseconds since January 1, 1970, 00:00:00 GMT.)

Specified by:
getStartTime in class IstiAbstractTimeRangePanel
Returns:
the start time or 0 if it is less than or equal to the minumum.

getTimeZone

public java.util.TimeZone getTimeZone()
Gets the time zone.

Returns:
the time zone object associated with this panel.

requestFocus

public void requestFocus()
Requests that the panel get the input focus.


setEndDate

public void setEndDate(java.util.Date endDate)
Sets the end date.

Parameters:
endDate - the end date.

setEndTime

public void setEndTime(long endTime)
Sets the end time.

Specified by:
setEndTime in class IstiAbstractTimeRangePanel
Parameters:
endTime - the end time.

setMinMaxPanelVisible

public void setMinMaxPanelVisible(boolean b)
Sets the min/max panel visible.

Parameters:
b - true for visible, false otherwise.

setMaxDate

public void setMaxDate(java.util.Date maxDate)
Sets the maximum date.

Parameters:
maxDate - the maximum date.

setMaxTime

public void setMaxTime(long time)
Sets the maximum time (number of milliseconds since January 1, 1970, 00:00:00 GMT.)

Specified by:
setMaxTime in class IstiAbstractTimeRangePanel
Parameters:
time - the maximum time.

setMinDate

public void setMinDate(java.util.Date minDate)
Sets the minimum date.

Parameters:
minDate - the minimum date.

setMinTime

public void setMinTime(long time)
Sets the minimum time (number of milliseconds since January 1, 1970, 00:00:00 GMT.)

Specified by:
setMinTime in class IstiAbstractTimeRangePanel
Parameters:
time - the minimum time.

setStartDate

public void setStartDate(java.util.Date startDate)
Sets the start date.

Parameters:
startDate - the start date.

setStartTime

public void setStartTime(long startTime)
Sets the start time.

Specified by:
setStartTime in class IstiAbstractTimeRangePanel
Parameters:
startTime - the start time.

updateTimeOffsets

protected void updateTimeOffsets()
Updates the time offsets.


processUpdate

public void processUpdate(java.awt.Component component,
                          java.lang.Object e)
Process an update.

Specified by:
processUpdate in interface UpdateListener
Parameters:
component - the component.
e - the event or null if none.

updateDurationTimes

protected void updateDurationTimes(java.awt.Component component)
Update the duration times.

Parameters:
component - the component.