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
FieldsModifier and TypeFieldDescriptionstatic final StringThe type ID of this model.static final org.eclipse.draw2d.geometry.Pointstatic final StringAutomatically scale all widgets when window resizes.static final StringAuto scale all the widgets as the window resizes.static final Stringstatic final StringFrame rate in Hz.static final StringSpace of grid in pixels.static final StringIf the tab close button should be hidden.static final StringIf the dash boundary line of the display should be visible.static final StringIf the grid should be visible.static final StringIf the ruler should be visible.static final StringIf 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_SELECTIONFields 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
ConstructorsConstructorDescriptionCreate 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 voidConfigure the properties of the widget.org.osgi.framework.Versionintorg.eclipse.gef.GraphicalViewergetWidgetFromWUID(String wuid) booleanboolean!!!booleanbooleanbooleanbooleanbooleanvoidscale(double widthRatio, double heightRatio) Scale location and size of the widget.voidsetDisplayID(int displayID) voidsetFrameRate(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.voidsetOpiFilePath(IPath opiFilePath) voidsetOpiRuntime(IOPIRuntime opiRuntime) Set theIOPIRuntimeon this display if it is in run mode.voidsetParentDisplayModel(DisplayModel rootDisplayModel) voidsetViewer(org.eclipse.gef.GraphicalViewer viewer) Set the viewer of the display model if this model belongs to a viewer.voidIn 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, setMacroMapMethods 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:AbstractWidgetModelConfigure the properties of the widget. Subclass should add new properties in this method.- Specified by:
configurePropertiesin 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:
getTypeIDin classAbstractWidgetModel- Returns:
- the unique typeID of the model.
-
setOpiFilePath
- Parameters:
opiFilePath- the opiFilePath to set
-
setOpiRuntime
Set theIOPIRuntimeon this display if it is in run mode.- Parameters:
opiRuntime-
-
getOpiRuntime
- Returns:
- the
IOPIRuntimeif 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:AbstractWidgetModelScale 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:
scalein 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
-