|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcgl.narada.topology.viewer.NodeManagement
public class NodeManagement
This class encapsulates all the activities that happen on the nodes. It is responsible for addition of a new node, deletion of an existing node, addition of a link, deletion of a link, zooming, recentering, drawing whole picture on screen etc.
| Field Summary | |
|---|---|
List |
deletedNodes
|
static int |
INVALID_VALUE
|
LinkManagement |
linkManagement
|
VirtualNode |
virtualNode
|
double |
ZOOM_IN_FACTOR
|
double |
ZOOM_OUT_FACTOR
|
| Constructor Summary | |
|---|---|
NodeManagement()
Only constructor |
|
| Method Summary | |
|---|---|
void |
addClientToNode(String nodeAddress,
int clientId,
String clientType)
|
void |
addLink(String nodeAddress1,
String nodeAddress2,
int linkId,
String linkType)
Adds a single link into the system. |
void |
addNode(String nodeAddress)
Adds a node into the system. |
void |
addTopicToClient(String nodeAddress,
int clientId,
String type)
|
void |
deleteAllClients(String nodeAddress)
|
void |
deleteAllTopicsFromNode(String nodeAddress,
int clientId,
String topic)
|
void |
deleteClientFromNode(String nodeAddress,
int clientId)
|
void |
deleteLink(String nodeAddress1,
String nodeAddress2,
int linkId)
Deletes a particular link from the system. |
void |
deleteNode(String nodeAddress)
Deletes a node into the system. |
void |
deleteTopicFromClient(String nodeAddress,
int clientId,
String topic)
|
void |
drawView()
Draws the screen view. |
List |
getAllClientsForNode(Node n)
|
String |
getCountInformation()
Returns count information consisting of node counts and link count. |
Node |
getNodeAtParticularCoordinates(int x,
int y)
Returns Node object closest to specified coordinates. |
List |
getSnapShot(List allLinks)
|
void |
recenter(int newCenterX,
int newCenterY,
int screenCenterX,
int screenCenterY)
Translates the view. |
void |
setGraphics(Graphics g)
|
void |
setInitialPositions(int centerX,
int centerY,
int limitX1,
int limitY1,
int limitX2,
int limitY2)
Sets Initial positions for the view. |
void |
setZoomInFactor(int zoomInFactor)
Sets ZOOM_IN_FACTOR |
void |
setZoomOutFactor(int zoomOutFactor)
Sets ZOOM_OUT_FACTOR |
void |
zoomIn(int screenCenterX,
int screenCenterY)
zooms into the picture. |
void |
zoomOut(int screenCenterX,
int screenCenterY)
zooms out from the picture. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int INVALID_VALUE
public double ZOOM_IN_FACTOR
public double ZOOM_OUT_FACTOR
public VirtualNode virtualNode
public LinkManagement linkManagement
public List deletedNodes
| Constructor Detail |
|---|
public NodeManagement()
| Method Detail |
|---|
public void setInitialPositions(int centerX,
int centerY,
int limitX1,
int limitY1,
int limitX2,
int limitY2)
centerX - X-coordinate of the center of the screen.centerY - Y-coordinate of the center of the screen.limitX1 - lower limit for X-coordinatelimitY1 - lower limit for Y-coordinatelimitX2 - upper limit for X-coordinatelimitY2 - upper limit for Y-coordinatepublic void setGraphics(Graphics g)
public void addNode(String nodeAddress)
nodeAddress - String representation of the node
address.public void deleteNode(String nodeAddress)
nodeAddress - String representation of the node
address.
public void addLink(String nodeAddress1,
String nodeAddress2,
int linkId,
String linkType)
throws TopologyException
nodeAddress1 - address of one end node.nodeAddress2 - address of other end node.linkId - id of a link to be inserted.linkType - String representing the link type.
TopologyException - if one of the end nodes is absent while
insertion
public void deleteLink(String nodeAddress1,
String nodeAddress2,
int linkId)
nodeAddress1 - address of one end node.nodeAddress2 - address of other end node.linkId - id of a link to be deleted.
public void addClientToNode(String nodeAddress,
int clientId,
String clientType)
public void deleteClientFromNode(String nodeAddress,
int clientId)
public void deleteAllClients(String nodeAddress)
public void addTopicToClient(String nodeAddress,
int clientId,
String type)
public void deleteTopicFromClient(String nodeAddress,
int clientId,
String topic)
public void deleteAllTopicsFromNode(String nodeAddress,
int clientId,
String topic)
public List getAllClientsForNode(Node n)
public String getCountInformation()
String representing all the counts in system.public List getSnapShot(List allLinks)
public Node getNodeAtParticularCoordinates(int x,
int y)
Node object closest to specified coordinates.
x - X-coordinate of mouse pointer.y - Y-coordinate of mouse pointer.
Nodepublic void drawView()
public void setZoomInFactor(int zoomInFactor)
ZOOM_IN_FACTOR
zoomInFactor - public void setZoomOutFactor(int zoomOutFactor)
ZOOM_OUT_FACTOR
zoomOutFactor -
public void zoomIn(int screenCenterX,
int screenCenterY)
virtualNode. Repositions all the components.
screenCenterX - X-coordinate of center of the screen.screenCenterY - Y-coordinate of the center of the screen.
public void zoomOut(int screenCenterX,
int screenCenterY)
virtualNode. Repositions all the components.
screenCenterX - X-coordinate of center of the screen.screenCenterY - Y-coordinate of the center of the screen.
public void recenter(int newCenterX,
int newCenterY,
int screenCenterX,
int screenCenterY)
virtualNode and
repositions all the components in the system.
newCenterX - X-coordinate of a new center for the view.newCenterY - Y-coordinate of a new center for the view.screenCenterX - X-coordinate of a screen center.screenCenterY - Y-coordinate of a screen center.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||