Class AbstractScaledWidgetFigure
java.lang.Object
org.eclipse.draw2d.Figure
org.eclipse.nebula.visualization.widgets.figures.AbstractScaledWidgetFigure
- All Implemented Interfaces:
org.eclipse.draw2d.IFigure
,Introspectable
- Direct Known Subclasses:
AbstractMarkedWidgetFigure
public abstract class AbstractScaledWidgetFigure extends org.eclipse.draw2d.Figure implements Introspectable
Base figure for a widget based on
AbstractScaledWidgetModel
.-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description protected boolean
logScale
protected int
majorTickMarkStepHint
protected double
maximum
protected double
minimum
protected AbstractScale
scale
protected boolean
showMinorTicks
protected boolean
showScale
protected boolean
transparent
protected double
value
protected java.lang.String
valueLabelFormat
-
Constructor Summary
Constructors Constructor Description AbstractScaledWidgetFigure()
-
Method Summary
Modifier and Type Method Description java.beans.BeanInfo
getBeanInfo()
double
getCoercedValue()
double
getCoercedValue(double v)
Coerce a value into range of the scale.int
getMajorTickMarkStepHint()
double
getMaximum()
double
getMinimum()
Range
getRange()
AbstractScale
getScale()
double
getValue()
java.lang.String
getValueLabelFormat()
java.lang.String
getValueText()
boolean
isLogScale()
boolean
isOpaque()
boolean
isShowMinorTicks()
boolean
isShowScale()
boolean
isTransparent()
void
paintFigure(org.eclipse.draw2d.Graphics graphics)
void
setLogScale(boolean logScale)
void
setMajorTickMarkStepHint(int majorTickMarkStepHint)
void
setRange(double min, double max)
set the range of the scalevoid
setRange(Range range)
void
setScale(AbstractScale scale)
void
setShowMinorTicks(boolean showMinorTicks)
void
setShowScale(boolean showScale)
void
setTransparent(boolean transparent)
Sets, if this widget should have a transparent background.void
setValue(double value)
void
setValueLabelFormat(java.lang.String valueLabelFormat)
Methods 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, 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, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
-
Field Details
-
scale
-
transparent
protected boolean transparent -
value
protected double value -
minimum
protected double minimum -
maximum
protected double maximum -
majorTickMarkStepHint
protected int majorTickMarkStepHint -
showMinorTicks
protected boolean showMinorTicks -
showScale
protected boolean showScale -
logScale
protected boolean logScale -
valueLabelFormat
protected java.lang.String valueLabelFormat
-
-
Constructor Details
-
AbstractScaledWidgetFigure
public AbstractScaledWidgetFigure()
-
-
Method Details
-
getBeanInfo
public java.beans.BeanInfo getBeanInfo() throws java.beans.IntrospectionException- Specified by:
getBeanInfo
in interfaceIntrospectable
- Throws:
java.beans.IntrospectionException
-
getCoercedValue
public double getCoercedValue()- Returns:
- the coerced value of the widget based on the scale range.
-
getCoercedValue
public double getCoercedValue(double v)Coerce a value into range of the scale.- Parameters:
v
- the value to be coerced.- Returns:
- the coerced value
-
getMajorTickMarkStepHint
public int getMajorTickMarkStepHint()- Returns:
- the majorTickMarkStepHint
-
getMaximum
public double getMaximum()- Returns:
- the maximum
-
getMinimum
public double getMinimum()- Returns:
- the minimum
-
getRange
-
getScale
- Returns:
- the scale
-
getValue
public double getValue() -
getValueLabelFormat
public java.lang.String getValueLabelFormat() -
getValueText
public java.lang.String getValueText()- Returns:
- the value text after format.
-
isLogScale
public boolean isLogScale()- Returns:
- the logScale
-
isOpaque
public boolean isOpaque()- Specified by:
isOpaque
in interfaceorg.eclipse.draw2d.IFigure
- Overrides:
isOpaque
in classorg.eclipse.draw2d.Figure
-
isShowMinorTicks
public boolean isShowMinorTicks()- Returns:
- the showMinorTicks
-
isShowScale
public boolean isShowScale()- Returns:
- the showScale
-
isTransparent
public boolean isTransparent()- Returns:
- the transparent
-
paintFigure
public void paintFigure(org.eclipse.draw2d.Graphics graphics)- Overrides:
paintFigure
in classorg.eclipse.draw2d.Figure
-
setLogScale
public void setLogScale(boolean logScale)- Parameters:
logScale
- the logScale to set
-
setMajorTickMarkStepHint
public void setMajorTickMarkStepHint(int majorTickMarkStepHint)- Parameters:
majorTickMarkStepHint
- the majorTickMarkStepHint to set
-
setRange
public void setRange(double min, double max)set the range of the scale- Parameters:
min
-max
-
-
setRange
-
setScale
- Parameters:
scale
- the scale to set
-
setShowMinorTicks
public void setShowMinorTicks(boolean showMinorTicks)- Parameters:
showMinorTicks
- the showMinorTicks to set
-
setShowScale
public void setShowScale(boolean showScale)- Parameters:
showScale
- the showScale to set
-
setTransparent
public void setTransparent(boolean transparent)Sets, if this widget should have a transparent background.- Parameters:
transparent
- The new value for the transparent property
-
setValue
public void setValue(double value)- Parameters:
value
- the value to set
-
setValueLabelFormat
public void setValueLabelFormat(java.lang.String valueLabelFormat)- Parameters:
valueLabelFormat
- the numeric format pattern for value label.
-