Class 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 Detail

      • DiagramProperties

        public DiagramProperties()
    • 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 Element
        propertyID - the property key
        value - 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 Element
        propertyID - the property key
        choices - the list of possible values
        choice - 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 Element
        propertyID - the property key
        choices - the list of possible values
        choice - 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 Element
        propertyID - the property key
        colorValue - 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 Element
        propertyID - the property key
        colorValue - 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 Element
        propertyID - the property key
        fontName - the name of the font
        size - the size of the font
        style - 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 Element
        propertyID - the property key
        value - the value
        lowRange - the low range
        highRange - 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 Element
        propertyID - the property id
        Returns:
        the list of choices separated by '^'