|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinterfaces.CommandColleague
classes.shapes.RectangleShape
public class RectangleShape
Class for rectangle shape objects
Field Summary | |
---|---|
boolean |
isPermanentShape
|
ShapeCoordinates |
shapeCoordinates
|
Fields inherited from class interfaces.CommandColleague |
---|
commandMediator |
Constructor Summary | |
---|---|
RectangleShape(ShapeCoordinates shapeCoordinates,
ICommandMediator commandMediator)
Initializes with the deafult shape coordinates and mediator object |
Method Summary | |
---|---|
void |
accept(IShapeVisitor shapeVisitor)
Accepts the visitor and execute its method |
void |
changeShapeXYCoordinates(int x,
int y)
Relocate the shape at external specified location |
java.lang.Object |
clone()
Creates clone of the object |
void |
drawShape()
Draws the rectangle shape This method acts as proxy to draw the shape. |
void |
drawShape(int x,
int y)
Draws the shape at the specified location |
java.awt.Color |
getColor()
Returns the color attribute for the shape |
boolean |
IsPermanentShape()
Return whether the shape is permanent |
void |
setAsPermanentShape(boolean isPermanent)
Sets whether the shape is permanent or tempory with respect to drawing |
void |
setColor(java.awt.Color color)
Sets the color attribute for the shape |
void |
setCommandObject(Command command)
Set the Command object which contains the commands to draw the shape |
void |
setGraphicsObject(java.awt.Graphics g)
Set the Graphics object which is responsible to draw the graphics |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public ShapeCoordinates shapeCoordinates
public boolean isPermanentShape
Constructor Detail |
---|
public RectangleShape(ShapeCoordinates shapeCoordinates, ICommandMediator commandMediator)
ShapeCoordinates
,
ICommandMediator
Method Detail |
---|
public void drawShape()
drawShape
in interface IShapeDrawer
IShapeDrawer.drawShape()
,
Command
public void setGraphicsObject(java.awt.Graphics g)
setGraphicsObject
in interface IShapeDrawer
g
- Graphics object to be setIShapeDrawer.setGraphicsObject(java.awt.Graphics)
public void setCommandObject(Command command)
setCommandObject
in interface IShapeDrawer
command
- Command object to setIShapeDrawer.setCommandObject(types.Command)
public void drawShape(int x, int y)
drawShape
in interface IShape
x
- x-coordinatey
- y-coordinateIShape.drawShape(int, int)
public void changeShapeXYCoordinates(int x, int y)
changeShapeXYCoordinates
in interface IShape
x
- x-coordinatey
- y-coordinateIShape.drawShape(int, int)
public void setAsPermanentShape(boolean isPermanent)
setAsPermanentShape
in interface IShape
isPermanent
- status of the shapeIShape.setAsPermanentShape(boolean)
public boolean IsPermanentShape()
IsPermanentShape
in interface IShape
IShape.IsPermanentShape()
public java.lang.Object clone()
clone
in interface IShape
clone
in class java.lang.Object
IShape.clone()
public void setColor(java.awt.Color color)
setColor
in interface IShape
color
- color of the shapeIShape.setColor(java.awt.Color)
public java.awt.Color getColor()
getColor
in interface IShape
IShape.getColor()
public void accept(IShapeVisitor shapeVisitor)
accept
in interface IVisitable
shapeVisitor
- the shapeVisitor object to be acceptedIVisitable.accept(interfaces.IShapeVisitor)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |