# 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`

public class AxisEditor extends 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 JPanel

`JPanel.AccessibleJPanel`

### Nested classes/interfaces inherited from class JComponent

`JComponent.AccessibleJComponent`

### Nested classes/interfaces inherited from class Container

`Container.AccessibleAWTContainer`

### Nested classes/interfaces inherited from class Component

`Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final JTextField`
`hiField_`
`protected final JTextField`
`loField_`

### Fields inherited from class JComponent

`listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW`

### Fields inherited from class Component

`accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT`

### Fields inherited from interface ImageObserver

`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

## Method Summary

Modifier and Type
Method
Description
`void`
`addActionListener(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.
`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(ActionListener listener)`
Unregisters a listener added by `addActionListener(ActionListener)`.
`void`
`removeMaintainedRange(uk.ac.starlink.ttools.plot.Range range)`
Removes a range previously added by `addMaintainedRange(Range)`.
`void`
`setAxis(uk.ac.starlink.table.ValueInfo axis)`
Configures this component to edit the configuration of a given axis.
`void`
`setTitle(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 JPanel

`getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI`

### Methods inherited from class 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 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 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`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### loField_

protected final JTextField loField_

### hiField_

protected final JTextField 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 submitted `axis` differs from the last one which was submitted in a call to this method. Thus it is important that the `equals()` method of `axis` is implemented properly.

Parameters:
  `axis` - metadata of the axis to edit

### getLabel

public 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 to `range` 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 by `addMaintainedRange(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(ActionListener listener)
Registers a listener to be notified when the state of this component changes.

Parameters:
  `listener` - listener to add

### removeActionListener

public void removeActionListener(ActionListener listener)
Unregisters a listener added by `addActionListener(ActionListener)`.

Parameters:
  `listener` - listener to remove

### setTitle

public void setTitle(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.