Class DisplayModel

All Implemented Interfaces:
IAdaptable, IPropertySource

public class DisplayModel extends AbstractContainerModel
The root model for an OPI Display.
  • Field Details

    • ID

      public static final String ID
      The type ID of this model.
      See Also:
    • PROP_GRID_SPACE

      public static final String PROP_GRID_SPACE
      Space of grid in pixels.
      See Also:
    • PROP_SHOW_GRID

      public static final String PROP_SHOW_GRID
      If the grid should be visible.
      See Also:
    • PROP_SHOW_RULER

      public static final String PROP_SHOW_RULER
      If the ruler should be visible.
      See Also:
    • PROP_SNAP_GEOMETRY

      public static final String PROP_SNAP_GEOMETRY
      If the moving widgets will be snapped to the geometry of other widgets.
      See Also:
    • PROP_SHOW_EDIT_RANGE

      public static final String PROP_SHOW_EDIT_RANGE
      If the dash boundary line of the display should be visible.
      See Also:
    • PROP_SHOW_CLOSE_BUTTON

      public static final String PROP_SHOW_CLOSE_BUTTON
      If the tab close button should be hidden.
      See Also:
    • PROP_BOY_VERSION

      public static final String PROP_BOY_VERSION
      See Also:
    • PROP_AUTO_ZOOM_TO_FIT_ALL

      public static final String 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

      public static final String PROP_AUTO_SCALE_WIDGETS
      Automatically scale all widgets when window resizes.
      See Also:
    • PROP_FRAME_RATE

      public static final String 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 use DisplayModel(IPath).
    • DisplayModel

      public DisplayModel(IPath opiFilePath)
      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 class AbstractWidgetModel
    • getDisplayScaleData

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

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

      public void setOpiFilePath(IPath opiFilePath)
      Parameters:
      opiFilePath - the opiFilePath to set
    • setOpiRuntime

      public void setOpiRuntime(IOPIRuntime opiRuntime)
      Set the IOPIRuntime on this display if it is in run mode.
      Parameters:
      opiRuntime -
    • getOpiRuntime

      public IOPIRuntime getOpiRuntime()
      Returns:
      the IOPIRuntime if it is in run mode.
    • getOpiFilePath

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

      public List<ConnectionModel> 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

      public AbstractWidgetModel getWidgetFromWUID(String wuid)
    • 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 override AbstractWidgetModel.doScale(double, double) instead of this method.
      Overrides:
      scale in class AbstractContainerModel
      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

      public void setParentDisplayModel(DisplayModel rootDisplayModel)
    • getParentDisplayModel

      public DisplayModel getParentDisplayModel()