Class AbstractPolyModel
java.lang.Object
org.csstudio.opibuilder.model.AbstractWidgetModel
org.csstudio.opibuilder.model.AbstractPVWidgetModel
org.csstudio.opibuilder.widgets.model.AbstractShapeModel
org.csstudio.opibuilder.widgets.model.AbstractPolyModel
- All Implemented Interfaces:
IPVWidgetModel
,IAdaptable
,IPropertySource
- Direct Known Subclasses:
PolygonModel
,PolyLineModel
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Points of the widget.static final String
Rotation angle of the widget.Fields inherited from class org.csstudio.opibuilder.widgets.model.AbstractShapeModel
PROP_ALPHA, PROP_ANTIALIAS, PROP_FILL_LEVEL, PROP_HORIZONTAL_FILL, PROP_LINE_COLOR, PROP_LINE_STYLE, PROP_LINE_WIDTH, PROP_TRANSPARENT
Fields inherited from class org.csstudio.opibuilder.model.AbstractWidgetModel
PROP_ACTIONS, PROP_BORDER_COLOR, PROP_BORDER_STYLE, PROP_BORDER_WIDTH, PROP_COLOR_BACKGROUND, PROP_COLOR_FOREGROUND, PROP_ENABLED, PROP_FONT, PROP_HEIGHT, PROP_NAME, PROP_RULES, PROP_SCALE_OPTIONS, PROP_SCRIPTS, PROP_SRC_CONNECTIONS, PROP_TGT_CONNECTIONS, PROP_TOOLTIP, PROP_VISIBLE, PROP_WIDGET_TYPE, PROP_WIDGET_UID, PROP_WIDTH, PROP_XPOS, PROP_YPOS, VERSION
Fields inherited from interface org.csstudio.opibuilder.model.IPVWidgetModel
PROP_ALARM_PULSING, PROP_BACKCOLOR_ALARMSENSITIVE, PROP_BORDER_ALARMSENSITIVE, PROP_FORECOLOR_ALARMSENSITIVE, PROP_PVNAME, PROP_PVVALUE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Configure the properties of the widget.protected void
doScale
(double widthRatio, double heightRatio) The actual code that scaling the widget.void
Flip the widget figure horizontally.void
flipHorizontally
(int centerX) Flip the widget figure horizontally.void
Flip the widget figure vertically.void
flipVertically
(int centerY) Flip the widget figure horizontally.org.eclipse.draw2d.geometry.PointList
org.eclipse.draw2d.geometry.PointList
Gets the polygon _points.double
Returns the rotation angle for this widget.protected void
rememberZeroDegreePoints
(org.eclipse.draw2d.geometry.PointList points) Rotates the given points to 0 degrees and sets them as_originalPoints
.void
rotate90
(boolean clockwise) Rotate the widget figure 90 degree.void
rotate90
(boolean clockwise, org.eclipse.draw2d.geometry.Point center) Rotate the widget figure 90 degree.org.eclipse.draw2d.geometry.PointList
rotatePoints
(org.eclipse.draw2d.geometry.PointList points, double angle) Rotates all points.void
setLocation
(int x, int y) void
setPoints
(org.eclipse.draw2d.geometry.PointList points, boolean rememberPoints) Sets the specified _points for the polygon.final void
setPropertyValue
(Object propertyID, Object value) void
setRotationAngle
(double angle) Sets the rotation angle for this widget, only when this widget is rotatable.void
setSize
(int width, int height) Methods inherited from class org.csstudio.opibuilder.widgets.model.AbstractShapeModel
getAlpha, getFillLevel, getLineColor, getLineStyle, getLineWidth, isAntiAlias, isHorizontalFill, isTransparent, setFillLevel, setHoizontalFill, setLineStyle, setLineWidth, setTransparent
Methods inherited from class org.csstudio.opibuilder.model.AbstractPVWidgetModel
configureBaseProperties, getDelegate, getPVName, getTooltip, isAlarmPulsing, isBackColorAlarmSensitve, isBorderAlarmSensitve, isForeColorAlarmSensitve, processVersionDifference
Methods inherited from class org.csstudio.opibuilder.model.AbstractWidgetModel
addConnection, addProperty, addProperty, addPVProperty, generateNewWUID, getActionsInput, getAdapter, getAllPropertyIDs, getBackgroundColor, getBorderColor, getBorderStyle, getBorderWidth, getBounds, getCastedPropertyValue, getEditableValue, getExecutionMode, getFont, getForegroundColor, getHeight, getIndex, getLocation, getName, getNestedDepth, getOriginLocation, getOriginSize, getParent, getProperty, getPropertyDescriptors, getPropertyValue, getPVMap, getRawPropertyValue, getRawTooltip, getRGBFromColorProperty, getRootDisplayModel, getRootDisplayModel, getRulesInput, getRuntimePropertyList, getScaledSize, getScaleOptions, getScriptsInput, getSize, getSourceConnections, getSWTColorFromColorProperty, getTargetConnections, getType, getTypeID, getVersion, getVersionOnFile, getWidgetType, getWidth, getWUID, getX, getY, isEnabled, isPropertySet, isVisible, removeProperty, removePVProperty, resetPropertyValue, scale, scaleConnections, setBackgroundColor, setBorderColor, setBorderStyle, setBorderWidth, setBounds, setBounds, setEnabled, setExecutionMode, setForegroundColor, setHeight, setLocation, setName, setParent, setPropertyDescription, setPropertyValue, setPropertyVisible, setPropertyVisibleAndSavable, setScaleOptions, setSize, setTooltip, setVersionOnFile, setWidth, setX, setY
-
Field Details
-
PROP_ROTATION
Rotation angle of the widget.- See Also:
-
PROP_POINTS
Points of the widget.- See Also:
-
-
Constructor Details
-
AbstractPolyModel
public AbstractPolyModel()
-
-
Method Details
-
configureProperties
protected void configureProperties()Description copied from class:AbstractWidgetModel
Configure the properties of the widget. Subclass should add new properties in this method.- Overrides:
configureProperties
in classAbstractShapeModel
-
setPoints
public void setPoints(org.eclipse.draw2d.geometry.PointList points, boolean rememberPoints) Sets the specified _points for the polygon.- Parameters:
points
- the polygon pointsrememberPoints
- true if the zero degree relative points should be remembered, false otherwise.
-
getPoints
public org.eclipse.draw2d.geometry.PointList getPoints()Gets the polygon _points.- Returns:
- the polygon _points
-
setSize
public void setSize(int width, int height) - Overrides:
setSize
in classAbstractWidgetModel
-
setLocation
public void setLocation(int x, int y) - Overrides:
setLocation
in classAbstractWidgetModel
-
rotatePoints
public org.eclipse.draw2d.geometry.PointList rotatePoints(org.eclipse.draw2d.geometry.PointList points, double angle) Rotates all points.- Parameters:
points
- The PoinList, which points should be rotatedangle
- The angle to rotate- Returns:
- The rotated PointList
-
rememberZeroDegreePoints
protected void rememberZeroDegreePoints(org.eclipse.draw2d.geometry.PointList points) Rotates the given points to 0 degrees and sets them as_originalPoints
.- Parameters:
points
- The currentPointList
-
getRotationAngle
public double getRotationAngle()Returns the rotation angle for this widget. Returns 0 if this widget is not rotatable- Returns:
- The rotation angle
-
setRotationAngle
public void setRotationAngle(double angle) Sets the rotation angle for this widget, only when this widget is rotatable.- Parameters:
angle
- The angle
-
setPropertyValue
- Specified by:
setPropertyValue
in interfaceIPropertySource
- Overrides:
setPropertyValue
in classAbstractWidgetModel
-
getOriginalPoints
public org.eclipse.draw2d.geometry.PointList getOriginalPoints() -
flipHorizontally
public void flipHorizontally()Description copied from class:AbstractWidgetModel
Flip the widget figure horizontally.- Overrides:
flipHorizontally
in classAbstractWidgetModel
-
flipHorizontally
public void flipHorizontally(int centerX) Description copied from class:AbstractWidgetModel
Flip the widget figure horizontally.- Overrides:
flipHorizontally
in classAbstractWidgetModel
- Parameters:
centerX
- the center X coordinate
-
flipVertically
public void flipVertically()Description copied from class:AbstractWidgetModel
Flip the widget figure vertically.- Overrides:
flipVertically
in classAbstractWidgetModel
-
flipVertically
public void flipVertically(int centerY) Description copied from class:AbstractWidgetModel
Flip the widget figure horizontally.- Overrides:
flipVertically
in classAbstractWidgetModel
- Parameters:
centerY
- the center Y coordinate
-
rotate90
public void rotate90(boolean clockwise) Description copied from class:AbstractWidgetModel
Rotate the widget figure 90 degree.- Overrides:
rotate90
in classAbstractWidgetModel
- Parameters:
clockwise
- true if rotate clockwise. false if counterclockwise.
-
rotate90
public void rotate90(boolean clockwise, org.eclipse.draw2d.geometry.Point center) Description copied from class:AbstractWidgetModel
Rotate the widget figure 90 degree.- Overrides:
rotate90
in classAbstractWidgetModel
- Parameters:
clockwise
- true if rotate clockwise. false if counterclockwise.
-
doScale
protected void doScale(double widthRatio, double heightRatio) Description copied from class:AbstractWidgetModel
The actual code that scaling the widget.- Overrides:
doScale
in classAbstractWidgetModel
-