|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--GP.Graphics.Shape
| Field Summary | |
static int |
ourNumShapes
|
| Constructor Summary | |
Shape()
default size 50x50, default color black, default position 0,0, default oritentation 0 degrees, default visible |
|
Shape(Container container,
Drawer drawer)
|
|
Shape(Shape shape)
Create a copy of the current shape. |
|
| Method Summary | |
void |
Act()
This method is automatically called when the user clicks (presses and releases the mouse button) inside the object. |
void |
AddBehavior(Behavior behavior)
This method can be used to add a new behavioral object to this object. |
void |
ApplyBehaviors(double time)
|
void |
ApplyInstincts(double time)
|
abstract Graphic |
Copy()
|
void |
DeSelect()
|
boolean |
equals(java.lang.Object other)
|
void |
Fill()
|
void |
Frame()
|
GP.Containers.Applet |
GetApplet()
|
Size |
GetBoxBoundedSize()
|
Color |
GetColor()
This method should return the current color of the object |
Container |
GetContainer()
This method should return the graphical container of the object. |
double |
GetCurrentTime()
This method should get the object's current time |
GP.Drawers.FillStyle |
GetFillStyle()
|
Orientation |
GetOrientation()
This method should return the current orientation of the object. |
Position |
GetPivot()
|
Position |
GetPosition()
This method should return the current position of the object. |
Size |
GetSize()
This method should return the current size of the object. |
void |
Hide()
Hide the graphical object so that it is no longer visible on the screen. |
boolean |
IsPositionInside(Position toTest)
This methods should determine whether the position passed into it is inside the graphical boundries of the object, and return the result of that calculation. |
boolean |
IsVisible()
This method should determine if the object is in a visible state, and return the result of that determination. |
void |
Move(double xChange,
double yChange)
|
void |
Move(Value xChange,
Value yChange)
|
void |
Move(Velocity velocity)
|
void |
MoveBackward()
|
void |
MoveForward()
|
void |
MoveToBack()
This method is to be used to control the layering of drawn objects. |
void |
MoveToFront()
|
void |
Pause()
This method should tell the object to pause what it is doing. |
void |
Play()
This method should tell the object to start playing. |
boolean |
PositionIsOnlyInsideMe(Position position)
This method should determine whether the position passed into it is inside the graphical boundries of the object, but not within any of its sub-objects, and return the result of that calculation. |
Size |
PreferedSize()
|
void |
React()
This method is automatically called when the user clicks (presses and releases the mouse button) inside the object. |
void |
Refresh()
This is a method used internally in this package and should not be called or redefined unless you know what you're doing. This method should draw the object to the offscreen graphic. |
void |
RemoveAllBehaviors()
This method removes all existing behavioral objects from this object. |
void |
RemoveBehavior(Behavior behavior)
This method can be used to remove an existing behavioral object from this object. |
void |
ReplaceAllBehaviors(Behavior behavior)
|
void |
Scale(double widthFactor,
double heightFactor)
This method should scale the object to the proper size give the height and width multiplication factors. |
void |
Scale(Size factor)
|
void |
Scale(Value widthFactor,
Value heightFactor)
|
void |
Select()
|
void |
SetColor(Color color)
This method should set the current color of the object. |
void |
SetContainer(Container container)
This method will modify which container the shape is shown in. |
void |
SetFillStyle(GP.Drawers.FillStyle fillStyle)
|
void |
SetOrientation(Orientation orientation)
This method should set the current orientation of the object. |
void |
SetPivot(Position pivot)
|
void |
SetPosition(Position position)
This method should set the current position of the object. |
void |
SetSize(Size size)
This method should set the current size of the object. |
void |
Show()
Show the graphical object in its current container. |
void |
Show(Container container)
Show the graphical object in a new container |
void |
Start()
|
void |
Stop()
This method should tell the object to stop what it is doing. |
java.lang.String |
toString()
|
void |
Turn(double change)
|
void |
Turn(double change,
Position pivot)
|
void |
Turn(Orientation change)
|
void |
Turn(Orientation change,
Position pivot)
|
void |
Turn(Value change)
|
void |
Turn(Value change,
Position pivot)
|
| Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static int ourNumShapes
| Constructor Detail |
public Shape()
public Shape(Container container,
Drawer drawer)
container - drawer - public Shape(Shape shape)
shape - | Method Detail |
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic Container GetContainer()
GraphicGetContainer in interface GraphicGP.Graphicpublic GP.Containers.Applet GetApplet()
public Size PreferedSize()
PreferedSize in interface GraphicGP.Graphicpublic void SetColor(Color color)
ColorableSetColor in interface ColorableGP.Colorablecolor - the new colorpublic Color GetColor()
ColorableGetColor in interface ColorableGP.Colorablepublic void Fill()
public void Frame()
public void SetFillStyle(GP.Drawers.FillStyle fillStyle)
SetFillStyle in interface Graphicpublic GP.Drawers.FillStyle GetFillStyle()
GetFillStyle in interface Graphicpublic void SetSize(Size size)
ScalableSetSize in interface ScalableGP.Scalablesize - the new sizepublic Size GetSize()
ScalableGetSize in interface ScalableGP.Scalable
public void Scale(double widthFactor,
double heightFactor)
ScalableScale in interface ScalableGP.ScalablewidthFactor - heightFactor -
public void Scale(Value widthFactor,
Value heightFactor)
Scale in interface Scalablepublic void Scale(Size factor)
Scale in interface Scalablepublic void SetPosition(Position position)
PositionableSetPosition in interface PositionableGP.Positionableposition - the new positionpublic Position GetPosition()
PositionableGetPosition in interface PositionableGP.Positionable
public void Move(double xChange,
double yChange)
Move in interface Positionable
public void Move(Value xChange,
Value yChange)
Move in interface Positionablepublic void Move(Velocity velocity)
Move in interface Positionablepublic void SetPivot(Position pivot)
public Position GetPivot()
GetPivot in interface Orientablepublic void SetOrientation(Orientation orientation)
OrientableSetOrientation in interface OrientableGP.Orientableorientation - the new orientationpublic Orientation GetOrientation()
OrientableGetOrientation in interface OrientableGP.Orientablepublic void Turn(double change)
Turn in interface Orientablepublic void Turn(Value change)
Turn in interface Orientablepublic void Turn(Orientation change)
Turn in interface Orientable
public void Turn(double change,
Position pivot)
Turn in interface Orientable
public void Turn(Value change,
Position pivot)
Turn in interface Orientable
public void Turn(Orientation change,
Position pivot)
Turn in interface Orientablepublic void AddBehavior(Behavior behavior)
BehavioralAddBehavior in interface BehavioralGP.Behavioralbehavior - the new behavior to be addedpublic void RemoveBehavior(Behavior behavior)
BehavioralRemoveBehavior in interface BehavioralGP.Behavioralbehavior - the existing behavior to be removedpublic void RemoveAllBehaviors()
BehavioralRemoveAllBehaviors in interface Behavioralpublic void ReplaceAllBehaviors(Behavior behavior)
ReplaceAllBehaviors in interface BehavioralGP.Behavioralbehavior - the new behvaior that will replace all
existing behaviors on this objectpublic boolean IsPositionInside(Position toTest)
GraphicIsPositionInside in interface GraphicGP.Graphicposition - the position in questionpublic boolean PositionIsOnlyInsideMe(Position position)
GraphicIsPositionInside(GP.Attributes.Position), but may differ when
dealing with composite structures such as
GP.MultiManagersPositionIsOnlyInsideMe in interface GraphicGP.Graphicposition - the position in questionpublic abstract Graphic Copy()
Copy in interface Graphicpublic void Start()
public void Play()
PlayablePlay in interface Playablepublic void Pause()
PlayablePause in interface Playablepublic void Stop()
PlayableStop in interface Playablepublic double GetCurrentTime()
PlayableGetCurrentTime in interface PlayableGP.Playablepublic void ApplyBehaviors(double time)
ApplyBehaviors in interface BehavioralGP.Behavioraltime - the current time in secondspublic void ApplyInstincts(double time)
ApplyInstincts in interface BehavioralGP.Behavioraltime - the current time in secondspublic void Refresh()
RefreshableRefresh in interface Refreshablepublic void Show()
ViewableShow in interface Viewablepublic void Show(Container container)
GraphicShow in interface GraphicGP.Graphiccontainer - public void SetContainer(Container container)
SetContainer in interface Graphiccontainer - the new containerpublic void Hide()
ViewableHide in interface Viewablepublic boolean IsVisible()
ViewableIsVisible in interface ViewableGP.Viewablepublic Size GetBoxBoundedSize()
GetBoxBoundedSize in interface Graphicpublic void Select()
Select in interface Selectablepublic void DeSelect()
DeSelect in interface Selectablepublic void MoveToBack()
MovableMoveToBack in interface MovableGP.Movableobject - the object you want to move to the back of the containerpublic void MoveToFront()
MoveToFront in interface Movablepublic void MoveBackward()
MoveBackward in interface Movablepublic void MoveForward()
MoveForward in interface Movablepublic void React()
React in interface Reactivepublic void Act()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||