Class DiagramProperties
- java.lang.Object
-
- com.sodius.mdw.metamodel.uml21.io.md.DiagramProperties
-
public class DiagramProperties extends java.lang.Object
Provides a way to manage Diagram Properties.
Diagram Properties are used to control the way the graphical elements are displayed in MagicDraw.
There are several kinds of MagicDraw Diagram Properties:- Boolean Property
- Choice Property
- Color Property
- Font Property
- Number Property
-
-
Constructor Summary
Constructors Constructor Description DiagramProperties()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static DiagramProperty
createBoolean(GraphElement element, java.lang.String propertyID, boolean value)
Creates a MagicDraw Boolean Diagram Propertystatic DiagramProperty
createChoice(GraphElement element, java.lang.String propertyID, java.util.List<java.lang.String> choices, int choice)
Creates a MagicDraw Choice Diagram Property.static DiagramProperty
createChoice(GraphElement element, java.lang.String propertyID, java.util.List<java.lang.String> choices, java.lang.String choice)
Creates a MagicDraw Choice Diagram Property.static DiagramProperty
createColor(GraphElement element, java.lang.String propertyID, float colorValue)
Deprecated.static DiagramProperty
createColor(GraphElement element, java.lang.String propertyID, java.lang.String colorValue)
Creates a MagicDraw Color Diagram Property.static DiagramProperty
createFont(GraphElement element, java.lang.String propertyID, java.lang.String fontName, int size, int style)
Creates a MagicDraw Font Diagram Property.static DiagramProperty
createNumber(GraphElement element, java.lang.String propertyID, java.lang.String value, int lowRange, int highRange)
Creates a MagicDraw Number Diagram Property.static java.util.List<java.lang.String>
getChoices(GraphElement graphElement, java.lang.String propertyID)
Returns a List of Strings corresponding to the possible values of the MagicDraw Choice Property.
The default value is an empty List.static int
getFontSize(GraphElement graphElement)
Returns the size of the MagicDraw Font Diagram Property.static int
getFontStyle(GraphElement graphElement)
Returns the style of the MagicDraw Font Diagram Property.
-
-
-
Method Detail
-
createBoolean
public static DiagramProperty createBoolean(GraphElement element, java.lang.String propertyID, boolean value)
Creates a MagicDraw Boolean Diagram Property- Parameters:
element
- the Graphical ElementpropertyID
- the property keyvalue
- the boolean value to set- Returns:
- a UML Diagram Property
-
createChoice
public static DiagramProperty createChoice(GraphElement element, java.lang.String propertyID, java.util.List<java.lang.String> choices, int choice)
Creates a MagicDraw Choice Diagram Property.- Parameters:
element
- the Graphical ElementpropertyID
- the property keychoices
- the list of possible valueschoice
- the index of the value- Returns:
- a UML Diagram Property
-
createChoice
public static DiagramProperty createChoice(GraphElement element, java.lang.String propertyID, java.util.List<java.lang.String> choices, java.lang.String choice)
Creates a MagicDraw Choice Diagram Property.- Parameters:
element
- the Graphical ElementpropertyID
- the property keychoices
- the list of possible valueschoice
- the value- Returns:
- a UML Diagram Property
-
createColor
public static DiagramProperty createColor(GraphElement element, java.lang.String propertyID, java.lang.String colorValue)
Creates a MagicDraw Color Diagram Property.- Parameters:
element
- the Graphical ElementpropertyID
- the property keycolorValue
- the value of the color- Returns:
- a UML Diagram Property
-
createColor
@Deprecated public static DiagramProperty createColor(GraphElement element, java.lang.String propertyID, float colorValue)
Deprecated.Creates a MagicDraw Color Diagram Property.- Parameters:
element
- the Graphical ElementpropertyID
- the property keycolorValue
- the value of the color- Returns:
- a UML Diagram Property
-
createFont
public static DiagramProperty createFont(GraphElement element, java.lang.String propertyID, java.lang.String fontName, int size, int style)
Creates a MagicDraw Font Diagram Property.- Parameters:
element
- the Graphical ElementpropertyID
- the property keyfontName
- the name of the fontsize
- the size of the fontstyle
- the style of the font- Returns:
- a UML Diagram Property
-
createNumber
public static DiagramProperty createNumber(GraphElement element, java.lang.String propertyID, java.lang.String value, int lowRange, int highRange)
Creates a MagicDraw Number Diagram Property.- Parameters:
element
- the Graphical ElementpropertyID
- the property keyvalue
- the valuelowRange
- the low rangehighRange
- the high range- Returns:
- a UML Diagram Property
-
getFontStyle
public static int getFontStyle(GraphElement graphElement)
Returns the style of the MagicDraw Font Diagram Property. The default value is '0'.- Parameters:
graphElement
- the Graphical Element- Returns:
- the Style value - '0' for 'Plain' - '1' for 'Bold' - '2' for 'Italic' - '3' for 'Italic Bold'
-
getFontSize
public static int getFontSize(GraphElement graphElement)
Returns the size of the MagicDraw Font Diagram Property. The default value is '11'.- Parameters:
graphElement
- the Graphical Element- Returns:
- the Size value
-
getChoices
public static java.util.List<java.lang.String> getChoices(GraphElement graphElement, java.lang.String propertyID)
Returns a List of Strings corresponding to the possible values of the MagicDraw Choice Property.
The default value is an empty List.- Parameters:
graphElement
- the Graphical ElementpropertyID
- the property id- Returns:
- the list of choices separated by '^'
-
-