public class RangeSelector extends javax.swing.JComponent implements java.awt.event.FocusListener, ResourceComponentFactoryable
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected static boolean |
defaultAutoRange |
protected static double[] |
defaultRange
The default range.
|
protected double[] |
initialRange
The range that initialize the dialog.
|
static java.lang.String |
SELECTEDAUTOSCALE_PROPERTY
Property Name for the selected auto scale flag.
|
protected double[] |
selectedRange
The selected range.
|
static java.lang.String |
SELECTEDRANGE_PROPERTY
Property Name for the selected range.
|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
RangeSelector()
The constructor.
|
RangeSelector(double[] range,
boolean autoRange,
java.awt.event.ActionListener autoRangeListener,
PropertyBundle resources,
java.lang.String keySuffix,
boolean noBorder)
The constructor receive the initial range.
|
Modifier and Type | Method and Description |
---|---|
void |
addMenuItem(java.lang.String itemKey,
javax.swing.JMenuItem menuItem)
Register a menu item and its actions keyword.
|
void |
commit()
Read out the value from text fields.
|
java.beans.PropertyChangeListener |
createActionChangeListener(javax.swing.JMenuItem menuItem)
Creates an action changed listener that implements PropertyChangeListener
|
static javax.swing.JDialog |
createDialog(java.awt.Component c,
PropertyBundle resources,
boolean modal,
RangeSelector dialogPane,
java.awt.event.ActionListener okListener,
java.awt.event.ActionListener cancelListener)
Creates and returns a new dialog containing the specified
RangeChooser pane along with "OK", "Cancel", and "Reset" buttons.
|
void |
focusGained(java.awt.event.FocusEvent e) |
void |
focusLost(java.awt.event.FocusEvent e) |
javax.swing.Action |
getAction(java.lang.String cmdKey)
Returns the menu item belongs the given keyword.
|
boolean |
getInitialAutoRange()
Get the initial autorange flag.
|
double[] |
getInitialRange()
Get the initial range.
|
protected java.lang.String |
getLocalKey(java.lang.String key) |
java.lang.String |
getResource(PropertyBundle resources,
java.lang.String key) |
boolean |
getSelectedAutoRange()
Get the selected autorange flag.
|
double[] |
getSelectedRange()
Get the selected range.
|
protected void |
recalc()
Recalculate the panel.
|
void |
reset()
The
reset method. |
void |
setInitialAutoRange(boolean auto)
Set the initial autorange flag.
|
protected void |
setIntialRange(double[] range)
Set the initial range.
|
void |
setSelectedAutoRange(boolean auto)
Set the selected autorange flag.
|
void |
setSelectedRange(double[] range)
Set the selected range.
|
static double[] |
showDialog(java.awt.Component component,
double[] initialRange,
boolean auto,
java.awt.event.ActionListener autoRangeListener,
PropertyBundle resources,
java.lang.String keySuffix,
boolean noBorder)
Shows a modal range selector dialog and blocks until the
dialog is hidden.
|
java.lang.String |
toString()
Return the string representation of the selected range.
|
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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, 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, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String SELECTEDRANGE_PROPERTY
public static final java.lang.String SELECTEDAUTOSCALE_PROPERTY
protected double[] initialRange
getInitialRange()
,
#setInitialRange
protected double[] selectedRange
protected static final double[] defaultRange
protected static final boolean defaultAutoRange
public RangeSelector()
public RangeSelector(double[] range, boolean autoRange, java.awt.event.ActionListener autoRangeListener, PropertyBundle resources, java.lang.String keySuffix, boolean noBorder)
public static double[] showDialog(java.awt.Component component, double[] initialRange, boolean auto, java.awt.event.ActionListener autoRangeListener, PropertyBundle resources, java.lang.String keySuffix, boolean noBorder)
component
- the parent Component for the dialoginitialRange
- the initial range when the selector is showninitialAutoRange
- the initial auto range flagresources
- the resource component factory to configure the selector.propertySuffix
- the key suffix that should be used to find properties.public static javax.swing.JDialog createDialog(java.awt.Component c, PropertyBundle resources, boolean modal, RangeSelector dialogPane, java.awt.event.ActionListener okListener, java.awt.event.ActionListener cancelListener)
c
- the parent component for the dialogtitle
- the title for the dialogmodal
- a boolean. When true, the remainder of the program
is inactive until the dialog is closed.chooserPane
- the color-chooser to be placed inside the dialogokListener
- the ActionListener invoked when "OK" is pressedcancelListener
- the ActionListener invoked when "Cancel" is pressedprotected java.lang.String getLocalKey(java.lang.String key)
public java.lang.String getResource(PropertyBundle resources, java.lang.String key)
public void focusGained(java.awt.event.FocusEvent e)
focusGained
in interface java.awt.event.FocusListener
public void focusLost(java.awt.event.FocusEvent e)
focusLost
in interface java.awt.event.FocusListener
protected void recalc()
public java.lang.String toString()
toString
in class java.awt.Component
public boolean getSelectedAutoRange()
public void setSelectedAutoRange(boolean auto)
boolean
- The new selected auto range.public boolean getInitialAutoRange()
public void setInitialAutoRange(boolean auto)
boolean
- The new initial auto range.public double[] getSelectedRange()
public void setSelectedRange(double[] range)
double[]
- The new range.protected void setIntialRange(double[] range)
public double[] getInitialRange()
public void reset()
reset
method.public void commit()
public void addMenuItem(java.lang.String itemKey, javax.swing.JMenuItem menuItem)
addMenuItem
in interface ResourceComponentFactoryable
public javax.swing.Action getAction(java.lang.String cmdKey)
getAction
in interface ResourceComponentFactoryable
public java.beans.PropertyChangeListener createActionChangeListener(javax.swing.JMenuItem menuItem)
createActionChangeListener
in interface ResourceComponentFactoryable