Package org.csstudio.opibuilder.model
Class GuideModel
java.lang.Object
org.csstudio.opibuilder.model.GuideModel
- All Implemented Interfaces:
Serializable
The Model for a Guide.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a PropertyChangeListener to this guide.void
attachPart
(AbstractWidgetModel model, int alignment) Attaches the given AbstractWidgetEditPart with the alignment to this guide.void
detachPart
(AbstractWidgetModel model) Detaches the given part from this guide.int
getAlignment
(AbstractWidgetModel model) This methods returns the edge along which the given part is attached to this guide.getMap()
int
Returns the position of this guide.boolean
Returns if this guide has a horizontal orientation.void
Removes a PropertyChangeListener from this guide.void
setOrientation
(boolean isHorizontal) Sets the orientation.void
setPosition
(int position) Sets the position.
-
Field Details
-
PROPERTY_CHILDREN_CHANGED
Property used to notify listeners when the parts attached to a guide are changed.- See Also:
-
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
Adds a PropertyChangeListener to this guide.- Parameters:
listener
- The listener to add
-
removePropertyChangeListener
Removes a PropertyChangeListener from this guide.- Parameters:
listener
- The listener to remove
-
attachPart
Attaches the given AbstractWidgetEditPart with the alignment to this guide.- Parameters:
model
- The AbstractWidgetEditPartalignment
- The alignment for the EditPart
-
detachPart
Detaches the given part from this guide.- Parameters:
model
- The part that is to be detached from this guide
-
getAlignment
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
- Returns:
- The Map containing all the parts attached to this guide, and their alignments; the keys are LogicSubparts and values are Integers
-
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.
-