////////////////////////////////////////////////////////////////////////////////
//  StyleSheet

SDM {
  Renderers : "DiagramRenderer=ilog.diagram.renderer.IlxDiagramSDMRenderer,LinkLayout=ilog.omdiagram.graphlayout.IlxOMSDMMixedLayout";
  DiagramRenderer : "true";
}

#ForkLayout {
  class : ilog.omdiagram.graphlayout.IlxOMForkLayout;
}

////////////////////////////////////////////////////////////////////////////////
//  nodes

node {
  fillColor1 : #FFFFEE;
  fillColor2 : #FFFFEE;
  fillStyle : SOLID_COLOR;
  foreground : #990033;
  Layer : 12;
}

node:selected {
  Layer : 13;
}

////////////////////////////////////////////////////////////////////////////////
// uml:Package

#packageBoxLayout {
  class : ilog.diagram.graphic.IlxBoxLayout;
  hgap : 4;
}

#packageNameGraphic {
  class : ilog.diagram.graphic.IlxGraphicLabel;
  label : @uml:qualifiedName;
  font : "sansserif-BOLD-12";
  alignment : 1; // CENTER
  maxWidth : 200;
}

////////////////////////////////////////////////////////////////////////////////
// uml:Class

#boxLayout {
  class : ilog.diagram.graphic.IlxBoxLayout;
}

#borderLayout {
  class : ilog.diagram.graphic.IlxBorderLayout;
}

#lineSeparator {
  class : ilog.diagram.graphic.IlxGraphicSeparator;
  foreground : #990033;
}

#otPackageNameGraphic {
  class : ilog.diagram.graphic.IlxGraphicLabel;
  label : @|computePackageName(@uml:containerQualifiedName,@uml:containerName);
  font : "sansserif-ITALIC-12";
  alignment : 2; // RIGHT
  SDMObject : @ilx:this;
  maxWidth : 160;
}

#superTypeGraphic {
  class : ilog.diagram.graphic.IlxGraphicLabel;
  label : @uml:superTypeDescription;
  font : "sansserif-ITALIC-12";
  alignment : 0; // LEFT
}

#superTypesGraphic {
  class : ilog.diagram.graphic.IlxGraphicFolderPanel;
  topMargin : 1;
  SDMObject : @ilx:this;
  layoutManager : @+boxLayout;
  components : @|ForEach(@local:invisibleSuperTypes,superTypeGraphic,null);
  label : "supertypes";
}

#subTypeGraphic {
  class : ilog.diagram.graphic.IlxGraphicLabel;
  label : @uml:subTypeDescription;
  font : "sansserif-ITALIC-12";
  alignment : 2; // RIGHT
}

#subTypesGraphic {
  class : ilog.diagram.graphic.IlxGraphicFolderPanel;
  topMargin : 3;
  SDMObject : @ilx:this;
  layoutManager : @+boxLayout;
  components : @|ForEach(@local:invisibleSubTypes,subTypeGraphic,null);
  label : "subtypes";
}

#typeNameGraphic {
  class : ilog.diagram.graphic.IlxGraphicLabel;
  label : @uml:name;
  font : "sansserif-BOLD-12";
  alignment : 1; // CENTER
}

#attributeGraphic {
  class : ilog.diagram.graphic.IlxGraphicLabel;
  label : @uml:description;
  font : "sansserif-12";
  toolTipText : '@|@uml:visSymbol+@uml:description';
  SDMObject : @ilx:this;
}

#attributeGraphic.umlAttribute["uml:visibility"="public"] {
  icon : url(../../images/ilog/attr_pub.png);
}

#attributeGraphic.umlAttribute["uml:visibility"="protected"] {
  icon : url(../../images/ilog/attr_pro.png);
}

#attributeGraphic.umlAttribute["uml:visibility"="private"] {
  icon : url(../../images/ilog/attr_pri.png);
}

#attributeGraphic.umlRelation["uml:isNary"=false]["uml:visibility"="public"] {
  icon : url(../../images/ilog/rel1_pub.png);
}

#attributeGraphic.umlRelation["uml:isNary"=false]["uml:visibility"="protected"] {
  icon : url(../../images/ilog/rel1_pro.png);
}

#attributeGraphic.umlRelation["uml:isNary"=false]["uml:visibility"="private"] {
  icon : url(../../images/ilog/rel1_pri.png);
}

#attributeGraphic.umlRelation["uml:isNary"=true]["uml:visibility"="public"] {
  icon : url(../../images/ilog/reln_pub.png);
}

#attributeGraphic.umlRelation["uml:isNary"=true]["uml:visibility"="protected"] {
  icon : url(../../images/ilog/reln_pro.png);
}

#attributeGraphic.umlRelation["uml:isNary"=true]["uml:visibility"="private"] {
  icon : url(../../images/ilog/reln_pri.png);
}

#attributesGraphic {
  class : ilog.diagram.graphic.IlxGraphicFolderPanel;
  //class : ilog.diagram.graphic.IlxGraphicPanel;
  SDMObject : @ilx:this;
  layoutManager : @+boxLayout;
  components : @|ForEach(@local:attributes,attributeGraphic,null);
  label : "attributes";
}

#operationGraphic {
  class : ilog.diagram.graphic.IlxGraphicLabel;
  label : @uml:shortDescription;
  font : "sansserif-12";
  toolTipText : '@|@uml:visSymbol+@uml:shortDescription';
  SDMObject : @ilx:this;
}

#operationGraphic.umlOperation["uml:visibility"="public"] {
  icon : url(../../images/ilog/ope_pub.png);
}

#operationGraphic.umlOperation["uml:visibility"="protected"] {
  icon : url(../../images/ilog/ope_pro.png);
}

#operationGraphic.umlOperation["uml:visibility"="private"] {
  icon : url(../../images/ilog/ope_pri.png);
}

#operationsGraphic {
  class : ilog.diagram.graphic.IlxGraphicFolderPanel;
  //class : ilog.diagram.graphic.IlxGraphicPanel;
  SDMObject : @ilx:this;
  layoutManager : @+boxLayout;
  components : @|ForEach(@local:operations,operationGraphic,null);
  label : "operations";
}

#objectTypeHeader {
  class : ilog.diagram.graphic.IlxGraphicPanel;
  layoutManager : @+borderLayout;
  components[1] : @+otPackageNameGraphic;
  constraints[0] : "West";
  constraints[1] : "East";
}

#verticalScrollBar {
  class : ilog.diagram.graphic.IlxGraphicScrollBar;
  orientation : 1; // VERTICAL
  increment : 10;
  increaseIconLocation : url(../../images/ilog/scrollup.png);
  trackerIconLocation : url(../../images/ilog/scrollvtracker.png);
  decreaseIconLocation : url(../../images/ilog/scrolldown.png);
  thumbColor : #C0A0A0A0;
}

#membersGraphic {
  class : ilog.diagram.graphic.IlxGraphicScrollPanel;
  verticalScrollBar : @+verticalScrollBar;
  layoutManager : @+boxLayout;

  components[0] : @+attributesGraphic;
  components[1] : @+lineSeparator;
  components[2] : @+operationsGraphic;

  SDMObject : @ilx:this;
}

#linkConnector {
  class : ilog.diagram.graphlayout.IlxRelativeLinkConnector;
  connectionPointMoveAllowed : "true";
}

node.umlClass {
  class : ilog.diagram.graphic.IlxGraphicFrame;

  minimumWidth : 120;
  minimumHeight : 60;
  maximumWidth : 180;
  maximumHeight : 200;

  layoutManager : @+boxLayout;

  components[0] : @+objectTypeHeader;
  components[1] : @+typeNameGraphic;
  components[2] : @+lineSeparator;
  components[3] : @+membersGraphic;

  SDMObject : @ilx:this;

  toolTipText : @uml:qualifiedName;
  Expandable : false;
  LinkConnector : @+linkConnector;
  LayoutFixed : @local:layoutFixed;
}

////////////////////////////////////////////////////////////////////////////////
//  links

link {
  class : ilog.diagram.graphic.IlxGeneralLink;
  oriented : true;
  lineWidth : 1;
  maximumLineWidth : 4;
  minimumLineWidth : 1;
  Layer : 10;
}

////////////////////////////////////////////////////////////////////////////////
// Arrow graphics

#arrowRelationPaint {
  class : ilog.views.sdm.graphic.IlvPaint;
  color : #990033;
}

#arrowExtendsPaint {
  class : ilog.views.sdm.graphic.IlvPaint;
  color : #005DA0;
}

#arrowSelectedPaint {
  class : ilog.views.sdm.graphic.IlvPaint;
  color : #A3A3CC;
}

#arrowFillPaint {
  class : ilog.views.sdm.graphic.IlvPaint;
  color : #990033;
}

#arrowWhitePaint {
  class : ilog.views.sdm.graphic.IlvPaint;
  color : white;
}

#noneGraphic {
  class : ilog.diagram.graphic.IlxGeneralPath$Shape;
  IlvRect : "0,0,,0";
  shape : "M 0 0";
}

#fromDiamondGraphic {
  class : ilog.diagram.graphic.IlxGeneralPath$Shape;
  IlvRect : "0,0,30,10";
  shape : "M 0 10 L -1 10 M 10 10 L 15 0 L 20 10 L 15 20 Z";
  strokePaint : @=arrowRelationPaint;
  fillOn : true;
  fillPaint : @=arrowWhitePaint;
}

#toDiamondGraphic {
  class : ilog.diagram.graphic.IlxGeneralPath$Shape;
  IlvRect : "0,0,30,10";
  shape : "M 0 10 L 1 10 M -10 10 L -15 0 L -20 10 L -15 20 Z";
  strokePaint : @=arrowRelationPaint;
  fillOn : true;
  fillPaint : @=arrowWhitePaint;
}

#fromDiamondFilledGraphic {
  class : ilog.diagram.graphic.IlxGeneralPath$Shape;
  IlvRect : "0,0,30,10";
  shape : "M 0 10 L -1 10 M 10 10 L 15 0 L 20 10 L 15 20 Z";
  strokePaint : @=arrowRelationPaint;
  fillOn : true;
  fillPaint : @=arrowFillPaint;
}

#toDiamondFilledGraphic {
  class : ilog.diagram.graphic.IlxGeneralPath$Shape;
  IlvRect : "0,0,30,10";
  shape : "M 0 10 L 1 10 M -10 10 L -15 0 L -20 10 L -15 20 Z";
  strokePaint : @=arrowRelationPaint;
  fillOn : true;
  fillPaint : @=arrowFillPaint;
}

#closedArrowGraphic {
  class : ilog.diagram.graphic.IlxGeneralPath$Shape;
  IlvRect : "0,0,18,18";
  shape : "M 5 0 L -5 10 L -5 -10 Z";
  strokePaint : @=arrowExtendsPaint;
  fillOn : true;
  fillPaint : @=arrowWhitePaint;
}

#fromOpenArrowGraphic {
  class : ilog.diagram.graphic.IlxGeneralPath$Shape;
  IlvRect : "0,0,24,12";
  shape : "M -5 0 L -10 5 L -5 10 M -16 5 L -16 5";
  strokePaint : @=arrowRelationPaint;
}

#toOpenArrowGraphic {
  class : ilog.diagram.graphic.IlxGeneralPath$Shape;
  IlvRect : "0,0,24,12";
  shape : "M 5 0 L 10 5 L 5 10 M 16 5 L 16 5";
  strokePaint : @=arrowRelationPaint;
}

#toLabel {
  class : ilog.views.sdm.graphic.IlvPowerLabel;
  label : '@|@uml:visSymbol+@uml:name';
  antialiasing : true;
}

#fromLabel {
  class : ilog.views.sdm.graphic.IlvPowerLabel;
  label : '@|@uml:visSymbol+@uml:inverseName';
  antialiasing : true;
}

#OtoNGraphic {
  class : ilog.views.sdm.graphic.IlvPowerLabel;
  label : "0..*";
  antialiasing : true;
}

#ltolGraphic {
  class : ilog.views.sdm.graphic.IlvPowerLabel;
  label : "1";
  antialiasing : true;
}

#multiplicityGraphic {
  class : ilog.views.sdm.graphic.IlvPowerLabel;
  label : @uml:multiplicity;
  antialiasing : true;
}

#inverseMultiplicityGraphic {
  class : ilog.views.sdm.graphic.IlvPowerLabel;
  label : @uml:inverseMultiplicity;
  antialiasing : true;
}

////////////////////////////////////////////////////////////////////////////////
// uml:Generalize

link.umlGeneralize {
  foreground : #005DA0;
  arrowColor : #005DA0;
  arrowRatio : 2;
  arrowMode : ARROW_DECORATION;
  decorations[0] : @=closedArrowGraphic;
  decorationPositions[0] : 1;
  decorationOptions[0] : "DECORATION_OVER|DECORATION_ROTATE|DECORATION_HALF_RETRACT_AT_END";
  drawFork : false;
  toolTipText : @uml:qualifiedName;
  SDMObject : @ilx:this;
  Layer : 9;
}

link.umlGeneralize:linkLayoutRenderer {
  NodeSideForOrigin : Top;
  NodeSideForDestination : Bottom;
}

////////////////////////////////////////////////////////////////////////////////
// uml:Relation

#arrowBBox {
   class : "ilog.views.sdm.graphic.IlvGraphicFactories$Rectangle";
   IlvRect : 0,0,40,20;
}



link.umlRelation {
  foreground : #990033;
  arrowColor : #990033;
  arrowRatio : 1.25;
  arrowMode : ARROW_DECORATION;
  decorations[0] = @+toLabel;
  decorationPositions[0] : 0.75;
  decorationOffsetX[0] : @local:labelOffsetX;
  decorationOffsetY[0] : @local:labelOffsetY;
  decorationProperties[0] = "local:labelOffset";
  decorations[1] = @=noneGraphic;//@+multiplicityGraphic;
  decorationPositions[1] : 0.95;
  decorationOffsetX[1] : @local:cardOffsetX;
  decorationOffsetY[1] : @local:cardOffsetY;
  decorationProperties[1] = "local:cardOffset";
  toolTipText : '@|@uml:visSymbol+@uml:qualifiedName';
  SDMObject : @ilx:this;
  decorations[2] : @=noneGraphic;
  decorationPositions[2] : 0;
  decorationOptions[2] : "DECORATION_OVER|DECORATION_ROTATE";
  decorations[3] : @=noneGraphic;
  decorationPositions[3] : 1;
  decorationOptions[3] : "DECORATION_OVER|DECORATION_ROTATE";
  decorations[4] : @=noneGraphic;
  decorationPositions[4] : 0.25;
  decorationOffsetX[4] : @local:invLabelOffsetX;
  decorationOffsetY[4] : @local:invLabelOffsetY;
  decorationProperties[4] = "local:invLabelOffset";
  decorations[5] : @=noneGraphic;
  decorationPositions[5] : 0.05;
  decorationOffsetX[5] : @local:invCardOffsetX;
  decorationOffsetY[5] : @local:invCardOffsetY;
  decorationProperties[5] = "local:invCardOffset";
}

// from arrow
link.umlRelation["uml:isNavigable"=false]["uml:inverseIsNavigable"=true]["uml:aggregation"="none"] {
  decorations[2] : @=fromOpenArrowGraphic;
}

// to arrow
link.umlRelation["uml:isNavigable"=true]["uml:inverseIsNavigable"=false]["uml:inverseAggregation"="none"] {
  decorations[3] : @=toOpenArrowGraphic;
}

// from composite
link.umlRelation["uml:aggregation"="composite"] {
  decorations[2] : @=fromDiamondFilledGraphic;
}

// from shared
link.umlRelation["uml:aggregation"="shared"] {
  decorations[2] : @=fromDiamondGraphic;
}

// to composite
link.umlRelation["uml:inverseAggregation"="composite"] {
  decorations[3] : @=toDiamondFilledGraphic;
}

// to shared
link.umlRelation["uml:inverseAggregation"="shared"] {
  decorations[3] : @=toDiamondGraphic;
}

// inverse relation labels
link.umlRelation["uml:hasInverse"=true] {
  decorations[4] = @=fromLabel;
  toolTipText : '@|@uml:visSymbol+@uml:qualifiedName+" / "+@uml:inverseVisSymbol+@uml:inverseQualifiedName';
}
