Class GuideModel

java.lang.Object
org.csstudio.opibuilder.model.GuideModel
All Implemented Interfaces:
Serializable

public final class GuideModel extends Object implements Serializable
The Model for a Guide.
See Also:
  • Field Details

    • PROPERTY_CHILDREN_CHANGED

      public static final String PROPERTY_CHILDREN_CHANGED
      Property used to notify listeners when the parts attached to a guide are changed.
      See Also:
    • PROPERTY_POSITION_CHANGED

      public static final String PROPERTY_POSITION_CHANGED
      Property used to notify listeners when the guide is re-positioned.
      See Also:
  • Constructor Details

    • GuideModel

      public GuideModel(int position)
      Constructor.
      Parameters:
      position - The position of this guide
  • Method Details

    • setOrientation

      public void setOrientation(boolean isHorizontal)
      Sets the orientation.
      Parameters:
      isHorizontal - The new orientation for this guide
    • setPosition

      public void setPosition(int position)
      Sets the position.
      Parameters:
      position - The new Position for this guide
    • isHorizontal

      public boolean isHorizontal()
      Returns if this guide has a horizontal orientation.
      Returns:
      boolean True, if this guide has a horizontal orientation, false otherwise
    • getPosition

      public int getPosition()
      Returns the position of this guide.
      Returns:
      int The position of this guide
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
      Adds a PropertyChangeListener to this guide.
      Parameters:
      listener - The listener to add
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener listener)
      Removes a PropertyChangeListener from this guide.
      Parameters:
      listener - The listener to remove
    • attachPart

      public void attachPart(AbstractWidgetModel model, int alignment)
      Attaches the given AbstractWidgetEditPart with the alignment to this guide.
      Parameters:
      model - The AbstractWidgetEditPart
      alignment - The alignment for the EditPart
    • detachPart

      public void detachPart(AbstractWidgetModel model)
      Detaches the given part from this guide.
      Parameters:
      model - The part that is to be detached from this guide
    • getAlignment

      public int getAlignment(AbstractWidgetModel model)
      This methods returns the edge along which the given part is attached to this guide. This information is used by to determine whether to attach or detach a part from a guide during resize operations.
      Parameters:
      model - The part whose alignment has to be found
      Returns:
      an int representing the edge along which the given part is attached to this guide; 1 is bottom or right; 0, center; -1, top or left; -2 if the part is not attached to this guide
    • getMap

      public Map<AbstractWidgetModel,Integer> getMap()
      Returns:
      The Map containing all the parts attached to this guide, and their alignments; the keys are LogicSubparts and values are Integers
    • getAttachedModels

      public Set<AbstractWidgetModel> getAttachedModels()
      Returns:
      the set of all the parts attached to this guide; a set is used because a part can only be attached to a guide along one edge.