Class AspectAxis
java.lang.Object
org.eclipse.draw2d.Figure
org.eclipse.nebula.visualization.xygraph.linearscale.AbstractScale
org.eclipse.nebula.visualization.xygraph.linearscale.LinearScale
org.eclipse.nebula.visualization.xygraph.figures.Axis
org.eclipse.nebula.visualization.xygraph.figures.DAxis
org.dawnsci.plotting.draw2d.swtxy.AspectAxis
- All Implemented Interfaces:
IAxis,org.eclipse.draw2d.IFigure,org.eclipse.nebula.visualization.xygraph.linearscale.IScaleProvider
public class AspectAxis
extends org.eclipse.nebula.visualization.xygraph.figures.DAxis
implements IAxis
An axis which can keep aspect with another and have a maximum possible extend which cannot
be altered.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.nebula.visualization.xygraph.linearscale.LinearScale
org.eclipse.nebula.visualization.xygraph.linearscale.LinearScale.OrientationNested classes/interfaces inherited from class org.eclipse.nebula.visualization.xygraph.linearscale.AbstractScale
org.eclipse.nebula.visualization.xygraph.linearscale.AbstractScale.LabelSideNested classes/interfaces inherited from class org.eclipse.draw2d.Figure
org.eclipse.draw2d.Figure.FigureIterator, org.eclipse.draw2d.Figure.IdentitySearchNested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure
org.eclipse.draw2d.IFigure.NoInsets -
Field Summary
FieldsFields inherited from class org.eclipse.nebula.visualization.xygraph.figures.DAxis
userDefinedFormatFields inherited from class org.eclipse.nebula.visualization.xygraph.figures.Axis
listenersFields inherited from class org.eclipse.nebula.visualization.xygraph.linearscale.LinearScale
SPACE_BTW_MARK_LABELFields inherited from class org.eclipse.nebula.visualization.xygraph.linearscale.AbstractScale
DEFAULT_DATE_FORMAT, default_decimal_format, DEFAULT_ENGINEERING_FORMAT, DEFAULT_LOG_SCALE_MAX, DEFAULT_MAX, DEFAULT_MIN, dirty, ENGINEERING_LIMIT, max, minFields inherited from class org.eclipse.draw2d.Figure
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTipFields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAxisListener(IAxisListener listener) Add a listener notified when the axis changes.voidcheckBounds(boolean zooming) protected voidfireAxisRangeChanged(org.eclipse.nebula.visualization.xygraph.linearscale.Range old_range, org.eclipse.nebula.visualization.xygraph.linearscale.Range new_range) protected voidprotected StringgetAutoFormat(double min, double max) doublegetLabel(double value) Override to provide custom axis labels.doublegetLower()returns the lower bound in the units of the axis (not pixels)org.eclipse.nebula.visualization.xygraph.linearscale.RangedoublegetPositionFromValue(double value) The position in pixels of a given value.doublegetPositionValue(int position) The value for a position in pixels.intdoublegetUpper()returns the upper bound in the units of the axis (not pixels)doublegetValueFromPosition(double position) The value for a position in pixels.intgetValuePosition(double value) The position in pixels of a given value.booleanbooleanbooleanbooleanisLog10()booleanbooleanprotected voidpaintClientArea(org.eclipse.draw2d.Graphics graphics) protected booleanpanChecked(org.eclipse.nebula.visualization.xygraph.linearscale.Range temp, double t1, double t2) voidremoveAxisListener(IAxisListener listener) Add a listener notified when the axis changes.voidsetAutoscale(boolean autoscale) voidsetDateFormatEnabled(boolean dateEnabled) Sets if the date format should be formatting this axis.voidsetForegroundColor(org.eclipse.swt.graphics.Color color) voidsetKeepAspect(boolean keepAspect) voidsetKeepAspectWith(AspectAxis axis) voidsetLabelDataAndTitle(org.eclipse.january.dataset.IDataset labels) Sets an alternative dataset to use for the labels and the titlevoidsetLog10(boolean isLog10) voidsetMaximumRange(double lower, double upper) Call to set a maximum range for the axisvoidsetMaximumRange(org.eclipse.nebula.visualization.xygraph.linearscale.Range maximumRange) Set with lowerinvalid input: '<'upper, the class will check for if the axis is in reversed mode.voidsetRange(double lower, double upper) Sets the range of the axis, start maybe > end for reversed axes.voidvoidsetUseAspectFromLabel(boolean useAspectFromLabel) toString()voidzoomInOut(double center, double factor) Methods inherited from class org.eclipse.nebula.visualization.xygraph.figures.DAxis
calculateSpan, clear, createLinearScaleTickLabels, createLinearScaleTickMarks, format, format, getMargin, getScaling, hasTicksAtEnds, hasUserDefinedFormat, isAxisAutoscaleTight, isTicksIndexBased, layout, layoutTicks, performAutoScale, setAutoFormat, setAxisAutoscaleTight, setDateEnabled, setFormatPattern, setHasUserDefinedFormat, setLogScale, setTicksAtEnds, setTicksIndexBased, updateTickMethods inherited from class org.eclipse.nebula.visualization.xygraph.figures.Axis
addListener, addTrace, dataChanged, getAutoScale, getAutoScaleThreshold, getForegroundColorRGB, getGrid, getMajorGridColor, getMajorGridColorRGB, getMinorGridColor, getPreferredSize, getScaleFontData, getTitle, getTitleFont, getTitleFontData, getTraceDataRange, getTraceList, getXYGraph, isAutoScale, isDashGridLine, isInverted, isOnPrimarySide, isShowMajorGrid, isShowMinorGrid, isYAxis, pan, removeListener, removeTrace, setAutoScale, setAutoScaleThreshold, setBackgroundColor, setDashGridLine, setFont, setGrid, setInverted, setMajorGridColor, setMinorGridColor, setMinorTicksVisible, setPrimarySide, setShowMajorGrid, setShowMinorGrid, setTitleFont, setVisible, setXYGraph, setYAxis, setZoomTypeMethods inherited from class org.eclipse.nebula.visualization.xygraph.linearscale.LinearScale
figureLayout, getDimension, getLength, getLocalRange, getMargin, getOrientation, getPositionValue, getPositionValue, getScaleRange, getScaleTickLabels, getScaleTickMarks, getTickLength, getTicksProvider, getValuePosition, getValuePrecisePosition, isHorizontal, isPrimary, isShowMaxLabel, isShowMinLabel, setBounds, setLength, setLocalRange, setMargin, setOrientation, setShowMaxLabel, setShowMinLabel, useLocalCoordinatesMethods inherited from class org.eclipse.nebula.visualization.xygraph.linearscale.AbstractScale
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, setTimeUnitMethods inherited from class org.eclipse.draw2d.Figure
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, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.dawnsci.plotting.api.axis.IAxis
format, format, getBackgroundColor, getForegroundColor, getFormatPattern, getMajorGridColor, getMinorGridColor, getScaling, getTitle, getTitleFont, isAutoFormat, isAxisAutoscaleTight, isInverted, isShowMajorGrid, isShowMinorGrid, isVisible, isYAxis, setAutoFormat, setAxisAutoscaleTight, setBackgroundColor, setFormatPattern, setInverted, setMajorGridColor, setMinorGridColor, setShowMajorGrid, setShowMinorGrid, setTitleFont, setVisible, setYAxisMethods inherited from interface org.eclipse.nebula.visualization.xygraph.linearscale.IScaleProvider
format, getFont, getForegroundColor, getMajorGridStep, getMajorTickMarkStepHint, getMinorTickMarkStepHint, getTimeUnit, isAutoFormat, isDateEnabled, isLogScaleEnabled
-
Field Details
-
axisListeners
-
-
Constructor Details
-
AspectAxis
-
-
Method Details
-
setTitle
-
setForegroundColor
public void setForegroundColor(org.eclipse.swt.graphics.Color color) - Specified by:
setForegroundColorin interfaceIAxis- Specified by:
setForegroundColorin interfaceorg.eclipse.draw2d.IFigure- Overrides:
setForegroundColorin classorg.eclipse.nebula.visualization.xygraph.figures.Axis- Parameters:
color-
-
setKeepAspectWith
-
getPrecheckTickLength
public int getPrecheckTickLength()- Returns:
- tick length before axis has been resized after checkBounds
-
getDirection
-
checkBounds
public void checkBounds(boolean zooming) -
zoomInOut
public void zoomInOut(double center, double factor) - Overrides:
zoomInOutin classorg.eclipse.nebula.visualization.xygraph.figures.Axis
-
paintClientArea
protected void paintClientArea(org.eclipse.draw2d.Graphics graphics) - Overrides:
paintClientAreain classorg.eclipse.nebula.visualization.xygraph.figures.Axis
-
panChecked
protected boolean panChecked(org.eclipse.nebula.visualization.xygraph.linearscale.Range temp, double t1, double t2) - Overrides:
panCheckedin classorg.eclipse.nebula.visualization.xygraph.figures.Axis
-
isKeepAspect
public boolean isKeepAspect() -
setAutoscale
public void setAutoscale(boolean autoscale) - Specified by:
setAutoscalein interfaceIAxis
-
setKeepAspect
public void setKeepAspect(boolean keepAspect) -
isUseAspectFromLabel
public boolean isUseAspectFromLabel() -
setUseAspectFromLabel
public void setUseAspectFromLabel(boolean useAspectFromLabel) -
getMaximumRange
public org.eclipse.nebula.visualization.xygraph.linearscale.Range getMaximumRange() -
setMaximumRange
public void setMaximumRange(double lower, double upper) Description copied from interface:IAxisCall to set a maximum range for the axis- Specified by:
setMaximumRangein interfaceIAxis
-
setMaximumRange
public void setMaximumRange(org.eclipse.nebula.visualization.xygraph.linearscale.Range maximumRange) Set with lowerinvalid input: '<'upper, the class will check for if the axis is in reversed mode.- Parameters:
maximumRange-
-
setRange
public void setRange(double lower, double upper) Description copied from interface:IAxisSets the range of the axis, start maybe > end for reversed axes. -
setLabelDataAndTitle
public void setLabelDataAndTitle(org.eclipse.january.dataset.IDataset labels) Description copied from interface:IAxisSets an alternative dataset to use for the labels and the title- Specified by:
setLabelDataAndTitlein interfaceIAxis- Parameters:
labels-
-
getLabel
public double getLabel(double value) Override to provide custom axis labels.- Specified by:
getLabelin interfaceorg.eclipse.nebula.visualization.xygraph.linearscale.IScaleProvider- Overrides:
getLabelin classorg.eclipse.nebula.visualization.xygraph.linearscale.LinearScale
-
isLog10
public boolean isLog10() -
setLog10
public void setLog10(boolean isLog10) -
getUpper
public double getUpper()Description copied from interface:IAxisreturns the upper bound in the units of the axis (not pixels) -
getLower
public double getLower()Description copied from interface:IAxisreturns the lower bound in the units of the axis (not pixels) -
getValuePosition
public int getValuePosition(double value) Description copied from interface:IAxisThe position in pixels of a given value.- Specified by:
getValuePositionin interfaceIAxis- Parameters:
value-- Returns:
- position
-
getPositionValue
public double getPositionValue(int position) Description copied from interface:IAxisThe value for a position in pixels.- Specified by:
getPositionValuein interfaceIAxis- Parameters:
position-- Returns:
- value
-
getValueFromPosition
public double getValueFromPosition(double position) Description copied from interface:IAxisThe value for a position in pixels.- Specified by:
getValueFromPositionin interfaceIAxis- Parameters:
position-- Returns:
-
getPositionFromValue
public double getPositionFromValue(double value) Description copied from interface:IAxisThe position in pixels of a given value.- Specified by:
getPositionFromValuein interfaceIAxis- Parameters:
value-- Returns:
-
fireRevalidated
protected void fireRevalidated()- Overrides:
fireRevalidatedin classorg.eclipse.nebula.visualization.xygraph.figures.Axis
-
fireAxisRangeChanged
protected void fireAxisRangeChanged(org.eclipse.nebula.visualization.xygraph.linearscale.Range old_range, org.eclipse.nebula.visualization.xygraph.linearscale.Range new_range) - Overrides:
fireAxisRangeChangedin classorg.eclipse.nebula.visualization.xygraph.figures.Axis
-
addAxisListener
Description copied from interface:IAxisAdd a listener notified when the axis changes.- Specified by:
addAxisListenerin interfaceIAxis- Parameters:
listener-
-
removeAxisListener
Description copied from interface:IAxisAdd a listener notified when the axis changes.- Specified by:
removeAxisListenerin interfaceIAxis- Parameters:
listener-
-
setDateFormatEnabled
public void setDateFormatEnabled(boolean dateEnabled) Description copied from interface:IAxisSets if the date format should be formatting this axis.- Specified by:
setDateFormatEnabledin interfaceIAxis- Parameters:
dateEnabled-
-
isDateFormatEnabled
public boolean isDateFormatEnabled()- Specified by:
isDateFormatEnabledin interfaceIAxis- Returns:
- true if in date/time mode, false normally.
-
toString
- Overrides:
toStringin classorg.eclipse.nebula.visualization.xygraph.figures.Axis
-
isPrimaryAxis
public boolean isPrimaryAxis()- Specified by:
isPrimaryAxisin interfaceIAxis- Returns:
- true if axis is a primary one that cannot be deleted.
-
isLabelCustomised
public boolean isLabelCustomised()- Specified by:
isLabelCustomisedin interfaceorg.eclipse.nebula.visualization.xygraph.linearscale.IScaleProvider- Overrides:
isLabelCustomisedin classorg.eclipse.nebula.visualization.xygraph.linearscale.LinearScale
-
getAutoFormat
- Overrides:
getAutoFormatin classorg.eclipse.nebula.visualization.xygraph.figures.DAxis
-