|
|||||||||
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.Object
public Container GetContainer()
Graphic
GetContainer
in interface Graphic
GP.Graphic
public GP.Containers.Applet GetApplet()
public Size PreferedSize()
PreferedSize
in interface Graphic
GP.Graphic
public void SetColor(Color color)
Colorable
SetColor
in interface Colorable
GP.Colorable
color
- the new colorpublic Color GetColor()
Colorable
GetColor
in interface Colorable
GP.Colorable
public void Fill()
public void Frame()
public void SetFillStyle(GP.Drawers.FillStyle fillStyle)
SetFillStyle
in interface Graphic
public GP.Drawers.FillStyle GetFillStyle()
GetFillStyle
in interface Graphic
public void SetSize(Size size)
Scalable
SetSize
in interface Scalable
GP.Scalable
size
- the new sizepublic Size GetSize()
Scalable
GetSize
in interface Scalable
GP.Scalable
public void Scale(double widthFactor, double heightFactor)
Scalable
Scale
in interface Scalable
GP.Scalable
widthFactor
- heightFactor
- public void Scale(Value widthFactor, Value heightFactor)
Scale
in interface Scalable
public void Scale(Size factor)
Scale
in interface Scalable
public void SetPosition(Position position)
Positionable
SetPosition
in interface Positionable
GP.Positionable
position
- the new positionpublic Position GetPosition()
Positionable
GetPosition
in interface Positionable
GP.Positionable
public void Move(double xChange, double yChange)
Move
in interface Positionable
public void Move(Value xChange, Value yChange)
Move
in interface Positionable
public void Move(Velocity velocity)
Move
in interface Positionable
public void SetPivot(Position pivot)
public Position GetPivot()
GetPivot
in interface Orientable
public void SetOrientation(Orientation orientation)
Orientable
SetOrientation
in interface Orientable
GP.Orientable
orientation
- the new orientationpublic Orientation GetOrientation()
Orientable
GetOrientation
in interface Orientable
GP.Orientable
public void Turn(double change)
Turn
in interface Orientable
public void Turn(Value change)
Turn
in interface Orientable
public 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 Orientable
public void AddBehavior(Behavior behavior)
Behavioral
AddBehavior
in interface Behavioral
GP.Behavioral
behavior
- the new behavior to be addedpublic void RemoveBehavior(Behavior behavior)
Behavioral
RemoveBehavior
in interface Behavioral
GP.Behavioral
behavior
- the existing behavior to be removedpublic void RemoveAllBehaviors()
Behavioral
RemoveAllBehaviors
in interface Behavioral
public void ReplaceAllBehaviors(Behavior behavior)
ReplaceAllBehaviors
in interface Behavioral
GP.Behavioral
behavior
- the new behvaior that will replace all
existing behaviors on this objectpublic boolean IsPositionInside(Position toTest)
Graphic
IsPositionInside
in interface Graphic
GP.Graphic
position
- the position in questionpublic boolean PositionIsOnlyInsideMe(Position position)
Graphic
IsPositionInside(GP.Attributes.Position)
, but may differ when
dealing with composite structures such as
GP.MultiManagers
PositionIsOnlyInsideMe
in interface Graphic
GP.Graphic
position
- the position in questionpublic abstract Graphic Copy()
Copy
in interface Graphic
public void Start()
public void Play()
Playable
Play
in interface Playable
public void Pause()
Playable
Pause
in interface Playable
public void Stop()
Playable
Stop
in interface Playable
public double GetCurrentTime()
Playable
GetCurrentTime
in interface Playable
GP.Playable
public void ApplyBehaviors(double time)
ApplyBehaviors
in interface Behavioral
GP.Behavioral
time
- the current time in secondspublic void ApplyInstincts(double time)
ApplyInstincts
in interface Behavioral
GP.Behavioral
time
- the current time in secondspublic void Refresh()
Refreshable
Refresh
in interface Refreshable
public void Show()
Viewable
Show
in interface Viewable
public void Show(Container container)
Graphic
Show
in interface Graphic
GP.Graphic
container
- public void SetContainer(Container container)
SetContainer
in interface Graphic
container
- the new containerpublic void Hide()
Viewable
Hide
in interface Viewable
public boolean IsVisible()
Viewable
IsVisible
in interface Viewable
GP.Viewable
public Size GetBoxBoundedSize()
GetBoxBoundedSize
in interface Graphic
public void Select()
Select
in interface Selectable
public void DeSelect()
DeSelect
in interface Selectable
public void MoveToBack()
Movable
MoveToBack
in interface Movable
GP.Movable
object
- the object you want to move to the back of the containerpublic void MoveToFront()
MoveToFront
in interface Movable
public void MoveBackward()
MoveBackward
in interface Movable
public void MoveForward()
MoveForward
in interface Movable
public void React()
React
in interface Reactive
public 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 |