org.netxms.client.maps
Class NetworkMapLink

java.lang.Object
  extended by org.netxms.client.maps.NetworkMapLink

public class NetworkMapLink
extends java.lang.Object

Represents link between two elements on map


Field Summary
static int MULTILINK
           
static int NORMAL
           
static int ROUTING_BENDPOINTS
           
static int ROUTING_DEFAULT
           
static int ROUTING_DIRECT
           
static int ROUTING_MANHATTAN
           
static int VPN
           
 
Constructor Summary
NetworkMapLink(int type, long element1, long element2)
           
NetworkMapLink(NXCPMessage msg, long baseId)
          Create link object from NXCP message
NetworkMapLink(java.lang.String name, int type, long element1, long element2, java.lang.String connectorName1, java.lang.String connectorName2)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 void fillMessage(NXCPMessage msg, long baseId)
          Fill NXCP message with link data
 long[] getBendPoints()
           
 int getColor()
           
 java.lang.String getConnectorName1()
           
 java.lang.String getConnectorName2()
           
 long getElement1()
           
 long getElement2()
           
 java.lang.String getLabel()
          Get label for display.
 java.lang.String getName()
           
 int getRouting()
           
 long getStatusObject()
           
 int getType()
           
 boolean hasConnectorName1()
          Check if link has non-empty name for connector 1
 boolean hasConnectorName2()
          Check if link has non-empty name for connector 2
 int hashCode()
           
 boolean hasName()
          Check if link has non-empty name
 boolean isUnnamed()
          Check if this link is unnamed.
 void setBendPoints(long[] bendPoints)
           
 void setColor(int color)
           
 void setRouting(int routing)
           
 void setStatusObject(long statusObject)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORMAL

public static final int NORMAL
See Also:
Constant Field Values

VPN

public static final int VPN
See Also:
Constant Field Values

MULTILINK

public static final int MULTILINK
See Also:
Constant Field Values

ROUTING_DEFAULT

public static final int ROUTING_DEFAULT
See Also:
Constant Field Values

ROUTING_DIRECT

public static final int ROUTING_DIRECT
See Also:
Constant Field Values

ROUTING_MANHATTAN

public static final int ROUTING_MANHATTAN
See Also:
Constant Field Values

ROUTING_BENDPOINTS

public static final int ROUTING_BENDPOINTS
See Also:
Constant Field Values
Constructor Detail

NetworkMapLink

public NetworkMapLink(java.lang.String name,
                      int type,
                      long element1,
                      long element2,
                      java.lang.String connectorName1,
                      java.lang.String connectorName2)
Parameters:
name -
type -
element1 -
element2 -
connectorName1 -
connectorName2 -

NetworkMapLink

public NetworkMapLink(int type,
                      long element1,
                      long element2)
Parameters:
linkType -
element1 -
element2 -
connectorName1 -
connectorName2 -

NetworkMapLink

public NetworkMapLink(NXCPMessage msg,
                      long baseId)
Create link object from NXCP message

Parameters:
msg - NXCP message
baseId - base variable ID
Method Detail

fillMessage

public void fillMessage(NXCPMessage msg,
                        long baseId)
Fill NXCP message with link data

Parameters:
msg - NXCP message
baseId - base variable ID

getType

public int getType()
Returns:
the linkType

getElement1

public long getElement1()
Returns:
first (left) element

getElement2

public long getElement2()
Returns:
second (right) element

getConnectorName1

public java.lang.String getConnectorName1()
Returns:
first (left) connector name

getConnectorName2

public java.lang.String getConnectorName2()
Returns:
second (right) connector name

getName

public java.lang.String getName()
Returns:
the name

getLabel

public java.lang.String getLabel()
Get label for display. If name is not null and not empty, label will have form name (connector1 - connector2) otherwise it will have form connector1 - connector2 If any of connector names is null or empty, it will be replaced with string "".

Returns:
display label or null for unnamed link

hasName

public boolean hasName()
Check if link has non-empty name

Returns:
true if link has non-empty name

hasConnectorName1

public boolean hasConnectorName1()
Check if link has non-empty name for connector 1

Returns:
true if link has non-empty name for connector 1

hasConnectorName2

public boolean hasConnectorName2()
Check if link has non-empty name for connector 2

Returns:
true if link has non-empty name for connector 2

isUnnamed

public boolean isUnnamed()
Check if this link is unnamed.

Returns:
true if all names (link and both connectors) are null or empty

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getColor

public int getColor()
Returns:
the color

setColor

public void setColor(int color)
Parameters:
color - the color to set

getStatusObject

public long getStatusObject()
Returns:
the statusObject

setStatusObject

public void setStatusObject(long statusObject)
Parameters:
statusObject - the statusObject to set

getRouting

public int getRouting()
Returns:
the routing

setRouting

public void setRouting(int routing)
Parameters:
routing - the routing to set

getBendPoints

public long[] getBendPoints()
Returns:
the bendPoints

setBendPoints

public void setBendPoints(long[] bendPoints)
Parameters:
bendPoints - the bendPoints to set


Copyright © 2012. All Rights Reserved.