Class DiagramProperties


  • public class DiagramProperties
    extends 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,
                                                    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,
                                                   String propertyID,
                                                   List<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,
                                                   String propertyID,
                                                   List<String> choices,
                                                   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,
                                                  String propertyID,
                                                  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,
                                                  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,
                                                 String propertyID,
                                                 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,
                                                   String propertyID,
                                                   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 List<String> getChoices​(GraphElement graphElement,
                                              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 '^'