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:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
public class AxisEditor extends javax.swing.JPanel
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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.swing.JTextField
hiField_
protected javax.swing.JTextField
loField_
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addActionListener(java.awt.event.ActionListener listener)
Registers a listener to be notified when the state of this component changes.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.void
clearBounds()
Clears the upper and lower bounds in this editor.double[]
getAxisBounds()
Returns the currently requested data range.protected double
getHigh()
Returns the current upper bound, fixing state if necessary.java.lang.String
getLabel()
Returns the currently entered label for the axis in this editor.protected double
getLow()
Returns the current lower bound, fixing state if necessary.void
removeActionListener(java.awt.event.ActionListener listener)
Unregisters a listener added byaddActionListener(java.awt.event.ActionListener)
.void
removeMaintainedRange(uk.ac.starlink.ttools.plot.Range range)
Removes a range previously added byaddMaintainedRange(uk.ac.starlink.ttools.plot.Range)
.void
setAxis(uk.ac.starlink.table.ValueInfo axis)
Configures this component to edit the configuration of a given axis.void
setTitle(java.lang.String title)
Sets the title of this editor.void
updateRanges()
Updates 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, updateUI
-
Methods 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, update
-
Methods 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, 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, 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
-
-
-
-
Method Detail
-
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 submittedaxis
differs from the last one which was submitted in a call to this method. Thus it is important that theequals()
method ofaxis
is implemented properly.- Parameters:
axis
- metadata of the axis to edit
-
getLabel
public java.lang.String 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 torange
will 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
public void addActionListener(java.awt.event.ActionListener listener)
Registers a listener to be notified when the state of this component changes.- Parameters:
listener
- listener to add
-
removeActionListener
public void removeActionListener(java.awt.event.ActionListener listener)
Unregisters a listener added byaddActionListener(java.awt.event.ActionListener)
.- Parameters:
listener
- listener to remove
-
setTitle
public void setTitle(java.lang.String title)
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.
-
-