package de.dwslab.risk.gui;

import javax.swing.ImageIcon;

import de.dwslab.risk.gui.model.Entity;
import de.dwslab.risk.gui.model.Type;
import de.dwslab.risk.gui.model.UserObject;

public enum RoCAShape implements RoCAIcons {

    COMPONENT("Component", ICON_RECTANGLE, null, 160, 120, Entity.create("New Component", new Type(
            "infra"))),

    RISK("Risk", ICON_ELLIPSE, "ellipse", 160, 120, Entity.create("New Risk", new Type("risk"))),

    REDUNDANCY("Redundancy", ICON_CONTAINER, "swimlane", 280, 280, Entity.create(
            "New Redundancy Component", new Type("redundancy")));

    private final String name;
    private final ImageIcon icon;
    private final String style;
    private final int width;
    private final int height;
    private final UserObject value;

    private RoCAShape(String name, ImageIcon icon, String style, int width, int height,
            UserObject value) {
        this.name = name;
        this.icon = icon;
        this.style = style;
        this.width = width;
        this.height = height;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public ImageIcon getIcon() {
        return icon;
    }

    public String getStyle() {
        return style;
    }

    public int getWidth() {
        return width;
    }

    public int getHeight() {
        return height;
    }

    public UserObject getValue() {
        return value;
    }

}

@@ -240,55 +240,313 @@
     
-COMPONENT(%22Component%22, ICON_RECTANGLE, null, 16
+SERVICE(%22Service%22, IMAGE_WRENCH,%0D%0A            %22icon;image=/com/mxgraph/examples/swing/images/wrench.png%22,%0D%0A            120, 120, Entity.create(%22New Service%22, new Type(%22infra%22))),%0D%0A%0D%0A    SERVER(%22Server%22, IMAGE_SERVER,%0D%0A            %22icon;image=/com/mxgraph/examples/swing/images/server.png%22,%0D%0A            12
 0, 1
@@ -568,25 +568,22 @@
 te(%22New 
-Component
+Server
 %22, new T
@@ -590,78 +590,277 @@
 ype(
-%0D%0A            %22infra%22))),%0D%0A%0D%0A    RISK(%22Risk%22, ICON_ELLIPSE, %22ellipse%22,
+%22infra%22))),%0D%0A%0D%0A    PRINTER(%22Printer%22, IMAGE_PRINTER,%0D%0A            %22icon;image=/com/mxgraph/examples/swing/images/printer.png;fill%22,%0D%0A            120, 120, Entity.create(%22New Printer%22, new Type(%22infra%22))),%0D%0A%0D%0A    COMPONENT(%22Component%22, ICON_RECTANGLE, null,%0D%0A           
  160
@@ -889,12 +889,17 @@
 New 
-Risk
+Component
 %22, n
@@ -907,20 +907,21 @@
 w Type(%22
-risk
+infra
 %22))),%0D%0A%0D
@@ -977,16 +977,29 @@
 imlane%22,
+%0D%0A           
  280, 28
@@ -1015,30 +1015,16 @@
 .create(
-%0D%0A            
 %22New Red
@@ -1067,16 +1067,140 @@
 ancy%22)))
+,%0D%0A%0D%0A    RISK(%22Risk%22, ICON_CLOUD, %22ellipse;shape=cloud%22,%0D%0A            160, 120, Entity.create(%22New Risk%22, new Type(%22risk%22)))
 ;%0D%0A%0D%0A   

Use shapes with Icons.