org.das2.graph
Class DasAxis

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by org.das2.graph.DasCanvasComponent
                  extended by org.das2.graph.DasAxis
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, Editable, DataRangeSelectionListener, TimeRangeSelectionListener
Direct Known Subclasses:
DasColorBar, DasLabelAxis

public class DasAxis
extends DasCanvasComponent
implements DataRangeSelectionListener, TimeRangeSelectionListener, java.lang.Cloneable

One dimensional axis component that transforms data to device space and back, and provides controls for nagivating the 1-D data space.

See Also:
Serialized Form

Nested Class Summary
protected  class DasAxis.AxisLayoutManager
           
static interface DasAxis.Lock
          until we switch to java 1.5, use this lock object instead of java.util.concurrent.lock
static class DasAxis.Memento
           
 
Nested classes/interfaces inherited from class org.das2.graph.DasCanvasComponent
DasCanvasComponent.CanvasComponentAction
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  boolean autoTickV
           
protected  java.lang.String axisLabel
           
static int BOTTOM
          This value indicates that the axis should be located at the bottom of its cell
protected  DataRange dataRange
           
protected  DatumFormatter datumFormatter
           
static int DOWN
           
protected  boolean flipLabel
           
protected  java.lang.String formatString
           
static int HORIZONTAL
          This value indicates that the axis should be oriented horizontally
static int LEFT
          This value indicates that the axis should be located to the left of its cell
protected  javax.swing.JPanel primaryInputPanel
           
static java.lang.String PROP_BOUNDS
           
static java.lang.String PROP_FLIPLABEL
           
static java.lang.String PROP_FORMATSTRING
           
static java.lang.String PROP_LABEL
           
static java.lang.String PROP_LOG
           
static java.lang.String PROP_OPPOSITE_AXIS_VISIBLE
           
static java.lang.String PROP_UNITS
           
static java.lang.String PROPERTY_DATUMRANGE
           
static java.lang.String PROPERTY_TICKS
           
static int RIGHT
          This value indicateds that the axis should be located to the right of its cell
protected  javax.swing.JPanel secondaryInputPanel
           
protected  TickVDescriptor tickV
           
static int TOP
          This value indicates that the axis should be located at the top of its cell
static int UP
           
static int VERTICAL
          This value indicates that the axis should be oriented vertically
 
Fields inherited from class org.das2.graph.DasCanvasComponent
mouseAdapter, PROPERTIES_ACTION
 
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.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
protected DasAxis(DataRange range, int orientation)
          TODO
  DasAxis(Datum min, Datum max, int orientation)
          TODO
  DasAxis(Datum min, Datum max, int orientation, boolean log)
          TODO
  DasAxis(DatumRange range, int orientation)
           
 
Method Summary
 void addMouseListener(java.awt.event.MouseListener l)
          TODO
 void addMouseMotionListener(java.awt.event.MouseMotionListener l)
          TODO
 void addMouseWheelListener(java.awt.event.MouseWheelListener l)
          Adds a MouseWheelListener to the DasAxis.
 void addTimeRangeSelectionListener(TimeRangeSelectionListener listener)
          Registers TimeRangeSelectionListener to receive events.
 void addToFavorites(DatumRange range)
           
 boolean areTickLabelsVisible()
          Deprecated. use isTickLabelsVisible
 void attachTo(DasAxis axis)
          TODO
 void clearHistory()
           
 java.lang.Object clone()
          TODO
 DasAxis createAttachedAxis()
           
 DasAxis createAttachedAxis(int orientation)
          TODO
static DasAxis createNamedAxis(java.lang.String name)
          TODO
 void dataRangeSelected(DataRangeSelectionEvent e)
          TODO
 void detach()
          TODO
protected  void deviceRangeChanged()
          TODO
protected  void drawLabel(java.awt.Graphics2D g, Datum value, java.lang.String label, int index, int x, int y)
          TODO
 Datum findTick(Datum xDatum, double direction, boolean minor)
          TODO
 java.awt.Shape getActiveRegion()
          TODO
 java.awt.geom.AffineTransform getAffineTransform(DasAxis.Memento memento, java.awt.geom.AffineTransform at)
          return the AffineTransform, or null.
protected  java.awt.Rectangle getAxisBounds()
          Calculate the rectangle that bounds the axis including its labels.
 Datum getDataMaximum()
          TODO
 double getDataMaximum(Units units)
          TODO
 Datum getDataMinimum()
          TODO
 double getDataMinimum(Units units)
          TODO
 java.lang.String getDataPath()
           
 DataRange getDataRange()
          TODO
 DatumFormatter getDatumFormatter()
          TODO
 DatumRange getDatumRange()
           
 int getDevicePosition()
          TODO
 int getDLength()
           
 org.w3c.dom.Element getDOMElement(org.w3c.dom.Document document)
          TODO
 boolean getDrawTca()
           
 java.lang.String getFormat()
           
 java.lang.String getLabel()
          Accessor method for the title property of this axis.
protected  java.awt.Rectangle getLabelBounds(java.awt.Rectangle bounds)
          calculate the bounds of the labels.
 java.awt.Font getLabelFont()
          TODO
 int getLineSpacing()
           
 DasAxis getMasterAxis()
          TODO
protected  int getMaxLabelWidth(java.awt.FontMetrics fm)
          Deprecated. use getMaxLabelWidth()
 DasAxis.Memento getMemento()
           
 int getOrientation()
          returns the orientation of the axis, which is one of BOTTOM,TOP,LEFT or RIGHT.
 DatumRange getRange()
          Deprecated. use getDatumRange instead.
 int getTickDirection()
          TODO
 java.awt.Font getTickLabelFont()
          TODO
 TickVDescriptor getTickV()
          TODO
protected  int getTitlePositionOffset()
          TODO
 Units getUnits()
          TODO
 DatumFormatter getUserDatumFormatter()
           
protected  void installComponent()
          TODO
 Datum invTransform(double idata)
           
 boolean isAnimated()
          Getter for property animated.
 boolean isAttached()
          TODO
 boolean isFlipLabel()
           
 boolean isFlipped()
           
 boolean isHorizontal()
          test if the axis is horizontal.
 boolean isLog()
          TODO
 boolean isOppositeAxisVisible()
          TODO
 boolean isTickLabelsVisible()
          true if the tick labels should be drawn.
 DasAxis.Lock mutatorLock()
           
protected static java.lang.String orientationToString(int i)
          TODO
protected  void paintComponent(java.awt.Graphics graphics)
          paints the axis component.
protected  void paintHorizontalAxis(java.awt.Graphics2D g)
          Paint the axis if it is horizontal
protected  void paintVerticalAxis(java.awt.Graphics2D g)
          Paint the axis if it is vertical
protected static int parseOrientationString(java.lang.String orientationString)
          TODO
protected  boolean rangeIsAcceptable(DatumRange dr)
           
 void removeMouseListener(java.awt.event.MouseListener l)
          TODO
 void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
          TODO
 void removeMouseWheelListener(java.awt.event.MouseWheelListener l)
           
 void removeTimeRangeSelectionListener(TimeRangeSelectionListener listener)
          Removes TimeRangeSelectionListener from the list of listeners.
 void resetRange(DatumRange range)
          changes the units of the axis to a new unit.
 void resize()
          TODO
 void scanNext()
          TODO
 void scanPrevious()
          TODO
 void setAnimated(boolean animated)
          Setter for property animated.
 void setDataMaximum(Datum max)
          TODO
 void setDataMinimum(Datum min)
          TODO
 void setDataPath(java.lang.String dataset)
           
 void setDataRange(Datum minimum, Datum maximum)
          TODO
 void setDataRangeForward()
          TODO
 void setDataRangePrev()
          TODO
 void setDataRangeZoomOut()
          TODO
 void setDataSetDescriptor(DataSetDescriptor dsdAux)
          Add auxilary data to an axis (usually OA data for a time axis).
 void setDatumRange(DatumRange dr)
           
 void setDrawTca(boolean b)
           
 void setFlipLabel(boolean flipLabel)
           
 void setFlipped(boolean b)
           
 void setFormat(java.lang.String formatString)
          set a hint at the format string.
 void setLabel(java.lang.String t)
          Mutator method for the title property of this axis.
 void setLabelFont(java.awt.Font labelFont)
          TODO
 void setLog(boolean log)
          Set the axis to be log or linear.
 void setOppositeAxisVisible(boolean visible)
          TODO
 void setOrientation(int orientation)
          TODO
 void setPlot(DasPlot p)
           
 void setTickLabelFont(java.awt.Font tickLabelFont)
          TODO
 void setTickLabelsVisible(boolean b)
          TODO
 void setTickV(TickVDescriptor tickV)
          Sets the TickVDescriptor for this axis.
 void setUnits(Units newUnits)
           
 void setUserDatumFormatter(DatumFormatter userDatumFormatter)
           
protected  java.lang.String tickFormatter(Datum d)
          return a label for this datum and visible range.
protected  java.lang.String[] tickFormatter(DatumVector tickV, DatumRange datumRange)
          return the tick labels for these datums and visible range.
 void timeRangeSelected(TimeRangeSelectionEvent e)
           
 java.lang.String toString()
           
 double transform(Datum datum)
          Transforms a Datum in data coordinates to a horizontal or vertical position on the parent canvas.
protected  double transform(double data, Units units)
          Transforms a double in the given units in data coordinates to a horizontal or vertical position on the parent canvas.
protected  double transform(double data, Units units, int dmin, int dmax)
           
protected  double transformFast(double data, Units units)
           
protected  void uninstallComponent()
          TODO
protected  void updateImmediately()
          TODO
 void updateTickV()
           
 boolean valueIsAdjusting()
          true if a lock is out and an object is rapidly mutating the object.
 
Methods inherited from class org.das2.graph.DasCanvasComponent
acceptContext, addMouseModule, coalesceEvents, getActions, getCanvas, getColumn, getDasMouseInputAdapter, getDasName, getEmSize, getFont, getMouseAdapter, getRow, processDasUpdateEvent, processEvent, removeMouseModule, setBounds, setBounds, setColumn, setDasMouseInputAdapter, setDasName, setRow, showProperties, update
 
Methods inherited from class javax.swing.JComponent
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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
 
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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, bounds, checkImage, checkImage, 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, 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, hide, 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, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_LABEL

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

PROP_LOG

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

PROP_OPPOSITE_AXIS_VISIBLE

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

PROP_BOUNDS

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

TOP

public static final int TOP
This value indicates that the axis should be located at the top of its cell

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
This value indicates that the axis should be located at the bottom of its cell

See Also:
Constant Field Values

LEFT

public static final int LEFT
This value indicates that the axis should be located to the left of its cell

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
This value indicateds that the axis should be located to the right of its cell

See Also:
Constant Field Values

HORIZONTAL

public static final int HORIZONTAL
This value indicates that the axis should be oriented horizontally

See Also:
Constant Field Values

VERTICAL

public static final int VERTICAL
This value indicates that the axis should be oriented vertically

See Also:
Constant Field Values

UP

public static final int UP
See Also:
Constant Field Values

DOWN

public static final int DOWN
See Also:
Constant Field Values

PROP_UNITS

public static java.lang.String PROP_UNITS

dataRange

protected DataRange dataRange

PROPERTY_TICKS

public static java.lang.String PROPERTY_TICKS

axisLabel

protected java.lang.String axisLabel

tickV

protected TickVDescriptor tickV

autoTickV

protected boolean autoTickV

datumFormatter

protected DatumFormatter datumFormatter

primaryInputPanel

protected javax.swing.JPanel primaryInputPanel

secondaryInputPanel

protected javax.swing.JPanel secondaryInputPanel

PROPERTY_DATUMRANGE

public static java.lang.String PROPERTY_DATUMRANGE

formatString

protected java.lang.String formatString

PROP_FORMATSTRING

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

flipLabel

protected boolean flipLabel

PROP_FLIPLABEL

public static final java.lang.String PROP_FLIPLABEL
See Also:
Constant Field Values
Constructor Detail

DasAxis

public DasAxis(Datum min,
               Datum max,
               int orientation)
TODO

Parameters:
min -
max -
orientation - DasAxis.VERTICAL, DasAxis.HORIZONTAL, DasAxis.RIGHT, etc.

DasAxis

public DasAxis(Datum min,
               Datum max,
               int orientation,
               boolean log)
TODO

Parameters:
min -
max -
orientation -
log -

DasAxis

protected DasAxis(DataRange range,
                  int orientation)
TODO

Parameters:
range -
orientation -

DasAxis

public DasAxis(DatumRange range,
               int orientation)
Method Detail

getUserDatumFormatter

public DatumFormatter getUserDatumFormatter()

setUserDatumFormatter

public void setUserDatumFormatter(DatumFormatter userDatumFormatter)

addToFavorites

public void addToFavorites(DatumRange range)

setOrientation

public void setOrientation(int orientation)
TODO

Parameters:
orientation -

setDatumRange

public void setDatumRange(DatumRange dr)

getDatumRange

public DatumRange getDatumRange()

rangeIsAcceptable

protected boolean rangeIsAcceptable(DatumRange dr)

setDataRange

public void setDataRange(Datum minimum,
                         Datum maximum)
TODO

Parameters:
minimum -
maximum -

clearHistory

public void clearHistory()

setDataRangePrev

public void setDataRangePrev()
TODO


setDataRangeForward

public void setDataRangeForward()
TODO


setDataRangeZoomOut

public void setDataRangeZoomOut()
TODO


getDataRange

public DataRange getDataRange()
TODO

Returns:

deviceRangeChanged

protected void deviceRangeChanged()
TODO


getDataMinimum

public Datum getDataMinimum()
TODO

Returns:

getDataMaximum

public Datum getDataMaximum()
TODO

Returns:

getRange

public DatumRange getRange()
Deprecated. use getDatumRange instead.

This is the preferred method for getting the range of the axis.

Returns:
a DatumRange indicating the range of the axis.

getDataMaximum

public double getDataMaximum(Units units)
TODO

Parameters:
units -
Returns:

getDataMinimum

public double getDataMinimum(Units units)
TODO

Parameters:
units -
Returns:

setDataMaximum

public void setDataMaximum(Datum max)
TODO

Parameters:
max -

setDataMinimum

public void setDataMinimum(Datum min)
TODO

Parameters:
min -

isLog

public boolean isLog()
TODO

Returns:

setLog

public void setLog(boolean log)
Set the axis to be log or linear. If necessary, axis range will be adjusted to make the range valid.

Parameters:
log -

getUnits

public Units getUnits()
TODO

Returns:

setUnits

public void setUnits(Units newUnits)

resetRange

public void resetRange(DatumRange range)
changes the units of the axis to a new unit.


setOppositeAxisVisible

public void setOppositeAxisVisible(boolean visible)
TODO

Parameters:
visible -

isOppositeAxisVisible

public boolean isOppositeAxisVisible()
TODO

Returns:

setLabel

public void setLabel(java.lang.String t)
Mutator method for the title property of this axis. The title for this axis is displayed below the ticks for horizontal axes or to left of the ticks for vertical axes.

Parameters:
t - The new title for this axis

getLabel

public java.lang.String getLabel()
Accessor method for the title property of this axis.

Returns:
A String instance that contains the title displayed for this axis, or null if the axis has no title.

isAnimated

public boolean isAnimated()
Getter for property animated.

Returns:
Value of property animated.

setAnimated

public void setAnimated(boolean animated)
Setter for property animated.

Parameters:
animated - new value of property animated.

getDrawTca

public boolean getDrawTca()

setDrawTca

public void setDrawTca(boolean b)

getDataPath

public java.lang.String getDataPath()

setDataPath

public void setDataPath(java.lang.String dataset)
Parameters:
dataset - The URL identifier string of a TCA data set, or "" for no TCAs.

setDataSetDescriptor

public void setDataSetDescriptor(DataSetDescriptor dsdAux)
Add auxilary data to an axis (usually OA data for a time axis). This function does the same thing as setDataPath, but with a different interface.

Parameters:
will - be called upon to generate auillary data sets. To avoid nonsensical graphs the X axis for this dataset must be the same as the that handed to the renderer.

getDevicePosition

public final int getDevicePosition()
TODO

Returns:

getDLength

public int getDLength()
Returns:
returns the length in pixels of the axis.

getMasterAxis

public DasAxis getMasterAxis()
TODO

Returns:

attachTo

public void attachTo(DasAxis axis)
TODO

Parameters:
axis -

detach

public void detach()
TODO


isAttached

public boolean isAttached()
TODO

Returns:

getTickV

public TickVDescriptor getTickV()
TODO

Returns:

setTickV

public void setTickV(TickVDescriptor tickV)
Sets the TickVDescriptor for this axis. If null is passed in, the axis will put into autoTickV mode, where the axis will attempt to determine ticks using an appropriate algortithm.

Parameters:
tickV - the new ticks for this axis, or null

updateTickV

public void updateTickV()

paintComponent

protected void paintComponent(java.awt.Graphics graphics)
paints the axis component. The tickV's and bounds should be calculated at this point

Overrides:
paintComponent in class javax.swing.JComponent

paintHorizontalAxis

protected void paintHorizontalAxis(java.awt.Graphics2D g)
Paint the axis if it is horizontal


paintVerticalAxis

protected void paintVerticalAxis(java.awt.Graphics2D g)
Paint the axis if it is vertical


getTitlePositionOffset

protected int getTitlePositionOffset()
TODO

Returns:

getLineSpacing

public int getLineSpacing()

drawLabel

protected void drawLabel(java.awt.Graphics2D g,
                         Datum value,
                         java.lang.String label,
                         int index,
                         int x,
                         int y)
TODO


getTickLabelFont

public java.awt.Font getTickLabelFont()
TODO

Returns:

setTickLabelFont

public void setTickLabelFont(java.awt.Font tickLabelFont)
TODO

Parameters:
tickLabelFont -

getLabelFont

public java.awt.Font getLabelFont()
TODO

Returns:

setLabelFont

public void setLabelFont(java.awt.Font labelFont)
TODO

Parameters:
labelFont -

getMemento

public DasAxis.Memento getMemento()

getAffineTransform

public java.awt.geom.AffineTransform getAffineTransform(DasAxis.Memento memento,
                                                        java.awt.geom.AffineTransform at)
return the AffineTransform, or null. The transform will be applied after the input transform is applied. So to just get the transform, pass in identity.


clone

public java.lang.Object clone()
TODO

Overrides:
clone in class java.lang.Object
Returns:

getMaxLabelWidth

protected int getMaxLabelWidth(java.awt.FontMetrics fm)
Deprecated. use getMaxLabelWidth()

TODO

Parameters:
fm -
Returns:
the width in pixels of the widest label.

resize

public void resize()
TODO

Overrides:
resize in class DasCanvasComponent

getLabelBounds

protected java.awt.Rectangle getLabelBounds(java.awt.Rectangle bounds)
calculate the bounds of the labels. This should including regions that the labels could occupy if the axis were panned, so that result doesn't change during panning.

Returns:
Rectangle in the canvas coordinate frame.

getAxisBounds

protected java.awt.Rectangle getAxisBounds()
Calculate the rectangle that bounds the axis including its labels. When the axis is drawn on both sides of the plot, this rectangle will extend across the plot.

Returns:
Rectangle containing the axes and its labels.

getOrientation

public int getOrientation()
returns the orientation of the axis, which is one of BOTTOM,TOP,LEFT or RIGHT.

Returns:
BOTTOM,TOP,LEFT or RIGHT.

isHorizontal

public boolean isHorizontal()
test if the axis is horizontal.

Returns:
true if the orientation is BOTTOM or TOP.

getTickDirection

public int getTickDirection()
TODO

Returns:

getDatumFormatter

public DatumFormatter getDatumFormatter()
TODO

Returns:

transform

public double transform(Datum datum)
Transforms a Datum in data coordinates to a horizontal or vertical position on the parent canvas.

Parameters:
datum - a data value
Returns:
Horizontal or vertical position on the canvas.

transformFast

protected double transformFast(double data,
                               Units units)

transform

protected double transform(double data,
                           Units units)
Transforms a double in the given units in data coordinates to a horizontal or vertical position on the parent canvas.

Parameters:
data - a data value
units - the units of the given data value.
Returns:
Horizontal or vertical position on the canvas.

transform

protected double transform(double data,
                           Units units,
                           int dmin,
                           int dmax)

invTransform

public Datum invTransform(double idata)

tickFormatter

protected java.lang.String tickFormatter(Datum d)
return a label for this datum and visible range. This is intended to be overriden to change behavior. Note that both tickFormatter methods should be overridden.

Parameters:
tickv -
Returns:
string, possibly with Granny control characters.

tickFormatter

protected java.lang.String[] tickFormatter(DatumVector tickV,
                                           DatumRange datumRange)
return the tick labels for these datums and visible range. This is intended to be overriden to change behavior. Note that both tickFormatter methods should be overridden.

Parameters:
tickV -
datumRange -
Returns:
Strings, possibly with Granny control characters.

dataRangeSelected

public void dataRangeSelected(DataRangeSelectionEvent e)
TODO

Specified by:
dataRangeSelected in interface DataRangeSelectionListener
Parameters:
e -

findTick

public Datum findTick(Datum xDatum,
                      double direction,
                      boolean minor)
TODO

Parameters:
xDatum -
direction -
minor -
Returns:

updateImmediately

protected void updateImmediately()
TODO

Overrides:
updateImmediately in class DasCanvasComponent

areTickLabelsVisible

public boolean areTickLabelsVisible()
Deprecated. use isTickLabelsVisible

TODO

Returns:

isTickLabelsVisible

public boolean isTickLabelsVisible()
true if the tick labels should be drawn.

Returns:

setTickLabelsVisible

public void setTickLabelsVisible(boolean b)
TODO

Parameters:
b -

installComponent

protected void installComponent()
TODO

Overrides:
installComponent in class DasCanvasComponent

uninstallComponent

protected void uninstallComponent()
TODO

Overrides:
uninstallComponent in class DasCanvasComponent

orientationToString

protected static java.lang.String orientationToString(int i)
TODO

Parameters:
i -
Returns:

parseOrientationString

protected static int parseOrientationString(java.lang.String orientationString)
TODO

Parameters:
orientationString -
Returns:

getDOMElement

public org.w3c.dom.Element getDOMElement(org.w3c.dom.Document document)
TODO

Parameters:
document -
Returns:

createAttachedAxis

public DasAxis createAttachedAxis()

createAttachedAxis

public DasAxis createAttachedAxis(int orientation)
TODO

Parameters:
row -
column -
orientation -
Returns:

setPlot

public void setPlot(DasPlot p)

createNamedAxis

public static DasAxis createNamedAxis(java.lang.String name)
TODO

Parameters:
name -
Returns:

scanPrevious

public void scanPrevious()
TODO


scanNext

public void scanNext()
TODO


getActiveRegion

public java.awt.Shape getActiveRegion()
TODO

Overrides:
getActiveRegion in class DasCanvasComponent
Returns:

addMouseWheelListener

public void addMouseWheelListener(java.awt.event.MouseWheelListener l)
Adds a MouseWheelListener to the DasAxis. Special care must be taken with the DasAxis, because it is composed of two sub panels, and their parent panel (this), must not recieve the events. (This is because the DasPlot between them should get the events, and the DasPlot does not have a simple rectangular boundary.

Overrides:
addMouseWheelListener in class java.awt.Component

removeMouseWheelListener

public void removeMouseWheelListener(java.awt.event.MouseWheelListener l)
Overrides:
removeMouseWheelListener in class java.awt.Component

addMouseListener

public void addMouseListener(java.awt.event.MouseListener l)
TODO

Overrides:
addMouseListener in class java.awt.Component
Parameters:
l -

removeMouseListener

public void removeMouseListener(java.awt.event.MouseListener l)
TODO

Overrides:
removeMouseListener in class java.awt.Component
Parameters:
l -

addMouseMotionListener

public void addMouseMotionListener(java.awt.event.MouseMotionListener l)
TODO

Overrides:
addMouseMotionListener in class java.awt.Component
Parameters:
l -

removeMouseMotionListener

public void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
TODO

Overrides:
removeMouseMotionListener in class java.awt.Component
Parameters:
l -

timeRangeSelected

public void timeRangeSelected(TimeRangeSelectionEvent e)
Specified by:
timeRangeSelected in interface TimeRangeSelectionListener

addTimeRangeSelectionListener

public void addTimeRangeSelectionListener(TimeRangeSelectionListener listener)
Registers TimeRangeSelectionListener to receive events.

Parameters:
listener - The listener to register.

removeTimeRangeSelectionListener

public void removeTimeRangeSelectionListener(TimeRangeSelectionListener listener)
Removes TimeRangeSelectionListener from the list of listeners.

Parameters:
listener - The listener to remove.

toString

public java.lang.String toString()
Overrides:
toString in class DasCanvasComponent
Returns:
a concise String representation of the object.

isFlipped

public boolean isFlipped()

setFlipped

public void setFlipped(boolean b)

getFormat

public java.lang.String getFormat()

isFlipLabel

public boolean isFlipLabel()

setFlipLabel

public void setFlipLabel(boolean flipLabel)

setFormat

public void setFormat(java.lang.String formatString)
set a hint at the format string. Examples include: 0.000 %H:%M!c%Y-%j

Parameters:
formatString -

mutatorLock

public DasAxis.Lock mutatorLock()

valueIsAdjusting

public boolean valueIsAdjusting()
true if a lock is out and an object is rapidly mutating the object. clients listening for property changes can safely ignore property changes while valueIsAdjusting is true, as they should receive a final propertyChangeEvent after the lock is released. (note it's not clear who is responsible for this. See http://www.das2.org/wiki/index.php/Das2.valueIsAdjusting)