|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Model that will manage the collection of MagnetNode instances
MagnetNode| Method Summary | |
void |
addListener(MagnetModelListener listener)
Adds a listener that will be notified when the model has changed. |
void |
addMagnetNode(MagnetNode newMagnetNode)
Adds a MagnetNode instance to this model
Nothing happens if aMagnetNode is null or already exists in the model. |
void |
addMagnetNodes(MagnetNode[] newMagnetNodes)
Adds MagnetNode instances to this model
If a node is null or already exists in the model, it is not added to the model.
|
void |
clearMagneticNodes()
Resets all magnetic nodes. |
void |
clearVisibleNodes()
Resets all visible nodes: none (except magnetic nodes) will be drawn on screen. |
boolean |
getIsMagneticNode(MagnetNode aNode)
Returns true if the node is magnetic, else false |
boolean |
getIsSelectedNode(MagnetNode aNode)
Returns true if the node is selected, else false |
boolean |
getIsVisibleNode(MagnetNode aMagnetNode)
Returns true if aMagnetNode is visible, else false. |
java.util.Collection |
getMagneticNodes()
Returns all magnetic nodes. |
java.util.Collection |
getMagnetNodes()
Returns all the nodes in the model |
java.util.Collection |
getSelectedNodes()
Returns all selected nodes. |
java.util.Collection |
getVisibleMagnetNodes()
Returns all visible nodes in the model |
java.util.Collection |
getVisibleMagnetNodesInRect(java.awt.Rectangle aRectangle)
Returns the nodes whoose origin is in a aRectangle |
void |
removeListener(MagnetModelListener listener)
Removes a listener. |
void |
removeMagnetNode(MagnetNode aMagnetNode)
Removes a MagnetNode instance from this model.
|
void |
reset()
Resets the model. |
void |
setIsMagneticNode(MagnetNode aNode,
boolean aBoolean)
Sets the node as magnetic if aBoolean is true,
else set it as non magnetic. |
void |
setIsSelectedNode(MagnetNode aNode,
boolean aBoolean)
Sets the node as selected if aBoolean is true,
else set it as not selected. |
void |
setIsVisibleNode(MagnetNode aNode,
boolean aBoolean)
Sets the node as visible or invisible in the view if aBoolean
is true or false; |
| Method Detail |
public void addMagnetNode(MagnetNode newMagnetNode)
MagnetNode instance to this model
Nothing happens if aMagnetNode is null or already exists in the model.
newMagnetNode - the node to add to the modelpublic void addMagnetNodes(MagnetNode[] newMagnetNodes)
MagnetNode instances to this model
If a node is null or already exists in the model, it is not added to the model.
This does not affect other nodes.
newMagnetNodes - the nodes to add to the modelpublic void removeMagnetNode(MagnetNode aMagnetNode)
MagnetNode instance from this model.
Nothing happens if aMagnetNode is null or does not exist in the model.
aMagnetNode - the node to remove from the modelpublic java.util.Collection getMagnetNodes()
public java.util.Collection getVisibleMagnetNodes()
public boolean getIsVisibleNode(MagnetNode aMagnetNode)
aMagnetNode is visible, else false.
aMagnetNode is visible, else false.
public void setIsVisibleNode(MagnetNode aNode,
boolean aBoolean)
aBoolean
is true or false;
aNode - the node to set visible/invisibleaBoolean - true if aMagnetNode has to be visible, else false.public void clearVisibleNodes()
public void clearMagneticNodes()
public java.util.Collection getVisibleMagnetNodesInRect(java.awt.Rectangle aRectangle)
aRectangle
aRectangle - a rectangle in the MagnetView coordinates
aRectanglepublic boolean getIsMagneticNode(MagnetNode aNode)
aNode - the node to check if it is magnetic.
public void setIsMagneticNode(MagnetNode aNode,
boolean aBoolean)
aBoolean is true,
else set it as non magnetic.
aNode - the node to make magnetic/non-magneticaBoolean - true to make the node magnetic, else falsepublic java.util.Collection getMagneticNodes()
public boolean getIsSelectedNode(MagnetNode aNode)
aNode - the node to check if it is selected.
public void setIsSelectedNode(MagnetNode aNode,
boolean aBoolean)
aBoolean is true,
else set it as not selected.
aNode - the node to select/deselectaBoolean - true to make the node selected, else falsepublic java.util.Collection getSelectedNodes()
public void addListener(MagnetModelListener listener)
listener - the listener object to addpublic void removeListener(MagnetModelListener listener)
listener - the listener object to removepublic void reset()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||