Package breadboards
Class GOval
- java.lang.Object
-
- breadboards.GObject
-
- breadboards.GOval
-
-
Constructor Summary
Constructors Constructor Description GOval(double width, double height)constructs a GOval with specified width and height with upper left corner at (0,0)GOval(double x, double y, double width, double height)constructs a GOval with a specified width and height at a specified location
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(double x, double y)returns true if (x,y) is inside this GRectvoiddraw(java.awt.Graphics g)draws the GOval (generally not called directly)GRectanglegetBounds()returns the bounding rectangle for this GOvaljava.awt.ColorgetColor()returns the border color of this GOvaljava.awt.ColorgetFillColor()returns the fill color for this GOvaldoublegetHeight()returns the height of this GOvaldoublegetWidth()returns the width of this GOvalbooleanisFilled()returns whether or not this GOval should be displayed with an opaque interiorvoidscale(double sf)scale this GOval by a factor of sfvoidscale(double sx, double sy)scale the width of the GOval by a factor of sx and the height of the GOval by a factor of syvoidsetBounds(double x, double y, double width, double height)set the width, height, and location of the GOval to the specified valuesvoidsetBounds(GRectangle bounds)set the width, height, and location of the GOval to those associated with the specified bounding rectanglevoidsetColor(java.awt.Color color)sets the border color of the GOval to the specified colorvoidsetFillColor(java.awt.Color fillColor)set the fill color for the opaque interior to the specified colorvoidsetFilled(boolean isFilled)this must be called for the GOval to show an opaque interiorvoidsetSize(double width, double height)set the width and height of the GOval to the specified values-
Methods inherited from class breadboards.GObject
addMouseListener, addMouseMotionListener, getBreadboard, getLocation, getMouseListeners, getMouseMotionListeners, getParent, getX, getY, isVisible, move, movePolar, removeMouseListener, removeMouseMotionListener, sendBackward, sendForward, sendToBack, sendToFront, setLocation, setParent, setVisible, setX, setY, updateBreadboard
-
-
-
-
Constructor Detail
-
GOval
public GOval(double width, double height)constructs a GOval with specified width and height with upper left corner at (0,0)- Parameters:
width- the specified widthheight- the specified height
-
GOval
public GOval(double x, double y, double width, double height)constructs a GOval with a specified width and height at a specified location- Parameters:
x- the x-coordinate of the upper left corner of the GOvaly- the y-coordinate of the upper left corner of the GOvalwidth- the specified widthheight- the specified height
-
-
Method Detail
-
getBounds
public GRectangle getBounds()
returns the bounding rectangle for this GOval
-
getColor
public java.awt.Color getColor()
returns the border color of this GOval- Returns:
- the border color of this GOval
-
getFillColor
public java.awt.Color getFillColor()
returns the fill color for this GOval- Returns:
- the fill color for this GOval
-
getHeight
public double getHeight()
returns the height of this GOval- Returns:
- the height of this GOval
-
getWidth
public double getWidth()
returns the width of this GOval- Returns:
- the width of this GOval
-
isFilled
public boolean isFilled()
returns whether or not this GOval should be displayed with an opaque interior- Returns:
- true if an opaque interior should be used, false otherwise
-
setColor
public void setColor(java.awt.Color color)
sets the border color of the GOval to the specified color- Parameters:
color- the specified color
-
setFilled
public void setFilled(boolean isFilled)
this must be called for the GOval to show an opaque interior- Parameters:
isFilled- true if an opaque interior is to be displayed, false otherwise
-
setFillColor
public void setFillColor(java.awt.Color fillColor)
set the fill color for the opaque interior to the specified color- Parameters:
fillColor- the specified color
-
setSize
public void setSize(double width, double height)set the width and height of the GOval to the specified values- Parameters:
width- the specified widthheight- the specified height
-
setBounds
public void setBounds(double x, double y, double width, double height)set the width, height, and location of the GOval to the specified values- Parameters:
x- x-coordinate of the upper left corner of the GOvaly- y-coordinate of the upper left corner of the GOvalwidth- width the specified widthheight- height the specified height
-
setBounds
public void setBounds(GRectangle bounds)
set the width, height, and location of the GOval to those associated with the specified bounding rectangle- Parameters:
bounds- a bounding rectangle for the GOval with the same dimensions and location
-
scale
public void scale(double sx, double sy)scale the width of the GOval by a factor of sx and the height of the GOval by a factor of sy- Parameters:
sx- the horizontal scaling factorsy- the vertical scaling factor
-
scale
public void scale(double sf)
scale this GOval by a factor of sf- Parameters:
sf- the scaling factor
-
draw
public void draw(java.awt.Graphics g)
draws the GOval (generally not called directly)
-
contains
public boolean contains(double x, double y)returns true if (x,y) is inside this GRect
-
-