LinearScale
, RoundScale
public abstract class AbstractScale
extends org.eclipse.draw2d.Figure
Modifier and Type | Class | Description |
---|---|---|
static class |
AbstractScale.LabelSide |
ticks label's position relative to tick marks
|
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
DEFAULT_ENGINEERING_FORMAT |
|
static double |
DEFAULT_LOG_SCALE_MAX |
the default maximum value of log scale range
|
static double |
DEFAULT_MAX |
|
static double |
DEFAULT_MIN |
Constructor | Description |
---|---|
AbstractScale() |
Modifier and Type | Method | Description |
---|---|---|
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,
boolean minOrMaxDate) |
Formats the given object as a DateFormat if Date is enabled or as a
DecimalFormat.
|
java.lang.String |
getFormatPattern() |
|
double |
getMajorGridStep() |
|
int |
getMajorTickMarkStepHint() |
|
int |
getMinorTickMarkStepHint() |
|
Range |
getRange() |
get the scale range
|
AbstractScale.LabelSide |
getTickLabelSide() |
|
AbstractScale.LabelSide |
getTickLablesSide() |
Deprecated.
use correctly spelled
#getTickLabelSide(LabelSide) |
int |
getTimeUnit() |
|
boolean |
isAutoFormat() |
|
boolean |
isDateEnabled() |
|
boolean |
isDirty() |
|
boolean |
isLogScaleEnabled() |
Gets the state indicating if log scale is enabled.
|
boolean |
isMinorTicksVisible() |
|
boolean |
isScaleLineVisible() |
|
void |
setAutoFormat(boolean autoFormat) |
|
void |
setDateEnabled(boolean dateEnabled) |
|
void |
setFont(org.eclipse.swt.graphics.Font f) |
|
void |
setFormatPattern(java.lang.String formatPattern) |
Sets the format pattern for axis tick label.
|
void |
setLogScale(boolean enabled) |
|
void |
setMajorGridStep(double majorGridStep) |
|
void |
setMajorTickMarkStepHint(int majorTickMarkStepHint) |
|
void |
setMinorTickMarkStepHint(int minorTickMarkStepHint) |
|
void |
setMinorTicksVisible(boolean minorTicksVisible) |
|
void |
setRange(double lower,
double upper) |
set the scale range
|
void |
setRange(double t1,
double t2,
boolean honorOriginDirection) |
Set the range with option to honor its original direction.
|
void |
setRange(Range range) |
set the scale range
|
void |
setScaleLineVisible(boolean scaleLineVisible) |
|
void |
setTickLabelSide(AbstractScale.LabelSide tickLabelSide) |
|
void |
setTickLableSide(AbstractScale.LabelSide tickLabelSide) |
Deprecated.
use correctly spelled
setTickLabelSide(LabelSide) |
void |
setTimeUnit(int timeUnit) |
Set the time unit for a date enabled scale.
|
abstract void |
updateTick() |
Updates the tick, recalculate all inner parameters
|
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, 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, setBounds, setClippingStrategy, setConstraint, setCursor, setEnabled, setFocusTraversable, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, validate
public static final double DEFAULT_MAX
public static final double DEFAULT_MIN
public static final java.lang.String DEFAULT_ENGINEERING_FORMAT
public static final double DEFAULT_LOG_SCALE_MAX
public java.lang.String format(java.lang.Object obj)
obj
- the objectpublic java.lang.String format(java.lang.Object obj, boolean minOrMaxDate)
obj
- the objectminOrMaxDate
- true if it is the min or max date on the scale.public int getMajorTickMarkStepHint()
public Range getRange()
@Deprecated public AbstractScale.LabelSide getTickLablesSide()
#getTickLabelSide(LabelSide)
public AbstractScale.LabelSide getTickLabelSide()
public int getTimeUnit()
public boolean isDateEnabled()
public boolean isDirty()
public boolean isLogScaleEnabled()
public boolean isMinorTicksVisible()
public boolean isScaleLineVisible()
public void setDateEnabled(boolean dateEnabled)
dateEnabled
- the dateEnabled to setpublic void setFormatPattern(java.lang.String formatPattern)
Format
If null is set, default format will be used.
format
- the formatjava.lang.NullPointerException
- if pattern
is nulljava.lang.IllegalArgumentException
- if the given pattern is invalid.public java.lang.String getFormatPattern()
public void setFont(org.eclipse.swt.graphics.Font f)
setFont
in class org.eclipse.draw2d.Figure
public void setLogScale(boolean enabled) throws java.lang.IllegalStateException
enabled
- true if enabling log scalesjava.lang.IllegalStateException
public void setMajorTickMarkStepHint(int majorTickMarkStepHint)
majorTickMarkStepHint
- the majorTickMarkStepHint to set, should be less than 1000.public void setMinorTicksVisible(boolean minorTicksVisible)
minorTicksVisible
- the minorTicksVisible to setpublic void setRange(Range range)
public void setRange(double t1, double t2, boolean honorOriginDirection)
t1
- value 1 of the ranget2
- value 2 of the rangehonorOriginDirection
- if true, the start and end value of the range will set
according to its original direction.public void setRange(double lower, double upper)
lower
- the lower limitupper
- the upper limitjava.lang.IllegalArgumentException
- if lower or upper is Nan of Infinite, or lower >= upper or
(upper - lower) is Infinitepublic void setScaleLineVisible(boolean scaleLineVisible)
scaleLineVisible
- the scaleLineVisible to setpublic void setTickLabelSide(AbstractScale.LabelSide tickLabelSide)
tickLabelSide
- the side of the tick label relative to tick mark@Deprecated public void setTickLableSide(AbstractScale.LabelSide tickLabelSide)
setTickLabelSide(LabelSide)
public void setTimeUnit(int timeUnit)
timeUnit
- the timeUnit to set. It should be one of:
Calendar.MILLISECOND, Calendar.SECOND,
Calendar.MINUTE, Calendar.HOUR_OF_DAY,
Calendar.DATE, Calendar.MONTH,
Calendar.YEAR.Calendar
public abstract void updateTick()
public void setMajorGridStep(double majorGridStep)
majorGridStep
- the majorGridStep to setpublic double getMajorGridStep()
public void setMinorTickMarkStepHint(int minorTickMarkStepHint)
minorTickMarkStepHint
- the minorTickMarkStepHint to setpublic int getMinorTickMarkStepHint()
public void setAutoFormat(boolean autoFormat)
autoFormat
- the autoFormat to setpublic boolean isAutoFormat()