|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
ifi.dsb.Axis
Class to hold an axis object. An axis object is composed of an AxisLine object, a MajorTicks object, a TickLabels object and an AxisLabel object. An Axis object belongs to a Graph object.
The data values for a curve are stored in two CurveData objects.
Property change listeners can be installed for the properties "Min", "Max", "FixedMin" and "FixedMax".
Plot2D,
Graph,
Curve,
CurveData,
Serialized Form| Nested Class Summary | |
class |
Axis.AxisLabel
Class to hold and paint label of axis (not labels of tick-marks). |
class |
Axis.AxisLine
Class to hold and paint line of axis. |
class |
Axis.MajorTicks
Class to hold and paint major tickmarks. |
class |
Axis.TickLabels
Class to hold and paint the ticklabels of this axis. |
| Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
static int |
HORIZONTAL
Constant to indicate a horizontal axis. |
static int |
VERTICAL
Constant to indicate a vertical axis. |
| 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 | |
Axis(Graph graph,
double min,
double max,
int length,
int orientation)
Constructs an Axis object. |
|
Axis(Graph graph,
int length,
int orientation)
Constructs an Axis object. |
|
Axis(int length,
int orientation)
Constructs an Axis object. |
|
| Method Summary | |
boolean |
getAutomaticBottomMargin()
Return whether or not to automatically leave some space between curve and axis, at the lower end of the axis. |
boolean |
getAutomaticTopMargin()
Return whether or not to automatically leave some space between curve and axis, at the higher end of the axis. |
Axis.AxisLabel |
getAxisLabel()
Return the AxisLabel child object. |
java.awt.Color |
getColor()
Return the color of this axis (including axis line, tick marks, tick labels and axis label). |
boolean |
getFixedMax()
Return whether or not the axis maximum value should be fixed (not automatically updated when axisData are changed). |
boolean |
getFixedMin()
Return whether or not the axis minimum value should be fixed (not automatically updated when axisData are changed). |
Graph |
getGraph()
Return Graph object to which this Axis belongs. |
int |
getHeight()
Return height in pixels. |
Axis.MajorTicks |
getMajorTicks()
Return the MajorTicks child object. |
double |
getMajorTickSpacing()
Return spacing between major tickmarks. |
boolean |
getManualBottomMargin()
Return whether or not to manually leave some space between curve and axis, at the lower end of the axis. |
boolean |
getManualTopMargin()
Return whether or not to manually leave some space between curve and axis, at the higher end of the axis. |
double |
getMax()
Return the axis maximum value. |
double |
getMin()
Return the axis minimum value. |
int |
getOrientation()
Return the orientation of the axis (VERTICAL or HORIZONTAL). |
boolean |
getPaintGrid()
Return whether or not to draw the grid. |
boolean |
getPaintMajorTicks()
Return whether or not to draw major tickmarks. |
boolean |
getPaintTickLabels()
Return whether or not to draw labels at the major tickmarks. |
java.awt.Dimension |
getPreferredSize()
Return the preferred size of this axis. |
Axis.TickLabels |
getTickLabels()
Return the TickLabels child object. |
int |
getWidth()
Return width in pixels. |
void |
paintComponent(java.awt.Graphics g)
Draw the axis. |
void |
setAutomaticBottomMargin(boolean set)
Set whether or not to automatically leave some space between curve and axis, at the lower end of the axis. |
void |
setAutomaticTopMargin(boolean set)
Set whether or not to automatically leave some space between curve and axis, at the higher end of the axis. |
void |
setBottomMargin(double margin)
Set size of bottom margin. |
void |
setColor(java.awt.Color color)
Set the color of this axis (including axis line, tick marks, tick labels and axis label). |
void |
setFixedMax(boolean fixedMax)
Set whether or not the axis maximum value should be fixed (not automatically updated when axisData are changed). |
void |
setFixedMax(boolean fixedMax,
boolean notify)
Set whether or not the axis maximum value should be fixed (not automatically updated when axisData are changed). |
void |
setFixedMin(boolean fixedMin)
Set whether or not the axis minimum value should be fixed (not automatically updated when axisData are changed). |
void |
setFixedMin(boolean fixedMin,
boolean notify)
Set whether or not the axis minimum value should be fixed (not automatically updated when axisData are changed). |
void |
setGraph(Graph graph)
Set Graph object to which this Axis belongs. |
void |
setLabelTable(java.util.Dictionary table)
Set the lables to be drawn for the major tickmarks. |
void |
setMajorTickSpacing(double spacing)
Set spacing between major tickmarks. |
void |
setManualBottomMargin(boolean set)
Set whether or not to manually leave some space between curve and axis, at the lower end of the axis. |
void |
setManualTopMargin(boolean set)
Set whether or not to manually leave some space between curve and axis, at the higher end of the axis. |
void |
setMax(double max)
Set the axis maximum value. |
void |
setMax(double max,
boolean notify)
Set the axis maximum value. |
void |
setMin(double min)
Set the axis minimum value. |
void |
setMin(double min,
boolean notify)
Set the axis minimum value. |
void |
setPaintGrid(boolean paintGrid)
Set whether or not to draw the grid. |
void |
setPaintMajorTicks(boolean paintTicks)
Set whether or not to draw major tickmarks. |
void |
setPaintTickLabels(boolean paintLabels)
Set whether or not to draw labels at the major tickmarks. |
void |
setTopMargin(double margin)
Set size of top margin. |
void |
updateMax()
Update axis maximum to reflect the maximum for all the CurveDatas (whether or not exceeding the current axis maximum), but only within a clipped axis range. |
void |
updateMax(CurveData curveData)
Update axis maximum if the maximum in CurveData exceeds the current axis maximum, but only within a clipped axis range. |
void |
updateMax(CurveData curveData,
int indMin,
int indMax)
Update axis maximum if the maximum over an index interval in CurveData exceeds the current axis maximum. |
void |
updateMin()
Update axis minimum to reflect the minimum for all the CurveDatas (whether or not exceeding the current axis minimum), but only within a clipped axis range. |
void |
updateMin(CurveData curveData)
Update axis minimum if the minimum in CurveData exceeds the current axis minimum, but only within a clipped axis range. |
void |
updateMin(CurveData curveData,
int indMin,
int indMax)
Update axis minimum if the minimum over an index interval in CurveData exceeds the current axis minimum. |
void |
updateMinMax()
Update axis minimum and maximum to reflect the extremas for all the CurveDatas (whether or not exceeding the current axis extrema), but only within a clipped axis range. |
void |
updateMinMax(boolean clipped)
Update axis minimum and maximum to reflect the extremas for all the CurveDatas (whether or not exceeding the current axis extrema), for the complete axis range, with or without clipping. |
void |
updateMinMax(CurveData curveData)
Update axis minimum and maximum if the extremas in CurveData exceed the current axis extrema, but only within a clipped axis range. |
void |
updateMinMax(CurveData curveData,
int indMin,
int indMax)
Update axis minimum and maximum if the extremas over an index interval in CurveData exceed the current axis extrema. |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int VERTICAL
public static final int HORIZONTAL
| Constructor Detail |
public Axis(int length,
int orientation)
length - Length of axis in pixels. Zero gives default value.orientation - Orientation (VERTICAL or HORIZONTAL)
public Axis(Graph graph,
int length,
int orientation)
graph - Graph to which this axis belongs.length - Length of axis in pixels. Zero gives default value.orientation - Orientation (VERTICAL or HORIZONTAL).
public Axis(Graph graph,
double min,
double max,
int length,
int orientation)
graph - Graph to which this axis belongs.min - Minimum value of axis. Will be set fixed unless both
min and max are zero. If not set fixed, the value will be updated when
axis is repainted.max - Maximum value of axis. Will be set fixed unless both
min and max are zero. If not set fixed, the value will be updated when
axis is repainted.length - Length of axis in pixels. Zero gives default value.orientation - Orientation (VERTICAL or HORIZONTAL).| Method Detail |
public int getWidth()
public int getHeight()
public Graph getGraph()
public void setGraph(Graph graph)
public void paintComponent(java.awt.Graphics g)
public java.awt.Dimension getPreferredSize()
public void updateMinMax()
The clipping range is determined by the intersection of [min, max] for this and the sister axis.
updateMinMax(boolean),
updateMinMax(CurveData)public void updateMinMax(boolean clipped)
clipped - Whether or not to update only within a clipped range.
The clipping range is determined by the intersection of [min, max]
for this and the sister axis.updateMinMax(),
updateMinMax(CurveData)public void updateMinMax(CurveData curveData)
Don't update an axis extremum which has been set fixed. Typical usage is for real-time plotting, i.e. when displaying a new curve which should not go outside the plot space.
curveData - Reference to data for one of the coordinates of a
curve.updateMinMax(CurveData, int, int)
public void updateMinMax(CurveData curveData,
int indMin,
int indMax)
curveData - Reference to data for one of the coordinates of a
curve.indMin - Lower bound of the index interval for the data array in
curveData.indMax - Upper bound of the index interval for the data array in
curveData.public void updateMin()
The clipping range is determined by the intersection of [min, max] for this and the sister axis.
updateMin(CurveData)public void updateMin(CurveData curveData)
The clipping range is determined by the intersection of [min, max] for this and the sister axis.
updateMin(CurveData, int, int)
public void updateMin(CurveData curveData,
int indMin,
int indMax)
curveData - Reference to data for one of the coordinates of a
curve.indMin - Lower bound of the index interval for the data array in
curveData.indMax - Upper bound of the index interval for the data array in
curveData.public void updateMax()
The clipping range is determined by the intersection of [min, max] for this and the sister axis.
updateMax(CurveData)public void updateMax(CurveData curveData)
The clipping range is determined by the intersection of [min, max] for this and the sister axis.
updateMax(CurveData, int, int)
public void updateMax(CurveData curveData,
int indMin,
int indMax)
curveData - Reference to data for one of the coordinates of a
curve.indMin - Lower bound of the index interval for the data array in
curveData.indMax - Upper bound of the index interval for the data array in
curveData.public int getOrientation()
public double getMin()
public void setMin(double min)
min - New value for axis minimum.
public void setMin(double min,
boolean notify)
min - New value for axis minimum.notify - Whether to notify property-change listeners (property
"Min");public double getMax()
public void setMax(double max)
max - New value for axis maximum.
public void setMax(double max,
boolean notify)
max - New value for axis maximum.notify - Whether to notify property-change listeners (property
"Max").public boolean getFixedMin()
public void setFixedMin(boolean fixedMin)
public void setFixedMin(boolean fixedMin,
boolean notify)
notify - Whether to notify property-change listeners (property
"FixedMin").public boolean getFixedMax()
public void setFixedMax(boolean fixedMax)
public void setFixedMax(boolean fixedMax,
boolean notify)
notify - Whether to notify property-change listeners (property
"FixedMax").public boolean getPaintGrid()
public void setPaintGrid(boolean paintGrid)
public boolean getPaintMajorTicks()
public void setPaintMajorTicks(boolean paintTicks)
public double getMajorTickSpacing()
public void setMajorTickSpacing(double spacing)
public boolean getPaintTickLabels()
public void setPaintTickLabels(boolean paintLabels)
public void setLabelTable(java.util.Dictionary table)
public java.awt.Color getColor()
public void setColor(java.awt.Color color)
public Axis.AxisLabel getAxisLabel()
public Axis.MajorTicks getMajorTicks()
public Axis.TickLabels getTickLabels()
public boolean getAutomaticBottomMargin()
public void setAutomaticBottomMargin(boolean set)
public boolean getAutomaticTopMargin()
public void setAutomaticTopMargin(boolean set)
public boolean getManualBottomMargin()
public void setManualBottomMargin(boolean set)
public boolean getManualTopMargin()
public void setManualTopMargin(boolean set)
public void setBottomMargin(double margin)
public void setTopMargin(double margin)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||