// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Network component additional customization
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Network {
  view: true;
  toolbar: true;
  zooming: true;
  interactor: true;
  graphLayout: true;
}

// Configure the view
View {
  keepingAspectRatio: true;
  maxZoomXFactor: 25;
  maxZoomYFactor: 25;
}

// Configure the toolbar to disallow moving of objects.
ToolBar {
  enabled: true;
  button[0]: @+SelectButton;
  button[1]: @+ZoomInButton;
  button[2]: @+ZoomOutButton;
  button[3]: @+ZoomBackButton;
  button[4]: @+ZoomResetButton;
  button[5]: @+FitToContentsButton;
  button[6]: @+ZoomViewButton;
}

#SelectButton {
  actionType: "Select";
  opaqueMove: true;
}

#ZoomInButton {
  actionType: "ZoomIn";
}

#ZoomOutButton {
  actionType: "ZoomOut";
}

#ZoomBackButton {
  actionType: "ZoomBack";
}

#ZoomResetButton {
  actionType: "ZoomReset";
}

#FitToContentsButton {
  actionType: "FitToContents";
  margins: "5";
}

#ZoomViewButton {
  actionType: "ZoomView";
  usingObjectInteractor: false;
}

// Configure Default View Interactor
Interactor {
  name: "Select";
}

// Configure Zoom Policy
Zooming {
  type: "Mixed";
}

// Configure Graph layout
GraphLayout { 
  layouts[0]: @+circularLayout;
  layouts[1]: @+hierarchicalLayout;
  layouts[2]: @+radialTreeLayout;
  layouts[3]: @+springEmbedderLayout;
  layouts[4]: @+treeLayout;
  layouts[5]: @+uniformLayout;
  autoLayoutIndex: -1;
}

//
// Circular Layout Configuration
//

// Create the Circular Layout
#circularLayout { 
  class: 'ilog.views.graphlayout.circular.IlvCircularLayout';
}

// Configure the cluster for each object
#SantaFe:graphLayoutRenderer:circular { 
  clusterIds[0]: @+cluster1;
}

#North:graphLayoutRenderer:circular { 
  clusterIds[0]: @+cluster2;
  starCenter: true;
}

#N1:graphLayoutRenderer:circular { 
  clusterIds[0]: @+cluster2;
}

#N2:graphLayoutRenderer:circular { 
  clusterIds[0]: @+cluster2;
}

#N3:graphLayoutRenderer:circular { 
  clusterIds[0]: @+cluster2;
}

#East:graphLayoutRenderer:circular { 
  clusterIds[0]: @+cluster3;
  starCenter: true;
}

#E1:graphLayoutRenderer:circular { 
  clusterIds[0]: @+cluster3;
}

#E2:graphLayoutRenderer:circular { 
  clusterIds[0]: @+cluster3;
}

#E3:graphLayoutRenderer:circular { 
  clusterIds[0]: @+cluster3;
}

#E4:graphLayoutRenderer:circular { 
  clusterIds[0]: @+cluster3;
}

// Create the clusters
#cluster1 {
  class: 'ilog.views.graphlayout.circular.IlvClusterNumber(number)';
  number: 1;
}

#cluster2 {
  class: 'ilog.views.graphlayout.circular.IlvClusterNumber(number)';
  number: 2;
}

#cluster3 {
  class: 'ilog.views.graphlayout.circular.IlvClusterNumber(number)';
  number: 3;
}

//
// Hierarchical Layout Configuration
//

#hierarchicalLayout { 
  class: 'ilog.views.graphlayout.hierarchical.IlvHierarchicalLayout';
  flowDirection: Bottom;
  horizontalNodeOffset: 70;
  verticalNodeOffset: 100;
  // If we choose NO_RESHAPE_STYLE here, JTGO will take over
  // the link placement. If we choose any other link style, we can
  // use one of the connector styles supported by the class IlvHierarchicalLayout
  // globalLinkStyle: NO_RESHAPE_STYLE;
  globalLinkStyle: MIXED_STYLE;
  // globalLinkStyle: POLYLINE_STYLE;
  // globalLinkStyle: ORTHOGONAL_STYLE;
  // globalLinkStyle: STRAIGHT_LINE_STYLE;

  connectorStyle: AUTOMATIC_PINS;
  // connectorStyle: CENTERED_PINS;
  // connectorStyle: CLIPPED_PINS;
  // connectorStyle: EVENLY_SPACED_PINS;
}


//
// Tree Layout Configuration 1
//

#radialTreeLayout { 
  class: 'ilog.views.graphlayout.tree.IlvTreeLayout';
  layoutMode: RADIAL;
  globalLinkStyle: NO_RESHAPE_STYLE;
}

//
// Spring Embedder Layout Configuration
//
#springEmbedderLayout { 
  class: 'ilog.views.graphlayout.springembedder.IlvSpringEmbedderLayout';
  allowedTime: 1000;
}

//
// Tree Layout Configuration 2
// 
#treeLayout { 
  class: 'ilog.views.graphlayout.tree.IlvTreeLayout';
  flowDirection: Bottom;
  siblingOffset: 70;
  branchOffset: 70;
  parentChildOffset: 100;
}

// Specify the root node
#SantaFe:graphLayoutRenderer:tree { 
  root: true;
}

//
// Uniform Length Edges Layout Configuration
//

#uniformLayout { 
  class: 'ilog.views.graphlayout.uniformlengthedges.IlvUniformLengthEdgesLayout';
  allowedTime: 1000;
}