Package org.csstudio.opibuilder.model
Class ConnectionModel
java.lang.Object
org.csstudio.opibuilder.model.AbstractWidgetModel
org.csstudio.opibuilder.model.ConnectionModel
- All Implemented Interfaces:
IAdaptable,IPropertySource
Model for connection.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumstatic enumType of router. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic doublestatic final StringThe type ID of this model.static final Stringstatic final StringTrue if anti alias is enabled for the figure.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringColor of the line.static final Stringstatic final Stringstatic final Stringstatic final StringStyle of the line.static final StringWidth of the line.static final StringAll points of this connection except start and end anchor. null if it should be routed by router.static final Stringstatic final StringThe source widget Pathstatic final StringSource Terminalstatic final StringThe source widget UIDstatic final StringThe target widget Pathstatic final StringTarget Terminalstatic final StringThe target widget UIDFields 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
ConstructorsConstructorDescriptionConnectionModel(DisplayModel displayModel) Construct a connection model which belongs to the displayModel. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidConfigure the properties of the widget.voidconnect(AbstractWidgetModel newSource, String newSourceTerminal, AbstractWidgetModel newTarget, String newTargetTerminal) Reconnect to a different source and/or target shape.voidDisconnect this connection from the shapes it is attached to.intintintintorg.eclipse.draw2d.geometry.PointListorg.eclipse.draw2d.geometry.PointListorg.eclipse.draw2d.ScrollPaneReturns the source endpoint of this connection.String[]Returns the target endpoint of this connection.String[]final booleanbooleanbooleanvoidReconnect this connection.voidresync()Resync this connection with its source and target.voidsetLoadedFromLinkedOpi(boolean loadedFromLinkedOpi) voidsetPoints(org.eclipse.draw2d.geometry.PointList points) voidsetScrollPane(org.eclipse.draw2d.ScrollPane scrollPane) voidsetSource(AbstractWidgetModel source) voidsetSourceTerminal(String terminal) voidsetTarget(AbstractWidgetModel target) voidsetTargetTerminal(String terminal) Methods inherited from class org.csstudio.opibuilder.model.AbstractWidgetModel
addConnection, addProperty, addProperty, addPVProperty, configureBaseProperties, 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, 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, scale, 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
-
ARROW_ANGLE
public static double ARROW_ANGLE -
ID
The type ID of this model.- See Also:
-
PROP_LINE_WIDTH
Width of the line.- See Also:
-
PROP_LINE_STYLE
Style of the line.- See Also:
-
PROP_LINE_COLOR
Color of the line.- See Also:
-
PROP_ROUTER
- See Also:
-
PROP_ARROW_TYPE
- See Also:
-
PROP_FILL_ARROW
- See Also:
-
PROP_ARROW_LENGTH
- See Also:
-
PROP_ANTIALIAS
True if anti alias is enabled for the figure.- See Also:
-
PROP_SRC_TERM
Source Terminal- See Also:
-
PROP_TGT_TERM
Target Terminal- See Also:
-
PROP_SRC_WUID
The source widget UID- See Also:
-
PROP_SRC_PATH
The source widget Path- See Also:
-
PROP_TGT_WUID
The target widget UID- See Also:
-
PROP_TGT_PATH
The target widget Path- See Also:
-
PATH_DELIMITER
- See Also:
-
PROP_POINTS
All points of this connection except start and end anchor. null if it should be routed by router.- See Also:
-
PROP_LINE_JUMP_ADD
- See Also:
-
PROP_LINE_JUMP_STYLE
- See Also:
-
PROP_LINE_JUMP_SIZE
- See Also:
-
PROP_IS_LOADED_FROM_LINKING_CONTAINER
- See Also:
-
-
Constructor Details
-
ConnectionModel
Construct a connection model which belongs to the displayModel. If this is a temporary connection model which doesn't belong to any display model, displayModel can be null.- Parameters:
displayModel- the display model. Can be null.
-
-
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
-
getTypeID
- Specified by:
getTypeIDin classAbstractWidgetModel- Returns:
- the unique typeID of the model.
-
getSource
Returns the source endpoint of this connection.- Returns:
- a non-null Shape instance
-
getTarget
Returns the target endpoint of this connection.- Returns:
- a non-null Shape instance
-
reconnect
public void reconnect()Reconnect this connection. The connection will reconnect with the shapes it was previously attached to. -
resync
public void resync()Resync this connection with its source and target. -
connect
public void connect(AbstractWidgetModel newSource, String newSourceTerminal, AbstractWidgetModel newTarget, String newTargetTerminal) Reconnect to a different source and/or target shape. The connection will disconnect from its current attachments and reconnect to the new source and target.- Parameters:
newSource- a new source endpoint for this connection (non null)newTarget- a new target endpoint for this connection (non null)- Throws:
IllegalArgumentException- if any of the paramers are null or newSource == newTarget
-
disconnect
public void disconnect()Disconnect this connection from the shapes it is attached to. -
getTargetTerminal
-
getSourceTerminal
-
setSource
-
setTarget
-
setTargetTerminal
-
setSourceTerminal
-
getLineWidth
public int getLineWidth() -
getTargetPath
-
getSourcePath
-
getLineStyle
public int getLineStyle()- Returns:
- SWT line style
-
getLineColor
-
getRouterType
-
getArrowType
-
getArrowLength
public int getArrowLength() -
isFillArrow
public boolean isFillArrow() -
isAntiAlias
public final boolean isAntiAlias()- Returns:
- true if the graphics's antiAlias is on.
-
getParent
- Overrides:
getParentin classAbstractWidgetModel- Returns:
- the parent
-
getPoints
public org.eclipse.draw2d.geometry.PointList getPoints()- Returns:
- the points on this connection except start and end anchors, can be null.
-
setPoints
public void setPoints(org.eclipse.draw2d.geometry.PointList points) -
getOriginPoints
public org.eclipse.draw2d.geometry.PointList getOriginPoints()- Returns:
- the original points before scaling.
-
setLoadedFromLinkedOpi
public void setLoadedFromLinkedOpi(boolean loadedFromLinkedOpi) -
isLoadedFromLinkedOpi
public boolean isLoadedFromLinkedOpi()- Returns:
- true if the connection was loaded from linked opi file in LinkingContainer
-
getLineJumpAdd
-
getLineJumpSize
public int getLineJumpSize() -
getLineJumpStyle
-
getScrollPane
public org.eclipse.draw2d.ScrollPane getScrollPane()- Returns:
- the scrollPane
-
setScrollPane
public void setScrollPane(org.eclipse.draw2d.ScrollPane scrollPane) - Parameters:
scrollPane- the scrollPane to set
-