|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--Forms.Forms
|
+--Forms.MyCircle
This class construct a new circle.
Forms| Field Summary | |
protected int |
radius
The radius of the circle. |
protected int |
xCenter
The x coord of the center. |
protected int |
yCenter
The y coord of the center. |
| Fields inherited from class Forms.Forms |
rectangle |
| Constructor Summary | |
MyCircle(int xCenter,
int yCenter,
int radius)
The constructor. |
|
| Method Summary | |
void |
drawCircle(int[] pixels,
int width,
int height,
Color color)
This method draw a circle in a array of pixels. |
void |
drawCircleWithTexture(int[] pixels,
int width,
int height,
Texture texture)
We draw the circle with a texture. |
boolean |
isSelected(int x,
int y)
This method tell if the forms is selected or not with the specified point. |
void |
optimizeDrawing(AnimatedImage animatedImage)
This method optimize the drawing of the circle on a animatedImage in drawing only the bounding rectangle of the circle. |
int |
radius()
This method return the radius of the circle. |
void |
radius(int radius)
This method assign the radius of the circle at a new value. |
protected int |
returnC(int var,
int p,
int q,
int r)
This method find the c value of the equation: (x-p)**2 + (var-q)**2 == r**2. |
protected int[] |
returnSolutions(int a,
int b,
int delta)
This method returns the solutions of a second degree equation. |
protected int |
solveDelta(int a,
int b,
int c)
This method solves the delta equation (bƒ-4ac). |
void |
translate(int x,
int y,
int maxWidth,
int maxHeight)
Translation of the circle to a new point. |
int |
xCenter()
This method return the x coordinate of the center of the circle. |
void |
xCenter(int xCenter)
This method assign the x coordinate of the center to a new value. |
int |
yCenter()
This method return the y coordinate of the center of the circle. |
void |
yCenter(int yCenter)
This method assign the y coordinate of the center to a new value. |
| Methods inherited from class Forms.Forms |
height,
height,
rectangle,
width,
width,
xOrigin,
xOrigin,
yOrigin,
yOrigin |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected int radius
protected int xCenter
protected int yCenter
| Constructor Detail |
public MyCircle(int xCenter,
int yCenter,
int radius)
xCenter - The x coordinate of the center of the circle.yCenter - The y coordinate of the center of the circle.radius - The radius of the circle.| Method Detail |
public int xCenter()
public void xCenter(int xCenter)
xCenter - The new x coordinate for the center.public int yCenter()
public void yCenter(int yCenter)
yCenter - The new y coordinate for the center.public int radius()
public void radius(int radius)
radius - The new value for the radius.
public void drawCircle(int[] pixels,
int width,
int height,
Color color)
pixels - The array of pixels we want to draw the circle.width - The width of the array of pixels.height - The height of the array of pixels.color - The color the circle is painted.
public void drawCircleWithTexture(int[] pixels,
int width,
int height,
Texture texture)
throws TextureError
pixels - The array of pixels we want to draw the circle.width - The width of the array of pixels.height - The height of the array of pixels.texture - The texture for the circle.public void optimizeDrawing(AnimatedImage animatedImage)
animatedImage - The animatedImage on which the circle must be drawn.
public void translate(int x,
int y,
int maxWidth,
int maxHeight)
x - The x coordinate the center of the circle must be translated.y - The y coordinate the center of the circle must be translated.maxWidth - The maximum width the circle must be translated. This prevent the circle from going out of the the animatedImage.maxHeight - The maximum height the circle must be translated. This prevent the circle from going out of the the animatedImage.
public boolean isSelected(int x,
int y)
x - The x coordinate of the point.y - The y coordinate of the point.
protected int returnC(int var,
int p,
int q,
int r)
var - The variable in the upper equation.p - The x center coordinate of the circle.q - The y center coordinate of the circle.r - The radius of the circle.
protected int solveDelta(int a,
int b,
int c)
a - The a in the upper equation.b - The b in the upper equation.c - The c in the upper equation.
protected int[] returnSolutions(int a,
int b,
int delta)
a - The a value in a second degree equation.b - The b value in a second degree equation.delta - The delta value in a second degree equation. It can be found with the upper methods.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||