@OpenApi public abstract class PresentationElement extends ElementImpl implements java.beans.PropertyChangeListener, com.nomagic.magicdraw.help.HelpSource, ModelElementProvider, NameOwner
Modifier and Type | Field and Description |
---|---|
static int |
DASHED_STROKE
Dashed path stroke.
|
static int |
DOTTED_STROKE
Dotted path stroke.
|
static int |
SOLID_STROKE
Solid path stroke.
|
Modifier and Type | Method and Description |
---|---|
void |
addProperty(Property prop)
Add property to presentation element.
|
void |
collectSubManipulatedElements(java.util.List<PresentationElement> col)
Collects all visible and manipulated elements in this hierarchy.
|
void |
editName(java.awt.event.KeyEvent evt)
Starts online diagram editing for a symbol
|
void |
editName(java.awt.event.KeyEvent evt,
java.util.Map<java.lang.String,java.lang.Boolean> textEditorOptions)
Starts online diagram editing for a symbol
|
java.awt.Rectangle |
getBounds()
Method returns bounds of this element.
|
java.awt.Shape |
getBoundsShape(ConverterToShape converterToShape)
Provides a bounding shape of the symbol
|
DiagramPresentationElement |
getDiagramPresentationElement()
Returns diagram of this presentation element.
|
DiagramSurface |
getDiagramSurface()
Returns diagram surface for this presentation element.
|
Element |
getElement()
Returns model element of this presentation element.
|
PresentationElement |
getManipulatedParent() |
java.util.List<PresentationElement> |
getManipulatedPresentationElements()
Returns a list of children of this element those have manipulator.
|
java.awt.Point |
getMiddlePoint()
Returns middle point of this element.
|
BaseElement |
getObjectParent()
Returns the presentation element parent.
|
PresentationElement |
getParent()
Returns parent of this element.
|
java.awt.Dimension |
getPreferredSize()
Returns preferable dimension of the element.
|
java.util.List<PresentationElement> |
getPresentationElements()
Returns all children of this element
|
java.awt.BasicStroke |
getPresentationElementStroke()
Return a stroke used to paint symbol's main part
|
java.awt.BasicStroke |
getPresentationElementStroke(int width)
Return a stroke used to paint symbol's main part
|
Property |
getProperty(java.lang.String id)
Returns element's property with given id.
|
PropertyManager |
getPropertyManager()
Returns the propertyManager of this element.
|
java.util.List<PresentationElement> |
getSelected()
Returns a list of selected elements in the diagram.
|
static java.awt.BasicStroke |
getStroke(java.awt.BasicStroke stroke,
int width)
Get cached stroke of given width.
|
static java.awt.BasicStroke |
getStroke(float width,
int cap,
int join,
float miterLimit,
float[] dash,
float dash_phase)
Get cached stroke.
|
static java.awt.BasicStroke |
getStroke(int lineStyle)
Get cached stroke of given style and default width.
|
static java.awt.BasicStroke |
getStroke(int lineStyle,
int width)
Get cached stroke of given style and width.
|
static java.awt.BasicStroke |
getStroke(int lineStyle,
int width,
int join)
Get cached stroke of given style, width and join.
|
static java.awt.BasicStroke |
getStroke(int lineStyle,
int width,
int join,
int cap)
Get cached stroke of given style, width and join.
|
boolean |
hasManipulatedPresentationElements() |
boolean |
isSelected()
Returns true, if this element is selected in the diagram.
|
void |
onFind()
Scrolls diagram canvas to this symbol and selects this symbol
|
void |
onFind(boolean center)
Scrolls diagram canvas to this symbol and selects this symbol
|
void |
setAllSelected(boolean select)
Selects(or deselects) all presentation elements in the diagram.
|
void |
setSelected(boolean select)
Selects or deselects this presentation element in the diagram.
|
void |
setSelected(java.util.List<PresentationElement> elements)
Selects given elements in the diagram.
|
boolean |
useParentProperties()
Does this element uses parent properties or has it own?
|
clone
accept, accept, addPropertyChangeListener, atInsert, canAdd, canAdd, canAddChild, canAddChild, canAddInstance, canBeDeleted, canChangeParent, canDeleteChild, compareTo, createSortKeys, dispose, fireMultiSourcePropertyChange, firePropertyChange, generateID, getClassType, getCommandForAppending, getHumanName, getHumanType, getID, getName, getProject, getProjectImpl, getResourceID, getSortKeys, hasListeners, isEditable, isParentOf, removeAllChildren, removeAllParents, removeAllPropertyChangeListeners, removePropertyChangeListener, setID, setMDElement, sGetID, toString
@OpenApi public static final int SOLID_STROKE
@OpenApi public static final int DASHED_STROKE
@OpenApi public static final int DOTTED_STROKE
@OpenApi public Element getElement()
getElement
in interface ModelElementProvider
@CheckForNull @OpenApi public DiagramSurface getDiagramSurface()
@OpenApi public PresentationElement getParent()
@OpenApi public final java.awt.Dimension getPreferredSize()
@CheckForNull @OpenApi public java.awt.Point getMiddlePoint()
@OpenApi public java.awt.Rectangle getBounds() throws NoRectangleDefinedException
NoRectangleDefinedException
- when bounds can not be calculated (some presentation
elements are abstract and can not have bounds).PresentationElementsManager.reshapeShapeElement(com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement, java.awt.Rectangle)
@OpenApi public java.util.List<PresentationElement> getPresentationElements()
@OpenApi public void setAllSelected(boolean select)
select
- select or deselect all elements.getDiagramPresentationElement()
@OpenApi public void setSelected(java.util.List<PresentationElement> elements)
elements
- elements to select.getDiagramPresentationElement()
@OpenApi public void setSelected(boolean select)
select
- select or deselect this presentation element.getDiagramPresentationElement()
@OpenApi public java.util.List<PresentationElement> getSelected()
getDiagramPresentationElement()
@OpenApi public boolean isSelected()
@OpenApi public DiagramPresentationElement getDiagramPresentationElement()
@OpenApi public final void onFind()
@OpenApi public final void onFind(boolean center)
center
- if true, centers current view in the center of the window.@OpenApi public final void collectSubManipulatedElements(java.util.List<PresentationElement> col)
@OpenApi public final java.util.List<PresentationElement> getManipulatedPresentationElements()
@OpenApi public final boolean hasManipulatedPresentationElements()
@OpenApi public boolean useParentProperties()
@OpenApi public final PropertyManager getPropertyManager()
useParentProperties()
,
PresentationElementsManager.setPresentationElementProperties(com.nomagic.magicdraw.uml.symbols.PresentationElement, com.nomagic.magicdraw.properties.PropertyManager)
@CheckForNull @OpenApi public Property getProperty(java.lang.String id)
id
- ID of property.useParentProperties()
@OpenApi public final void addProperty(Property prop)
PresentationElementsManager.setPresentationElementProperties(com.nomagic.magicdraw.uml.symbols.PresentationElement, com.nomagic.magicdraw.properties.PropertyManager)
prop
- property@OpenApi public final void editName(@CheckForNull java.awt.event.KeyEvent evt)
evt
- first key event or null@OpenApi public void editName(@CheckForNull java.awt.event.KeyEvent evt, @CheckForNull java.util.Map<java.lang.String,java.lang.Boolean> textEditorOptions)
evt
- first key event or nulltextEditorOptions
- boolean options for text editor. Passed when creating text editor with
TextEditorFactory
@CheckForNull @OpenApi public final PresentationElement getManipulatedParent()
@OpenApi public BaseElement getObjectParent()
getObjectParent
in interface BaseElement
getObjectParent
in class com.nomagic.magicdraw.uml.MDElementImpl
getParent()
@OpenApi @CheckForNull public final java.awt.Shape getBoundsShape(ConverterToShape converterToShape)
converterToShape
- transform bounding shape according this converter@OpenApi public final java.awt.BasicStroke getPresentationElementStroke()
@OpenApi public final java.awt.BasicStroke getPresentationElementStroke(int width)
width
- a custom stroke width. Other stroke parameters will be specific to symbol@OpenApi public static java.awt.BasicStroke getStroke(java.awt.BasicStroke stroke, int width)
stroke
- base stroke.width
- of the stroke.@OpenApi public static java.awt.BasicStroke getStroke(int lineStyle)
lineStyle
- style of line.SOLID_STROKE
,
DASHED_STROKE
,
DOTTED_STROKE
@OpenApi public static java.awt.BasicStroke getStroke(int lineStyle, int width)
lineStyle
- style of linewidth
- widthSOLID_STROKE
,
DASHED_STROKE
,
DOTTED_STROKE
@OpenApi public static java.awt.BasicStroke getStroke(int lineStyle, int width, int join)
lineStyle
- style of linewidth
- widthSOLID_STROKE
,
DASHED_STROKE
,
DOTTED_STROKE
,
BasicStroke.JOIN_BEVEL
,
BasicStroke.JOIN_MITER
,
BasicStroke.JOIN_ROUND
@OpenApi public static java.awt.BasicStroke getStroke(int lineStyle, int width, int join, int cap)
lineStyle
- style of linewidth
- widthSOLID_STROKE
,
DASHED_STROKE
,
DOTTED_STROKE
,
BasicStroke.JOIN_BEVEL
,
BasicStroke.JOIN_MITER
,
BasicStroke.JOIN_ROUND
@OpenApi public static java.awt.BasicStroke getStroke(float width, int cap, int join, float miterLimit, @CheckForNull float[] dash, float dash_phase)
BasicStroke.BasicStroke(float, int, int, float, float[], float)