Class RepresentationTextParams

java.lang.Object
com.nomagic.magicdraw.uml.RepresentationTextParams
All Implemented Interfaces:
Cloneable

@OpenApiAll public final class RepresentationTextParams extends Object implements Cloneable
Configuration for getting element's text from RepresentationTextCreator
  • Constructor Details

    • RepresentationTextParams

      public RepresentationTextParams()
      Constructor
  • Method Details

    • createByEnvironmentOptions

      public static RepresentationTextParams createByEnvironmentOptions()
      Creates new instance of representation params and sets fields depending on EnvironmentOptions. Only isShowFullType() value is affected.
      Returns:
      new text params instance pre-configured by environment options
    • createByOptions

      public static RepresentationTextParams createByOptions(Project project)
      Creates new instance of representation params and sets fields depending on both Environment and Project options. isShowFullType() and isShowElementNumber() values are affected.
      Returns:
      new text params instance pre-configured by environment and project options
    • setAddColor

      public RepresentationTextParams setAddColor(boolean addColor)
      Parameters:
      addColor - if true, color information will be added to the text
    • isAddColor

      public boolean isAddColor()
      Defines if color information should be added to the representation text. Default is false. Color information should be added when rendering colored text in UI.
      Returns:
      true if color information should be added
    • isForceShowTypeName

      public boolean isForceShowTypeName()
      Defines if element auto numbers (IDs) should be included to the representation text. Default is false.
      Returns:
      true if element auto numbers (IDs) should be included
    • setForceShowTypeName

      public RepresentationTextParams setForceShowTypeName(boolean forceShowTypeName)
      Parameters:
      forceShowTypeName - true if element need to show type name if it's name is empty
    • isShowElementNumber

      public boolean isShowElementNumber()
      Defines if element auto numbers (IDs) should be included to the representation text. Default is false.
      Returns:
      true if element auto numbers (IDs) should be included
    • setShowElementNumber

      public RepresentationTextParams setShowElementNumber(boolean showElementNumber)
      Parameters:
      showElementNumber - true if element auto numbers (IDs) should be included
    • setShowFullType

      public RepresentationTextParams setShowFullType(boolean showFullType)
      Parameters:
      showFullType - if Type of TypedElement should be represented by full qualified name. Also affects text of relationship end elements.
    • getMaxTextLength

      public int getMaxTextLength()
      Returns:
      max text length.
    • setMaxTextLength

      public RepresentationTextParams setMaxTextLength(int maxTextLength)
      Set max expected text length. There is no guarantee this option will be respected by RepresentationTextCreator
      Parameters:
      maxTextLength - max text length.
    • setAddHumanType

      public RepresentationTextParams setAddHumanType(boolean addHumanType)
      Set to add human type to name
      Parameters:
      addHumanType - flag to indicate if we add or not humann type to text (default is true)
    • isAddHumanType

      public boolean isAddHumanType()
      Checks if we need to add human type to name
      Returns:
      true if we need to add, else false
    • isShowFullType

      public boolean isShowFullType()
      Defines how text of some elements should be constructed. Affects Type text for TypedElement and end element text for Relationship elements. Default value is false.
      Returns:
      true if specific elements will be represented by full qualified name, false if name will be used
    • setLocationInTool

      public RepresentationTextParams setLocationInTool(LocationInTool locationInTool)
      Parameters:
      locationInTool - describes GUI location for which text is being created
      See Also:
    • getLocationInTool

      public LocationInTool getLocationInTool()
      Invocation information. See LocationInTool. Default is LocationInTool.unknown
      Returns:
      location in tool
    • isShowPrefix

      public boolean isShowPrefix()
      Returns:
      true if prefix should be added
    • setShowPrefix

      public RepresentationTextParams setShowPrefix(boolean showPrefix)
      Set to show or hide prefix
      Parameters:
      showPrefix - false if prefix should not be added
    • isShowPostfix

      public boolean isShowPostfix()
      Returns:
      true if postfix should be added
    • setShowPostfix

      public RepresentationTextParams setShowPostfix(boolean showPostfix)
      Set to show or hide prefix
      Parameters:
      showPostfix - false if postfix should not be added
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public RepresentationTextParams clone()
      Overrides:
      clone in class Object