Class RoundScaledRamp
- java.lang.Object
-
- org.eclipse.draw2d.Figure
-
- org.eclipse.nebula.visualization.widgets.figureparts.RoundScaledRamp
-
- All Implemented Interfaces:
org.eclipse.draw2d.IFigure
public class RoundScaledRamp extends org.eclipse.draw2d.FigureA ramp looks like a colorful donut, which is used to indicate the alarm limit, hihi, hi, lo or lolo. The ramp is based on a round scale which is in the same polar coordinate system as the ramp. The ramp could be used for any round scale based widgets, such as meter, gauge and knob etc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRoundScaledRamp.ThresholdThe alarm thereshold for a PV, includs HIHI, HI, LO or LOLO.(package private) static classRoundScaledRamp.ThresholdMarkerHold the properties for each threshold.
-
Field Summary
Fields Modifier and Type Field Description private booleandirtyprivate booleangradientprivate RoundScaledRamp.ThresholdMarkerhiprivate RoundScaledRamp.ThresholdMarkerhihiprivate RoundScaledRamp.ThresholdMarkerloprivate RoundScaledRamp.ThresholdMarkerloloprivate RoundScaledRamp.ThresholdMarkermaxprivate RoundScaledRamp.ThresholdMarkerminprivate RoundScaledRamp.ThresholdMarkernormalprivate static intOVERLAP_DEGREEprivate intrampWidthprivate RoundScalescale
-
Constructor Summary
Constructors Constructor Description RoundScaledRamp(RoundScale scale)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.draw2d.geometry.DimensiongetPreferredSize(int wHint, int hHint)intgetRampWidth()RoundScalegetScale()protected voidpaintClientArea(org.eclipse.draw2d.Graphics graphics)voidsetBounds(org.eclipse.draw2d.geometry.Rectangle rect)voidsetDirty(boolean dirty)voidsetGradient(boolean gradient)If gradient is true, the color will be displayed in gradient stylevoidsetRampWidth(int rampWidth)voidsetScale(RoundScale scale)voidsetThresholdColor(RoundScaledRamp.Threshold thresholdName, org.eclipse.swt.graphics.RGB color)Set color of the threshold.voidsetThresholdValue(RoundScaledRamp.Threshold thresholdName, double value)Set value of the threshold.voidsetThresholdVisibility(RoundScaledRamp.Threshold thresholdName, boolean visible)Set visibility of the threshold.private voidupdateThresholdPosition()update the the position for each threshold, and other parameters related to the positions.-
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, 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, layout, paint, paintBorder, paintChildren, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, 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 Detail
-
OVERLAP_DEGREE
private static final int OVERLAP_DEGREE
- See Also:
- Constant Field Values
-
scale
private RoundScale scale
-
lolo
private RoundScaledRamp.ThresholdMarker lolo
-
lo
private RoundScaledRamp.ThresholdMarker lo
-
hi
private RoundScaledRamp.ThresholdMarker hi
-
hihi
private RoundScaledRamp.ThresholdMarker hihi
-
normal
private RoundScaledRamp.ThresholdMarker normal
-
min
private RoundScaledRamp.ThresholdMarker min
-
max
private RoundScaledRamp.ThresholdMarker max
-
rampWidth
private int rampWidth
-
gradient
private boolean gradient
-
dirty
private boolean dirty
-
-
Constructor Detail
-
RoundScaledRamp
public RoundScaledRamp(RoundScale scale)
Constructor- Parameters:
scale- the round scale
-
-
Method Detail
-
setBounds
public void setBounds(org.eclipse.draw2d.geometry.Rectangle rect)
- Specified by:
setBoundsin interfaceorg.eclipse.draw2d.IFigure- Overrides:
setBoundsin classorg.eclipse.draw2d.Figure
-
getPreferredSize
public org.eclipse.draw2d.geometry.Dimension getPreferredSize(int wHint, int hHint)- Specified by:
getPreferredSizein interfaceorg.eclipse.draw2d.IFigure- Overrides:
getPreferredSizein classorg.eclipse.draw2d.Figure
-
updateThresholdPosition
private void updateThresholdPosition()
update the the position for each threshold, and other parameters related to the positions.
-
paintClientArea
protected void paintClientArea(org.eclipse.draw2d.Graphics graphics)
- Overrides:
paintClientAreain classorg.eclipse.draw2d.Figure
-
getScale
public RoundScale getScale()
- Returns:
- the round scale for this ramp
-
setScale
public void setScale(RoundScale scale)
- Parameters:
scale- the round scale to set
-
getRampWidth
public int getRampWidth()
- Returns:
- the rampWidth
-
setRampWidth
public void setRampWidth(int rampWidth)
- Parameters:
rampWidth- the rampWidth to set
-
setGradient
public void setGradient(boolean gradient)
If gradient is true, the color will be displayed in gradient style- Parameters:
gradient- the gradient to set
-
setThresholdValue
public void setThresholdValue(RoundScaledRamp.Threshold thresholdName, double value)
Set value of the threshold.- Parameters:
thresholdName- the threshold name which should be one ofRoundScaledRamp.Thresholdvalue- the value to set
-
setThresholdColor
public void setThresholdColor(RoundScaledRamp.Threshold thresholdName, org.eclipse.swt.graphics.RGB color)
Set color of the threshold.- Parameters:
thresholdName- the threshold name which should be one ofRoundScaledRamp.Thresholdcolor- the RGB color to set
-
setThresholdVisibility
public void setThresholdVisibility(RoundScaledRamp.Threshold thresholdName, boolean visible)
Set visibility of the threshold.- Parameters:
thresholdName- the threshold name which should be one ofRoundScaledRamp.Thresholdvisible- true if this threshold should be visible
-
setDirty
public void setDirty(boolean dirty)
- Parameters:
dirty- the dirty to set
-
-