Package org.csstudio.swt.widgets.figures
Class AbstractBoolFigure
java.lang.Object
org.eclipse.draw2d.Figure
org.csstudio.swt.widgets.figures.AbstractBoolFigure
- All Implemented Interfaces:
Introspectable
,org.eclipse.draw2d.IFigure
- Direct Known Subclasses:
AbstractBoolControlFigure
,LEDFigure
Base figure for a widget based on
AbstractBoolWidgetModel
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
Nested classes/interfaces inherited from class org.eclipse.draw2d.Figure
org.eclipse.draw2d.Figure.FigureIterator, org.eclipse.draw2d.Figure.IdentitySearch, org.eclipse.draw2d.Figure.ReverseFigureChildrenIterator
Nested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure
org.eclipse.draw2d.IFigure.NoInsets
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected boolean
protected org.eclipse.draw2d.Label
protected AbstractBoolFigure.BoolLabelPosition
protected Color
protected String
protected Color
protected String
protected boolean
protected long
Fields inherited from class org.eclipse.draw2d.Figure
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip
Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
calculateLabelLocation
(org.eclipse.draw2d.geometry.Point defaultLocation) int
getBit()
boolean
protected org.eclipse.draw2d.geometry.Point
getLabelLocation
(int x, int y) protected org.eclipse.draw2d.geometry.Point
getLabelLocation
(org.eclipse.draw2d.geometry.Point defaultLocation) long
getValue()
void
boolean
isOpaque()
boolean
void
setBit
(int bit) void
setBooleanValue
(boolean value) void
setBoolLabelPosition
(AbstractBoolFigure.BoolLabelPosition labelPosition) void
setEnabled
(boolean value) void
void
setOffColor
(Color offColor) void
setOffLabel
(String offLabel) void
setOnColor
(Color onColor) void
setOnLabel
(String onLabel) void
setShowBooleanLabel
(boolean showBooleanLabel) void
setTotalBits
(AbstractBoolFigure.TotalBits totalBits) void
setValue
(double value) void
setValue
(long value) protected void
update the boolValue from value and bit.protected void
update the value from boolValueMethods 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, getChildrenRevIterable, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getListenersIterable, 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, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, optimizeClip, paint, paintBorder, paintChildren, paintClientArea, paintFigure, 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, setFlag, setFocusTraversable, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
-
Field Details
-
boolLabel
protected org.eclipse.draw2d.Label boolLabel -
value
protected long value -
bit
protected int bit -
showBooleanLabel
protected boolean showBooleanLabel -
booleanValue
protected boolean booleanValue -
onLabel
-
offLabel
-
boolLabelPosition
-
onColor
-
offColor
-
-
Constructor Details
-
AbstractBoolFigure
protected AbstractBoolFigure()
-
-
Method Details
-
calculateLabelLocation
protected void calculateLabelLocation(org.eclipse.draw2d.geometry.Point defaultLocation) -
getBit
public int getBit()- Returns:
- the bit
-
getBooleanValue
public boolean getBooleanValue()- Returns:
- the boolValue
-
getLabelLocation
protected org.eclipse.draw2d.geometry.Point getLabelLocation(int x, int y) -
getLabelLocation
protected org.eclipse.draw2d.geometry.Point getLabelLocation(org.eclipse.draw2d.geometry.Point defaultLocation) - Parameters:
defaultLocation
- The default location.- Returns:
- the location of the boolean label
-
getBoolLabelPosition
-
getOffColor
- Returns:
- the offColor
-
getOffLabel
- Returns:
- the offLabel
-
getOnColor
- Returns:
- the onColor
-
getOnLabel
- Returns:
- the onLabel
-
getValue
public long getValue()- Returns:
- the value
-
invalidate
public void invalidate()- Specified by:
invalidate
in interfaceorg.eclipse.draw2d.IFigure
- Overrides:
invalidate
in classorg.eclipse.draw2d.Figure
-
isOpaque
public boolean isOpaque()- Specified by:
isOpaque
in interfaceorg.eclipse.draw2d.IFigure
- Overrides:
isOpaque
in classorg.eclipse.draw2d.Figure
-
isShowBooleanLabel
public boolean isShowBooleanLabel()- Returns:
- the showBooleanLabel
-
setBit
public void setBit(int bit) - Parameters:
bit
- the bit to set
-
setBooleanValue
public void setBooleanValue(boolean value) -
setEnabled
public void setEnabled(boolean value) - Specified by:
setEnabled
in interfaceorg.eclipse.draw2d.IFigure
- Overrides:
setEnabled
in classorg.eclipse.draw2d.Figure
-
setFont
- Specified by:
setFont
in interfaceorg.eclipse.draw2d.IFigure
- Overrides:
setFont
in classorg.eclipse.draw2d.Figure
-
setBoolLabelPosition
-
setOffColor
- Parameters:
offColor
- the offColor to set
-
setOffLabel
- Parameters:
offLabel
- the offLabel to set
-
setOnColor
- Parameters:
onColor
- the onColor to set
-
setOnLabel
- Parameters:
onLabel
- the onLabel to set
-
setShowBooleanLabel
public void setShowBooleanLabel(boolean showBooleanLabel) - Parameters:
showBooleanLabel
- the showBooleanLabel to set
-
setValue
public void setValue(double value) -
setValue
public void setValue(long value) -
updateBoolValue
protected void updateBoolValue()update the boolValue from value and bit. All the boolValue based behavior changes should be implemented here by inheritance. -
updateValue
protected void updateValue()update the value from boolValue -
getTotalBits
-
setTotalBits
- Parameters:
totalBits
- number of total bits
-
getBeanInfo
- Specified by:
getBeanInfo
in interfaceIntrospectable
- Throws:
IntrospectionException
-