NodeRealizer Idiosyncrasies |
| Applies to: yFiles for Java 2.7, 2.6, 2.5 |
Categories this article belongs to:
| yFiles for Java | > yFiles Viewer | > Displaying and Editing Graphs | > Bringing Graph Elements to Life: The Realizer Concept |
Working with NodeRealizer
Abstract class NodeRealizer
serves as the basis for node realizer implementations.
Among other user interface aspects, a node realizer defines the way a graph element is rendered, i.e., it provides and manages all visual aspects of a node in a Graph2D.
When working with node realizers, some aspects regarding a node's size and its location should be kept in mind.
Setting the node size also changes the coordinates of the node's upper left corner
Abstract class NodeRealizer follows a node center-centric scheme with regard to node size changes, i.e., the coordinates of a node's center stay the same when changing the node's size.
As a matter of fact, when calling the NodeRealizer.setSize
method, the coordinates of the node's upper left corner change, i.e., the node's location changes.
Consequently, whenever you need to set both size and location of a node (realizer), either first set the size, then the location or use one of NodeRealizer's setFrame
methods.
| Keywords: | NodeRealizer - node - realizer - Graph2D - setSize - size - coordinates - upper - left - layout - center - setLocation |


