IScaleProvider
public class DAxis extends Axis
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 |
---|---|
DAxis() |
Constructor that creates a DAxis with no title
|
DAxis(java.lang.String title,
boolean yAxis) |
Constructor
|
Modifier and Type | Method | Description |
---|---|---|
int |
calculateSpan(java.lang.Object obj) |
Calculate span of a textual form of object in scale's orientation
|
void |
clear() |
|
java.lang.String |
format(java.lang.Object obj) |
Formats the given object as a DateFormat if Date is enabled or as a
DecimalFormat.
|
java.lang.String |
format(java.lang.Object obj,
int extraDP) |
Formats the given object as a DateFormat if Date is enabled or as a
DecimalFormat.
|
int |
getMargin() |
Margin is half of the label's length(Horizontal Scale) or height(Vertical
scale), so that the label can be displayed correctly.
|
double |
getScaling() |
Get scaling for axis in terms of pixels/unit
|
boolean |
hasTicksAtEnds() |
Returns true if ticks at end of axis are shown
|
boolean |
hasUserDefinedFormat() |
|
boolean |
isAxisAutoscaleTight() |
|
boolean |
isTicksIndexBased() |
|
boolean |
performAutoScale(boolean force) |
Perform an auto-scale: Axis limits are set to the value range of the
traces on this axis.
|
void |
setAutoFormat(boolean autoFormat) |
|
void |
setAxisAutoscaleTight(boolean axisTight) |
|
void |
setDateEnabled(boolean dateEnabled) |
|
void |
setFormatPattern(java.lang.String formatPattern) |
Sets the format pattern for axis tick label.
|
void |
setHasUserDefinedFormat(boolean hasUserDefinedFormat) |
Sets whether there is a user defined format or not
|
void |
setLogScale(boolean enabled) |
|
void |
setRange(double lower,
double upper) |
set the scale range
|
void |
setTicksAtEnds(boolean ticksAtEnds) |
Sets whether ticks at ends of axis are shown
|
void |
setTicksIndexBased(boolean isTicksIndexBased) |
|
void |
updateTick() |
Updates the tick, recalculate all parameters, such as margin, length...
|
format, getFormatPattern, getMajorGridStep, getMajorTickMarkStepHint, getMinorTickMarkStepHint, getRange, getTickLabelSide, getTickLablesSide, getTimeUnit, isAutoFormat, isDateEnabled, isDirty, isLogScaleEnabled, isMinorTicksVisible, isScaleLineVisible, setMajorGridStep, setMajorTickMarkStepHint, setMinorTickMarkStepHint, setRange, setRange, setScaleLineVisible, setTickLabelSide, setTickLableSide, setTimeUnit
addListener, addTrace, dataChanged, getAutoScale, getAutoScaleThreshold, getForegroundColorRGB, getGrid, getMajorGridColor, getMajorGridColorRGB, getMinorGridColor, getPreferredSize, getScaleFontData, getTitle, getTitleFont, getTitleFontData, getTraceDataRange, getXYGraph, isAutoScale, isDashGridLine, isInverted, isOnPrimarySide, isShowMajorGrid, isShowMinorGrid, isYAxis, removeListener, removeTrace, setAutoScale, setAutoScaleThreshold, setBackgroundColor, setDashGridLine, setFont, setForegroundColor, setGrid, setInverted, setMajorGridColor, setMinorGridColor, setMinorTicksVisible, setPrimarySide, setShowMajorGrid, setShowMinorGrid, setTitle, setTitleFont, setVisible, setXYGraph, setYAxis, setZoomType, toString, zoomInOut
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, getFont, getForegroundColor, getMajorGridStep, getMajorTickMarkStepHint, getMinorTickMarkStepHint, getTimeUnit, isAutoFormat, isDateEnabled, isLogScaleEnabled
figureLayout, getDimension, getLabel, getLength, getLocalRange, getMargin, getOrientation, getPositionValue, getPositionValue, getScaleRange, getScaleTickLabels, getScaleTickMarks, getTickLength, getTicksProvider, getValuePosition, getValuePrecisePosition, isHorizontal, isLabelCustomised, isPrimary, isShowMaxLabel, isShowMinLabel, setBounds, setLength, setLocalRange, setMargin, setOrientation, setShowMaxLabel, setShowMinLabel
public DAxis()
public DAxis(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 int calculateSpan(java.lang.Object obj)
obj
- objectpublic int getMargin()
LinearScale
getMargin
in interface IScaleProvider
getMargin
in class LinearScale
public double getScaling()
public void setTicksIndexBased(boolean isTicksIndexBased)
isTicksIndexBased
- if true, make ticks based on axis dataset indexespublic boolean isTicksIndexBased()
public java.lang.String format(java.lang.Object obj)
AbstractScale
format
in interface IScaleProvider
format
in class AbstractScale
obj
- the objectpublic void updateTick()
LinearScale
updateTick
in class LinearScale
public java.lang.String format(java.lang.Object obj, int extraDP)
obj
- the objectextraDP
- must be non-negativepublic void setDateEnabled(boolean dateEnabled)
setDateEnabled
in class AbstractScale
dateEnabled
- the dateEnabled to setpublic void setFormatPattern(java.lang.String formatPattern)
AbstractScale
Format
If null is set, default format will be used.
setFormatPattern
in class AbstractScale
public void setRange(double lower, double upper)
AbstractScale
public void setAutoFormat(boolean autoFormat)
setAutoFormat
in interface IScaleProvider
setAutoFormat
in class AbstractScale
autoFormat
- the autoFormat to setpublic void setLogScale(boolean enabled) throws java.lang.IllegalStateException
setLogScale
in class Axis
enabled
- true if enabling log scalesjava.lang.IllegalStateException
public boolean performAutoScale(boolean force)
Axis
performAutoScale
in class Axis
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.Axis.autoScaleThreshold
public void clear()
public void setAxisAutoscaleTight(boolean axisTight)
axisTight
- set whether autoscale sets axis range tight to the data or the
end of axis is set to the nearest tickmarkpublic boolean isAxisAutoscaleTight()
public void setTicksAtEnds(boolean ticksAtEnds)
ticksAtEnds
- public boolean hasTicksAtEnds()
hasTicksAtEnds
in interface IScaleProvider
hasTicksAtEnds
in class LinearScale
public void setHasUserDefinedFormat(boolean hasUserDefinedFormat)
hasUserDefinedFormat
- public boolean hasUserDefinedFormat()