|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.umd.cs.piccolo.PNode
edu.umd.cs.piccolox.nodes.P3DRect
public class P3DRect
This is a simple node that draws a "3D" rectangle within the bounds of the node. Drawing a 3D rectangle in a zooming environment is a little tricky because if you just use the regular (Java2D) 3D rectangle, the 3D borders get scaled, and that is ugly. This version always draws the 3D border at fixed 2 pixel width.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class edu.umd.cs.piccolo.PNode |
|---|
PNode.PSceneGraphDelegate |
| Field Summary |
|---|
| Fields inherited from interface java.awt.print.Printable |
|---|
NO_SUCH_PAGE, PAGE_EXISTS |
| Constructor Summary | |
|---|---|
P3DRect()
Constructs a simple P3DRect with empty bounds and a black stroke. |
|
P3DRect(double x,
double y,
double width,
double height)
Constructs a P3DRect with the bounds provided. |
|
P3DRect(Rectangle2D bounds)
Constructs a P3DRect with the provided bounds. |
|
| Method Summary | |
|---|---|
boolean |
getRaised()
Returns whether this P3DRect is drawn as raised. |
static void |
main(String[] args)
Deprecated. since it has been moved to P3DRectExample. |
protected void |
paint(PPaintContext paintContext)
Paints this rectangle with shaded edges. |
void |
setPaint(Paint newPaint)
Changes the paint that will be used to draw this rectangle. |
void |
setRaised(boolean raised)
Sets whether this rectangle is raised off the canvas. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public P3DRect()
public P3DRect(Rectangle2D bounds)
bounds - bounds to assigned to the P3DRect
public P3DRect(double x,
double y,
double width,
double height)
x - left of boundsy - top of boundswidth - width of boundsheight - height of bounds| Method Detail |
|---|
public void setRaised(boolean raised)
raised - whether the rectangle should be painted as raised or
recessedpublic boolean getRaised()
protected void paint(PPaintContext paintContext)
paint in class PNodepaintContext - context in which the paiting should occurpublic void setPaint(Paint newPaint)
setPaint in class PNodenewPaint - the color to use for painting this rectanglepublic static void main(String[] args)
args - Command line arguments
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||