Class JDEllipse


public class JDEllipse extends JDRectangular
JDraw Ellipse graphic object.
  • Field Details

  • Constructor Details

    • JDEllipse

      public JDEllipse(String objectName, int x, int y, int w, int h)
      Construct a JDEllipse.
      Parameters:
      objectName - Object name
      x - Up left corner x coordinate
      y - Up left corner y coordinate
      w - Ellipse width
      h - Ellipse height
  • Method Details

    • copy

      public JDObject 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.
    • 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.
    • convertToPolyline

      public JDPolyline convertToPolyline()
    • rotate90

      public void rotate90(double x, double y)
      Description copied from class: JDObject
      Rotate the object by 90deg. A call to refresh() is needed after transformation.
      Overrides:
      rotate90 in class JDRectangular
      Parameters:
      x - Rotation center horizontal pos
      y - Rotation center vertical pos
      See Also:
    • restoreTransform

      public void restoreTransform()
      Description copied from class: JDObject
      Restore original shape previously backuped by saveTransform
      Overrides:
      restoreTransform in class JDObject
      See Also:
    • saveTransform

      public void saveTransform()
      Description copied from class: JDObject
      Backup the shape. This can be usefull when making scaling animation, after multiple scale the rounding may result in deformed shape. To avoid this you can use saveTransform() and restoreTransform(). Note: This is done once when JDrawEditor.loadFile() is called().
      Overrides:
      saveTransform in class JDObject
      See Also:
    • setStep

      public void setStep(int s)
      Sets the interpolation step of this ellispe.
      Parameters:
      s - Interpolation step (Default is 10)
    • getStep

      public int getStep()
      Returns:
      the interpolation step.
      See Also:
    • setArcType

      public void setArcType(int type)
      Sets the arc type for this ellipse.
      Parameters:
      type - Arc type
      See Also:
    • getArcType

      public int getArcType()
      Returns:
      the current arc type.
      See Also:
    • setAngleStart

      public void setAngleStart(int a)
      Sets the starting angle of the arc.
      Parameters:
      a - Angle in degrees.
    • getAngleStart

      public int getAngleStart()
      Returns:
      the starting angle of the arc.
      See Also:
    • setAngleExtent

      public void setAngleExtent(int a)
      Sets the arc angle extent.
      Parameters:
      a - Angle extent in degrees.
    • getAngleExtent

      public int getAngleExtent()
      Returns:
      the arc angle extent.
      See Also:
    • 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