IScaleProvider
DAxis
public class Axis extends LinearScale
AbstractScale.LabelSide
org.eclipse.draw2d.Figure.FigureIterator
org.eclipse.draw2d.IFigure.NoInsets
LinearScale.Orientation
DEFAULT_ENGINEERING_FORMAT, DEFAULT_LOG_SCALE_MAX, DEFAULT_MAX, DEFAULT_MIN
Constructor | Description |
---|---|
Axis(java.lang.String title,
boolean yAxis) |
Constructor
|
Modifier and Type | Method | Description |
---|---|---|
void |
addListener(IAxisListener listener) |
|
void |
addTrace(Trace trace) |
Add a trace to the axis.
|
void |
dataChanged(IDataProvider dataProvider) |
|
boolean |
getAutoScale() |
|
double |
getAutoScaleThreshold() |
|
org.eclipse.swt.graphics.RGB |
getForegroundColorRGB() |
|
Grid |
getGrid() |
|
org.eclipse.swt.graphics.Color |
getMajorGridColor() |
|
org.eclipse.swt.graphics.RGB |
getMajorGridColorRGB() |
|
org.eclipse.swt.graphics.Color |
getMinorGridColor() |
|
org.eclipse.draw2d.geometry.Dimension |
getPreferredSize(int wHint,
int hHint) |
|
org.eclipse.swt.graphics.FontData |
getScaleFontData() |
|
java.lang.String |
getTitle() |
|
org.eclipse.swt.graphics.Font |
getTitleFont() |
|
org.eclipse.swt.graphics.FontData |
getTitleFontData() |
|
Range |
getTraceDataRange() |
|
IXYGraph |
getXYGraph() |
|
boolean |
isAutoScale() |
|
boolean |
isDashGridLine() |
|
boolean |
isInverted() |
Returns True if axis is inverted, False otherwise
|
boolean |
isOnPrimarySide() |
|
boolean |
isShowMajorGrid() |
|
boolean |
isShowMinorGrid() |
|
boolean |
isYAxis() |
|
boolean |
performAutoScale(boolean force) |
Perform an auto-scale: Axis limits are set to the value range of the
traces on this axis.
|
boolean |
removeListener(IAxisListener listener) |
|
boolean |
removeTrace(Trace trace) |
Remove a trace from the axis.
|
void |
setAutoScale(boolean autoScale) |
|
void |
setAutoScaleThreshold(double autoScaleThreshold) |
The autoScaleThreshold must be a value in range [0,1], which represents a
percentage of the plot area for the threshold when autoScale is
performed.The autoScale will performed only if the spare space exceeds
this threshold.
|
void |
setBackgroundColor(org.eclipse.swt.graphics.Color bg) |
|
void |
setDashGridLine(boolean dashGridLine) |
|
void |
setFont(org.eclipse.swt.graphics.Font font) |
|
void |
setForegroundColor(org.eclipse.swt.graphics.Color color) |
|
void |
setGrid(Grid grid) |
|
void |
setInverted(boolean isInverted) |
Inverts the axis if set to True
|
void |
setLogScale(boolean enabled) |
|
void |
setMajorGridColor(org.eclipse.swt.graphics.Color majorGridColor) |
|
void |
setMinorGridColor(org.eclipse.swt.graphics.Color minorGridColor) |
|
void |
setMinorTicksVisible(boolean minorTicksVisible) |
|
void |
setPrimarySide(boolean onPrimarySide) |
Set the axis on primary side (Bottom/Left) or secondary side (Top/Right).
|
void |
setRange(double lower,
double upper) |
set the scale range
|
void |
setShowMajorGrid(boolean showMajorGrid) |
|
void |
setShowMinorGrid(boolean showMinorGrid) |
|
void |
setTitle(java.lang.String title) |
|
void |
setTitleFont(org.eclipse.swt.graphics.Font titleFont) |
|
void |
setVisible(boolean visible) |
|
void |
setXYGraph(IXYGraph xyGraph) |
|
void |
setYAxis(boolean isYAxis) |
Set this axis as Y-Axis or X-Axis.
|
void |
setZoomType(ZoomType zoomType) |
|
java.lang.String |
toString() |
|
void |
zoomInOut(double center,
double factor) |
Zoom axis
|
format, format, getFormatPattern, getMajorGridStep, getMajorTickMarkStepHint, getMinorTickMarkStepHint, getRange, getTickLabelSide, getTickLablesSide, getTimeUnit, isAutoFormat, isDateEnabled, isDirty, isLogScaleEnabled, isMinorTicksVisible, isScaleLineVisible, setAutoFormat, setDateEnabled, setFormatPattern, setMajorGridStep, setMajorTickMarkStepHint, setMinorTickMarkStepHint, setRange, setRange, setScaleLineVisible, setTickLabelSide, setTickLableSide, setTimeUnit
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getClippingStrategy, getCursor, getFont, getForegroundColor, getInsets, getLayoutManager, getLocalBackgroundColor, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isOpaque, isRequestFocusEnabled, isShowing, isVisible, paint, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBorder, setClippingStrategy, setConstraint, setCursor, setEnabled, setFocusTraversable, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, validate
format, format, getFont, getForegroundColor, getMajorGridStep, getMajorTickMarkStepHint, getMinorTickMarkStepHint, getTimeUnit, isAutoFormat, isDateEnabled, isLogScaleEnabled, setAutoFormat
figureLayout, getDimension, getLabel, getLength, getLocalRange, getMargin, getMargin, getOrientation, getPositionValue, getPositionValue, getScaleRange, getScaleTickLabels, getScaleTickMarks, getTickLength, getTicksProvider, getValuePosition, getValuePrecisePosition, hasTicksAtEnds, isHorizontal, isLabelCustomised, isPrimary, isShowMaxLabel, isShowMinLabel, setBounds, setLength, setLocalRange, setMargin, setOrientation, setShowMaxLabel, setShowMinLabel, updateTick
public Axis(java.lang.String title, boolean yAxis)
title
- title of the axisyAxis
- true if this is the Y-Axis, false if this is the X-Axis.public void setFont(org.eclipse.swt.graphics.Font font)
setFont
in class LinearScale
public org.eclipse.swt.graphics.FontData getTitleFontData()
public org.eclipse.swt.graphics.FontData getScaleFontData()
public void addListener(IAxisListener listener)
public boolean removeListener(IAxisListener listener)
public void setRange(double lower, double upper)
AbstractScale
setRange
in class AbstractScale
lower
- the lower limitupper
- the upper limitpublic void setInverted(boolean isInverted)
isInverted
- public boolean isInverted()
public void setVisible(boolean visible)
setVisible
in class org.eclipse.draw2d.Figure
public void setForegroundColor(org.eclipse.swt.graphics.Color color)
setForegroundColor
in class LinearScale
public void setMinorTicksVisible(boolean minorTicksVisible)
setMinorTicksVisible
in class AbstractScale
minorTicksVisible
- the minorTicksVisible to setpublic org.eclipse.swt.graphics.RGB getForegroundColorRGB()
public void setBackgroundColor(org.eclipse.swt.graphics.Color bg)
setBackgroundColor
in class org.eclipse.draw2d.Figure
public org.eclipse.draw2d.geometry.Dimension getPreferredSize(int wHint, int hHint)
getPreferredSize
in class LinearScale
public Range getTraceDataRange()
null
if there is no trace
data.public boolean performAutoScale(boolean force)
force
- If true, the axis will be auto-scaled by force regardless the
autoScale field. Otherwise, it will use the autoScale field to
judge whether an auto-scale will be performed.autoScaleThreshold
public void addTrace(Trace trace)
trace
- the trace to be added.public boolean removeTrace(Trace trace)
trace
- public void setTitle(java.lang.String title)
title
- the title to setpublic java.lang.String getTitle()
public boolean isAutoScale()
public void setAutoScale(boolean autoScale)
autoScale
- the autoScale to setpublic boolean isShowMajorGrid()
public void setShowMajorGrid(boolean showMajorGrid)
showMajorGrid
- the showMajorGrid to setpublic boolean isShowMinorGrid()
public void setShowMinorGrid(boolean showMinorGrid)
showMinorGrid
- the showMinorGrid to setpublic org.eclipse.swt.graphics.Color getMajorGridColor()
public void setMajorGridColor(org.eclipse.swt.graphics.Color majorGridColor)
majorGridColor
- the majorGridColor to setpublic org.eclipse.swt.graphics.RGB getMajorGridColorRGB()
public org.eclipse.swt.graphics.Color getMinorGridColor()
public void setMinorGridColor(org.eclipse.swt.graphics.Color minorGridColor)
minorGridColor
- the minorGridColor to setpublic void setTitleFont(org.eclipse.swt.graphics.Font titleFont)
titleFont
- the titleFont to setpublic boolean isDashGridLine()
public void setDashGridLine(boolean dashGridLine)
dashGridLine
- the dashGridLine to setpublic void setXYGraph(IXYGraph xyGraph)
xyGraph
- the xyGraph to setpublic IXYGraph getXYGraph()
public java.lang.String toString()
toString
in class java.lang.Object
public void dataChanged(IDataProvider dataProvider)
public void setAutoScaleThreshold(double autoScaleThreshold)
autoScaleThreshold
- the autoScaleThreshold to setpublic void setZoomType(ZoomType zoomType)
zoomType
- the zoomType to setpublic org.eclipse.swt.graphics.Font getTitleFont()
public double getAutoScaleThreshold()
public boolean getAutoScale()
public void setYAxis(boolean isYAxis)
isYAxis
- set true if the axis is Y-Axis; false if it is X-Axis.public void setPrimarySide(boolean onPrimarySide)
onPrimarySide
- set true if the axis on primary side(Bottom/Left); false if it
is not on the primary side of xy graph(Top/Right).public boolean isYAxis()
public boolean isOnPrimarySide()
public void zoomInOut(double center, double factor)
center
- Axis position at the 'center' of the zoomfactor
- Zoom factor. Positive to zoom 'in', negative 'out'.public void setGrid(Grid grid)
grid
- the grid to setpublic Grid getGrid()
public void setLogScale(boolean enabled) throws java.lang.IllegalStateException
setLogScale
in class AbstractScale
enabled
- true if enabling log scalesjava.lang.IllegalStateException