public class DAxis extends Axis
Axis.AxisMouseListener
LinearScale.Orientation
AbstractScale.LabelSide
Modifier and Type | Field and Description |
---|---|
protected boolean |
userDefinedFormat
the user format
|
listeners, ZOOM_RATIO, ZOOM_SPEED
SPACE_BTW_MARK_LABEL
DEFAULT_DATE_FORMAT, default_decimal_format, DEFAULT_ENGINEERING_FORMAT, DEFAULT_LOG_SCALE_MAX, DEFAULT_MAX, DEFAULT_MIN, dirty, ENGINEERING_LIMIT, max, min
Constructor and Description |
---|
DAxis()
Constructor that creates a DAxis with no title
|
DAxis(java.lang.String title,
boolean yAxis)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
calculateSpan(java.lang.Object obj)
Calculate span of a textual form of object in scale's orientation
|
void |
clear() |
protected LinearScaleTickLabels |
createLinearScaleTickLabels()
Creates the linearScaleTickLabel.
|
protected LinearScaleTickMarks |
createLinearScaleTickMarks()
Creates the LinearScaleTickMarks.
|
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.
|
protected java.lang.String |
getAutoFormat(double min,
double max) |
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() |
protected void |
layout() |
protected void |
layoutTicks() |
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...
|
addListener, addTrace, dataChanged, fireAxisRangeChanged, fireRevalidated, getAutoScale, getAutoScaleThreshold, getForegroundColorRGB, getGrid, getMajorGridColor, getMajorGridColorRGB, getMinorGridColor, getPreferredSize, getScaleFontData, getTitle, getTitleFont, getTitleFontData, getTraceDataRange, getTraceList, getXYGraph, isAutoScale, isDashGridLine, isInverted, isOnPrimarySide, isShowMajorGrid, isShowMinorGrid, isYAxis, paintClientArea, pan, panChecked, removeListener, removeTrace, setAutoScale, setAutoScaleThreshold, setBackgroundColor, setDashGridLine, setFont, setForegroundColor, setGrid, setInverted, setMajorGridColor, setMinorGridColor, setMinorTicksVisible, setPrimarySide, setShowMajorGrid, setShowMinorGrid, setTitle, setTitleFont, setVisible, setXYGraph, setYAxis, setZoomType, toString, zoomInOut
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, useLocalCoordinates
format, getFormatPattern, getMajorGridStep, getMajorTickMarkStepHint, getMinorTickMarkStepHint, getRange, getTickLabelSide, getTickLablesSide, getTimeUnit, internalSetAutoFormat, internalSetFormatPattern, internalSetLogScaleEnabled, internalSetRange, isAutoFormat, isDateEnabled, isDirty, isLogScaleEnabled, isMinorTicksVisible, isScaleLineVisible, setDirty, setMajorGridStep, setMajorTickMarkStepHint, setMinorTickMarkStepHint, setRange, setRange, setScaleLineVisible, setTickLabelSide, setTickLableSide, setTimeUnit
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalFont, 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, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, paint, paintBorder, paintChildren, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBorder, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
format, getFont, getForegroundColor, getFormatPattern, getMajorGridStep, getMajorTickMarkStepHint, getMinorTickMarkStepHint, getTimeUnit, isAutoFormat, isDateEnabled, isLogScaleEnabled
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.protected LinearScaleTickLabels createLinearScaleTickLabels()
LinearScale
createLinearScaleTickLabels
in class LinearScale
protected LinearScaleTickMarks createLinearScaleTickMarks()
LinearScale
createLinearScaleTickMarks
in class LinearScale
public int calculateSpan(java.lang.Object obj)
obj
- objectpublic int getMargin()
LinearScale
getMargin
in interface IScaleProvider
getMargin
in class LinearScale
public double getScaling()
protected void layoutTicks()
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-negativeprotected java.lang.String getAutoFormat(double min, double max)
public 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()