IScaleProvider
Axis
public class LinearScale extends AbstractScale implements IScaleProvider
Modifier and Type | Class | Description |
---|---|---|
static class |
LinearScale.Orientation |
scale direction
|
AbstractScale.LabelSide
DEFAULT_ENGINEERING_FORMAT, DEFAULT_LOG_SCALE_MAX, DEFAULT_MAX, DEFAULT_MIN
Constructor | Description |
---|---|
LinearScale() |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
void |
figureLayout() |
Simple call of
org.eclipse.draw2d.Figure.layout() |
org.eclipse.draw2d.geometry.Dimension |
getDimension(java.lang.Object obj) |
Calculate dimension of a textual form of object
|
double |
getLabel(double value) |
Override to provide custom axis labels.
|
int |
getLength() |
|
Range |
getLocalRange() |
|
int |
getMargin() |
Margin is half of the label's length(Horizontal Scale) or height(Vertical
scale), so that the label can be displayed correctly.
|
int |
getMargin(boolean updateTick) |
If updateTick is True,
getMargin() is used where the tick are
updated, if not, the method returns margin . |
LinearScale.Orientation |
getOrientation() |
|
double |
getPositionValue(double position,
boolean relative) |
Get the corresponding value on the position of the scale.
|
double |
getPositionValue(int position,
boolean relative) |
Get the corresponding value on the position of the scale.
|
org.eclipse.draw2d.geometry.Dimension |
getPreferredSize(int wHint,
int hHint) |
|
Range |
getScaleRange() |
|
LinearScaleTickLabels |
getScaleTickLabels() |
Gets the scale tick labels.
|
LinearScaleTickMarks |
getScaleTickMarks() |
Gets the scale tick marks.
|
int |
getTickLength() |
|
ITicksProvider |
getTicksProvider() |
Gets the ticks provider
|
int |
getValuePosition(double value,
boolean relative) |
Get the position of the value based on scale.
|
double |
getValuePrecisePosition(double value,
boolean relative) |
Get the position of the value based on scale.
|
boolean |
hasTicksAtEnds() |
|
boolean |
isHorizontal() |
|
boolean |
isLabelCustomised() |
|
boolean |
isPrimary() |
|
boolean |
isShowMaxLabel() |
shows the maximum value of the range as a label
|
boolean |
isShowMinLabel() |
shows the minimum value of the range as a label
|
void |
setBounds(org.eclipse.draw2d.geometry.Rectangle rect) |
|
void |
setFont(org.eclipse.swt.graphics.Font font) |
|
void |
setForegroundColor(org.eclipse.swt.graphics.Color color) |
|
void |
setLength(int length) |
|
void |
setLocalRange(Range localRange) |
|
void |
setMargin(int margin) |
|
void |
setOrientation(LinearScale.Orientation orientation) |
sets the orientation
|
void |
setShowMaxLabel(boolean b) |
sets the visibility of the maximum label
|
void |
setShowMinLabel(boolean b) |
sets the visibility of the minimum label
|
void |
updateTick() |
Updates the tick, recalculate all parameters, such as margin, length...
|
format, format, getFormatPattern, getMajorGridStep, getMajorTickMarkStepHint, getMinorTickMarkStepHint, getRange, getTickLabelSide, getTickLablesSide, getTimeUnit, isAutoFormat, isDateEnabled, isDirty, isLogScaleEnabled, isMinorTicksVisible, isScaleLineVisible, setAutoFormat, setDateEnabled, setFormatPattern, setLogScale, setMajorGridStep, setMajorTickMarkStepHint, setMinorTickMarkStepHint, setMinorTicksVisible, setRange, 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, setBackgroundColor, setBorder, setClippingStrategy, setConstraint, setCursor, setEnabled, setFocusTraversable, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, validate
format, format, getFont, getForegroundColor, getMajorGridStep, getMajorTickMarkStepHint, getMinorTickMarkStepHint, getTimeUnit, isAutoFormat, isDateEnabled, isLogScaleEnabled, setAutoFormat
public int getLength()
getLength
in interface IScaleProvider
public void setLength(int length)
length
- public int getMargin(boolean updateTick)
getMargin()
is used where the tick are
updated, if not, the method returns margin
.updateTick
- public int getMargin()
getMargin
in interface IScaleProvider
public void setMargin(int margin)
margin
- public LinearScale.Orientation getOrientation()
public org.eclipse.draw2d.geometry.Dimension getPreferredSize(int wHint, int hHint)
getPreferredSize
in class org.eclipse.draw2d.Figure
public ITicksProvider getTicksProvider()
IScaleProvider
getTicksProvider
in interface IScaleProvider
public LinearScaleTickLabels getScaleTickLabels()
public LinearScaleTickMarks getScaleTickMarks()
public int getTickLength()
public int getValuePosition(double value, boolean relative)
value
- the value to find its position. Support value out of range.relative
- return the position relative to the left/bottom bound of the
scale if true. If false, return the absolute position which
has the scale bounds counted.public double getValuePrecisePosition(double value, boolean relative)
value
- the value to find its position. Support value out of range.relative
- return the position relative to the left/bottom bound of the
scale if true. If false, return the absolute position which
has the scale bounds counted.public double getPositionValue(int position, boolean relative)
the
- position.true
- if the position is relative to the left/bottom bound of the
scale; False if it is the absolute position.public double getPositionValue(double position, boolean relative)
the
- position.true
- if the position is relative to the left/bottom bound of the
scale; False if it is the absolute position.public boolean isHorizontal()
isHorizontal
in interface IScaleProvider
public boolean isShowMaxLabel()
public boolean isShowMinLabel()
public void figureLayout()
org.eclipse.draw2d.Figure.layout()
public void setBounds(org.eclipse.draw2d.geometry.Rectangle rect)
setBounds
in class org.eclipse.draw2d.Figure
public void setFont(org.eclipse.swt.graphics.Font font)
setFont
in class AbstractScale
public void setForegroundColor(org.eclipse.swt.graphics.Color color)
setForegroundColor
in class org.eclipse.draw2d.Figure
public void setOrientation(LinearScale.Orientation orientation)
orientation
- the orientation to setpublic void setShowMaxLabel(boolean b)
b
- show maximal value as a labelpublic void setShowMinLabel(boolean b)
b
- show minimum value as a labelpublic Range getLocalRange()
public void setLocalRange(Range localRange)
localRange
- public void updateTick()
updateTick
in class AbstractScale
public Range getScaleRange()
getScaleRange
in interface IScaleProvider
public org.eclipse.draw2d.geometry.Dimension getDimension(java.lang.Object obj)
getDimension
in interface IScaleProvider
obj
- objectpublic boolean isPrimary()
isPrimary
in interface IScaleProvider
public double getLabel(double value)
getLabel
in interface IScaleProvider
public boolean isLabelCustomised()
isLabelCustomised
in interface IScaleProvider
public boolean hasTicksAtEnds()
hasTicksAtEnds
in interface IScaleProvider