The basic shape of the general node is controlled by the
shapeType
property. The possible values are as listed in the following table.
shapeType : “Rectangle”;
|
|
shapeType : “RoundRectangle”;
|
|
shapeType : “Ellipse”;
|
|
shapeType : “Diamond”;
|
|
shapeType : “TriangleUp”;
|
|
shapeType : “TriangleDown”;
|
|
shapeType : “TriangleLeft”;
|
|
shapeType : “TriangleRight”;
|
|
shapeType : “Marker”;
|
|
If needed, you can set the shape of the node directly through the
setShape
method. This lets you use any custom shape. You can specify a
custom shapes in any of the following ways:
- By referring to an SVG file in the style sheet:
node { shape : "url(myCustomShape.svg)"; }
- In Java code:
IlvGeneralPath myShape = new IlvGeneralPath(...); generalNode.setShape(myShape);
The horizontal and vertical sizes of the shape are controlled
through the properties
shapeWidth
,
shapeHeight
, and
shapeAspectRatio
.
There are basically two policies to set the
width and height of the shape:
- You can set the properties
shapeWidth
andshapeHeight
. In this case the aspect ratio of the shape will not be preserved. For example:node { class : "ilog.views.sdm.graphic.IlvGeneralNode"; shapeType : "RoundRectangle"; shapeWidth : "100"; shapeHeight : "50"; }
- You can set the property
shapeWidth
to the desired width and the propertyshapeAspectRatio
to the desired width/height ratio. For example:node { class : "ilog.views.sdm.graphic.IlvGeneralNode"; shapeType : "RoundRectangle"; shapeWidth : "100"; shapeAspectRatio : "2"; }
If you change the shape width in another rule, the aspect ratio will be preserved.