|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.byu.phun2d.DrawObj
public class DrawObj
This is the superclass of every object that can be drawn. This super class allows any of its subclasses to be added to a Win2D or to a Group. The result is that structures of drawings can be built with arbitrary complexity.
This class also manages the line color, line width and fill color for all of its subclasses.
| Constructor Summary | |
|---|---|
DrawObj()
|
|
| Method Summary | |
|---|---|
Color |
getFillColor()
Returns the color being used to fill this object. |
Color |
getLineColor()
Returns the color being used to draw the border on this object. |
double |
getLineWidth()
The width of the line/border. |
double |
getRotate()
Returns the rotation angle |
double |
getScaleX()
Get the X scale factor |
double |
getScaleY()
Get the Y scale factor |
Point |
getTranslate()
Returns the point to where the origin (0,0) has been translated |
Point |
insideToOutside(Point outsidePoint)
|
Point |
outsideToInside(Point outsidePoint)
|
void |
setFillColor(Color c)
Changes the fill color of this object. |
void |
setLineColor(Color c)
Changes the border or line color of this object. |
void |
setLineWidth(double width)
Changes the width of the line or border of this object. |
void |
setRotate(double angle)
This will rotate the object around the point (0,0) regardless of where the center of the object is. |
void |
setScale(double scaleX,
double scaleY)
This will change the size of the object. |
void |
setTranslate(double x,
double y)
This will move the origin (0,0) to location (x,y) |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DrawObj()
| Method Detail |
|---|
public void setFillColor(Color c)
c - the new fill color.public Color getFillColor()
public void setLineColor(Color c)
c - the new line/border color.public Color getLineColor()
public void setLineWidth(double width)
width - the new line width.public double getLineWidth()
public void setScale(double scaleX,
double scaleY)
Scaling is performed relative to the point (0,0) regardless of where center of the object is.
scaleX - the scale factor to be applied in the X direction.scaleY - the scale factor to be applied in the Y direction.public double getScaleX()
public double getScaleY()
public void setTranslate(double x,
double y)
x - the X coordinate of the new locationy - the Y coordinate of the new locationpublic Point getTranslate()
public void setRotate(double angle)
angle - this is the counterclockwise angle in degrees that
the object is to rotate.public double getRotate()
public Point insideToOutside(Point outsidePoint)
public Point outsideToInside(Point outsidePoint)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||