Class MNameTextBox

All Implemented Interfaces:
Serializable, Cloneable

@PublicApi public class MNameTextBox extends MTextBox
Name Text box object to display IUPAC name.
Since:
Marvin 5.0, 03/22/2007
See Also:
  • Constructor Details

    • MNameTextBox

      protected MNameTextBox(MNameTextBox t)
      Copy constructor.
      Parameters:
      t - the original text box
    • MNameTextBox

      public MNameTextBox()
      Constructs an empty name text box.
  • Method Details

    • clone

      public MNameTextBox clone()
      Description copied from class: MObject
      Creates a clone.
      Overrides:
      clone in class MTextBox
      Returns:
      the clone
    • isEditable

      public boolean isEditable()
      Description copied from class: MTextBox
      Determines if this text box's content can be edited by the user.
      Overrides:
      isEditable in class MTextBox
      Returns:
      true if the content can be edited, false otherwise
    • calcWidth

      public double calcWidth(Graphics2D g)
      Calculates the width of the string in the name text box.
      Parameters:
      g - the graphics context
      Returns:
      the width of the string in the name box.
    • setCurrentWidth

      public void setCurrentWidth(double w)
      Sets the current height of the text..
      Overrides:
      setCurrentWidth in class MTextBox
      Parameters:
      w - the width
    • setAutoHeight

      public void setAutoHeight(boolean v)
      Turns on/off automatic height calculation.
      Overrides:
      setAutoHeight in class MTextBox
      Parameters:
      v - turn on (true) or off (false)
      Since:
      Marvin 5.0, 03/22/2007
    • setText

      public void setText(String s)
      Sets the text.
      Overrides:
      setText in class MTextBox
      Parameters:
      s - the text
      Since:
      Marvin 5.0, 03/23/2007
    • getGrinv

      public long getGrinv()
      Gets an invariant the text box depends on.
      Returns:
      the invariant value
      Since:
      Marvin 5.0, 03/22/2007
    • setGrinv

      public void setGrinv(long grinv)
      Sets the invariant the text box depends on.
      Parameters:
      grinv - the invariant value
      Since:
      Marvin 5.0, 03/22/2007
    • isAutoResize

      public boolean isAutoResize()
      Returns if the text-box is in automatic resize mode.
      Returns:
      true if in automatic resize mode
    • setAutoResize

      public void setAutoResize(boolean autoResize)
      Sets the resizing behavior of the text-box.
      Parameters:
      autoResize - if set true then the behavior is automatic resize.
    • isAutoAlign

      public boolean isAutoAlign()
      Returns if the text-box is in automatic alignment mode.
      Returns:
      true if in automatic alignment mode
    • setAutoAlign

      public void setAutoAlign(boolean autoAlign)
      Sets the alignment behavior of the text-box.
      Parameters:
      autoAlign - if set true then the behavior is automatic alignment.
    • getPreferredWidth

      public double getPreferredWidth()
      Gets the preferred width of the text-box.
      Returns:
      the preferred width
    • setPreferredWidth

      public void setPreferredWidth(double preferredWidth)
      Sets the preferred width of the text-box.
      Parameters:
      preferredWidth - the preferred width
    • transform

      public void transform(CTransform3D t, int opts, CTransform3D trot)
      Transforms all points, scales the arrow head widths and lengths.
      Overrides:
      transform in class MTextBox
      Parameters:
      t - the transformation matrix
      opts - transform options or 0
      trot - the viewing transformation or null
      See Also:
    • setPoints

      public void setPoints(MPoint[] p)
      Sets the points.
      Overrides:
      setPoints in class MTextBox
      Parameters:
      p - the points
    • addAttributeKeys

      public void addAttributeKeys(List<String> l)
      Adds the attribute names to the specified list. CDATA attributes are not added.
      Overrides:
      addAttributeKeys in class MTextBox
      Parameters:
      l - the list
    • getAttribute

      public String getAttribute(String s)
      Gets the value of an attribute.
      Supported attributes:
      • autoResize: resizing mode of the text box
      • autoAlign: aligning mode of the text box
      • preferredWidth: preferred width of the text box
      Overrides:
      getAttribute in class MTextBox
      Parameters:
      s - the attribute name
      Returns:
      the value or null
    • setAttribute

      public void setAttribute(String s, String v)
      Sets the value of an attribute.
      Supported attributes:
      • autoResize: resizing mode of the text box
      • autoAlign: aligning mode of the text box
      • preferredWidth: preferred width of the text box
      Overrides:
      setAttribute in class MTextBox
      Parameters:
      s - the attribute name
      v - the attribute value
    • getPreBreakingChars

      public String getPreBreakingChars()
      Gets the breaking characters before that the text in the text box can be broken if it doesn't fit into the text box.
      Overrides:
      getPreBreakingChars in class MTextBox
      Returns:
      the string that contains the breaking characters.
    • getBreakingChars

      public String getBreakingChars()
      Gets the breaking characters after that the text in the text box can be broken if it doesn't fit into the text box.
      Overrides:
      getBreakingChars in class MTextBox
      Returns:
      the string that contains the breaking characters.