ilog.cpl.equipment.renderer
Class IlpLinkLayoutRenderer

java.lang.Object
  extended by ilog.cpl.graphic.css.renderer.IlpAbstractGraphicViewRenderer
      extended by ilog.cpl.graph.css.renderer.IlpAbstractRepresentationViewRenderer
          extended by ilog.cpl.graph.css.renderer.IlpLayoutRenderer
              extended by ilog.cpl.graph.css.renderer.IlpLinkLayoutRenderer
                  extended by ilog.cpl.equipment.renderer.IlpLinkLayoutRenderer

public class IlpLinkLayoutRenderer
extends ilog.cpl.graph.css.renderer.IlpLinkLayoutRenderer

This class gives control over the link layout of an IlpEquipmentView.

This class is a CSS stylable bean. It can be configured as follows in a CSS file:

 LinkLayout {
   // Any properties configurable for a given class.
 }
 

The value of the class property should be the name of a subclass of IlvGraphLayout that has a no-argument constructor.

The allowed properties and their values depend on the class.

Specifying a Different Layout for Each Subgraph

The properties linkLayout can be set on a subgraph node. This lets you use a different link layout algorithm for each subgraph. For example, the following rule says that subgraph identified as SubNetwork1 must be laid out using an IlvLinkLayout algorithm:

 #SubNetwork1:linkLayoutRenderer {
   linkLayout: @+linkLayout;
 }
 Subobject#linkLayout {
    class: 'ilog.views.graphlayout.link.IlvLinkLayout';
    // Any properties configurable for given class.
 }
 

When specifying the link layout for a given subnetwork, use the pseudoclass linkLayoutRenderer indicating that the properties refers to the link layout renderer.

Per-Object Parameters

ILOG JViews layout algorithms (that is, subclasses of IlvGraphLayout) provide many parameters that control how a specific layout will be applied to a particular node or link. Starting with ILOG JTGO 7.5, the link layout renderer lets you set these per-object parameters from the style sheet as in the following examples:

 object."ilog.tgo.model.IltAbstractLink":linkLayoutRenderer:link {
   linkStyle: DIRECT_STYLE;
 }
 

The first rule will cause the method IlvLinkLayout.setLinkStyle(java.lang.Object, int) to be called for all the links that match the rule. Note: Starting with JTGO 7.5, if you are not using any node or link parameters, you can disable this mechanism using setUsePerObjectParameters(false). This will remove the overhead of testing the parameters, which can speed up the rendering process significantly.

Since:
JTGO 4.0
See Also:
IlpEquipmentView

Field Summary
 
Fields inherited from class ilog.cpl.graph.css.renderer.IlpLayoutRenderer
rendererPseudoClass
 
Constructor Summary
IlpLinkLayoutRenderer()
           
 
Method Summary
 IlvGraphLayout getLinkLayout()
          Returns the graph layout for links.
 IlvGraphLayout getLinkLayout(IlpRepresentationObject ro)
          Return the link layout that is associated with the given representation object.
 boolean isUsePerObjectParameters()
          Returns true if per-object layout parameters are enabled (the default), or false otherwise.
 void setLinkLayout(IlpRepresentationObject ro, IlvGraphLayout layout)
          Sets the link layout that is associated to the given subnetwork representation object.
 void setLinkLayout(IlvGraphLayout layout)
          Changes the link layout.
 void setUsePerObjectParameters(boolean use)
          Enables or disables per-object layout parameters.
 
Methods inherited from class ilog.cpl.graph.css.renderer.IlpLinkLayoutRenderer
apply, applyDeclarations, customizeContainerGraphic, customizeGraphic, getCSSID, reset
 
Methods inherited from class ilog.cpl.graph.css.renderer.IlpLayoutRenderer
attach, detach, getLayoutParameters
 
Methods inherited from class ilog.cpl.graph.css.renderer.IlpAbstractRepresentationViewRenderer
getView, noteContainerAdded, noteContainerUpdated
 
Methods inherited from class ilog.cpl.graphic.css.renderer.IlpAbstractGraphicViewRenderer
getContext, getGraphicView, isRendererEnabled, setRendererEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlpLinkLayoutRenderer

public IlpLinkLayoutRenderer()
Method Detail

getLinkLayout

public IlvGraphLayout getLinkLayout()
Returns the graph layout for links.

Overrides:
getLinkLayout in class ilog.cpl.graph.css.renderer.IlpLinkLayoutRenderer
Returns:
A graph layout or null if none has been specified.

setLinkLayout

public void setLinkLayout(IlvGraphLayout layout)
Changes the link layout.

Overrides:
setLinkLayout in class ilog.cpl.graph.css.renderer.IlpLinkLayoutRenderer
Parameters:
layout - A graph layout or null.

getLinkLayout

public IlvGraphLayout getLinkLayout(IlpRepresentationObject ro)
Return the link layout that is associated with the given representation object.

Overrides:
getLinkLayout in class ilog.cpl.graph.css.renderer.IlpLinkLayoutRenderer
Parameters:
ro - Representation object
Returns:
The link layout that have been configured for the given representation object or null if nothing has been explicitely configured to this node.
Since:
JViews 7.5

setLinkLayout

public void setLinkLayout(IlpRepresentationObject ro,
                          IlvGraphLayout layout)
Sets the link layout that is associated to the given subnetwork representation object.

The value is stored here just temporarily while the composite grapher of the given representation object is not created.

Overrides:
setLinkLayout in class ilog.cpl.graph.css.renderer.IlpLinkLayoutRenderer
Since:
JViews 7.5

isUsePerObjectParameters

public boolean isUsePerObjectParameters()
Returns true if per-object layout parameters are enabled (the default), or false otherwise.

Overrides:
isUsePerObjectParameters in class ilog.cpl.graph.css.renderer.IlpLinkLayoutRenderer
Since:
JViews 7.5
See Also:
setUsePerObjectParameters(boolean)

setUsePerObjectParameters

public void setUsePerObjectParameters(boolean use)
Enables or disables per-object layout parameters.

This method can be used to disable or re-enable the mechanism that sets per-link parameters, as explained in the class description.

By default, per-object parameters are enabled. You can disable them if you are sure that your style sheet does not use any per-object layout parameters. Disabling per-object parameters speeds up the rendering process.

Overrides:
setUsePerObjectParameters in class ilog.cpl.graph.css.renderer.IlpLinkLayoutRenderer
Parameters:
use - If this parameter is true, per-object layout parameters can be set in the style sheet, as explained in the class description. If this parameter is false, per-object layout parameters are ignored.
Since:
JViews 7.5


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.