java.lang.Objectobjectdraw.ObjectDrawObject
objectdraw.ObjectDrawShape
legos.LegoPiece
legos.Legs
public class Legs
A Legs
is a LegoPiece
representing the legs of a lego person. It
has two Leg
subunits.
Constructor Summary | |
---|---|
Legs()
Construct just the waist of a pair of legs, but do not make it appear on any canvas yet. |
|
Legs(Color color)
Construct just the waist of a pair of legs, but do not make it appear on any canvas yet. |
|
Legs(Color color,
DrawingCanvas canvas)
Construct just the waist of a pair of legs, placing it on the given canvas. |
|
Legs(DrawingCanvas canvas)
Construct just the waist of a pair of legs, placing it on the given canvas. |
|
Legs(Leg rightLeg,
Leg leftLeg)
Construct a pair of legs, but do not make them appear on any canvas yet. |
|
Legs(Leg rightLeg,
Leg leftLeg,
Color color)
Construct a pair of legs, but do not make them appear on any canvas yet. |
|
Legs(Leg rightLeg,
Leg leftLeg,
Color color,
DrawingCanvas canvas)
Construct a pair of legs, placing them on the given canvas. |
|
Legs(Leg rightLeg,
Leg leftLeg,
DrawingCanvas canvas)
Construct a pair of legs, placing them on the given canvas. |
Method Summary | |
---|---|
Leg |
getLeftLeg()
Get the left Leg . |
Leg |
getRightLeg()
Get the right Leg . |
void |
setLeftLeg(Leg leg)
Replace the left Leg with a different Leg . |
void |
setRightLeg(Leg leg)
Replace the right Leg with a different Leg . |
Methods inherited from class legos.LegoPiece |
---|
addToCanvas, canAttach, contains, detach, getAttachmentPoint, getCanvas, getColor, getDoubleX, getDoubleY, getLocation, getOwner, getSubunit, getSubunitCount, getX, getY, hide, isHidden, move, moveTo, moveTo, removeFromCanvas, removeSubunit, removeSubunit, sendBackward, sendForward, sendToBack, sendToFront, setColor, setSubunit, show, toString |
Methods inherited from class objectdraw.ObjectDrawShape |
---|
clearCanvas, draw, draw, getDrawables, getShape, makeShape, removeCanvas, setMyShape, update |
Methods inherited from class objectdraw.ObjectDrawObject |
---|
deferUpdates, depend, runUpdates, undepend |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface objectdraw.DrawableInterface |
---|
draw, getShape |
Constructor Detail |
---|
public Legs()
Body
that is already visible on a canvas.
public Legs(Color color)
Body
that is already visible on a canvas.
color
- The color of the waist.public Legs(Color color, DrawingCanvas canvas)
color
- The color of the waist.canvas
- Canvas to place this pair of legs on.public Legs(DrawingCanvas canvas)
canvas
- Canvas to place this pair of legs on.public Legs(Leg rightLeg, Leg leftLeg)
Body
that is already visible on a canvas.
rightLeg
- The right Leg
.leftLeg
- The left Leg
.public Legs(Leg rightLeg, Leg leftLeg, Color color)
Body
that is already visible on a canvas.
rightLeg
- The right Leg
.leftLeg
- The left Leg
.color
- The color of the waist.public Legs(Leg rightLeg, Leg leftLeg, Color color, DrawingCanvas canvas)
rightLeg
- The right Leg
.leftLeg
- The left Leg
.color
- The color of the waist.canvas
- Canvas to place this pair of legs on.public Legs(Leg rightLeg, Leg leftLeg, DrawingCanvas canvas)
rightLeg
- The right Leg
.leftLeg
- The left Leg
.canvas
- Canvas to place this pair of legs on.Method Detail |
---|
public Leg getLeftLeg()
Leg
.
Leg
.public Leg getRightLeg()
Leg
.
Leg
.public void setLeftLeg(Leg leg)
Leg
with a different Leg
.
leg
- new Leg
to replace the old one with.public void setRightLeg(Leg leg)
Leg
with a different Leg
.
leg
- new Leg
to replace the old one with.