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
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumNested classes/interfaces inherited from class org.eclipse.draw2d.Figure
org.eclipse.draw2d.Figure.FigureIterator, org.eclipse.draw2d.Figure.IdentitySearch, org.eclipse.draw2d.Figure.ReverseFigureChildrenIteratorNested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure
org.eclipse.draw2d.IFigure.NoInsets -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected booleanprotected org.eclipse.draw2d.Labelprotected AbstractBoolFigure.BoolLabelPositionprotected Colorprotected Stringprotected Colorprotected Stringprotected booleanprotected longFields 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 TypeMethodDescriptionprotected voidcalculateLabelLocation(org.eclipse.draw2d.geometry.Point defaultLocation) intgetBit()booleanprotected org.eclipse.draw2d.geometry.PointgetLabelLocation(int x, int y) protected org.eclipse.draw2d.geometry.PointgetLabelLocation(org.eclipse.draw2d.geometry.Point defaultLocation) longgetValue()voidbooleanisOpaque()booleanvoidsetBit(int bit) voidsetBooleanValue(boolean value) voidsetBoolLabelPosition(AbstractBoolFigure.BoolLabelPosition labelPosition) voidsetEnabled(boolean value) voidvoidsetOffColor(Color offColor) voidsetOffLabel(String offLabel) voidsetOnColor(Color onColor) voidsetOnLabel(String onLabel) voidsetShowBooleanLabel(boolean showBooleanLabel) voidsetTotalBits(AbstractBoolFigure.TotalBits totalBits) voidsetValue(double value) voidsetValue(long value) protected voidupdate the boolValue from value and bit.protected voidupdate 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:
invalidatein interfaceorg.eclipse.draw2d.IFigure- Overrides:
invalidatein classorg.eclipse.draw2d.Figure
-
isOpaque
public boolean isOpaque()- Specified by:
isOpaquein interfaceorg.eclipse.draw2d.IFigure- Overrides:
isOpaquein 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:
setEnabledin interfaceorg.eclipse.draw2d.IFigure- Overrides:
setEnabledin classorg.eclipse.draw2d.Figure
-
setFont
- Specified by:
setFontin interfaceorg.eclipse.draw2d.IFigure- Overrides:
setFontin 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:
getBeanInfoin interfaceIntrospectable- Throws:
IntrospectionException
-