Class ConnectionModel

java.lang.Object
org.csstudio.opibuilder.model.AbstractWidgetModel
org.csstudio.opibuilder.model.ConnectionModel
All Implemented Interfaces:
IAdaptable, IPropertySource

public class ConnectionModel extends AbstractWidgetModel
Model for connection.
  • Field Details

  • Constructor Details

    • ConnectionModel

      public ConnectionModel(DisplayModel displayModel)
      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: AbstractWidgetModel
      Configure the properties of the widget. Subclass should add new properties in this method.
      Specified by:
      configureProperties in class AbstractWidgetModel
    • getTypeID

      public String getTypeID()
      Specified by:
      getTypeID in class AbstractWidgetModel
      Returns:
      the unique typeID of the model.
    • getSource

      public AbstractWidgetModel getSource()
      Returns the source endpoint of this connection.
      Returns:
      a non-null Shape instance
    • getTarget

      public AbstractWidgetModel 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

      public String getTargetTerminal()
    • getSourceTerminal

      public String getSourceTerminal()
    • setSource

      public void setSource(AbstractWidgetModel source)
    • setTarget

      public void setTarget(AbstractWidgetModel target)
    • setTargetTerminal

      public void setTargetTerminal(String terminal)
    • setSourceTerminal

      public void setSourceTerminal(String terminal)
    • getLineWidth

      public int getLineWidth()
    • getTargetPath

      public String[] getTargetPath()
    • getSourcePath

      public String[] getSourcePath()
    • getLineStyle

      public int getLineStyle()
      Returns:
      SWT line style
    • getLineColor

      public OPIColor getLineColor()
    • getRouterType

      public ConnectionModel.RouterType getRouterType()
    • getArrowType

      public ConnectionModel.ArrowType getArrowType()
    • getArrowLength

      public int getArrowLength()
    • isFillArrow

      public boolean isFillArrow()
    • isAntiAlias

      public final boolean isAntiAlias()
      Returns:
      true if the graphics's antiAlias is on.
    • getParent

      public AbstractContainerModel getParent()
      Overrides:
      getParent in class AbstractWidgetModel
      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

      public ConnectionModel.LineJumpAdd getLineJumpAdd()
    • getLineJumpSize

      public int getLineJumpSize()
    • getLineJumpStyle

      public ConnectionModel.LineJumpStyle 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