java.lang.Objectobjectdraw.ObjectDrawObject
objectdraw.ObjectDrawShape
legos.LegoPiece
legos.Body
public class Body
A Body
is a LegoPiece
representing the body of a lego person. It
has four subunits:
Head
Legs
Arm
Arm
Constructor Summary | |
---|---|
Body(Color color,
DrawingCanvas canvas)
Construct just the torso of a lego person, placing it on the given canvas. |
|
Body(DrawingCanvas canvas)
Construct just the torso of a lego person, placing it on the given canvas. |
|
Body(Head head,
Legs legs,
Arm rightArm,
Arm leftArm,
Color color,
DrawingCanvas canvas)
Construct a lego person, placing it on the given canvas. |
|
Body(Head head,
Legs legs,
Arm rightArm,
Arm leftArm,
DrawingCanvas canvas)
Construct a lego person, placing it on the given canvas. |
Method Summary | |
---|---|
Head |
getHead()
Return the Head . |
Arm |
getLeftArm()
Return the left Arm . |
Legs |
getLegs()
Return the Head . |
Arm |
getRightArm()
Return the right Arm . |
void |
setHead(Head head)
Replace the Head with a different Head . |
void |
setLeftArm(Arm arm)
Replace the left Arm with a different Arm . |
void |
setLegs(Legs legs)
Replace the Legs with a different Legs . |
void |
setRightArm(Arm arm)
Replace the right Arm with a different Arm . |
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 Body(Color color, DrawingCanvas canvas)
color
- the color of the torso.canvas
- the canvas to add this person to.public Body(DrawingCanvas canvas)
canvas
- the canvas to add this person to.public Body(Head head, Legs legs, Arm rightArm, Arm leftArm, Color color, DrawingCanvas canvas)
head
- the person's Head
.legs
- the person's Legs
.rightArm
- the person's right Arm
.leftArm
- the person's left Arm
.color
- the color of the person's torso.canvas
- the canvas to add this person to.public Body(Head head, Legs legs, Arm rightArm, Arm leftArm, DrawingCanvas canvas)
head
- the person's Head
.legs
- the person's Legs
.rightArm
- the person's right Arm
.leftArm
- the person's left Arm
.canvas
- the canvas to add this person to.Method Detail |
---|
public Head getHead()
Head
.
Head
.public Arm getLeftArm()
Arm
.
Arm
.public Legs getLegs()
Head
.
Head
.public Arm getRightArm()
Arm
.
Arm
.public void setHead(Head head)
Head
with a different Head
.
head
- new Head
to replace the old one with.public void setLeftArm(Arm arm)
Arm
with a different Arm
.
arm
- new Arm
to replace the old one with.public void setLegs(Legs legs)
Legs
with a different Legs
.
legs
- new Legs
to replace the old one with.public void setRightArm(Arm arm)
Arm
with a different Arm
.
arm
- new Arm
to replace the old one with.