|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fdda.graphics.java2d.Component | +--fdda.graphics.java2d.Message
Implementation of the message interface. The message is shown as a small rectangle.
Field Summary | |
static double |
HALF_LENGTH
half the length of the message rectangle |
static double |
HALF_WIDTH
half the width of the message rectangle |
Fields inherited from class fdda.graphics.java2d.Component |
COLOR_NORMAL, COLOR_SELECTED, dirtyShape, selected, shape, x, y |
Fields inherited from interface fdda.graphics.Component |
SEL_ALL, SEL_EQUALS, SEL_MOVABLES, SEL_NOTHING |
Constructor Summary | |
Message(Line line,
boolean forward)
Constructor |
Method Summary | |
protected void |
calcShape()
Recalculates the shape. |
boolean |
doesMoveInLineDirection()
Returns whether the message moves in the direction of the line |
void |
draw(Graphics2D graphContext)
Draws the component, using the given graphics. |
Color |
getColor()
Returns the color of the message |
Line |
getLine()
Returns the line on which the message moves |
Message |
getRealMessage()
Returns the underlying message of the algorithm |
boolean |
isMovable()
Returns false. |
void |
move(double xOffset,
double yOffset)
Move the component (or its most prominent point). |
void |
moveForward()
Moves the message forward, towards its destination |
int |
selectableWith()
Returns SEL_NOTHING. |
void |
setColor(Color color)
Sets the color of the message |
void |
setRealMessage(Message message)
Sets the underlying message of the algorithm |
Object |
visit(ComponentVisitor visitor)
Calls visitMessage according to visitor pattern |
Methods inherited from class fdda.graphics.java2d.Component |
clone, deselect, getGraphicalSystem, getShape, getX, getY, isSelected, recalculateShape, select, setGraphicalSystem, setXY |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface fdda.graphics.Component |
clone, deselect, getGraphicalSystem, getShape, getX, getY, isSelected, recalculateShape, select, setGraphicalSystem, setXY |
Field Detail |
public static final double HALF_LENGTH
public static final double HALF_WIDTH
Constructor Detail |
public Message(Line line, boolean forward)
line
- the line on which the message movesforward
- whether the message moves forwardMethod Detail |
protected void calcShape()
Component
calcShape
in class Component
public void draw(Graphics2D graphContext)
Component
draw
in class Component
graphContext
- the graphicspublic Message getRealMessage()
Message
getRealMessage
in interface Message
public void setRealMessage(Message message)
Message
setRealMessage
in interface Message
message
- the real messagepublic boolean doesMoveInLineDirection()
Message
doesMoveInLineDirection
in interface Message
public void moveForward()
Message
moveForward
in interface Message
public boolean isMovable()
isMovable
in interface Component
Component.isMovable()
public void move(double xOffset, double yOffset)
Component
move
in interface Component
xOffset
- offset for move in x directionyOffset
- offset for move in y directionpublic int selectableWith()
selectableWith
in interface Component
Component.selectableWith()
public Object visit(ComponentVisitor visitor)
visit
in interface Component
visitor
- the visitor
Component.visit(fdda.graphics.ComponentVisitor)
public Line getLine()
Message
getLine
in interface Message
public void setColor(Color color)
Message
setColor
in interface Message
color
- the colorpublic Color getColor()
Message
getColor
in interface Message
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |