|
||||||||||
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.Container
Implementation of the container interface. Uses a linked list to store the elements; so the order of the elements is fixed to the insertion order. The Shape is the addition of all element shapes.
Field Summary | |
protected LinkedList |
elements
the elements in the container |
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 | |
Container()
Constructor. |
Method Summary | |
void |
addElement(Component element)
Adds an element to the container. |
protected void |
calcShape()
Recalculates the shape. |
void |
clear()
Removes all elements from the container. |
Object |
clone()
Clones the component |
void |
deselect()
Deselects all elements in the container. |
void |
draw(Graphics2D graphContext)
Draws all elements in the container. |
Component |
flatten()
Returns a 'flattened' version of the container. |
ListIterator |
getIterator()
Returns an iterator over the container. |
int |
getSize()
Returns the current number of elements |
double |
getX()
Returns the leftmost x coordinate of all the components in the container. |
double |
getY()
Returns the topmost y coordinate of all the components in the container |
boolean |
hasElement(Component element)
Checks whether the container contains a certain element. |
boolean |
isFlatteningAllowed()
Returns true. |
boolean |
isMovable()
Returns true iff all components in the container are movable. |
void |
move(double x,
double y)
Moves all elements in the container. |
void |
removeElement(Component element)
Removes an element from the container. |
void |
select()
Selects all elements in the container. |
int |
selectableWith()
Returns the minimum of the SEL_XX values of all the components in the container. |
void |
setGraphicalSystem(GraphicalSystem graphicalSystem)
Sets the graphical system for all elements. |
Object |
visit(ComponentVisitor visitor)
Calls the visitContainer method according to the pattern |
Methods inherited from class fdda.graphics.java2d.Component |
getGraphicalSystem, getShape, isSelected, recalculateShape, 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 |
getGraphicalSystem, getShape, isSelected, recalculateShape, setGraphicalSystem, setXY |
Field Detail |
protected LinkedList elements
Constructor Detail |
public Container()
Method Detail |
public void addElement(Component element)
Container
addElement
in interface Container
element
- the elementpublic void removeElement(Component element)
Container
removeElement
in interface Container
element
- the elementpublic boolean hasElement(Component element)
Container
hasElement
in interface Container
element
- the element
public ListIterator getIterator()
Container
getIterator
in interface Container
public void clear()
Container
clear
in interface Container
public void move(double x, double y)
move
in interface Component
x
- offset for move in x directiony
- offset for move in y directionComponent.move(double, double)
public void select()
select
in interface Component
select
in class Component
Component.select()
public void deselect()
deselect
in interface Component
deselect
in class Component
Component.deselect()
public void draw(Graphics2D graphContext)
draw
in class Component
graphContext
- the graphicsComponent.draw(java.awt.Graphics2D)
protected void calcShape()
Component
calcShape
in class Component
public Object clone()
Component
clone
in interface Component
clone
in class Component
public int getSize()
Container
getSize
in interface Container
public double getX()
getX
in interface Component
getX
in class Component
Component.getX()
public double getY()
getY
in interface Component
getY
in class Component
Component.getY()
public boolean isMovable()
isMovable
in interface Component
Component.isMovable()
public int selectableWith()
selectableWith
in interface Component
Component.selectableWith()
public void setGraphicalSystem(GraphicalSystem graphicalSystem)
Component.setGraphicalSystem(fdda.graphics.GraphicalSystem)
public Component flatten()
Container
flatten
in interface Container
public boolean isFlatteningAllowed()
isFlatteningAllowed
in interface Container
Container.isFlatteningAllowed()
public Object visit(ComponentVisitor visitor)
visit
in interface Component
visitor
- the visitor
Component.visit(fdda.graphics.ComponentVisitor)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |