Network Visual Properties

From DSL

Jump to: navigation, search

[edit] Methods: Visual Properties

jSMILE allows for setting visual properties of the network (nodes, arc). Those visual properties are read when a model is opened in GeNIe.


  • void setNodePosition(int nodeHandle, int x, int y, int width, int height)

void setNodePosition(String nodeId, int x, int y, int width, int height)

Sets the position of a specified node (this property is read by GeNIe). The (x, y) are the coordinates of the upper left corner of a node's rectangle.


  • void setNodePosition(int nodeHandle, java.awt.Rectangle rect)

void setNodePosition(String nodeId, java.awt.Rectangle rect)

Sets the position of a specified node (this property is read by GeNIe).

More information on the java.awt.Rectangle class can be found in Java API Developer Documentation.


  • java.awt.Rectangle getNodePosition(int nodeHandle)

java.awt.Rectangle getNodePosition(String nodeId)

Returns the position of a specified node. It is returned as a java.awt.Rectangle structure. This structure gives an access to a number of interesting methods and properties, e.g.:

  net.getNodePosition("node_id").getCenterX();

More information on the java.awt.Rectangle class can be found in Java API Developer Documentation.


  • void setNodeBgColor(int nodeHandle, java.awt.Color Color)

void setNodeBgColor(String nodeId, java.awt.Color Color)

Sets the background (interior) color for a specified node (this property is read by GeNIe). java.awt.Color class is used to pass the desired color. Using this class you can use (1) predefined color constants, (2) colors constructed with RGB components, and (3) colors in hexagonal notation (see examples below).

  net.setNodeBgColor("node_id", Color.red);  // (1)
  net.setNodeBgColor("node_id", new Color(255, 0, 0));  // (2)
  net.setNodeBgColor("node_id", "0xFF0000");  // (3)

More information on the java.awt.Color class can be found in Java API Developer Documentation.


  • java.awt.Color getNodeBgColor(int nodeHandle)

java.awt.Color getNodeBgColor(String nodeId)

Returns the background (interior) color of a specified node. A java.awt.Color structure is returned.

More information on the java.awt.Color class can be found in Java API Developer Documentation.


  • void setNodeTextColor(int nodeHandle, java.awt.Color color)

void setNodeTextColor(String nodeId, java.awt.Color color)

Sets the text (font) color for a specified node (this property is read by GeNIe). java.awt.Color class is used to pass the desired color. Using this class you can use (1) predefined color constants, (2) colors constructed with RGB components, and (3) colors in hexagonal notation (see examples below).

  net.setNodeTextColor("node_id", Color.RED);  // (1)
  net.setNodeTextColor("node_id", new Color(255, 0, 0));  // (2)
  net.setNodeTextColor("node_id", "0xFF0000");  // (3)

More information on the java.awt.Color class can be found in Java API Developer Documentation.


  • java.awt.Color getNodeTextColor(int nodeHandle)

java.awt.Color getNodeTextColor(String nodeId)

Returns the text (font) color of a specified node. A java.awt.Color structure is returned.

More information on the java.awt.Color class can be found in Java API Developer Documentation.


  • void setNodeBorderColor(int nodeHandle, java.awt.Color color)

void setNodeBorderColor(String nodeId, java.awt.Color color)

Sets the border color for a specified node (this property is read by GeNIe). java.awt.Color class is used to pass the desired color. Using this class you can use (1) predefined color constants, (2) colors constructed with RGB components, and (3) colors in hexagonal notation (see examples below).

  net.setNodeBorderColor("node_id", Color.RED);  // (1)
  net.setNodeBorderColor("node_id", new Color(255, 0, 0));  // (2)
  net.setNodeBorderColor("node_id", "0xFF0000");  // (3)

More information on the java.awt.Color class can be found in Java API Developer Documentation.


  • java.awt.Color getNodeBorderColor(int nodeHandle)

java.awt.Color getNodeBorderColor(String nodeId)

Returns the border color of a specified node. A java.awt.Color structure is returned.

More information on the java.awt.Color class can be found in Java API Developer Documentation.


  • void setNodeBorderWidth(int nodeHandle, int width)

void setNodeBorderWidth(String nodeId, int width)

Sets the border width (thickness) of a specified node (this property is read by GeNIe). 1 is the smallest value (the border will no be any thinner than 1 pixel).


  • int getNodeBorderWidth(int nodeHandle)

int getNodeBorderWidth(String nodeId)

Returns the border width (thickness) of a specified node's position.

Personal tools