public class DasAxis extends DasCanvasComponent implements DataRangeSelectionListener, TimeRangeSelectionListener, java.lang.Cloneable
Modifier and Type | Class and Description |
---|---|
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
class for storing an axis transform.
|
DasCanvasComponent.CanvasComponentAction
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
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 |
protected DatumFormatter |
dividerDatumFormatter
the formatter identified to work with the divider
|
protected boolean |
enableHistory
true if the axis built-in history is enabled.
|
protected boolean |
flipLabel
true means flip the right label so all vertical labels are facing the same direction.
|
protected java.lang.String |
formatString
the formatString, or "" if default behavior.
|
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 DomainDivider |
majorTicksDomainDivider |
static int |
MAX_TCA_LINES |
protected DomainDivider |
minorTicksDomainDivider |
protected javax.swing.JPanel |
primaryInputPanel |
static java.lang.String |
PROP_AXISOFFSET |
static java.lang.String |
PROP_BOUNDS |
static java.lang.String |
PROP_DIVIDERDATUMFORMATTER |
static java.lang.String |
PROP_ENABLEHISTORY
true if the axis built-in history is enabled.
|
static java.lang.String |
PROP_FLIPLABEL |
static java.lang.String |
PROP_FLIPPED |
static java.lang.String |
PROP_FONTSIZE |
static java.lang.String |
PROP_FORMATSTRING |
static java.lang.String |
PROP_LABEL |
static java.lang.String |
PROP_LINETHICKNESS |
static java.lang.String |
PROP_LOCKDOMAINDIVIDER |
static java.lang.String |
PROP_LOG |
static java.lang.String |
PROP_MAJORTICKSDOMAINDIVIDER |
static java.lang.String |
PROP_MINORTICKSDOMAINDIVIDER |
static java.lang.String |
PROP_OPPOSITE_AXIS_VISIBLE |
static java.lang.String |
PROP_REFERENCE |
static java.lang.String |
PROP_SCAN_RANGE |
static java.lang.String |
PROP_TCALABELS |
static java.lang.String |
PROP_TCAROWS |
static java.lang.String |
PROP_TICKVALUES |
static java.lang.String |
PROP_UNITS |
static java.lang.String |
PROP_USEDOMAINDIVIDER |
static java.lang.String |
PROPERTY_DATUMRANGE |
static java.lang.String |
PROPERTY_TICKS |
static int |
RIGHT
This value indicates 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
|
protected boolean |
useDomainDivider |
static int |
VERTICAL
This value indicates that the axis should be oriented vertically
|
mouseAdapter, PROP_OPAQUEBACKGROUND, PROPERTIES_ACTION
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Modifier | Constructor and Description |
---|---|
protected |
DasAxis(DataRange range,
int orientation)
Create an axis object, relating data and canvas pixel coordinates.
|
|
DasAxis(Datum min,
Datum max,
int orientation)
Create an axis object, relating data and canvas pixel coordinates.
|
|
DasAxis(Datum min,
Datum max,
int orientation,
boolean log)
Create an axis object, relating data and canvas pixel coordinates.
|
|
DasAxis(DatumRange range,
int orientation)
Create an axis object, relating data and canvas pixel coordinates.
|
Modifier and Type | Method and Description |
---|---|
void |
addMouseListener(java.awt.event.MouseListener l)
add mouse wheel listener.
|
void |
addMouseMotionListener(java.awt.event.MouseMotionListener l)
add mouse motion listener.
|
void |
addMouseWheelListener(java.awt.event.MouseWheelListener l)
Adds a MouseWheelListener to the DasAxis.
|
void |
addTickV(Datum majorTick)
add the tick to the current set of major ticks.
|
void |
addTimeRangeSelectionListener(TimeRangeSelectionListener listener)
Registers TimeRangeSelectionListener to receive events.
|
void |
addToFavorites(DatumRange range)
add the range to the favorites list, which is accessible from the popup-menu.
|
void |
attachTo(DasAxis axis)
attach the axis to another axis, so they will both show the same range,
as with a stack of time axes or with a slice.
|
void |
clearHistory()
clear the internal history.
|
java.lang.Object |
clone() |
DasAxis |
createAttachedAxis()
create another axis that follows this axis.
|
DasAxis |
createAttachedAxis(int orientation)
create another axis that follows this axis.
|
void |
dataRangeSelected(DataRangeSelectionEvent e)
target event handlers to reset the axis bounds.
|
void |
detach()
disconnect this from the common DataRange object that ties this to other
axes, and create a new DataRange.
|
protected void |
deviceRangeChanged()
Deprecated.
this is not used.
|
protected void |
drawLabel(java.awt.Graphics2D g,
Datum value,
java.lang.String label,
int index,
int x,
int y)
Draw each label of the axis.
|
Datum |
findTick(Datum xDatum,
double direction,
boolean minor)
Deprecated.
Use getTickVDescriptor.findTick
|
java.awt.Shape |
getActiveRegion()
get the region containing the axis.
|
java.awt.geom.AffineTransform |
getAffineTransform(DasAxis.Memento memento,
java.awt.geom.AffineTransform at)
return the AffineTransform, or null.
|
java.awt.Rectangle |
getAxisBounds()
Calculate the rectangle that bounds the axis including its labels.
|
java.lang.String |
getAxisOffset() |
protected int |
getAxisOffsetPixels()
return the offset of the axis from the plot, as specified by the axisOffset property.
|
Datum |
getDataMaximum()
return the maximum value
|
double |
getDataMaximum(Units units)
get the bigger extent of the range of this axis, in the given units.
|
Datum |
getDataMinimum()
return the minimum value
|
double |
getDataMinimum(Units units)
get the smaller extent of the range of this axis, in the given units.
|
java.lang.String |
getDataPath()
return the path for the TCA dataset.
|
DataRange |
getDataRange()
return the mutable DataRange object.
|
DatumFormatter |
getDatumFormatter()
return the formatter which converts Datum tick positions to a string.
|
DatumRange |
getDatumRange()
return the current range
|
int |
getDevicePosition()
Deprecated.
this should not be used.
|
DatumFormatter |
getDividerDatumFormatter() |
int |
getDLength()
return the length of the axis in pixels.
|
boolean |
getDrawTca()
Deprecated.
use isDrawTca()
|
java.lang.String |
getFontSize() |
java.lang.String |
getFormat()
return the format string for each tick.
|
java.lang.String |
getLabel()
get the label for the axis.
|
protected java.awt.Rectangle |
getLabelBounds(java.awt.Rectangle bounds)
calculate the bounds of the labels.
|
java.awt.Font |
getLabelFont()
get the font for labels.
|
java.lang.String |
getLabelOffset() |
int |
getLineSpacing()
calculate the spacing (whitespace) between the TCA items.
|
java.lang.String |
getLineThickness() |
DomainDivider |
getMajorTicksDomainDivider()
return the domain divider for major ticks, or null.
|
DasAxis |
getMasterAxis()
return the axis this is attached to.
|
protected int |
getMaxLabelWidth(java.awt.FontMetrics fm)
Deprecated.
use getMaxLabelWidth()
|
DasAxis.Memento |
getMemento()
get the memento object which identifies the state of the axis transformation.
|
DomainDivider |
getMinorTicksDomainDivider()
return the domain divider for minor ticks, or null.
|
int |
getOrientation()
returns the orientation of the axis, which is one of BOTTOM,TOP,LEFT or RIGHT.
|
DatumRange |
getRange()
Deprecated.
use getDatumRange instead.
|
java.lang.String |
getReference() |
DatumRange |
getScanRange()
get the limit the scan buttons, which may be null.
|
java.lang.String |
getTcaLabels() |
int |
getTcaRows()
the explicit number of TCA rows used to allocate space (not including time location).
|
int |
getTickDirection()
return the tick direction, 1=down or left, -1=up or right
|
java.awt.Font |
getTickLabelFont()
get the font for tick labels.
|
java.lang.String |
getTickLength()
get the tick length string, for example "0.66em"
|
int |
getTickLines()
return the number of lines that the ticks use, considering the ephemeris (TCAs) loaded.
|
TickVDescriptor |
getTickV()
return the current set of ticks.
|
java.lang.String |
getTickValues() |
protected int |
getTitlePositionOffset()
get the offset of the label from the baseline in pixels.
|
Units |
getUnits()
return the units of the axis.
|
DatumFormatter |
getUserDatumFormatter()
get the userDatumFormatter, which converts Datums into Strings.
|
protected void |
installComponent()
perform actions necessary when starting the component, such as handling TCA.
|
Datum |
invTransform(double idata)
return the data location for the given pixel position.
|
DatumRange |
invTransform(double idata1,
double idata2)
get the range covered by the two points.
|
boolean |
isAnimated()
true if the axis is animated.
|
boolean |
isAttached()
return true if this is attached to another axis.
|
boolean |
isDrawTca()
true if additional tick labels are drawn using the TCA function.
|
boolean |
isEnableHistory()
true if the axis built-in history is enabled.
|
boolean |
isFlipLabel()
true if the right vertical label should be flipped.
|
boolean |
isFlipped()
return true if the axis is flipped.
|
boolean |
isHorizontal()
test if the axis is horizontal.
|
boolean |
isLockDomainDivider() |
boolean |
isLog()
return true if the axis is log.
|
boolean |
isOppositeAxisVisible()
return true if the opposite side is also drawn.
|
boolean |
isTcaLoaded()
true if the TCA data has been loaded and the axis bounds reflect TCA data present.
|
boolean |
isTickLabelsVisible()
true if the tick labels should be drawn.
|
boolean |
isUseDomainDivider()
true if the domain divider should be used.
|
DasAxis.Lock |
mutatorLock()
get an object to lock the axis for multiple operations.
|
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 vertical axis
|
protected void |
processEvent(java.awt.AWTEvent e)
Processes events occurring on this component.
|
protected boolean |
rangeIsAcceptable(DatumRange dr) |
void |
removeFromFavorites(DatumRange range)
remove the range from the favorites list, which is accessible from the popup-menu.
|
void |
removeMouseListener(java.awt.event.MouseListener l)
remove mouse motion listener.
|
void |
removeMouseMotionListener(java.awt.event.MouseMotionListener l)
remove mouse motion listener.
|
void |
removeMouseWheelListener(java.awt.event.MouseWheelListener l)
remove mouse wheel listener.
|
void |
removeTimeRangeSelectionListener(TimeRangeSelectionListener listener)
Removes TimeRangeSelectionListener from the list of listeners.
|
void |
repaint() |
void |
resetRange(DatumRange range)
set the axis to the new range, allowing the units to change.
|
protected void |
resetTickV(TickVDescriptor ticks)
call-back for TickMaster
|
void |
resize()
reset bounds (and unused transform), invalidate the tickV, etc.
|
void |
scanNext()
scan to the next interval.
|
void |
scanPrevious()
scan to the previous interval.
|
void |
setAnimated(boolean animated)
if true then the axis will be animated.
|
void |
setAxisOffset(java.lang.String axisOffset)
set the offset of the axis from the plot.
|
void |
setDataMaximum(Datum max)
set the bigger extent of the range of this axis.
|
void |
setDataMinimum(Datum min)
set the smaller extent of the range of this axis.
|
void |
setDataPath(java.lang.String dataset) |
void |
setDataRange(Datum minimum,
Datum maximum)
Set the data range.
|
void |
setDataRangeForward()
set the range to the next interval.
|
void |
setDataRangePrev()
set the range to the previous interval.
|
void |
setDataRangeZoomOut()
set the range to min-width to max+width.
|
void |
setDatumRange(DatumRange dr)
Set the range for the axis.
|
void |
setDividerDatumFormatter(DatumFormatter dividerDatumFormatter) |
void |
setDrawTca(boolean b)
if true then turn on additional tick labels using the TCA function.
|
void |
setEnableHistory(boolean enableHistory)
true if the axis built-in history is enabled.
|
void |
setFlipLabel(boolean flipLabel)
true if the right vertical label should be flipped.
|
void |
setFlipped(boolean b)
flip over the axis.
|
void |
setFontSize(java.lang.String fontSize) |
void |
setFormat(java.lang.String formatString)
set a hint at the format string.
|
void |
setLabel(java.lang.String t)
set the label for the axis.
|
void |
setLabelOffset(java.lang.String spec)
explicitly set the position of the label from the axis.
|
void |
setLeftXLabelOverride(int leftXOverride)
Deprecated.
use setLabelOffset instead.
|
void |
setLineThickness(java.lang.String lineThickness)
set the thickness of the lines drawn.
|
void |
setLockDomainDivider(boolean lockDomainDivider)
don't allow the domain divider to adjust.
|
void |
setLog(boolean log)
Set the axis to be log or linear.
|
void |
setMajorTicksDomainDivider(DomainDivider majorTicksDomainDivider) |
void |
setMinorTicksDomainDivider(DomainDivider minorTicksDomainDivider) |
void |
setNextAction(java.lang.String label,
javax.swing.AbstractAction abstractAction)
set the action for the next button
|
void |
setNextActionLabel(java.lang.String label,
java.lang.String tooltip)
set the label for the popup button
|
void |
setOppositeAxisVisible(boolean visible)
if true, then the axis and its ticks on the opposite side will also be drawn.
|
void |
setOrientation(int orientation)
Set the axis orientation.
|
void |
setPlot(DasPlot p)
set the plot that will get updates
|
void |
setPreviousAction(java.lang.String label,
javax.swing.AbstractAction abstractAction)
set the action for the prev button
|
void |
setPreviousActionLabel(java.lang.String label,
java.lang.String tooltip)
set the label for the popup button
|
void |
setReference(java.lang.String reference)
draw an optional reference line at the location.
|
void |
setScanRange(DatumRange range)
limit the scan buttons to operate within this range.
|
void |
setTcaFunction(QFunction f)
Add auxiliary data to an axis (usually OrbitAttitude data for a time axis).
|
void |
setTcaLabels(java.lang.String tcaLabels)
set the TCA data labels explicitly, using a semi-colon delimited list of labels.
|
void |
setTcaRows(int tcaRows)
the explicit number of additional TCA rows used to allocate space (not including time location).
|
void |
setTickLabelsVisible(boolean b)
set true if the tick labels should be drawn.
|
void |
setTickLength(java.lang.String tickLengthStr)
set the tick length string, for example
"0.33em" "5px" "-0.33em"
|
void |
setTickV(double[] minorTicks,
double[] majorTicks)
convenience method for manually setting the ticks so the user
needn't understand TickVDescriptor.
|
void |
setTickV(TickVDescriptor tickV)
Sets the TickVDescriptor for this axis.
|
void |
setTickValues(java.lang.String ticks)
manually set the tick positions or spacing.
|
void |
setUnits(Units newUnits)
set the units of the axis, which must be convertible from the old units.
|
void |
setUseDomainDivider(boolean useDomainDivider)
true if the domain divider should be used.
|
void |
setUserDatumFormatter(DatumFormatter userDatumFormatter)
set the userDatumFormatter, which converts Datums into Strings.
|
void |
setVisible(boolean aFlag)
set the component visible or invisible.
|
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)
call back for time range selection event.
|
java.lang.String |
toString() |
double |
transform(Datum datum)
Transforms a Datum in data coordinates to a horizontal or vertical
position on the parent canvas.
|
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)
Transforms a double in the given units in data coordinates to a horizontal or vertical
position on the parent canvas.
|
double |
transform(QDataSet data)
Transforms the rank 0 dataset a horizontal or vertical
position on the parent canvas.
|
double |
transform(QDataSet data,
Units units)
Transforms the rank 0 dataset a horizontal or vertical
position on the parent canvas.
|
protected double |
transformFast(double data,
Units units)
this was never utilized, but at_m and at_b could be used to speed up
transformation.
|
protected void |
uninstallComponent()
remove the component row and column update listener.
|
protected void |
updateImmediately()
reset the transform and update the tick locations.
|
protected void |
updateTickV()
recalculate the tick positions.
|
protected void |
updateTickVManualTicks(java.lang.String lticks) |
boolean |
valueIsAdjusting()
true if a lock is out and an object is rapidly mutating the object.
|
acceptContext, addMouseModule, coalesceEvents, getActions, getCanvas, getColumn, getDasMouseInputAdapter, getDasName, getEmSize, getFont, getLineThicknessDouble, getRow, isOpaqueBackground, processDasUpdateEvent, removeMouseModule, setColumn, setDasName, setOpaqueBackground, setRow, showProperties, update
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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
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, getAccessibleContext, 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, 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, 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 PROP_LABEL
public static final java.lang.String PROP_LOG
public static final java.lang.String PROP_OPPOSITE_AXIS_VISIBLE
public static final java.lang.String PROP_BOUNDS
public static final java.lang.String PROP_SCAN_RANGE
public static final java.lang.String PROP_UNITS
public static final java.lang.String PROPERTY_TICKS
public static final int MAX_TCA_LINES
public static final int TOP
public static final int BOTTOM
public static final int LEFT
public static final int RIGHT
public static final int HORIZONTAL
public static final int VERTICAL
protected DataRange dataRange
protected java.lang.String axisLabel
protected TickVDescriptor tickV
protected DatumFormatter datumFormatter
protected javax.swing.JPanel primaryInputPanel
protected javax.swing.JPanel secondaryInputPanel
public static final java.lang.String PROPERTY_DATUMRANGE
protected boolean enableHistory
public static final java.lang.String PROP_ENABLEHISTORY
public static final java.lang.String PROP_REFERENCE
public static final java.lang.String PROP_TCAROWS
public static final java.lang.String PROP_TCALABELS
public static final java.lang.String PROP_TICKVALUES
public static final java.lang.String PROP_AXISOFFSET
public static final java.lang.String PROP_FONTSIZE
public static final java.lang.String PROP_LINETHICKNESS
public static final java.lang.String PROP_FLIPPED
protected java.lang.String formatString
public static final java.lang.String PROP_FORMATSTRING
protected boolean flipLabel
public static final java.lang.String PROP_FLIPLABEL
protected DatumFormatter dividerDatumFormatter
public static final java.lang.String PROP_DIVIDERDATUMFORMATTER
protected DomainDivider minorTicksDomainDivider
public static final java.lang.String PROP_MINORTICKSDOMAINDIVIDER
protected DomainDivider majorTicksDomainDivider
public static final java.lang.String PROP_MAJORTICKSDOMAINDIVIDER
protected boolean useDomainDivider
public static final java.lang.String PROP_USEDOMAINDIVIDER
public static final java.lang.String PROP_LOCKDOMAINDIVIDER
public DasAxis(Datum min, Datum max, int orientation)
min
- the minimum valuemax
- the maximum valueorientation
- DasAxis.TOP, DasAxis.BOTTOM, DasAxis.LEFT, DasAxis.RIGHT.public DasAxis(DatumRange range, int orientation)
range
- the initial range for the axis.orientation
- the position relative to a plot, one of DasAxis.TOP, DasAxis.BOTTOM, DasAxis.LEFT, DasAxis.RIGHT.public DasAxis(Datum min, Datum max, int orientation, boolean log)
min
- the minimum valuemax
- the maximum valueorientation
- the position relative to a plot, one of DasAxis.TOP, DasAxis.BOTTOM, DasAxis.LEFT, DasAxis.RIGHT.log
- if true then the axis is a log axis.protected DasAxis(DataRange range, int orientation)
range
- the range object allowing connections between axes. A DataRange is a mutable object.orientation
- the position relative to a plot, one of DasAxis.TOP, DasAxis.BOTTOM, DasAxis.LEFT, DasAxis.RIGHTpublic DatumFormatter getUserDatumFormatter()
public void setUserDatumFormatter(DatumFormatter userDatumFormatter)
userDatumFormatter
- the userDatumFormatter.public void setNextAction(java.lang.String label, javax.swing.AbstractAction abstractAction)
label
- the label (step or scan)abstractAction
- the action to invoke.public void setPreviousAction(java.lang.String label, javax.swing.AbstractAction abstractAction)
label
- the label (step or scan)abstractAction
- the action to invoke.public void addToFavorites(DatumRange range)
range
- the range to add.public void removeFromFavorites(DatumRange range)
range
- the range to add.public boolean isEnableHistory()
public void setEnableHistory(boolean enableHistory)
enableHistory
- true if the axis built-in history is enabled.public void setOrientation(int orientation)
public void setDatumRange(DatumRange dr)
dr
- the new range. The range must be interval or ratio measurements.public DatumRange getDatumRange()
protected boolean rangeIsAcceptable(DatumRange dr)
public void setDataRange(Datum minimum, Datum maximum)
minimum
- the minimum valuemaximum
- the maximum valuepublic void clearHistory()
public void setDataRangePrev()
public void setDataRangeForward()
public void setDataRangeZoomOut()
public DataRange getDataRange()
protected void deviceRangeChanged()
public Datum getDataMinimum()
public Datum getDataMaximum()
public DatumRange getRange()
public double getDataMaximum(Units units)
units
- the units which the result should be returned in.public double getDataMinimum(Units units)
units
- the units which the result should be returned in.public void setDataMaximum(Datum max)
max
- the new valuepublic void setDataMinimum(Datum min)
min
- the new valuepublic boolean isLog()
public void setLog(boolean log)
log
- true if the axis should be log.public java.lang.String getReference()
public void setReference(java.lang.String reference)
reference
- public Units getUnits()
public void setUnits(Units newUnits)
newUnits
- the units of the axis.resetRange(org.das2.datum.DatumRange)
public void setScanRange(DatumRange range)
range
- null or the range to limit the scanningpublic DatumRange getScanRange()
public void resetRange(DatumRange range)
range
- the new rangepublic void setOppositeAxisVisible(boolean visible)
visible
- if true, then the axis and its ticks on the opposite side will also be drawn.public boolean isOppositeAxisVisible()
public void setLabel(java.lang.String t)
t
- The new label for this axispublic java.lang.String getLabel()
public boolean isAnimated()
public void setAnimated(boolean animated)
animated
- if true then the axis will be animated.public boolean getDrawTca()
public boolean isDrawTca()
setTcaFunction(org.das2.qds.QFunction)
public boolean isTcaLoaded()
public void setDrawTca(boolean b)
b
- if true then additional ticks will be drawn.setTcaFunction(org.das2.qds.QFunction)
public java.lang.String getDataPath()
public void setDataPath(java.lang.String dataset)
dataset
- The URL identifier string of a TCA data set, or "" for no TCAs.which turns on additional ticks.
protected void processEvent(java.awt.AWTEvent e)
DasCanvasComponent
process<event type>Event
method for the given class of event.
Note that if the event parameter is null
the behavior is unspecified and may result in an
exception.
processEvent
in class DasCanvasComponent
e
- the eventComponent.processComponentEvent(java.awt.event.ComponentEvent)
,
Component.processFocusEvent(java.awt.event.FocusEvent)
,
Component.processKeyEvent(java.awt.event.KeyEvent)
,
Component.processMouseEvent(java.awt.event.MouseEvent)
,
Component.processMouseMotionEvent(java.awt.event.MouseEvent)
,
Component.processInputMethodEvent(java.awt.event.InputMethodEvent)
,
Component.processHierarchyEvent(java.awt.event.HierarchyEvent)
,
Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent)
,
DasCanvasComponent.processDasUpdateEvent(org.das2.event.DasUpdateEvent)
public void setTcaFunction(QFunction f)
f
- will be called upon to generate auxiliary data sets, or null to disable.which turns on additional ticks.
public int getTcaRows()
public void setTcaRows(int tcaRows)
tcaRows
- public java.lang.String getTcaLabels()
public void setTcaLabels(java.lang.String tcaLabels)
tcaLabels
- public final int getDevicePosition()
public int getDLength()
public DasAxis getMasterAxis()
public void attachTo(DasAxis axis)
axis
- the axis.public void detach()
public boolean isAttached()
public TickVDescriptor getTickV()
public void setTickV(double[] minorTicks, double[] majorTicks)
minorTicks
- the minor ticks, or null (None) for the current minor ticksmajorTicks
- the major ticks, or null (None) to automatic.setTickV(org.das2.graph.TickVDescriptor)
public void addTickV(Datum majorTick)
majorTick
- tick in the same units as the axis.setTickV(double[], double[])
public void setTickV(TickVDescriptor tickV)
tickV
- the new ticks for this axis, or null for automaticpublic java.lang.String getTickValues()
public void setTickValues(java.lang.String ticks)
empty string is automatic behavior | |
0,45,90,135,180 | explicit tick positions, in axis units |
+45 | spacing between ticks, parsed with the axis offset units. |
+20s/4 | every 20 seconds, with four minor divisions. |
+30s | 30 seconds spacing between ticks |
*10/2,3,4,5,6,7,8,9 | normal log axis. |
*1e2/5,10,50 | log major ticks should be every two cycles |
*5/2,3,4 | log major ticks at 1,5,25/ |
none | no ticks |
ticks
- about log axes.
,
GraphUtil.calculateManualTicks(java.lang.String, org.das2.datum.DatumRange, boolean)
protected void resetTickV(TickVDescriptor ticks)
ticks
- the new ticks.protected void updateTickVManualTicks(java.lang.String lticks)
protected void updateTickV()
protected void paintComponent(java.awt.Graphics graphics)
paintComponent
in class javax.swing.JComponent
graphics
- the graphics context.protected void paintHorizontalAxis(java.awt.Graphics2D g)
g
- the graphics contextprotected int getAxisOffsetPixels()
protected void paintVerticalAxis(java.awt.Graphics2D g)
g
- the graphics contextpublic void setLeftXLabelOverride(int leftXOverride)
leftXOverride
- setLabelOffset(java.lang.String)
public void setLabelOffset(java.lang.String spec)
spec
- offset string like "5em+5px"public java.lang.String getLabelOffset()
public java.lang.String getAxisOffset()
public void setAxisOffset(java.lang.String axisOffset)
axisOffset
- protected int getTitlePositionOffset()
public int getLineSpacing()
protected void drawLabel(java.awt.Graphics2D g, Datum value, java.lang.String label, int index, int x, int y)
g
- graphics contextvalue
- value to look up.label
- the labelindex
- the index. The default does not use this, but overriding methods may use it.x
- tick position relative to the canvasy
- tick position relative to the canvaspublic java.awt.Font getTickLabelFont()
public java.awt.Font getLabelFont()
public java.lang.String getFontSize()
public void setFontSize(java.lang.String fontSize)
public DasAxis.Memento getMemento()
public java.awt.geom.AffineTransform getAffineTransform(DasAxis.Memento memento, java.awt.geom.AffineTransform at)
memento
- memento from another axis state.at
- initial transformpublic java.lang.Object clone()
clone
in class java.lang.Object
protected int getMaxLabelWidth(java.awt.FontMetrics fm)
fm
- the font metrics.getMaxLabelWidth()
public void resize()
resize
in class DasCanvasComponent
protected java.awt.Rectangle getLabelBounds(java.awt.Rectangle bounds)
bounds
- the bounds which will be enlarged, or null.public java.awt.Rectangle getAxisBounds()
public int getTickLines()
public int getOrientation()
public boolean isHorizontal()
public int getTickDirection()
public DatumFormatter getDatumFormatter()
public double transform(Datum datum)
datum
- a data valueInconvertibleUnitsException
protected double transformFast(double data, Units units)
data
- the data locationunits
- the unitspublic double transform(double data, Units units)
data
- a data valueunits
- the units of the given data value.InconvertibleUnitsException
public double transform(QDataSet data, Units units)
data
- a data valueunits
- the units of the given data value.InconvertibleUnitsException
public double transform(QDataSet data)
data
- a data valueInconvertibleUnitsException
protected double transform(double data, Units units, int dmin, int dmax)
data
- a data valueunits
- the units of the given data value.dmin
- the axis minimum.dmax
- the axis maximum.InconvertibleUnitsException
public DatumRange invTransform(double idata1, double idata2)
idata1
- pixel position on the axis, in the canvas frame.idata2
- pixel position on the axis, in the canvas frame.InconvertibleUnitsException
public Datum invTransform(double idata)
idata
- the pixel location on the axis, in the canvas frame.InconvertibleUnitsException
protected java.lang.String tickFormatter(Datum d)
d
- the locationprotected java.lang.String[] tickFormatter(DatumVector tickV, DatumRange datumRange)
tickV
- the ticksdatumRange
- the rangepublic void dataRangeSelected(DataRangeSelectionEvent e)
dataRangeSelected
in interface DataRangeSelectionListener
e
- the eventpublic Datum findTick(Datum xDatum, double direction, boolean minor)
xDatum
- find the tick closest to this.direction
- -1 previous, 1 next, 0 closestminor
- find closest minor tick, major if false.protected void updateImmediately()
updateImmediately
in class DasCanvasComponent
public boolean isTickLabelsVisible()
public void setTickLabelsVisible(boolean b)
b
- true if the tick labels should be drawn.protected void installComponent()
installComponent
in class DasCanvasComponent
protected void uninstallComponent()
uninstallComponent
in class DasCanvasComponent
public DasAxis createAttachedAxis()
public DasAxis createAttachedAxis(int orientation)
orientation
- the position relative to a plot, one of DasAxis.TOP, DasAxis.BOTTOM, DasAxis.LEFT, DasAxis.RIGHTpublic void setPlot(DasPlot p)
p
- plot object.public void scanPrevious()
public void scanNext()
public java.awt.Shape getActiveRegion()
getActiveRegion
in class DasCanvasComponent
public void addMouseWheelListener(java.awt.event.MouseWheelListener l)
addMouseWheelListener
in class java.awt.Component
l
- the listenerpublic void removeMouseWheelListener(java.awt.event.MouseWheelListener l)
removeMouseWheelListener
in class java.awt.Component
l
- the listenermaybeInitializeInputPanels()
public void addMouseListener(java.awt.event.MouseListener l)
addMouseListener
in class java.awt.Component
l
- the listenermaybeInitializeInputPanels()
public void removeMouseListener(java.awt.event.MouseListener l)
removeMouseListener
in class java.awt.Component
l
- the listenermaybeInitializeInputPanels()
public void addMouseMotionListener(java.awt.event.MouseMotionListener l)
addMouseMotionListener
in class java.awt.Component
l
- the listenermaybeInitializeInputPanels()
public void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
removeMouseMotionListener
in class java.awt.Component
l
- the listenermaybeInitializeInputPanels()
public void timeRangeSelected(TimeRangeSelectionEvent e)
timeRangeSelected
in interface TimeRangeSelectionListener
e
- the eventpublic void addTimeRangeSelectionListener(TimeRangeSelectionListener listener)
listener
- The listener to register.public void removeTimeRangeSelectionListener(TimeRangeSelectionListener listener)
listener
- The listener to remove.public java.lang.String toString()
toString
in class DasCanvasComponent
public void setNextActionLabel(java.lang.String label, java.lang.String tooltip)
label
- concise labeltooltip
- text for popup tooltippublic void setPreviousActionLabel(java.lang.String label, java.lang.String tooltip)
label
- concise labeltooltip
- text for popup tooltippublic void repaint()
repaint
in class java.awt.Component
public java.lang.String getTickLength()
public void setTickLength(java.lang.String tickLengthStr)
tickLengthStr
- the tick length string.public java.lang.String getLineThickness()
public void setLineThickness(java.lang.String lineThickness)
lineThickness
- public boolean isFlipped()
public void setFlipped(boolean b)
b
- public java.lang.String getFormat()
public boolean isFlipLabel()
public void setFlipLabel(boolean flipLabel)
flipLabel
- true if the right vertical label should be flipped.public DatumFormatter getDividerDatumFormatter()
public void setDividerDatumFormatter(DatumFormatter dividerDatumFormatter)
public DomainDivider getMinorTicksDomainDivider()
public void setMinorTicksDomainDivider(DomainDivider minorTicksDomainDivider)
public DomainDivider getMajorTicksDomainDivider()
public void setMajorTicksDomainDivider(DomainDivider majorTicksDomainDivider)
public boolean isUseDomainDivider()
public void setUseDomainDivider(boolean useDomainDivider)
useDomainDivider
- true if the domain divider should be used.public boolean isLockDomainDivider()
public void setLockDomainDivider(boolean lockDomainDivider)
lockDomainDivider
- public void setVisible(boolean aFlag)
setVisible
in class javax.swing.JComponent
aFlag
- public void setFormat(java.lang.String formatString)
formatString
- public DasAxis.Lock mutatorLock()
public boolean valueIsAdjusting()