Package org.csstudio.opibuilder.model
Class DisplayModel
java.lang.Object
org.csstudio.opibuilder.model.AbstractWidgetModel
org.csstudio.opibuilder.model.AbstractContainerModel
org.csstudio.opibuilder.model.DisplayModel
- All Implemented Interfaces:
IAdaptable
,IPropertySource
The root model for an OPI Display.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The type ID of this model.static final org.eclipse.draw2d.geometry.Point
static final String
Automatically scale all widgets when window resizes.static final String
Auto scale all the widgets as the window resizes.static final String
static final String
Frame rate in Hz.static final String
Space of grid in pixels.static final String
If the tab close button should be hidden.static final String
If the dash boundary line of the display should be visible.static final String
If the grid should be visible.static final String
If the ruler should be visible.static final String
If the moving widgets will be snapped to the geometry of other widgets.Fields inherited from class org.csstudio.opibuilder.model.AbstractContainerModel
PROP_CHILDREN, PROP_MACROS, PROP_SELECTION
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
-
Constructor Summary
ConstructorDescriptionCreate a Display Model which is the root model for an OPI.DisplayModel
(IPath opiFilePath) Create a Display Model which is the root model for an OPI. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Configure the properties of the widget.org.osgi.framework.Version
int
org.eclipse.gef.GraphicalViewer
getWidgetFromWUID
(String wuid) boolean
boolean
!!!boolean
boolean
boolean
boolean
boolean
void
scale
(double widthRatio, double heightRatio) Scale location and size of the widget.void
setDisplayID
(int displayID) void
setFrameRate
(double rate) When a new frame rate is notified by GUI toolkit side, this method shall be called to set the up-to-date frame rate.void
setOpiFilePath
(IPath opiFilePath) void
setOpiRuntime
(IOPIRuntime opiRuntime) Set theIOPIRuntime
on this display if it is in run mode.void
setParentDisplayModel
(DisplayModel rootDisplayModel) void
setViewer
(org.eclipse.gef.GraphicalViewer viewer) Set the viewer of the display model if this model belongs to a viewer.void
In connections are spanning over multiple display models (e.g. via linking containers), and if one of those sub display models is reloaded, all the links will become invalid - the previously existing widgets will no longer exist.Methods inherited from class org.csstudio.opibuilder.model.AbstractContainerModel
addChild, addChild, addChild, addChildren, addMacro, changeChildOrder, configureBaseProperties, getAllDescendants, getChildByName, getChildren, getChildrenProperty, getEditPart, getIndexOf, getLayoutWidget, getMacroMap, getMacrosInput, getParentMacroMap, getSelectionProperty, isChildrenOperationAllowable, removeAllChildren, removeChild, scaleChildren, selectWidget, selectWidgets, setMacroMap
Methods inherited from class org.csstudio.opibuilder.model.AbstractWidgetModel
addConnection, addProperty, addProperty, addPVProperty, doScale, flipHorizontally, flipHorizontally, flipVertically, flipVertically, 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, getTooltip, getType, getVersion, getVersionOnFile, getWidgetType, getWidth, getWUID, getX, getY, isEnabled, isPropertySet, isVisible, processVersionDifference, removeProperty, removePVProperty, resetPropertyValue, rotate90, rotate90, scaleConnections, setBackgroundColor, setBorderColor, setBorderStyle, setBorderWidth, setBounds, setBounds, setEnabled, setExecutionMode, setForegroundColor, setHeight, setLocation, setLocation, setName, setParent, setPropertyDescription, setPropertyValue, setPropertyValue, setPropertyVisible, setPropertyVisibleAndSavable, setScaleOptions, setSize, setSize, setTooltip, setVersionOnFile, setWidth, setX, setY
-
Field Details
-
ID
The type ID of this model.- See Also:
-
PROP_GRID_SPACE
Space of grid in pixels.- See Also:
-
PROP_SHOW_GRID
If the grid should be visible.- See Also:
-
PROP_SHOW_RULER
If the ruler should be visible.- See Also:
-
PROP_SNAP_GEOMETRY
If the moving widgets will be snapped to the geometry of other widgets.- See Also:
-
PROP_SHOW_EDIT_RANGE
If the dash boundary line of the display should be visible.- See Also:
-
PROP_SHOW_CLOSE_BUTTON
If the tab close button should be hidden.- See Also:
-
PROP_BOY_VERSION
- See Also:
-
PROP_AUTO_ZOOM_TO_FIT_ALL
Auto scale all the widgets as the window resizes. If this is set to true, zoom operation will not work.- See Also:
-
PROP_AUTO_SCALE_WIDGETS
Automatically scale all widgets when window resizes.- See Also:
-
PROP_FRAME_RATE
Frame rate in Hz. This is the hidden property which can be referred only from scripts. The value is valid only when running mode. In edit mode, it is always -1.- See Also:
-
NULL_LOCATION
public static final org.eclipse.draw2d.geometry.Point NULL_LOCATION
-
-
Constructor Details
-
DisplayModel
public DisplayModel()Create a Display Model which is the root model for an OPI. Only use this constructor if this model doesn't relate to any real opi file. Otherwise, please useDisplayModel(IPath)
. -
DisplayModel
Create a Display Model which is the root model for an OPI.- Parameters:
opiFilePath
- path of the OPI. It can only be null if this model doesn't relate to any real opi file.
-
-
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.- Specified by:
configureProperties
in classAbstractWidgetModel
-
getDisplayScaleData
- Returns:
- true if Children should be auto scaled when this container is resized.
-
isShowGrid
public boolean isShowGrid() -
isShowRuler
public boolean isShowRuler() -
isSnapToGeometry
public boolean isSnapToGeometry() -
isShowEditRange
public boolean isShowEditRange() -
isShowCloseButton
public boolean isShowCloseButton() -
isAutoZoomToFitAll
public boolean isAutoZoomToFitAll() -
getTypeID
- Specified by:
getTypeID
in classAbstractWidgetModel
- Returns:
- the unique typeID of the model.
-
setOpiFilePath
- Parameters:
opiFilePath
- the opiFilePath to set
-
setOpiRuntime
Set theIOPIRuntime
on this display if it is in run mode.- Parameters:
opiRuntime
-
-
getOpiRuntime
- Returns:
- the
IOPIRuntime
if it is in run mode.
-
getOpiFilePath
- Returns:
- the opiFilePath
-
setViewer
public void setViewer(org.eclipse.gef.GraphicalViewer viewer) Set the viewer of the display model if this model belongs to a viewer.- Parameters:
viewer
- the viewer to set
-
getViewer
public org.eclipse.gef.GraphicalViewer getViewer()- Returns:
- the viewer, null if it has no viewer.
-
setDisplayID
public void setDisplayID(int displayID) - Parameters:
displayID
- the unique displayID to set
-
getDisplayID
public int getDisplayID()- Returns:
- the displayID
-
getBOYVersion
public org.osgi.framework.Version getBOYVersion() -
getConnectionList
- Returns:
- the list of connections belongs to this display model.
-
syncConnections
public void syncConnections()In connections are spanning over multiple display models (e.g. via linking containers), and if one of those sub display models is reloaded, all the links will become invalid - the previously existing widgets will no longer exist. This methods intends to reconnect such broken connections, by resetting the connectors sources and targets. -
getWidgetFromWUID
-
scale
public void scale(double widthRatio, double heightRatio) Description copied from class:AbstractWidgetModel
Scale location and size of the widget. If the widget needs to change its scale behavior, it should overrideAbstractWidgetModel.doScale(double, double)
instead of this method.- Overrides:
scale
in classAbstractContainerModel
- Parameters:
widthRatio
- Ratio of width change.heightRatio
- Ratio of height change.
-
isFreshRateEnabled
public boolean isFreshRateEnabled()!!! This is function only for test purpose. It might be removed in future!- Returns:
- true if calculating fresh rate is enabled.
-
setFrameRate
public void setFrameRate(double rate) When a new frame rate is notified by GUI toolkit side, this method shall be called to set the up-to-date frame rate.- Parameters:
rate
- Frame rate in Hz
-
setParentDisplayModel
-
getParentDisplayModel
-