legos
Class Legs

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

public class Legs
extends LegoPiece

A Legs is a LegoPiece representing the legs of a lego person. It has two Leg subunits.

Author:
Russell Zahniser (russell@zahniser.net)

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

Legs

public Legs()
Construct just the waist of a pair of legs, but do not make it appear on any canvas yet. It will be colored blue. You can make it appear by adding it to a canvas, or setting it as the legs of a Body that is already visible on a canvas.


Legs

public Legs(Color color)
Construct just the waist of a pair of legs, 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 the legs of a Body that is already visible on a canvas.

Parameters:
color - The color of the waist.

Legs

public Legs(Color color,
            DrawingCanvas canvas)
Construct just the waist of a pair of legs, placing it on the given canvas.

Parameters:
color - The color of the waist.
canvas - Canvas to place this pair of legs on.

Legs

public Legs(DrawingCanvas canvas)
Construct just the waist of a pair of legs, placing it on the given canvas. It will be colored blue.

Parameters:
canvas - Canvas to place this pair of legs on.

Legs

public Legs(Leg rightLeg,
            Leg leftLeg)
Construct a pair of legs, but do not make them appear on any canvas yet. The waist will be colored blue. You can make it appear by adding it to a canvas, or setting it as the legs of a Body that is already visible on a canvas.

Parameters:
rightLeg - The right Leg.
leftLeg - The left Leg.

Legs

public Legs(Leg rightLeg,
            Leg leftLeg,
            Color color)
Construct a pair of legs, but do not make them appear on any canvas yet. You can make it appear by adding it to a canvas, or setting it as the legs of a Body that is already visible on a canvas.

Parameters:
rightLeg - The right Leg.
leftLeg - The left Leg.
color - The color of the waist.

Legs

public Legs(Leg rightLeg,
            Leg leftLeg,
            Color color,
            DrawingCanvas canvas)
Construct a pair of legs, placing them on the given canvas.

Parameters:
rightLeg - The right Leg.
leftLeg - The left Leg.
color - The color of the waist.
canvas - Canvas to place this pair of legs on.

Legs

public Legs(Leg rightLeg,
            Leg leftLeg,
            DrawingCanvas canvas)
Construct a pair of legs, placing them on the given canvas. The waist will be blue.

Parameters:
rightLeg - The right Leg.
leftLeg - The left Leg.
canvas - Canvas to place this pair of legs on.
Method Detail

getLeftLeg

public Leg getLeftLeg()
Get the left Leg.

Returns:
the left Leg.

getRightLeg

public Leg getRightLeg()
Get the right Leg.

Returns:
the right Leg.

setLeftLeg

public void setLeftLeg(Leg leg)
Replace the left Leg with a different Leg.

Parameters:
leg - new Leg to replace the old one with.

setRightLeg

public void setRightLeg(Leg leg)
Replace the right Leg with a different Leg.

Parameters:
leg - new Leg to replace the old one with.