// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Network Component configuration
// Type: Network
//
// This is the main selector when customizing
// a Network Component. It identifies the 
// sub-components that will be addressed in the
// CSS customization. 
//
// In the Network Component, it is possible
// to customize the following elements:
//
// List of Properties:
// - adapter:     Adapter configuration, such as
//                origins and filters
// - toolbar:     Toolbar buttons and interactors
// - view:        Network view configuration, such as
//                horizontal and vertical scrollbars
// - overview:    Overview window
// - interactor:  Default view interactor and
//                object interactors
// - zooming:     Zoom policy
// - graphLayout: Graph Layout configuration
// - linkLayout:  Link Layout configuration
// - labelLayout: Label Layout configuration
// - backgrounds: Network View Backgrounds
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Network {
  view: true;
  toolbar: true;
  interactor: true;
  zooming: true;
  backgrounds: true;
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Style Sheet configuration
// Type: StyleSheet
// 
// The following list shows all possible properties for
// the style sheet
//
// List of available properties:
// - styleSheetDebugMask: int
// - funtionList: String
//
// Example:
//StyleSheet {
//    styleSheetDebugMask: "BAD_PROP_MASK|BAD_CLASS_MASK|FAILED_CONVERSIONS_MASK|WARNING_PROP_MASK";
//    functionList: "MediaMapFunction, MediaColorFunction";
//}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Configure the Network View
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View {
  keepingAspectRatio: true;
  maxZoomXFactor: 10;
  maxZoomYFactor: 10;
}


// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Configure the Toolbar buttons
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ToolBar {
  enabled: true;
  button[0]: @+SelectButton;
  button[1]: @+PanButton;
  button[2]: @+ZoomInButton;
  button[3]: @+ZoomOutButton;
  button[4]: @+ZoomBackButton;
  button[5]: @+ZoomResetButton;
  button[6]: @+FitToContentsButton;
  button[7]: @+ZoomViewButton;
}

#SelectButton {
  actionType: "Select";
  usingObjectInteractor: true;
  popupMenuFactory: @=viewPopupMenuFactory;
  opaqueMove: true;
  action[0]: @+action0;
  action[1]: @+action1;
}

#viewPopupMenuFactory {
  class: 'alarm.AlarmPopupMenuFactory';
}

#action0 {
  key: "control A";
  class: "ilog.cpl.graph.action.IlpSelectAllObjectsAction";
}
#action1 {
  gesture: BUTTON1_DOUBLE_CLICKED;
  class: "alarm.ShowDetailsAction";
}

#PanButton {
  actionType: "Pan";
  usingObjectInteractor: false;
}

#ZoomInButton {
  actionType: "ZoomIn";
}

#ZoomOutButton {
  actionType: "ZoomOut";
}

#ZoomBackButton {
  actionType: "ZoomBack";
}

#ZoomResetButton {
  actionType: "ZoomReset";
}

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

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


// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Configure the default view interactor
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Interactor {
  name: "Select";
}


// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Configure Zoom Policy: Mixed, Logical or Physical
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Zooming {
  type: "Mixed";
}


// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Configure Background file
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Backgrounds {
  background[0]: "europe_smaller.png";
}


// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Customize subnetwork expansion mode and
// foreground
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#SubNetwork1 {
  expansion: IN_PLACE;
  subnetworkFrame: TITLEBAR_FRAME;
  subnetworkTitleColor: black;
  subnetworkTitleJustification: Center|Bottom;
  subnetworkBackground: '#607F7F7F';
  subnetworkForeground: '#607F7F7F';
  subnetworkOpaque: true;
  subnetworkTopMargin: 10;
  subnetworkBottomMargin: 10;
  subnetworkLeftMargin: 10;
  subnetworkRightMargin: 10;
}

#SubNetwork1:hover { 
  subnetworkForeground: '#60FFFFFF';
}

#SubNetwork1:expanded { 
  toolTipText: '@|alarmSummary("Default", "Description")';
}

#SubNetwork1:expanded:impactAlarm {
  toolTipText: '@|alarmSummary("Impact", "Description")';
}


// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Customize polygonal group representation
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#PolyGroup {
  reliefThickness: 1.0;
  borderWidth: 0.5;
  outlineWidth: 4.0;
  outlineInside: false;
}


// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Customize business object to show either
// raw alarms or impact alarms.
//
// See: AlarmPopupMenuFactory
//
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

object."ilog.tgo.model.IltObject" {
  primaryAlarmState: Raw;
  labelFont: "arial-plain-12";
  labelBackground: '';
  interactor: @+objInter;
}

object."ilog.tgo.model.IltObject":impactAlarm {
  primaryAlarmState: Impact;
}

object."ilog.tgo.model.IltObject":hover {
  labelFont: "arial-bold-12";
  labelBackground: '#60FFFFFF';
}


// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Customize object interactor
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#objInter { 
  class: "ilog.cpl.interactor.IlpDefaultObjectInteractor";
  action[0]: @+enterAction;
  action[1]: @+exitAction;
}

#enterAction { 
  class: 'ilog.cpl.interactor.IlpGestureAction';
  gesture: MOUSE_ENTERED;
  action: @+addPseudoClassAction;
}

#exitAction { 
  class: 'ilog.cpl.interactor.IlpGestureAction';
  gesture: MOUSE_EXITED;
  action: @+removePseudoClassAction;
}

#addPseudoClassAction { 
  class: 'alarm.AddPseudoClassAction';
  pseudoClass: hover;
}

#removePseudoClassAction { 
  class: 'alarm.RemovePseudoClassAction';
  pseudoClass: hover;
}