NORSYS SOFTWARE © 2012 | NETICA API | JAVA   VERSION   5.04  |
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--norsys.netica.VisualNode
An object representing the visual aspects of a Netica Node as it would be displayed in the Netica Application.
This class does not have a public constructor; use Node.visual
to retrieve an instance for a node.
Method Summary | |
Node |
getNode()
Returns the Node that this VisualNode represents. |
double[] |
getPosition()
Retrieves as elements 0 and 1 respectively, the x,y coordinates of the center of this node, as it would appear in a visual display (e.g., in Netica Application). |
java.lang.String |
getStyle()
Returns the current "style descriptor" of this node for any visual display (e.g., in Netica Application, or within a NetPanel). |
void |
setPosition(double x,
double y)
Moves this node so that its center is at coordinates (x, y), for any visual display (e.g., in Netica Application). |
void |
setStyle(java.lang.String style)
Sets the style of this node for any visual display (e.g., in Netica Application, or within a NetPanel). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public Node getNode ( ) |
public double[] getPosition ( ) throws NeticaException |
setPosition | Sets it | |
Node.getNodesetColor | Gets color | |
Node.visual | Gets a VisualNode to work with |
public String getStyle ( ) throws NeticaException |
The returned string may be used as a parameter to setStyle.
Version:
setStyle | Sets the style | |
getPosition | Retrieves display coordinates | |
Node.visual | Gets a VisualNode to work with |
// if style of node is labelled_box, make it belief_bars, for display in Netica Application. String style= node.visual().getStyle(); if ( style.startsWith( "labelled_box" ) ) { node.visual().setStyle ( "belief_bars" ); } // copy style of node1 to node2, for display in Netica Application. node2.visual().setStyle ( node1.visual().getStyle() );
public void setPosition ( |
| ) throws NeticaException |
This is useful when directly programming Netica Application, or before writing a net to a file that will later be read by Netica Application.
Parameters:
double | x | desired horizontal pixel value | ||
double | y | desired vertical pixel value |
getPosition | Retrieves coordinates | |
Node.setNodesetColor | Sets color | |
Node.visual | Gets a VisualNode to work with |
// lower node by 20 pixels for display in Netica Application. double[] pos = node.visual().getPosition(); node.visual().setPosition (pos[0], pos[1]+20);
public void setStyle ( |
| ) throws NeticaException |
This is useful when directly programming Netica Application, or before writing a net to a file that will later be read by Netica Application.
style must be one of: "Default", "Absent", "Shape", "LabeledBox", "BeliefBars", "BeliefLine", or "Meter". In future, other qualifiers may be added to this style parameter (e.g., "LabeledBox,CornerRoundingRadius=3,LineThickness=2").
Note that setting the style does not guarantee that a particular display application will be able to display the node in that style. Some applications may be limited in their ability and may interpret a particular display style differently or even ignore it.
Parameters:
String | style | a style descriptor for the desired style |
getStyle | Gets style | |
setPosition | Sets coordinates | |
Node.visual | Gets a VisualNode to work with |
// if style of node is labelled_box, make it belief_bars, for display in Netica Application. String style= node.visual().getStyle(); if ( style.startsWith( "labelled_box" ) ) { node.visual().setStyle ( "belief_bars" ); } // copy style of node1 to node2, for display in Netica Application. node2.visual().setStyle ( node1.visual().getStyle() );
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |