Class JDTitledRect


public class JDTitledRect extends JDRectangular
JDraw Title rectangle graphic object.
  • Constructor Details

    • JDTitledRect

      public JDTitledRect(String objectName, String title, int x, int y)
      Construct a JDTitledRect.
      Parameters:
      objectName - Object name
      title - Title
      x - Up left corner x coordinate
      y - Up left corner y coordinate
  • Method Details

    • copy

      public JDTitledRect copy(int x, int y)
      Description copied from class: JDObject
      Returns a copy of this object at the specified location.
      Specified by:
      copy in class JDObject
      Parameters:
      x - Horizontal position of the copied object (pixel)
      y - Vertical Position of the copied object (pixel)
      Returns:
      The copy of this object.
    • paint

      public void paint(JDrawEditor parent, Graphics g)
      Description copied from class: JDObject
      Paints this object.
      Overrides:
      paint in class JDRectangular
      Parameters:
      parent - JdrawEditor parent (Can be null except for JDSwingObject)
      g - the specified Graphics window
    • isInsideObject

      public boolean isInsideObject(int x, int y)
      Overrides:
      isInsideObject in class JDObject
      Parameters:
      x - X coordinate (pixel)
      y - Y coordinate (pixel)
      Returns:
      whether the specified point is inside this object.
    • setFont

      public void setFont(Font f)
      Sets the font of this label and resize it if needed and specified.
      Parameters:
      f - Font
    • getFont

      public Font getFont()
      Returns:
      the current font of this label.
    • setTitle

      public void setTitle(String s)
      Sets the title of this titled rectangle.
      Parameters:
      s - Title
    • getTitle

      public String getTitle()
      Returns:
      the current label text.
    • setColor1

      public void setColor1(Color c)
      Sets the line color
      Parameters:
      c - Line color
    • getColor1

      public Color getColor1()
      Returns:
      the line color
    • setColor2

      public void setColor2(Color c)
      Sets the line color
      Parameters:
      c - Line color
    • getColor2

      public Color getColor2()
      Returns:
      the line color
    • hasEtchedBorder

      public boolean hasEtchedBorder()
      Returns:
      true if etched border is enabled
    • setEtchedBorder

      public void setEtchedBorder(boolean b)
      Sets the etched border.
      Parameters:
      b - Etched border