legos
Class Arm

java.lang.Object
  extended by objectdraw.ObjectDrawObject
      extended by objectdraw.ObjectDrawShape
          extended by legos.LegoPiece
              extended by legos.Arm
All Implemented Interfaces:
Dependent, DrawableInterface, LocatableInterface

public class Arm
extends LegoPiece

An Arm is a LegoPiece representing the arm of a lego person. It has a single subunit, a Hand.

Author:
Russell Zahniser (russell@zahniser.net)

Constructor Summary
Arm()
          Construct a handless arm, but do not make it appear on any canvas yet.
Arm(Color color)
          Construct a handless arm, but do not make it appear on any canvas yet.
Arm(Color color, DrawingCanvas canvas)
          Construct a handless arm, placing it on the given canvas.
Arm(DrawingCanvas canvas)
          Construct a handless arm, placing it on the given canvas.
Arm(Hand hand)
          Construct an arm, but do not make it appear on any canvas yet.
Arm(Hand hand, Color color)
          Construct an arm, but do not make it appear on any canvas yet.
Arm(Hand hand, Color color, DrawingCanvas canvas)
          Construct an arm, placing it on the given canvas.
Arm(Hand hand, DrawingCanvas canvas)
          Construct an arm, placing it on the given canvas.
 
Method Summary
 Hand getHand()
          Get the Hand.
 void setHand(Hand hand)
          Replace the Hand with a different Hand.
 
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

Arm

public Arm()
Construct a handless arm, but do not make it appear on any canvas yet. The sleeve will be colored red. You can make it appear by adding it to a canvas, or setting it as an arm of of a Body that is already visible on a canvas.


Arm

public Arm(Color color)
Construct a handless arm, but do not make it appear on any canvas yet. You can make it appear by adding it to a canvas, or setting it as an arm of of a Body that is already visible on a canvas.

Parameters:
color - The color of the sleeve.

Arm

public Arm(Color color,
           DrawingCanvas canvas)
Construct a handless arm, placing it on the given canvas.

Parameters:
color - The color of the sleeve.
canvas - Canvas to place this arm on.

Arm

public Arm(DrawingCanvas canvas)
Construct a handless arm, placing it on the given canvas. The sleeve will be colored red.

Parameters:
canvas - Canvas to place this arm on.

Arm

public Arm(Hand hand)
Construct an arm, but do not make it appear on any canvas yet. The sleeve will be colored red. You can make it appear by adding it to a canvas, or setting it as an arm of of a Body that is already visible on a canvas.

Parameters:
hand - The Hand.

Arm

public Arm(Hand hand,
           Color color)
Construct an arm, but do not make it appear on any canvas yet. You can make it appear by adding it to a canvas, or setting it as an arm of of a Body that is already visible on a canvas.

Parameters:
hand - The Hand.
color - The color of the sleeve.

Arm

public Arm(Hand hand,
           Color color,
           DrawingCanvas canvas)
Construct an arm, placing it on the given canvas.

Parameters:
hand - The Hand.
color - The color of the sleeve.
canvas - Canvas to place this arm on.

Arm

public Arm(Hand hand,
           DrawingCanvas canvas)
Construct an arm, placing it on the given canvas. The sleeve will be colored red.

Parameters:
hand - The Hand.
canvas - Canvas to place this arm on.
Method Detail

getHand

public Hand getHand()
Get the Hand.

Returns:
the Hand.

setHand

public void setHand(Hand hand)
Replace the Hand with a different Hand.

Parameters:
hand - new Hand to replace the old one with.