|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkaapo.Observable
kaapo.project.DiagramComponentWrapper
public abstract class DiagramComponentWrapper
Abstract base class for element and connection wrappers.
For general info on the wrapper mechanism, see the documentation of Diagram.
Each diagram component wrapper maintains a list of incoming and outgoing connections to the wrapper.
If a wrapper needs to be cast to a concrete wrapper class
(ElementWrapper or ConnectionWrapper) to access all available methods, it
can be done with the following logic: if getDiagramComponent().isElement()
returns true, it is safe to cast the wrapper to ElementWrapper; otherwise,
it is safe to cast the wrapper to ConnectionWrapper.
Diagram
,
Serialized FormField Summary | |
---|---|
protected DCGraphics |
dcgraphics
|
protected DiagramComponent |
dComponent
|
protected Vector<ConnectionWrapper> |
inConnections
|
protected Vector<ConnectionWrapper> |
outConnections
|
Constructor Summary | |
---|---|
protected |
DiagramComponentWrapper()
|
|
DiagramComponentWrapper(DiagramComponent dc)
|
Method Summary | |
---|---|
protected void |
addConnection(ConnectionWrapper cw)
Adds a connection to wrapper. |
boolean |
canMove()
Tells whether the wrapper can be moved by user. |
boolean |
canResize()
Tells whether the wrapper can be resized by user. |
DCGraphics |
getDCGraphics(ProjectManager pm)
Returns the DCGraphics component associated to this wrapper. |
DiagramComponent |
getDiagramComponent()
Returns the diagram component associated to this wrapper. |
List<ConnectionWrapper> |
getInConnections()
Returns the incoming connections of the wrapper. |
List<ConnectionWrapper> |
getOutConnections()
Returns the outgoing connections of the wrapper. |
abstract void |
moveXY(double changeX,
double changeY,
Selection selected)
Moves a DiagramComponent in the Diagram this wrapper is in. |
void |
reinstateConnections(List<ConnectionWrapper> inConnections,
List<ConnectionWrapper> outConnections)
Reinstates all the connections removed with removeAllConnections. |
void |
removeAllConnections()
Removes all connections from wrapper. |
protected boolean |
removeConnection(ConnectionWrapper cw)
Removes a connection from wrapper. |
Methods inherited from class kaapo.Observable |
---|
addObserver, notifyObservers, notifyObservers, removeAllObservers, removeObserver, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DiagramComponent dComponent
protected transient DCGraphics dcgraphics
protected Vector<ConnectionWrapper> inConnections
protected Vector<ConnectionWrapper> outConnections
Constructor Detail |
---|
protected DiagramComponentWrapper()
public DiagramComponentWrapper(DiagramComponent dc)
Method Detail |
---|
public DCGraphics getDCGraphics(ProjectManager pm)
pm
- Project managerpublic DiagramComponent getDiagramComponent()
protected void addConnection(ConnectionWrapper cw)
If the connection is already part of the wrapper, this method does nothing.
cw
- Connection wrapper to be added
IllegalArgumentException
- if neither the
connection's start nor end point is this wrapper.protected boolean removeConnection(ConnectionWrapper cw)
cw
- The connection to be removed.
public void removeAllConnections()
public List<ConnectionWrapper> getInConnections()
public List<ConnectionWrapper> getOutConnections()
public void reinstateConnections(List<ConnectionWrapper> inConnections, List<ConnectionWrapper> outConnections)
public boolean canResize()
public boolean canMove()
public abstract void moveXY(double changeX, double changeY, Selection selected)
changeX
- change in xchangeY
- change in yselected
- all the moved DiagramComponents
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |