Package uk.ac.starlink.topcat.plot
Class AxisEditor
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
uk.ac.starlink.topcat.plot.AxisEditor
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible
Axis configuration editor component.
This provides boxes in which axis labels and data ranges can be entered.
The data ranges are either some fixed numeric value, or Double.NaN;
the latter means that the limit in question is to be assigned dynamically
by the plot component (presumably by assessing the range of the available
data).
- Since:
- 27 Jan 2006
- Author:
- Mark Taylor
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Method Summary
Modifier and TypeMethodDescriptionvoidaddActionListener(ActionListener listener) Registers a listener to be notified when the state of this component changes.voidaddMaintainedRange(uk.ac.starlink.ttools.plot.Range range) Adds a range which will be modified in accordance with changes of the state of this editor.voidClears the upper and lower bounds in this editor.double[]Returns the currently requested data range.protected doublegetHigh()Returns the current upper bound, fixing state if necessary.getLabel()Returns the currently entered label for the axis in this editor.protected doublegetLow()Returns the current lower bound, fixing state if necessary.voidremoveActionListener(ActionListener listener) Unregisters a listener added byaddActionListener(java.awt.event.ActionListener).voidremoveMaintainedRange(uk.ac.starlink.ttools.plot.Range range) Removes a range previously added byaddMaintainedRange(uk.ac.starlink.ttools.plot.Range).voidsetAxis(uk.ac.starlink.table.ValueInfo axis) Configures this component to edit the configuration of a given axis.voidSets the title of this editor.voidUpdates all of the Ranges currently maintained by this editor according to its current state.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
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, updateMethods inherited from class java.awt.Container
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, validateTreeMethods 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, 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
loField_
-
hiField_
-
-
Method Details
-
setAxis
public void setAxis(uk.ac.starlink.table.ValueInfo axis) Configures this component to edit the configuration of a given axis. Some of the fields will be initialised only if the submittedaxisdiffers from the last one which was submitted in a call to this method. Thus it is important that theequals()method ofaxisis implemented properly.- Parameters:
axis- metadata of the axis to edit
-
getLabel
Returns the currently entered label for the axis in this editor.- Returns:
- axis label string
-
addMaintainedRange
public void addMaintainedRange(uk.ac.starlink.ttools.plot.Range range) Adds a range which will be modified in accordance with changes of the state of this editor. Note the converse does not apply: changes torangewill not be refelected by this component.- Parameters:
range- range to maintain
-
removeMaintainedRange
public void removeMaintainedRange(uk.ac.starlink.ttools.plot.Range range) Removes a range previously added byaddMaintainedRange(uk.ac.starlink.ttools.plot.Range). Note that object identity not equality is used for removal.- Parameters:
range- to unmaintain
-
getAxisBounds
public double[] getAxisBounds()Returns the currently requested data range. The result is a 2-element array giving lower, then upper bounds in that order. Either or both elements may be Double.NaN, indicating no preferred limit.- Returns:
- (lo,hi) array
-
clearBounds
public void clearBounds()Clears the upper and lower bounds in this editor. -
addActionListener
Registers a listener to be notified when the state of this component changes.- Parameters:
listener- listener to add
-
removeActionListener
Unregisters a listener added byaddActionListener(java.awt.event.ActionListener).- Parameters:
listener- listener to remove
-
setTitle
Sets the title of this editor. It is used to label the component's border.- Parameters:
title- title text
-
getLow
protected double getLow()Returns the current lower bound, fixing state if necessary.- Returns:
- lower bound, may be NaN
-
getHigh
protected double getHigh()Returns the current upper bound, fixing state if necessary.- Returns:
- upper bound, may be NaN
-
updateRanges
public void updateRanges()Updates all of the Ranges currently maintained by this editor according to its current state.
-