IlpEquipmentView
can be connected to several node algorithms and one link algorithm.
IlpEquipmentView
. If the
perform
parameter is set to
true
, the layout is applied to the objects immediately. With this
method the layout is executed every time the equipment content
changes.
setLinkLayout (IlvGraphLayout layout,
boolean perform)
. This method sets the given layout as the default link layout
for this instance of
IlpEquipmentView
. If the
perform
parameter is set to
true
, the layout is applied to the links immediately. With this
method the layout is executed every time the equipment content
changes.
public void
performLayoutOnce(IlvGraphLayout layout)
. This method executes the layout algorithm once on the manager
content.
void startDelayingUpdates()
. This method suspends temporarily the layout operations. This
mechanism avoids unnecessary computation when you intend to
perform a sequence of operations that affect the equipment
layout.
void endDelayingUpdates()
. This method resumes the layout operations suspended by a call
to the method
startDelayingUpdates
. Any operation that requests a layout recalculation is
suspended when it is executed between
startDelayingUpdates
and
endDelayingUpdates
calls.
void setGraphLayouts(IlvGraphLayout[]
layouts)
. This method sets the given graph layouts for this IlpEquipmentView. Several graph layouts
can be set to position nodes in the view. One of them can be
configured to be executed every time the equipment contents
changes. This method does not apply the layout to the nodes
immediately. All the graph layouts given as argument to the
method are attached to the view.
void setGraphLayouts(int index,
IlvGraphLayout layout)
. This method sets a new graph layout for the
IlpEquipmentView
or replaces an existing graph layout. This method does not apply
the layout to the nodes immediately.
IlvGraphLayout[] getGraphLayouts()
. This method returns the graph layouts that have been
configured for the view.
IlvGraphLayout getGraphLayouts(int
index)
. This method returns the graph layout that is configured for
the view at the given index.
void setAutoLayoutIndex (int index)
. This method indicates, from the list of graph layouts that
have been configured using method
setGraphLayouts
, which one is executed automatically when the contents of the
view changes.
int getAutoLayoutIndex()
. This method returns the index of the graph layout that is
executed automatically when the contents of the view changes.
void performAttachedLayout(int index)
. This method executes the layout that has been configured for
the given index, recursively in the object tree. The layout has
been already attached to the view and keeps the configuration
whenever it is performed.
IlvGraphic
getLayoutProxy(IlpRepresentationObject)
. This method returns the graphic object corresponding to the
given representation object for layout purposes. This method
should be used if you need to set per-object layout properties
to configure the layout algorithms.
equipment.getView().getCompositeGrapher().getZoomTransformer()
equipment.getManagerView().getTransformer()
) before passing them to the graph layout.
Equipment { graphLayout: true; } GraphLayout { class: 'ilog.views.graphlayout.hierarchical.IlvHierarchicalLayout'; flowDirection: Bottom; levelJustification: Top; globalLinkStyle: 'ilog.views.graphlayout.hierarchical.IlvHierarchicalLayout.POLYLINE_STYLE'; connectorStyle: 'ilog.views.graphlayout.hierarchical.IlvHierarchicalLayout.EVENLY_SPACED_PINS'; }
globalLinkStyle
and
connectorStyle
for the type converter to locate and convert the constants.
IlvHierarchicalLayout layout = new IlvHierarchicalLayout(); layout.setFlowDirection (IlvDirection.Bottom); layout.setLevelJustification (IlvDirection.Top); layout.setGlobalLinkStyle (IlvHierarchicalLayout.POLYLINE_STYLE); layout.setConnectorStyle (IlvHierarchicalLayout.EVENLY_SPACED_PINS); equipment.setNodeLayout(layout);
layout.setCoordinatesMode(IlvGraphLayout.VIEW_COORDINATES);
IlvGraphLayout
:
setPreserveFixedLinks (boolean
preserve)
. This method determines whether or not the layout will
preserve the position of the registered links.
setPreserveFixedNodes (boolean
preserve)
. This method determines whether or not the layout will
preserve the position of the registered nodes.
void setFixed (Object obj /* link or
node */, boolean fix)
. This method determines whether or not the given object will
be fixed in the equipment view.
boolean isFixed (Object obj)
. The return value indicates whether or not the given object
is marked to be fixed. The object to be passed is an IlvGraphic belonging to the IlpGraphic that represents the object
and not the
IlpGraphic
or IlpRepresentationObject itself.
void unfixAllLinks()
void unfixAllNodes()
Equipment { graphLayout: true; linkLayout: true; } LinkLayout { class: 'ilog.views.graphlayout.link.IlvLinkLayout'; } GraphLayout { layouts[0]: @+treeLayout; } Subobject#treeLayout { class: 'ilog.views.graphlayout.tree.IlvTreeLayout'; } #Link:linkLayoutRenderer { fixed: true; } #NE1:graphLayoutRenderer:tree { fixed: true; }
IlvGraphLayout layout = equipmentView.getLinkLayout(); layout.setPreserveFixedLinks (true); IlpRepresentationObject linkRO = equipmentAdapter.getRepresentationObject(link); layout.setFixed(equipmentView.getLayoutProxy(linkRO)); layout = equipmentView.getNodeLayout(); layout.setPreserveFixedNodes (true); IlpRepresentationObject neRO = equipmentAdapter.getRepresentationObject(ne); layout.setFixed(equipmentView.getLayoutProxy(neRO));
view.setPosition
).
IlvShortLinkLayout
to shape and position links. This default layout sets all objects
without an attached position to
(0,0)
.
Equipment { graphLayout: true; } GraphLayout { layouts[0]: @+hierarchicalLayout; layouts[1]: @+treeLayout; autoLayoutIndex: 0; } Subobject#hierarchicalLayout { class: 'ilog.views.graphlayout.hierarchical.IlvHierarchicalLayout'; flowDirection: Bottom; levelJustification: Top; globalLinkStyle: POLYLINE_STYLE; connectorStyle: EVENLY_SPACED_PINS; } Subobject#treeLayout { class: 'ilog.views.graphlayout.tree.IlvTreeLayout'; flowDirection: Bottom; }
performAttachedLayout
, where the index is the one defined in the CSS configuration, as
follows:
equipment.getView().performAttachedLayout(1);
Equipment { graphLayout: true; } GraphLayout { layouts[0]: @+busLayout } Subobject#busLayout { class: 'ilog.views.graphlayout.bus.IlvBusLayout'; horizontalOffset: 50; verticalOffsetToLevel: 50; verticalOffsetToPreviousLevel: 40; margin: 30; marginOnBus: 50; } // Configure the bus object as the bus in the layout // All layout configuration uses the 'graphLayoutRenderer' // and the graph layout name pseudoclasses #BUS:graphLayoutRenderer:bus { bus: true; } // Configure the bus to route the links that connect the // bus to the nodes #BUS { linksConnectToBase: true; }
IlvBusLayout busLayout = new IlvBusLayout(); equipment.setGraphLayouts(new IlvGraphLayout[] { busLayout }); IlpRepresentationObject ro = equipment.getAdapter().getRepresentationObject("BUS"); IlvGraphic layoutProxy = equipment.getView().getLayoutProxy(ro); busLayout.setBus((IlvPolyPointsInterface)layoutProxy);
usePerObjectParamenters
in the graph layout renderer and link layout renderer. Disabling
the per-object layout properties configuration speeds up
significantly the rendering process.
Equipment { graphLayout: true; linkLayout: true; } LinkLayout { class: 'ilog.views.graphlayout.link.IlvLinkLayout'; usePerObjectParameters: false; } GraphLayout { layouts[0]: @+treeLayout; usePerObjectParameters: false; }