summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--de.dhbw.horb.ksm.core/.classpath7
-rw-r--r--de.dhbw.horb.ksm.core/.gitignore1
-rw-r--r--de.dhbw.horb.ksm.core/.project28
-rw-r--r--de.dhbw.horb.ksm.core/META-INF/MANIFEST.MF36
-rw-r--r--de.dhbw.horb.ksm.core/build.properties10
-rw-r--r--de.dhbw.horb.ksm.core/icons/16/ksm-connection-new.pngbin0 -> 609 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/16/ksm-modell.pngbin0 -> 786 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/16/ksm-node-delete.pngbin0 -> 616 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/16/ksm-node-new.pngbin0 -> 697 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/16/ksm-node-property-add.pngbin0 -> 645 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/16/ksm-node-property-delete.pngbin0 -> 610 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/16/ksm-node.pngbin0 -> 560 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/16/ksm-nodegroup-delete.pngbin0 -> 656 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/16/ksm-nodegroup-new.pngbin0 -> 571 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/16/ksm-nodegroup.pngbin0 -> 569 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/32/ksm-connection-new.pngbin0 -> 1385 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/32/ksm-modell.pngbin0 -> 1920 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/32/ksm-node-delete.pngbin0 -> 1116 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/32/ksm-node-new.pngbin0 -> 1607 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/32/ksm-node-property-add.pngbin0 -> 1221 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/32/ksm-node-property-delete.pngbin0 -> 1092 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/32/ksm-node.pngbin0 -> 1057 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/32/ksm-nodegroup-delete.pngbin0 -> 1172 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/32/ksm-nodegroup-new.pngbin0 -> 1042 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/32/ksm-nodegroup.pngbin0 -> 1042 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/alt_about.gifbin0 -> 9340 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/alt_launcher.icnsbin0 -> 51159 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/alt_launcher.icobin0 -> 26694 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/alt_launcher.xpm307
-rw-r--r--de.dhbw.horb.ksm.core/icons/alt_window_16.gifbin0 -> 637 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/alt_window_32.gifbin0 -> 1192 bytes
-rw-r--r--de.dhbw.horb.ksm.core/icons/releng_gears.gifbin0 -> 159 bytes
-rw-r--r--de.dhbw.horb.ksm.core/ksm-target-definition.target141
-rw-r--r--de.dhbw.horb.ksm.core/plugin.xml252
-rw-r--r--de.dhbw.horb.ksm.core/schema/de.dhbw.horb.ksm.core.mode.property.exsd128
-rw-r--r--de.dhbw.horb.ksm.core/splash.bmpbin0 -> 135600 bytes
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/Activator.java61
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/Application.java46
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/ApplicationActionBarAdvisor.java26
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/ApplicationWorkbenchAdvisor.java39
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/ApplicationWorkbenchWindowAdvisor.java48
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/KSMMessages.java20
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/actions/DiagramActionBarContributor.java37
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/ConnectionCreateCommand.java44
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/ConnectionDeleteCommand.java46
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/ConnectionReconnectCommand.java103
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeCreateCommand.java63
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeDeleteCommand.java39
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeGroupCreateCommand.java69
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeGroupDeleteCommand.java38
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeGroupRenameCommand.java61
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeGroupSetBoundsCommand.java83
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeMoveCommand.java70
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeRenameCommand.java50
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/package.html4
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/dnd/DiagramTemplateTransferDropTargetListener.java27
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/figures/KSMNodeFigure.java52
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/figures/KSMNodeGroupFigure.java43
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/ModelProperties.java101
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/NodeGroupRequest.java36
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/NodeGroupRequestFactory.java46
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/NodeRequest.java34
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/NodeRequestFactory.java43
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/property/BaseConnectionPropertyAdvisor.java15
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/property/BaseNodeGroupPropertyAdvisor.java15
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/property/BaseNodePropertyAdvisor.java63
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/property/ModelPropertySource.java161
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/KSMConnectionEditPart.java204
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/KSMEditPart.java110
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/KSMNodeEditPart.java273
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/KSMNodeGroupEditPart.java252
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/PartFactory.java35
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/editmanager/MyCellEditorLocator.java28
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/editmanager/NodeDirectEditManager.java62
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/editmanager/NodeGroupDirectEditManager.java62
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/outline/TreeKSMEditPart.java53
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/outline/TreeNodeEditPart.java81
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/outline/TreeNodeGroupEditPart.java80
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/outline/TreePartFactory.java31
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/routing/ModifiedAutomaticRouter.java226
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/routing/RoundedPolyline.java374
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/routing/RoundedPolylineConnection.java338
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/DiagramLayoutEditPolicy.java121
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeComponentEditPolicy.java36
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeDirectEditPolicy.java30
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeGraphicalNodeEditPolicy.java51
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeGroupComponentEditPolicy.java35
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeGroupDirectEditPolicy.java36
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/package.html9
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/ui/DiagramCreationWizard.java104
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/ui/DiagramEditor.java329
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/extension/AbstractPropertyDescriptorAdvisor.java102
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/handler/CallEditorPerspective.java37
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/messages.properties6
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/perspectives/KSMEditorPerspective.java37
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/project/KSMProjectNature.java39
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/project/NewKSMProjectWizard.java38
-rw-r--r--de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/view/Navigator.java7
-rw-r--r--de.dhbw.horb.ksm.model/.classpath7
-rw-r--r--de.dhbw.horb.ksm.model/.project28
-rw-r--r--de.dhbw.horb.ksm.model/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--de.dhbw.horb.ksm.model/META-INF/MANIFEST.MF9
-rw-r--r--de.dhbw.horb.ksm.model/build.properties4
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/Connection.classbin0 -> 352 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/KSM.classbin0 -> 735 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/Node.classbin0 -> 749 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/NodeGroup.classbin0 -> 902 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/Properties.classbin0 -> 1269 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/ObjectFactory.classbin0 -> 2763 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XConnection.classbin0 -> 986 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XConnections.classbin0 -> 761 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XKSM.classbin0 -> 1259 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XNode.classbin0 -> 1266 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XNodeGroup.classbin0 -> 1579 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XProperties.classbin0 -> 2456 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyBase.classbin0 -> 959 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyBaseList.classbin0 -> 949 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyBoolean.classbin0 -> 904 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyDecimal.classbin0 -> 968 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyDecimalList.classbin0 -> 747 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyInteger.classbin0 -> 968 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyIntegerList.classbin0 -> 747 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyString.classbin0 -> 886 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyStringList.classbin0 -> 737 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/package-info.classbin0 -> 313 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/ConnectionImpl.classbin0 -> 1633 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/KSMFactory.classbin0 -> 2664 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/KSMImpl.classbin0 -> 3527 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/NodeGroupImpl.classbin0 -> 4295 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/NodeImpl.classbin0 -> 3745 bytes
-rw-r--r--de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/PropertiesImpl.classbin0 -> 7485 bytes
-rw-r--r--de.dhbw.horb.ksm.qksm/.classpath7
-rw-r--r--de.dhbw.horb.ksm.qksm/.gitignore1
-rw-r--r--de.dhbw.horb.ksm.qksm/.project28
-rw-r--r--de.dhbw.horb.ksm.qksm/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--de.dhbw.horb.ksm.qksm/META-INF/MANIFEST.MF11
-rw-r--r--de.dhbw.horb.ksm.qksm/build.properties5
-rw-r--r--de.dhbw.horb.ksm.qksm/plugin.xml13
-rw-r--r--de.dhbw.horb.ksm.qksm/src/de/dhbw/horb/ksm/qksm/Activator.java50
-rw-r--r--de.dhbw.horb.ksm.qksm/src/de/dhbw/horb/ksm/qksm/QKSMNodePropertyDescriptorAdvisor.java12
-rw-r--r--de.dhbw.horb.ksm.simulator/.classpath9
-rw-r--r--de.dhbw.horb.ksm.simulator/.gitignore1
-rw-r--r--de.dhbw.horb.ksm.simulator/.project28
-rw-r--r--de.dhbw.horb.ksm.simulator/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--de.dhbw.horb.ksm.simulator/META-INF/MANIFEST.MF16
-rw-r--r--de.dhbw.horb.ksm.simulator/build.properties7
-rw-r--r--de.dhbw.horb.ksm.simulator/icons/16/ksm-simulator.pngbin0 -> 1101 bytes
-rw-r--r--de.dhbw.horb.ksm.simulator/icons/32/ksm-simulator.pngbin0 -> 2200 bytes
-rw-r--r--de.dhbw.horb.ksm.simulator/lib/org.swtchart.ext_0.7.0.v20110128.jarbin0 -> 94661 bytes
-rw-r--r--de.dhbw.horb.ksm.simulator/lib/org.swtchart_0.7.0.v20110128.jarbin0 -> 173774 bytes
-rw-r--r--de.dhbw.horb.ksm.simulator/plugin.xml26
-rw-r--r--de.dhbw.horb.ksm.simulator/src/de/dhbw/horb/simulator/Activator.java50
-rw-r--r--de.dhbw.horb.ksm.simulator/src/de/dhbw/horb/simulator/perspective/SimulatorPerspective.java33
-rw-r--r--de.dhbw.horb.ksm.simulator/src/de/dhbw/horb/simulator/view/SimulatorView.java184
-rw-r--r--de.dhbw.horb.ksm.tableeditor/.classpath7
-rw-r--r--de.dhbw.horb.ksm.tableeditor/.gitignore1
-rw-r--r--de.dhbw.horb.ksm.tableeditor/.project28
-rw-r--r--de.dhbw.horb.ksm.tableeditor/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--de.dhbw.horb.ksm.tableeditor/META-INF/MANIFEST.MF9
-rw-r--r--de.dhbw.horb.ksm.tableeditor/build.properties6
-rw-r--r--de.dhbw.horb.ksm.tableeditor/fragment.xml28
-rw-r--r--de.dhbw.horb.ksm.tableeditor/icons/16/ksm-tableeditor.pngbin0 -> 579 bytes
-rw-r--r--de.dhbw.horb.ksm.tableeditor/icons/32/ksm-tableeditor.pngbin0 -> 832 bytes
-rw-r--r--de.dhbw.horb.ksm.tableeditor/src/de/dhbw/horb/tableeditor/perspective/TableEditorPerspective.java37
-rw-r--r--de.dhbw.horb.ksm.tableeditor/src/de/dhbw/horb/tableeditor/view/PropertyLabelProvider.java75
-rw-r--r--de.dhbw.horb.ksm.tableeditor/src/de/dhbw/horb/tableeditor/view/TableEditorView.java281
-rw-r--r--ksm-model/.classpath9
-rw-r--r--ksm-model/.gitignore3
-rw-r--r--ksm-model/.project17
-rw-r--r--ksm-model/build.xml72
-rw-r--r--ksm-model/doc/Altes Format.txt257
-rw-r--r--ksm-model/doc/KSM-Datamodel.asciidoc289
-rw-r--r--ksm-model/doc/KSM-Datamodel.html1165
-rw-r--r--ksm-model/doc/KSM-Datamodel.pdfbin0 -> 486938 bytes
-rw-r--r--ksm-model/doc/asciidoc-dblatex.sty10
-rwxr-xr-xksm-model/doc/make.sh3
-rw-r--r--ksm-model/ksm-model-1.jarbin0 -> 25272 bytes
-rw-r--r--ksm-model/lib/hamcrest.jarbin0 -> 27828 bytes
-rw-r--r--ksm-model/lib/jaxb-api.jarbin0 -> 105134 bytes
-rw-r--r--ksm-model/lib/jaxb-impl.jarbin0 -> 890168 bytes
-rw-r--r--ksm-model/lib/jaxb-xjc.jarbin0 -> 3133496 bytes
-rw-r--r--ksm-model/lib/jaxb.License.txt274
-rw-r--r--ksm-model/lib/jaxb.ThirdPartyLicenseReadme.txt754
-rw-r--r--ksm-model/lib/junit-4.8.2.jarbin0 -> 237344 bytes
-rw-r--r--ksm-model/lib/mockito-all-1.8.5.jarbin0 -> 1419869 bytes
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/api/Connection.java11
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/api/KSM.java62
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/api/Node.java39
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/api/NodeGroup.java94
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/api/Properties.java138
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/ObjectFactory.java159
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/XConnection.java97
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/XConnections.java74
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/XKSM.java124
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/XNode.java124
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/XNodeGroup.java163
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/XProperties.java268
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyBase.java97
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyBaseList.java75
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyBoolean.java88
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyDecimal.java97
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyDecimalList.java77
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyInteger.java97
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyIntegerList.java77
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyString.java96
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyStringList.java76
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/generated/package-info.java9
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/impl/ConnectionImpl.java49
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/impl/KSMFactory.java74
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/impl/KSMImpl.java109
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/impl/NodeGroupImpl.java153
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/impl/NodeImpl.java109
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/impl/PropertiesImpl.java356
-rw-r--r--ksm-model/src/de/dhbw/horb/ksm/model/impl/package.html3
-rw-r--r--ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestConnection.java30
-rw-r--r--ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestKSM.java47
-rw-r--r--ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestNode.java87
-rw-r--r--ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestNodeGroup.java102
-rw-r--r--ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestProperties.java119
-rw-r--r--ksm-model/test/de/dhbw/horb/ksm/xmlschema/Utils.java18
-rw-r--r--ksm-model/xml/example-1.xml49
-rw-r--r--ksm-model/xml/ksm-1.xsd238
222 files changed, 13290 insertions, 0 deletions
diff --git a/de.dhbw.horb.ksm.core/.classpath b/de.dhbw.horb.ksm.core/.classpath
new file mode 100644
index 0000000..ad32c83
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/de.dhbw.horb.ksm.core/.gitignore b/de.dhbw.horb.ksm.core/.gitignore
new file mode 100644
index 0000000..e660fd9
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/.gitignore
@@ -0,0 +1 @@
+bin/
diff --git a/de.dhbw.horb.ksm.core/.project b/de.dhbw.horb.ksm.core/.project
new file mode 100644
index 0000000..0b60022
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>de.dhbw.horb.ksm.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/de.dhbw.horb.ksm.core/META-INF/MANIFEST.MF b/de.dhbw.horb.ksm.core/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..58ba489
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/META-INF/MANIFEST.MF
@@ -0,0 +1,36 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: KSM
+Bundle-SymbolicName: de.dhbw.horb.ksm.core;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: de.dhbw.horb.ksm.core.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.ui,
+ org.eclipse.ui.navigator,
+ org.eclipse.ui.navigator.resources,
+ org.eclipse.ui.ide;bundle-version="3.6.1",
+ org.eclipse.ui.views;bundle-version="3.5.0",
+ org.eclipse.draw2d;bundle-version="3.6.1",
+ org.eclipse.gef;bundle-version="3.6.1",
+ de.dhbw.horb.ksm.model;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ClassPath: .
+Export-Package: de.dhbw.horb.ksm.core,
+ de.dhbw.horb.ksm.core.editor.actions,
+ de.dhbw.horb.ksm.core.editor.commands,
+ de.dhbw.horb.ksm.core.editor.dnd,
+ de.dhbw.horb.ksm.core.editor.figures,
+ de.dhbw.horb.ksm.core.editor.model,
+ de.dhbw.horb.ksm.core.editor.model.property,
+ de.dhbw.horb.ksm.core.editor.parts,
+ de.dhbw.horb.ksm.core.editor.parts.editmanager,
+ de.dhbw.horb.ksm.core.editor.parts.outline,
+ de.dhbw.horb.ksm.core.editor.parts.routing,
+ de.dhbw.horb.ksm.core.editor.policies,
+ de.dhbw.horb.ksm.core.editor.ui,
+ de.dhbw.horb.ksm.core.extension,
+ de.dhbw.horb.ksm.core.handler,
+ de.dhbw.horb.ksm.core.perspectives,
+ de.dhbw.horb.ksm.core.project,
+ de.dhbw.horb.ksm.core.view
diff --git a/de.dhbw.horb.ksm.core/build.properties b/de.dhbw.horb.ksm.core/build.properties
new file mode 100644
index 0000000..053dd77
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/build.properties
@@ -0,0 +1,10 @@
+source.. = src/
+output.. = bin/
+
+bin.includes = plugin.xml,\
+ .,\
+ META-INF/,\
+ splash.bmp,\
+ icons/
+src.includes = schema/,\
+ icons/
diff --git a/de.dhbw.horb.ksm.core/icons/16/ksm-connection-new.png b/de.dhbw.horb.ksm.core/icons/16/ksm-connection-new.png
new file mode 100644
index 0000000..19797f8
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/16/ksm-connection-new.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/16/ksm-modell.png b/de.dhbw.horb.ksm.core/icons/16/ksm-modell.png
new file mode 100644
index 0000000..e9bb945
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/16/ksm-modell.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/16/ksm-node-delete.png b/de.dhbw.horb.ksm.core/icons/16/ksm-node-delete.png
new file mode 100644
index 0000000..0d552f7
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/16/ksm-node-delete.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/16/ksm-node-new.png b/de.dhbw.horb.ksm.core/icons/16/ksm-node-new.png
new file mode 100644
index 0000000..1975f97
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/16/ksm-node-new.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/16/ksm-node-property-add.png b/de.dhbw.horb.ksm.core/icons/16/ksm-node-property-add.png
new file mode 100644
index 0000000..6cf6f86
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/16/ksm-node-property-add.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/16/ksm-node-property-delete.png b/de.dhbw.horb.ksm.core/icons/16/ksm-node-property-delete.png
new file mode 100644
index 0000000..2b1f9de
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/16/ksm-node-property-delete.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/16/ksm-node.png b/de.dhbw.horb.ksm.core/icons/16/ksm-node.png
new file mode 100644
index 0000000..104d0ff
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/16/ksm-node.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/16/ksm-nodegroup-delete.png b/de.dhbw.horb.ksm.core/icons/16/ksm-nodegroup-delete.png
new file mode 100644
index 0000000..af44d15
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/16/ksm-nodegroup-delete.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/16/ksm-nodegroup-new.png b/de.dhbw.horb.ksm.core/icons/16/ksm-nodegroup-new.png
new file mode 100644
index 0000000..528bca6
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/16/ksm-nodegroup-new.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/16/ksm-nodegroup.png b/de.dhbw.horb.ksm.core/icons/16/ksm-nodegroup.png
new file mode 100644
index 0000000..482583e
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/16/ksm-nodegroup.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/32/ksm-connection-new.png b/de.dhbw.horb.ksm.core/icons/32/ksm-connection-new.png
new file mode 100644
index 0000000..8cd7d1b
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/32/ksm-connection-new.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/32/ksm-modell.png b/de.dhbw.horb.ksm.core/icons/32/ksm-modell.png
new file mode 100644
index 0000000..98192e2
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/32/ksm-modell.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/32/ksm-node-delete.png b/de.dhbw.horb.ksm.core/icons/32/ksm-node-delete.png
new file mode 100644
index 0000000..3a12545
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/32/ksm-node-delete.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/32/ksm-node-new.png b/de.dhbw.horb.ksm.core/icons/32/ksm-node-new.png
new file mode 100644
index 0000000..46f3c6d
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/32/ksm-node-new.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/32/ksm-node-property-add.png b/de.dhbw.horb.ksm.core/icons/32/ksm-node-property-add.png
new file mode 100644
index 0000000..545e5cc
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/32/ksm-node-property-add.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/32/ksm-node-property-delete.png b/de.dhbw.horb.ksm.core/icons/32/ksm-node-property-delete.png
new file mode 100644
index 0000000..59a6b6b
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/32/ksm-node-property-delete.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/32/ksm-node.png b/de.dhbw.horb.ksm.core/icons/32/ksm-node.png
new file mode 100644
index 0000000..f59fcee
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/32/ksm-node.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/32/ksm-nodegroup-delete.png b/de.dhbw.horb.ksm.core/icons/32/ksm-nodegroup-delete.png
new file mode 100644
index 0000000..64900db
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/32/ksm-nodegroup-delete.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/32/ksm-nodegroup-new.png b/de.dhbw.horb.ksm.core/icons/32/ksm-nodegroup-new.png
new file mode 100644
index 0000000..ff8ce40
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/32/ksm-nodegroup-new.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/32/ksm-nodegroup.png b/de.dhbw.horb.ksm.core/icons/32/ksm-nodegroup.png
new file mode 100644
index 0000000..2bf5950
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/32/ksm-nodegroup.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/alt_about.gif b/de.dhbw.horb.ksm.core/icons/alt_about.gif
new file mode 100644
index 0000000..20d9ad2
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/alt_about.gif
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/alt_launcher.icns b/de.dhbw.horb.ksm.core/icons/alt_launcher.icns
new file mode 100644
index 0000000..b77a6a6
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/alt_launcher.icns
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/alt_launcher.ico b/de.dhbw.horb.ksm.core/icons/alt_launcher.ico
new file mode 100644
index 0000000..d548f71
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/alt_launcher.ico
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/alt_launcher.xpm b/de.dhbw.horb.ksm.core/icons/alt_launcher.xpm
new file mode 100644
index 0000000..b0c139e
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/alt_launcher.xpm
@@ -0,0 +1,307 @@
+/* XPM */
+static char * icon48_xpm[] = {
+"48 48 256 2",
+" c #4B4B3B3B9090",
+". c #0D0D0E0E5454",
+"X c #11110E0E5B5B",
+"o c #17170F0F6363",
+"O c #1D1D13136969",
+"+ c #212114146C6C",
+"@ c #252514147171",
+"# c #282811116C6C",
+"$ c #26260D0D6363",
+"% c #22220B0B5E5E",
+"& c #1C1C0B0B5A5A",
+"* c #1C1C0B0B5252",
+"= c #1B1B05055353",
+"- c #161606064D4D",
+"; c #161605054949",
+": c #111104044848",
+"> c #131304044545",
+", c #131305054242",
+"< c #141410105E5E",
+"1 c #2C2C15157373",
+"2 c #2B2B1B1B7575",
+"3 c #343416167272",
+"4 c #313113136E6E",
+"5 c #222209095757",
+"6 c #1B1B06064D4D",
+"7 c #15150B0B4242",
+"8 c #13130C0C5555",
+"9 c #2E2E1B1B7878",
+"0 c #33331F1F7C7C",
+"q c #343418187878",
+"w c #3B3B1C1C7575",
+"e c #2E2E10106767",
+"r c #1B1B07074747",
+"t c #18180B0B4646",
+"y c #151513136262",
+"u c #1A1A15156464",
+"i c #34341F1F7777",
+"p c #40401E1E8080",
+"a c #42421B1B7A7A",
+"s c #3B3B15157474",
+"d c #2B2B0B0B5B5B",
+"f c #222207075252",
+"g c #373727277A7A",
+"h c #474724248484",
+"j c #393915156E6E",
+"k c #373711116A6A",
+"l c #343413136363",
+"z c #232319196E6E",
+"x c #292919197070",
+"c c #3C3C2C2C8282",
+"v c #444431318585",
+"b c #494934348A8A",
+"n c #505026268A8A",
+"m c #3D3D1B1B6E6E",
+"M c #31310E0E5C5C",
+"N c #2B2B0D0D5353",
+"B c #222207074A4A",
+"V c #52523C3C9292",
+"C c #58583C3C9494",
+"Z c #5D5D44449797",
+"A c #5C5C2E2E9292",
+"S c #676733339595",
+"D c #424228287575",
+"F c #29290A0A4F4F",
+"G c #6C6C4A4A9E9E",
+"H c #72725454A7A7",
+"J c #8C8C6D6DB2B2",
+"K c #343424246E6E",
+"L c #3A3A23236A6A",
+"P c #3A3A1C1C6767",
+"I c #24240A0A4B4B",
+"U c #151518186161",
+"Y c #76766F6FA5A5",
+"T c #ADAD9191CCCC",
+"R c #98988989D3D3",
+"E c #45453B3B8686",
+"W c #3C3C35357979",
+"Q c #363631317575",
+"! c #32322D2D6B6B",
+"~ c #323229296363",
+"^ c #30301F1F6262",
+"/ c #323218185E5E",
+"( c #272707074B4B",
+") c #202028286C6C",
+"_ c #1E1E1D1D6868",
+"` c #9A9A8282BBBB",
+"' c #C8C8B3B3D3D3",
+"] c #B3B3AFAFE7E7",
+"[ c #84847272C6C6",
+"{ c #58585757A3A3",
+"} c #3F3F3C3C8A8A",
+"| c #3B3B3A3A8484",
+" . c #414139397D7D",
+".. c #3D3D39397A7A",
+"X. c #37372E2E6E6E",
+"o. c #2C2C21215A5A",
+"O. c #2E2E1B1B5B5B",
+"+. c #F5F5EFEFF5F5",
+"@. c #656566669A9A",
+"#. c #47474B4B8E8E",
+"$. c #3C3C44447B7B",
+"%. c #444442428080",
+"&. c #45453E3E8181",
+"*. c #40403C3C8181",
+"=. c #3D3D33337474",
+"-. c #3B3B30306E6E",
+";. c #38382D2D6969",
+":. c #303026265D5D",
+">. c #2C2C15155A5A",
+",. c #1F1F1C1C7070",
+"<. c #25251E1E7171",
+"1. c #59595C5C9191",
+"2. c #4D4D53538989",
+"3. c #4C4C49498484",
+"4. c #484845458585",
+"5. c #494941418585",
+"6. c #494940408181",
+"7. c #2F2F1C1C5353",
+"8. c #2B2B28287676",
+"9. c #323231317F7F",
+"0. c #545452528B8B",
+"q. c #51514E4E8989",
+"w. c #4E4E4B4B8C8C",
+"e. c #4C4C47478686",
+"r. c #46463D3D7E7E",
+"t. c #434336367A7A",
+"y. c #2B2B13135555",
+"u. c #47473D3D8D8D",
+"i. c #575757578E8E",
+"p. c #48483E3E7F7F",
+"a. c #46463A3A7D7D",
+"s. c #424235357575",
+"d. c #404034347171",
+"f. c #BFBFCBCBFAFA",
+"g. c #B8B8A8A8DDDD",
+"h. c #5E5E60609292",
+"j. c #565655558C8C",
+"k. c #4B4B44448282",
+"l. c #454539397B7B",
+"z. c #434338387878",
+"x. c #3F3F32326D6D",
+"c. c #3D3D30306969",
+"v. c #3A3A2E2E6363",
+"b. c #36362A2A5C5C",
+"n. c #343424245555",
+"m. c #30301E1E4D4D",
+"M. c #49493C3C8282",
+"N. c #5E5E4F4F8C8C",
+"B. c #56563B3B8B8B",
+"V. c #545407078585",
+"C. c #424234347272",
+"Z. c #9797A4A4F7F7",
+"A. c #444436367676",
+"S. c #7D7D7979D5D5",
+"D. c #464640408A8A",
+"F. c #44444B4B8282",
+"G. c #414107077777",
+"H. c #71716161C1C1",
+"J. c #303039397979",
+"K. c #8E8E8E8EE6E6",
+"L. c #404033338B8B",
+"P. c #4A4A45458C8C",
+"I. c #46463A3A8080",
+"U. c #363629295454",
+"Y. c #303022224848",
+"T. c #424237377575",
+"R. c #2E2E1D1D6363",
+"E. c #79798383EAEA",
+"W. c #74747B7BE4E4",
+"Q. c #6D6D7676D6D6",
+"!. c #6A6A7171CECE",
+"~. c #66666969C6C6",
+"^. c #62626565BCBC",
+"/. c #5F5F6060B5B5",
+"(. c #5B5B5B5BACAC",
+"). c #535353539898",
+"_. c #4F4F4F4FA4A4",
+"`. c #54544D4DA4A4",
+"'. c #323204046B6B",
+"]. c #303035357979",
+"[. c #313122224343",
+"{. c #5A5A5B5BB7B7",
+"}. c #484846468080",
+"|. c #454541417575",
+" X c #4B4B31318282",
+".X c #47473C3C8484",
+"XX c #3E3E35356E6E",
+"oX c #2F2F26264040",
+"OX c #2B2B23233A3A",
+"+X c #262619195C5C",
+"@X c #252515155A5A",
+"#X c #55555151B3B3",
+"$X c #3C3C2D2D5D5D",
+"%X c #39392F2F5656",
+"&X c #37372D2D5050",
+"*X c #25251F1F3030",
+"=X c #24241D1D4343",
+"-X c #202013135656",
+";X c #41413B3B6C6C",
+":X c #444442429696",
+">X c #212100005E5E",
+",X c #444436367272",
+"<X c #444436366F6F",
+"1X c #424236366868",
+"2X c #3F3F34346161",
+"3X c #3C3C32325A5A",
+"4X c #34342A2A4A4A",
+"5X c #21211B1B2121",
+"6X c #22221C1C6363",
+"7X c #2D2D01015E5E",
+"8X c #20201B1B2525",
+"9X c #49492F2F7B7B",
+"0X c #434334346C6C",
+"qX c #323229294545",
+"wX c #1C1C10104F4F",
+"eX c #222217176363",
+"rX c #37371E1E6B6B",
+"tX c #424232326E6E",
+"yX c #444433336969",
+"uX c #424233336565",
+"iX c #1E1E1A1A1E1E",
+"pX c #161601014C4C",
+"aX c #1C1C11115454",
+"sX c #252503035B5B",
+"dX c #414131316A6A",
+"fX c #22221F1F7878",
+"gX c #272724246767",
+"hX c #1D1D16165E5E",
+"jX c #131305055151",
+"kX c #40402F2F6464",
+"lX c #111107074E4E",
+"zX c #0C0C05054B4B",
+"xX c #22221E1E5757",
+"cX c #1A1A0D0D4D4D",
+"vX c #16160B0B4D4D",
+"bX c #060604044747",
+"nX c #040403034343",
+"mX c #3B3B27276565",
+"MX c #0E0E03034141",
+"NX c #111106064A4A",
+"BX c #0E0E04044646",
+"VX c #111105053B3B",
+"CX c #0D0D01013A3A",
+"ZX c #030305053F3F",
+"AX c #0F0F0F0F4C4C",
+"SX c #020207073B3B",
+"DX c #0D0D03034646",
+"FX c #0B0B02023F3F",
+"GX c #0D0D02023434",
+"HX c #0A0A0E0E4444",
+"JX c #161614145252",
+"KX c #0B0B04044646",
+"LX c #0A0A03034444",
+"PX c #1D1D21215757",
+"IX c #090910104040",
+"UX c #18181E1E5353",
+" ",
+" . . . . X X o o o o O + + @ @ @ @ @ @ @ # # # # # # $ $ % % & & & & * = - - - ; : > > , , , ",
+" . . X X < < o o O O + @ 1 2 2 1 1 1 1 1 1 1 1 3 4 # # $ $ $ % % % 5 = = 6 6 - ; ; > > , , 7 ",
+" . 8 < < < o O O + @ @ 2 9 9 0 0 q q q q q q q w 3 4 4 e e $ $ $ $ % 5 = = 6 6 6 ; ; > > r t ",
+" . X < y u O O + @ 1 2 i 0 0 p p p p p p p a a p a s 3 4 4 e e e e d 5 5 f f 6 6 6 ; ; r r t ",
+" X < y u O + + @ 2 9 0 g p p h h h h h h h p h h a a s s j k k j l d d 5 5 f f 6 6 r r r r r ",
+" X < y O z x x 9 0 g c v b n n n n n n n n n n n h a a s s j j m l M d d N f f B B B B r r r ",
+" < y u + z 2 0 c c b V C Z C C A A A A A S S S n h D w w m m m m k l M d d N f F F F B r r r ",
+" < y O z z 9 c b V Z G H H H G S G G J J H V v c g g K K K K L P l l l M M N N N N I B B r r ",
+" U u + z x i v C H Y J J J J H J T R H V E W W Q Q Q Q ! ! ! ~ ^ ^ / / M M M M M N ( B B r r ",
+" ) _ z x 9 g b Z Y ` ' ' ' T T ] [ { } | .........W W Q Q X.! ~ ~ o.O./ / / / N F ( B B B r ",
+" ) ) z x i c V G J ' +.+.+.+.] [ @.#.$.%.%.%.&.*. . .....W =.-.X.;.~ :.o.O.^ >.N F ( B B B B ",
+" ) ,.<.2 g v C H J ' +.+.+.+.T Y 1.2.3.4.4.4.5.6.&.&. . ...W =.=.-.;.~ :.o.7.>.N F F ( B I I ",
+" ) ,.<.8.9.b C H J T +.+.+.' J @.1.0.q.q.w.e.4.5.6.&.r. . .t.W =.=.-.;.~ :.o.7.y.N F ( ( I I ",
+" 8.8.8.9.| u.C G J T +.+.' ` Y @.1.i.0.q.q.e.e.5.6.p.r.a. .t.t.s.d.d.-.;.~ :.7.7.y.F F ( I I ",
+" 9.c c c v b A S H ' f.g.` Y @.h.1.i.j.0.q.q.e.k.6.p.r.a.l.t.z.s.s.d.x.c.v.b.n.m.7.N F F F I ",
+" <.g M.N.B.B.n V.J f.R J @.h.h.1.i.i.j.j.0.q.3.k.6.p.r.a.l.l.z.s.C.d.x.x.c.v.b.n.m.y.N F F F ",
+" + x i v B.Z Z G g.Z.[ @.2.i.i.j.j.j.j.j.0.q.3.k.6.p.p.a.l.l.A.s.C.C.d.x.c.v.b.n.m.7.y.N N y. ",
+" O # 3 w p n Z ` f.S.H D.F.q.0.0.0.0.j.0.q.q.3.k.6.p.r.a.a.l.A.s.s.C.d.x.x.c.v.b.n.m.y.y.y.y. ",
+" O # 4 s a G.V.T Z.H.V J.%.e.w.q.0.0.0.0.q.q.e.k.6.p.r.a.a.l.z.A.s.C.d.d.x.c.v.b.n.m.7.>.y.y. ",
+" O # 4 s w G.A f.K.H L...4.P.w.w.w.q.q.q.q.e.e.5.6.M.I.I.a.a.l.z.A.s.d.d.x.c.v.v.U.Y.7.O.>.y. ",
+" $ # 4 3 s G.G f.S.Z 9.*.D.P.P.w.w.w.w.w.e.e.5.5.M.M.I.I.a.a.l.z.T.s.d.d.x.x.c.v.U.Y.m.R.>.>. ",
+" E.E.W.W.W.W.E.Z.E.W.Q.Q.Q.Q.Q.Q.Q.Q.Q.Q.!.!.!.!.!.~.~.~.~.~.~.^.^.^.^.^./././.(.{ { )._.`._. ",
+" + # 3 w s '.` f.H.V ].*.D.P.P.P.P.P.P.P.5.5.5.M.M.M.I.I.a.l.z.z.T.T.s.d.d.x.c.v.U.Y.[.^ O.>. ",
+" ~.~.~.~.~.~.K.Z.S.~.{.^.^.^.^.^.^.^.^././././././.(.(.(.(.(.(.{ { { { { ).).).w.w.}.|.P.u.} ",
+" .I.6. X X XT f.H.b ].*.E D.D.D.D.5.5..X.XM.M.I.I.a.a.l.l.z.z.T.T.T.d.XXx.c.v.b.U.oXOXR.+X@X ",
+" E.E.E.W.W.W.K.Z.E.W.Q.Q.Q.Q.Q.Q.Q.Q.!.!.!.!.!.!.~.~.~.~.~.~.^.^.^.^.^./././.(.{ { ).).#X_._. ",
+" & % $ e '.= H f.H.b 8.W *.E E E .X.X.XI.I.I.I.a.a.l.l.z.z.T.T.T.C.XXXXc.v.$X%X&XY.*X=X2 @X-X ",
+" {.{.{.{.{.#X~.Z.W.~.{.{./././././././././.(.(.(.(.(.(.(.{ { { { { { ).).).w.w.3.}.;X%.:X} } ",
+" & & % $ e >XV.f.S.C K X.W t. . .l.l.t.t.t.t.A.A.A.,X,X,X,X,X<X;X1X1X2X3X%X&X4XoX*X5Xo.6X-X-X ",
+" & & % $ $ >X7X` Z.Z D ! =.=.s.t.t.t.A.A.s.A.,X,X,X,X<X<X<X<X;X1X2X2X3X%X&X4XoXOX8X5X<.@X-X-X ",
+" 8 & & $ e K 9XJ f.^. XK X.=.=.s.s.s.s.s.C.C.C.C.<X0X0X0X1X1X1X2X2X3X%X&X4XqXOX*X8X=X<.-X-XwX ",
+" 8 & eXK k.@.M. Xg.E.B.rX~ -.d.d.C.C.C.C.C.tX0X0X0XyXyX1X1XuX2X2X3X%X&X4XqXoXOX8XiX6XeX-X-XwX ",
+" 6XQ h.Y N.K e pXB.f./.9Xo.;.-.x.d.tXtXtXtXtX0X0XyXyXyXuXuX2X2X3X%X&X4XqXoXOX*XiX=X_ aX-XaXwX ",
+" Y Y .R.@X% sX= 7XT Z.V P :.;.c.x.x.x.tXdXdXdXyXyXuXuX2X2X3X3X%X&X4XqXoXOX*X8X*XfXaXaXaXwXwX ",
+" gXhX& * & 5 5 sXjXa ] S.9X/ ~ v.c.dXdXdXdXdXuXuXuXkX2X2X3X%X%X&X4XqXoXOX*X8XiX<.hXwXwXaXwXwX ",
+" 8 lXlXjX= * 5 5 = zX9X] H.D 7.b.v.v.kXc.kXkXkXkXkX2X$X3X%X&X&X4XqXoXOX*X8XiXxXhXwXcXcXwXwXwX ",
+" zXzXlXlXjX= = f f sXD Y ] ~.D 7.n.b.v.v.kXkXkXkX$X$X%X%X&X4XqXoXoXOX*X8X5XgXu cXvXvXcXcXwXwX ",
+" bXbXzXlXlX- = * @XX.h.e D T S.D n.m.b.$X$X$X$X$X%X%X&X&X4XqXoXOX*X8X8X*X<.hXvX; ; vXvXvXcXwX ",
+" nXbXzXzXlXlX- -XX.Y R.pXpXP J K.Z mXm.n.U.U.U.U.U.4X4XY.oXOX*X8X8X8X=X,.aXvX; > > > t t t cX ",
+" nXbXbXzXzXlXaXXXY +Xf = f = 7XtXR R mXn.Y.[.[.[.[.OX*X*X8X5X*X=X,.u vXvX; > > MXMX, 7 t t ",
+" nXnXnXbXzXvX-.Y +XcX6 6 = = = d L B.G H `.X.:.7.m.=X=X=X=X=X6X,.u cXvXNX: BX> MXVXCXVX7 7 7 ",
+" ZXZXnXbXAXgX@.+XvX; - - - - * @XR.>.sX>.R.i 0 x eXeXeXeXO hXaXcXvXNX: BXMXMXMXVXCXCXCXVX7 7 ",
+" SXZXZXAXgXN.aXNX: : NXNXNX- * +X+X* 6 6 6 * * * * * * * vXvX- NX: DXBXMXMXFXCXCXCXCXGXVXVX7 ",
+" SXSXHXgX0.JXKXLXKXKXDX: : NX* @X-X- - - - - - - - - - - NX: DXDXDXMXMXFXFXCXCXCXCXGXGXGXVXVX ",
+" SXHXPX3.JXnXnXnXnXbXLXKXKXNXaX-XvX: : NX: : : : : : : BXDXDXLXMXMXFXFXCXCXCXCXGXGXGXGXGXGXGX ",
+" IXUX$.AXZXZXZXZXnXnXnXLXLXNXJXvXBXDXBXBXBXBXDXDXDXDXLXDXLXLXFXFXFXFXCXCXCXCXGXGXGXGXGXGXGXGX ",
+" "};
diff --git a/de.dhbw.horb.ksm.core/icons/alt_window_16.gif b/de.dhbw.horb.ksm.core/icons/alt_window_16.gif
new file mode 100644
index 0000000..05626b1
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/alt_window_16.gif
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/alt_window_32.gif b/de.dhbw.horb.ksm.core/icons/alt_window_32.gif
new file mode 100644
index 0000000..b432f88
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/alt_window_32.gif
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/icons/releng_gears.gif b/de.dhbw.horb.ksm.core/icons/releng_gears.gif
new file mode 100644
index 0000000..81fb7b4
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/icons/releng_gears.gif
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/ksm-target-definition.target b/de.dhbw.horb.ksm.core/ksm-target-definition.target
new file mode 100644
index 0000000..444bfb9
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/ksm-target-definition.target
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde version="3.6"?>
+
+<target name="Base RCP (Binary Only)">
+<locations>
+<location id="org.eclipse.rcp" path="${eclipse_home}" type="Feature"/>
+<location id="org.eclipse.draw2d" path="/mnt/btrfs/stuff/eclipse" type="Feature"/>
+<location id="org.eclipse.platform" path="${eclipse_home}" type="Feature"/>
+<location id="org.eclipse.gef" path="${eclipse_home}" type="Feature"/>
+<location id="org.eclipse.equinox.p2.user.ui" path="${eclipse_home}" type="Feature"/>
+</locations>
+<includeBundles>
+<plugin id="org.eclipse.equinox.p2.ui.sdk.scheduler"/>
+<plugin id="org.eclipse.core.net.linux.x86_64"/>
+<plugin id="org.eclipse.core.databinding.observable"/>
+<plugin id="org.eclipse.core.runtime.compatibility.registry"/>
+<plugin id="org.eclipse.core.filebuffers"/>
+<plugin id="org.eclipse.swt"/>
+<plugin id="org.eclipse.debug.core"/>
+<plugin id="org.eclipse.ecf.provider.filetransfer.httpclient"/>
+<plugin id="org.eclipse.ui.cheatsheets"/>
+<plugin id="org.eclipse.ui.intro"/>
+<plugin id="org.eclipse.text"/>
+<plugin id="org.eclipse.core.resources"/>
+<plugin id="org.eclipse.ui"/>
+<plugin id="org.eclipse.equinox.p2.director"/>
+<plugin id="org.eclipse.ant.core"/>
+<plugin id="org.eclipse.ui.navigator"/>
+<plugin id="org.eclipse.equinox.launcher.gtk.linux.x86_64"/>
+<plugin id="org.eclipse.jface"/>
+<plugin id="com.ibm.icu"/>
+<plugin id="org.eclipse.equinox.p2.operations"/>
+<plugin id="org.eclipse.equinox.p2.metadata"/>
+<plugin id="org.eclipse.equinox.ds"/>
+<plugin id="org.eclipse.core.runtime.compatibility"/>
+<plugin id="org.eclipse.equinox.p2.directorywatcher"/>
+<plugin id="org.eclipse.ui.console"/>
+<plugin id="org.eclipse.ui.forms"/>
+<plugin id="org.eclipse.jsch.core"/>
+<plugin id="org.eclipse.equinox.util"/>
+<plugin id="org.eclipse.ui.views.properties.tabbed"/>
+<plugin id="org.eclipse.ltk.core.refactoring"/>
+<plugin id="com.jcraft.jsch"/>
+<plugin id="org.eclipse.ui.workbench"/>
+<plugin id="org.eclipse.equinox.p2.jarprocessor"/>
+<plugin id="org.eclipse.update.scheduler"/>
+<plugin id="org.eclipse.osgi.services"/>
+<plugin id="org.eclipse.jsch.ui"/>
+<plugin id="org.eclipse.ecf.identity"/>
+<plugin id="org.eclipse.equinox.p2.touchpoint.natives"/>
+<plugin id="org.eclipse.core.variables"/>
+<plugin id="org.eclipse.equinox.p2.repository.tools"/>
+<plugin id="org.eclipse.osgi.util"/>
+<plugin id="org.eclipse.equinox.p2.updatechecker"/>
+<plugin id="org.eclipse.equinox.registry"/>
+<plugin id="org.eclipse.core.runtime.compatibility.auth"/>
+<plugin id="org.eclipse.core.filesystem"/>
+<plugin id="org.apache.ant"/>
+<plugin id="org.eclipse.help"/>
+<plugin id="org.eclipse.core.databinding"/>
+<plugin id="org.eclipse.core.contenttype"/>
+<plugin id="org.eclipse.equinox.preferences"/>
+<plugin id="org.eclipse.gef"/>
+<plugin id="org.eclipse.ui.net"/>
+<plugin id="org.eclipse.equinox.p2.publisher"/>
+<plugin id="org.eclipse.equinox.p2.ui"/>
+<plugin id="org.eclipse.ltk.ui.refactoring"/>
+<plugin id="org.eclipse.rcp"/>
+<plugin id="org.eclipse.ecf"/>
+<plugin id="org.eclipse.ui.workbench.texteditor"/>
+<plugin id="org.eclipse.equinox.p2.extensionlocation"/>
+<plugin id="org.eclipse.ecf.filetransfer"/>
+<plugin id="org.eclipse.compare"/>
+<plugin id="org.eclipse.platform.doc.user"/>
+<plugin id="org.sat4j.pb"/>
+<plugin id="org.eclipse.ui.browser"/>
+<plugin id="org.eclipse.draw2d"/>
+<plugin id="org.eclipse.core.net"/>
+<plugin id="org.eclipse.update.core"/>
+<plugin id="org.eclipse.equinox.p2.reconciler.dropins"/>
+<plugin id="org.eclipse.ecf.ssl"/>
+<plugin id="org.eclipse.equinox.security.ui" version="1.0.200.v20100503"/>
+<plugin id="org.eclipse.compare.core"/>
+<plugin id="org.eclipse.core.jobs"/>
+<plugin id="org.eclipse.equinox.frameworkadmin"/>
+<plugin id="org.eclipse.equinox.common"/>
+<plugin id="org.eclipse.core.databinding.beans"/>
+<plugin id="org.eclipse.core.expressions"/>
+<plugin id="org.eclipse.equinox.p2.console"/>
+<plugin id="org.eclipse.ui.presentations.r21"/>
+<plugin id="org.eclipse.core.filesystem.linux.x86_64"/>
+<plugin id="org.eclipse.equinox.p2.engine"/>
+<plugin id="org.eclipse.equinox.p2.ql"/>
+<plugin id="org.sat4j.core"/>
+<plugin id="org.eclipse.equinox.p2.touchpoint.eclipse"/>
+<plugin id="org.eclipse.equinox.app"/>
+<plugin id="org.eclipse.update.configurator"/>
+<plugin id="org.eclipse.core.databinding.property"/>
+<plugin id="org.apache.commons.logging"/>
+<plugin id="org.eclipse.equinox.p2.director.app"/>
+<plugin id="org.apache.commons.httpclient"/>
+<plugin id="org.eclipse.help.appserver"/>
+<plugin id="org.eclipse.equinox.p2.metadata.generator"/>
+<plugin id="org.eclipse.equinox.simpleconfigurator.manipulator"/>
+<plugin id="org.eclipse.team.ui"/>
+<plugin id="org.eclipse.core.boot"/>
+<plugin id="org.eclipse.ecf.provider.filetransfer.ssl"/>
+<plugin id="org.eclipse.core.commands"/>
+<plugin id="org.eclipse.equinox.p2.updatesite"/>
+<plugin id="org.eclipse.ui.views"/>
+<plugin id="org.eclipse.team.core"/>
+<plugin id="org.apache.commons.codec"/>
+<plugin id="org.eclipse.equinox.security" version="1.0.200.v20100503"/>
+<plugin id="org.eclipse.jface.text"/>
+<plugin id="org.eclipse.debug.ui"/>
+<plugin id="org.eclipse.ecf.provider.filetransfer.httpclient.ssl"/>
+<plugin id="org.eclipse.equinox.p2.metadata.repository"/>
+<plugin id="org.eclipse.equinox.p2.garbagecollector"/>
+<plugin id="org.eclipse.equinox.launcher"/>
+<plugin id="org.eclipse.swt.gtk.linux.x86_64"/>
+<plugin id="org.eclipse.platform"/>
+<plugin id="org.eclipse.equinox.p2.core"/>
+<plugin id="org.eclipse.ecf.provider.filetransfer"/>
+<plugin id="org.eclipse.equinox.security.ui" version="1.0.200.v20100503"/>
+<plugin id="org.eclipse.equinox.p2.ui.sdk"/>
+<plugin id="org.eclipse.equinox.simpleconfigurator"/>
+<plugin id="org.eclipse.ui.ide"/>
+<plugin id="org.eclipse.equinox.event"/>
+<plugin id="org.eclipse.ui.intro.universal"/>
+<plugin id="org.eclipse.core.runtime"/>
+<plugin id="org.eclipse.ui.ide.application"/>
+<plugin id="org.eclipse.jface.databinding"/>
+<plugin id="org.eclipse.ui.editors"/>
+<plugin id="org.eclipse.ui.navigator.resources"/>
+<plugin id="org.eclipse.equinox.p2.repository"/>
+<plugin id="org.eclipse.equinox.p2.artifact.repository"/>
+<plugin id="org.eclipse.equinox.security" version="1.0.200.v20100503"/>
+<plugin id="org.eclipse.osgi"/>
+<plugin id="org.eclipse.equinox.frameworkadmin.equinox"/>
+</includeBundles>
+</target>
diff --git a/de.dhbw.horb.ksm.core/plugin.xml b/de.dhbw.horb.ksm.core/plugin.xml
new file mode 100644
index 0000000..86cbb5f
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/plugin.xml
@@ -0,0 +1,252 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension-point id="de.dhbw.horb.ksm.core.model.property" name="PropertyAdvisor" schema="schema/de.dhbw.horb.ksm.core.mode.property.exsd"/>
+ <extension
+ id="ksm"
+ point="org.eclipse.core.runtime.applications">
+ <application>
+ <run
+ class="de.dhbw.horb.ksm.core.Application">
+ </run>
+ </application>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.navigator.viewer">
+ <viewerContentBinding
+ viewerId="ksm.core.view.navigator">
+ <includes>
+ <contentExtension pattern="org.eclipse.ui.navigator.resourceContent" />
+ <contentExtension pattern="org.eclipse.ui.navigator.resources.filters.*"/>
+ </includes>
+ </viewerContentBinding>
+ <viewerActionBinding
+ viewerId="ksm.core.view.navigator">
+ <includes>
+ <actionExtension pattern="org.eclipse.ui.navigator.actionProvider.*" />
+ <actionExtension
+ pattern="org.eclipse.ui.navigator.resources.*">
+ </actionExtension>
+ </includes>
+ </viewerActionBinding>
+ <viewer
+ viewerId="ksm.core.view.navigatorigator">
+ <!--
+ <popupMenu
+ allowsPlatformContributions="true"
+ id="org.eclipse.ui.navigator.resourceContent#PopupMenu">
+ <insertionPoint name="group.new"/>
+ <insertionPoint name="group.edit" />
+ <insertionPoint name="group.reorganize" />
+ <insertionPoint name="group.open" />
+ <insertionPoint name="group.openWith"/>
+ </popupMenu>-->
+ </viewer>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="menu:org.eclipse.ui.main.menu">
+ <menu
+ id="ksm.core.menu.file"
+ label="File">
+ <command
+ commandId="org.eclipse.ui.newWizard"
+ label="New"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.ui.edit.text.openLocalFile"
+ label="Open Local File"
+ style="push">
+ </command>
+ <separator
+ name="ksm.core.menu.seperator1"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.eclipse.ui.file.save"
+ label="Save"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.ui.file.print"
+ label="Print"
+ style="push">
+ </command>
+ <separator
+ name="ksm.core.menu.seperator2"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.eclipse.ui.file.exit"
+ label="Exit"
+ style="push">
+ </command>
+ </menu>
+ <menu
+ label="Edit"
+ mnemonic="ksm.core.menu.edit">
+ <command
+ commandId="org.eclipse.ui.edit.undo"
+ label="Undo"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.ui.edit.redo"
+ label="Redo"
+ style="push">
+ </command>
+ </menu>
+ <menu
+ id="ksm.core.menu.perspective"
+ label="Perspective">
+ <command
+ commandId="ksm.core.command.CallEditorPerspective"
+ id="ksmcore.menu.perspective.editor"
+ label="Editor"
+ style="push">
+ </command>
+ </menu>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="toolbar:org.eclipse.ui.main.toolbar">
+ <toolbar
+ id="ksm.core.toolbar">
+ <command
+ commandId="org.eclipse.ui.file.save"
+ label="Save"
+ style="push">
+ </command>
+ </toolbar>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ defaultHandler="de.dhbw.horb.ksm.core.handler.CallEditorPerspective"
+ id="ksm.core.command.CallEditorPerspective"
+ name="CallEditorPerspective">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ class="de.dhbw.horb.ksm.core.editor.ui.DiagramEditor"
+ contributorClass="de.dhbw.horb.ksm.core.editor.actions.DiagramActionBarContributor"
+ default="true"
+ extensions="ksm"
+ icon="icons/16/ksm-modell.png"
+ id="ksm.core.editor"
+ name="KSM Editor">
+ </editor>
+ </extension>
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category
+ id="ksm.core.category"
+ name="KSM">
+ </category>
+ <wizard
+ category="ksm.core.category"
+ class="de.dhbw.horb.ksm.core.editor.ui.DiagramCreationWizard"
+ icon="icons/16/ksm-modell.png"
+ id="ksm.core.editor.wizard.new.file"
+ name="KSM Model"
+ project="false">
+ <description>
+ Wizard for creating a new KSM model
+ </description>
+ <selection
+ class="org.eclipse.core.resources.IResource">
+ </selection>
+ </wizard>
+ <primaryWizard
+ id="ksm.core.editor.wizard.new.file">
+ </primaryWizard>
+ <wizard
+ category="ksm.core.category"
+ class="de.dhbw.horb.ksm.core.project.NewKSMProjectWizard"
+ finalPerspective="ksm.core.perspectives.KSMEditorPerspective"
+ icon="icons/32/ksm-modell.png"
+ id="ksm.core.editor.wizard.new.project"
+ name="New KSM Project"
+ project="true">
+ </wizard>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.products">
+ <product
+ application="ksm.core.application"
+ description="Kybernetisches System Modell"
+ name="KSM">
+ <property
+ name="windowImages"
+ value="icons/16/ksm-modell.png icons/32/ksm-modell.png">
+ </property>
+ </product>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ category="ksm.core.views.KSMCategory"
+ class="de.dhbw.horb.ksm.core.view.Navigator"
+ id="ksm.core.view.navigator"
+ name="Navigator"
+ restorable="true">
+ </view>
+ <category
+ id="ksm.core.views.KSMCategory"
+ name="KSM">
+ </category>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectives">
+ <perspective
+ class="de.dhbw.horb.ksm.core.perspectives.KSMEditorPerspective"
+ fixed="true"
+ icon="icons/releng_gears.gif"
+ id="ksm.core.perspectives.KSMEditorPerspective"
+ name="KSM Editor Perspektive">
+ </perspective>
+ </extension>
+ <extension
+ id="ksmProjectNature"
+ point="org.eclipse.core.resources.natures">
+ <runtime>
+ <run
+ class="de.dhbw.horb.ksm.core.project.KSMProjectNature">
+ </run>
+ </runtime>
+ </extension>
+ <extension
+ point="org.eclipse.ui.ide.projectNatureImages">
+ <image
+ icon="icons/32/ksm-modell.png"
+ id="ksm.core.natureImage"
+ natureId="de.dhbw.horb.ksm.core.ksmProjectNature">
+ </image>
+ </extension>
+ <extension
+ point="de.dhbw.horb.ksm.core.model.property">
+ <advisor
+ class="de.dhbw.horb.ksm.core.editor.model.property.BaseNodePropertyAdvisor"
+ name="BaseNodePropertyAdvisor"
+ type="node">
+ </advisor>
+ <advisor
+ class="de.dhbw.horb.ksm.core.editor.model.property.BaseNodeGroupPropertyAdvisor"
+ name="BaseNodeGroupPropertyAdvisor"
+ type="nodegroup">
+ </advisor>
+ <advisor
+ class="de.dhbw.horb.ksm.core.editor.model.property.BaseConnectionPropertyAdvisor"
+ name="BaseConnectionPropertyAdvisor"
+ type="connection">
+ </advisor>
+ </extension>
+</plugin>
diff --git a/de.dhbw.horb.ksm.core/schema/de.dhbw.horb.ksm.core.mode.property.exsd b/de.dhbw.horb.ksm.core/schema/de.dhbw.horb.ksm.core.mode.property.exsd
new file mode 100644
index 0000000..0ef92f3
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/schema/de.dhbw.horb.ksm.core.mode.property.exsd
@@ -0,0 +1,128 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="de.dhbw.horb.ksm.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="de.dhbw.horb.ksm.core" id="de.dhbw.horb.ksm.core.model.property" name="PropertyAdvisor"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="advisor"/>
+ </sequence>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="advisor">
+ <complexType>
+ <attribute name="type" use="required">
+ <annotation>
+ <documentation>
+ Specify the model type which properties should be extended.
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="node">
+ </enumeration>
+ <enumeration value="nodegroup">
+ </enumeration>
+ <enumeration value="ksm">
+ </enumeration>
+ <enumeration value="connection">
+ </enumeration>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="de.dhbw.horb.ksm.core.extension.AbstractPropertyDescriptorAdvisor:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/de.dhbw.horb.ksm.core/splash.bmp b/de.dhbw.horb.ksm.core/splash.bmp
new file mode 100644
index 0000000..d7d2e30
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/splash.bmp
Binary files differ
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/Activator.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/Activator.java
new file mode 100644
index 0000000..8cea566
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/Activator.java
@@ -0,0 +1,61 @@
+package de.dhbw.horb.ksm.core;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "de.dhbw.horb.ksm.core"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/Application.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/Application.java
new file mode 100644
index 0000000..5417723
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/Application.java
@@ -0,0 +1,46 @@
+package de.dhbw.horb.ksm.core;
+
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * This class controls all aspects of the application's execution
+ */
+public class Application implements IApplication {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
+ */
+ public Object start(IApplicationContext context) throws Exception {
+ Display display = PlatformUI.createDisplay();
+ try {
+ int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
+ if (returnCode == PlatformUI.RETURN_RESTART)
+ return IApplication.EXIT_RESTART;
+ else
+ return IApplication.EXIT_OK;
+ } finally {
+ display.dispose();
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.equinox.app.IApplication#stop()
+ */
+ public void stop() {
+ if (!PlatformUI.isWorkbenchRunning())
+ return;
+ final IWorkbench workbench = PlatformUI.getWorkbench();
+ final Display display = workbench.getDisplay();
+ display.syncExec(new Runnable() {
+ public void run() {
+ if (!display.isDisposed())
+ workbench.close();
+ }
+ });
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/ApplicationActionBarAdvisor.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/ApplicationActionBarAdvisor.java
new file mode 100644
index 0000000..6db8d80
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/ApplicationActionBarAdvisor.java
@@ -0,0 +1,26 @@
+package de.dhbw.horb.ksm.core;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+
+public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
+
+ private IWorkbenchAction saveAction;
+
+ public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
+ super(configurer);
+ }
+
+ protected void makeActions(IWorkbenchWindow window) {
+ saveAction = ActionFactory.SAVE.create(window);
+ register(saveAction);
+ }
+
+ protected void fillMenuBar(IMenuManager menuBar) {
+
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/ApplicationWorkbenchAdvisor.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/ApplicationWorkbenchAdvisor.java
new file mode 100644
index 0000000..6c272dd
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/ApplicationWorkbenchAdvisor.java
@@ -0,0 +1,39 @@
+package de.dhbw.horb.ksm.core;
+
+
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.ui.application.IWorkbenchConfigurer;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchAdvisor;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+import org.eclipse.ui.ide.IDE;
+
+import de.dhbw.horb.ksm.core.perspectives.KSMEditorPerspective;
+
+public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
+ public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
+ IWorkbenchWindowConfigurer configurer) {
+ return new ApplicationWorkbenchWindowAdvisor(configurer);
+ }
+
+ public String getInitialWindowPerspectiveId() {
+ return KSMEditorPerspective.ID;
+ }
+
+ public void initialize(IWorkbenchConfigurer configurer) {
+ IDE.registerAdapters();
+ }
+
+ /**
+ * Return the Default Workspace of this Workbench.
+ * <br>
+ * used for Navigator View, defaults to null
+ */
+ @Override
+ public IAdaptable getDefaultPageInput() {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ return workspace.getRoot();
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/ApplicationWorkbenchWindowAdvisor.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/ApplicationWorkbenchWindowAdvisor.java
new file mode 100644
index 0000000..aa27fc1
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/ApplicationWorkbenchWindowAdvisor.java
@@ -0,0 +1,48 @@
+package de.dhbw.horb.ksm.core;
+
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.ui.IWorkbenchPreferenceConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+
+public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
+
+ public ApplicationWorkbenchWindowAdvisor(
+ IWorkbenchWindowConfigurer configurer) {
+ super(configurer);
+ }
+
+ public ActionBarAdvisor createActionBarAdvisor(
+ IActionBarConfigurer configurer) {
+ return new ApplicationActionBarAdvisor(configurer);
+ }
+
+ public void preWindowOpen() {
+ IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
+ configurer.setInitialSize(new Point(700, 600));
+ configurer.setShowCoolBar(true);
+ configurer.setShowStatusLine(false);
+ configurer
+ .setTitle(KSMMessages.ApplicationWorkbenchWindowAdvisor_Title);
+
+ // Activate the Perspective Switcher
+ configurer.setShowPerspectiveBar(true);
+ // Position in the Eclipse-style top-right
+ PlatformUI.getPreferenceStore().setValue(
+ IWorkbenchPreferenceConstants.DOCK_PERSPECTIVE_BAR,
+ IWorkbenchPreferenceConstants.TOP_RIGHT);
+
+ // XXX Should be dynamic, not easy since fragment-plugins doesnt have
+ // activators
+ PlatformUI
+ .getPreferenceStore()
+ .setValue(
+ IWorkbenchPreferenceConstants.PERSPECTIVE_BAR_EXTRAS,
+ "ksm.tableeditor.perspectives.TableEditorPerspective,ksm.simulator.perspectives.SimulatorPerspective");
+ PlatformUI.getPreferenceStore().setValue(
+ IWorkbenchPreferenceConstants.PERSPECTIVE_BAR_SIZE, 400);
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/KSMMessages.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/KSMMessages.java
new file mode 100644
index 0000000..4c435af
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/KSMMessages.java
@@ -0,0 +1,20 @@
+package de.dhbw.horb.ksm.core;
+
+import org.eclipse.osgi.util.NLS;
+
+public class KSMMessages extends NLS {
+ private static final String BUNDLE_NAME = "de.dhbw.horb.ksm.core.messages"; //$NON-NLS-1$
+ public static String ApplicationWorkbenchWindowAdvisor_Title;
+ public static String PaletteFactory_Components;
+ public static String PaletteFactory_Connection;
+ public static String PaletteFactory_CreateConnection;
+ public static String PaletteFactory_CreateNode;
+ public static String PaletteFactory_Node;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, KSMMessages.class);
+ }
+
+ private KSMMessages() {
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/actions/DiagramActionBarContributor.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/actions/DiagramActionBarContributor.java
new file mode 100644
index 0000000..164b817
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/actions/DiagramActionBarContributor.java
@@ -0,0 +1,37 @@
+package de.dhbw.horb.ksm.core.editor.actions;
+
+import org.eclipse.gef.ui.actions.ActionBarContributor;
+import org.eclipse.gef.ui.actions.DeleteRetargetAction;
+import org.eclipse.gef.ui.actions.RedoRetargetAction;
+import org.eclipse.gef.ui.actions.UndoRetargetAction;
+import org.eclipse.gef.ui.actions.ZoomComboContributionItem;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.ui.actions.ActionFactory;
+
+/**
+ * The Editor is linked with this class to contribute buttons to the toolbar.
+ */
+public class DiagramActionBarContributor extends ActionBarContributor {
+ @Override
+ protected void buildActions() {
+ // Register GEF-Actions
+ addRetargetAction(new UndoRetargetAction());
+ addRetargetAction(new RedoRetargetAction());
+ addRetargetAction(new DeleteRetargetAction());
+ }
+
+ protected void declareGlobalActionKeys() {
+ // do nothing
+ }
+
+ @Override
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ // Add GEF-Actions to toolBar
+ toolBarManager.add(getAction(ActionFactory.UNDO.getId()));
+ toolBarManager.add(getAction(ActionFactory.REDO.getId()));
+ toolBarManager.add(getAction(ActionFactory.DELETE.getId()));
+
+ // Zoom, see DiagrammEditor#getAdapter
+ toolBarManager.add(new ZoomComboContributionItem(getPage()));
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/ConnectionCreateCommand.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/ConnectionCreateCommand.java
new file mode 100644
index 0000000..0870538
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/ConnectionCreateCommand.java
@@ -0,0 +1,44 @@
+package de.dhbw.horb.ksm.core.editor.commands;
+
+import org.eclipse.gef.commands.Command;
+
+import de.dhbw.horb.ksm.model.api.Connection;
+import de.dhbw.horb.ksm.model.api.Node;
+
+public class ConnectionCreateCommand extends Command {
+ protected Connection connection;
+ protected Node source, target;
+
+ public void setSource(Node source) {
+ this.source = source;
+ }
+
+ public void setTarget(Node target) {
+ this.target = target;
+ }
+
+ @Override
+ public String getLabel() {
+ return "Create Connection";
+ }
+
+ @Override
+ public boolean canExecute() {
+ return true;
+ }
+
+ @Override
+ public void execute() {
+ connection = source.createConnection(target);
+ }
+
+ @Override
+ public void undo() {
+ source.removeConnection(connection);
+ }
+
+ @Override
+ public void redo() {
+ source.addConnection(connection);
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/ConnectionDeleteCommand.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/ConnectionDeleteCommand.java
new file mode 100644
index 0000000..23b4932
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/ConnectionDeleteCommand.java
@@ -0,0 +1,46 @@
+package de.dhbw.horb.ksm.core.editor.commands;
+
+import org.eclipse.gef.commands.Command;
+
+import de.dhbw.horb.ksm.model.api.Connection;
+import de.dhbw.horb.ksm.model.api.Node;
+
+public class ConnectionDeleteCommand extends Command {
+
+ protected Connection connection;
+ protected Node sourceNode;
+ protected Node targetNode;
+
+ public void setConnection(Connection connection) {
+ this.connection = connection;
+ }
+
+ public void setSourceNode(Node sourceNode) {
+ this.sourceNode = sourceNode;
+ }
+
+ @Override
+ public String getLabel() {
+ return "Delete Connection";
+ }
+
+ @Override
+ public boolean canExecute() {
+ return true;
+ }
+
+ @Override
+ public void execute() {
+ sourceNode.removeConnection(connection);
+ }
+
+ @Override
+ public void undo() {
+ sourceNode.addConnection(connection);
+ }
+
+ @Override
+ public void redo() {
+ execute();
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/ConnectionReconnectCommand.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/ConnectionReconnectCommand.java
new file mode 100644
index 0000000..7a50c38
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/ConnectionReconnectCommand.java
@@ -0,0 +1,103 @@
+package de.dhbw.horb.ksm.core.editor.commands;
+
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.commands.Command;
+
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeEditPart;
+
+/**
+ * This command reconnects source or target of connection
+ */
+@SuppressWarnings("unused")
+public class ConnectionReconnectCommand extends Command {
+
+ private ConnectionEditPart connectionEditPart;
+ private KSMNodeEditPart newSourceNodeEditPart = null;
+ private KSMNodeEditPart newTargetNodeEditPart = null;
+ private KSMNodeEditPart prevTargetNodeEditPart = null;
+ private KSMNodeEditPart prevSourceNodeEditPart = null;
+
+ public void setSource(KSMNodeEditPart source) {
+ this.newSourceNodeEditPart = source;
+ }
+
+ public void setOldSource(KSMNodeEditPart oldSourceNodeEditPart) {
+ this.prevSourceNodeEditPart = oldSourceNodeEditPart;
+ }
+
+ public void setConnection(ConnectionEditPart connectionEditPart) {
+ this.connectionEditPart = connectionEditPart;
+ }
+
+ public void setTarget(KSMNodeEditPart target) {
+ this.newTargetNodeEditPart = target;
+ }
+
+ public void setOldTarget(KSMNodeEditPart oldTargetNodeEditPart) {
+ this.prevTargetNodeEditPart = oldTargetNodeEditPart;
+ }
+
+ @Override
+ public String getLabel() {
+ // TODO be more verbose
+ return "Reconnect Connection";
+ }
+
+ @Override
+ public boolean canExecute() {
+ return true;
+ }
+
+ @Override
+ public void execute() {
+ System.out.println("ConnectionReconnectCommand.execute()");
+ // KSMConnectionModel connectionModel = (KSMConnectionModel)
+ // connectionEditPart
+ // .getModel();
+ // if (newSourceNodeEditPart != null && prevSourceNodeEditPart != null)
+ // {
+ // KSMNodeModel sourceModel = (KSMNodeModel) newSourceNodeEditPart
+ // .getModel();
+ // connectionModel.setSource(sourceModel);
+ // newSourceNodeEditPart.refresh();
+ // prevSourceNodeEditPart.refresh();
+ // }
+ // if (newTargetNodeEditPart != null && prevTargetNodeEditPart != null)
+ // {
+ // KSMNodeModel targetModel = (KSMNodeModel) newTargetNodeEditPart
+ // .getModel();
+ // connectionModel.setTarget(targetModel);
+ // newTargetNodeEditPart.refresh();
+ // prevTargetNodeEditPart.refresh();
+ // }
+ }
+
+ @Override
+ public void undo() {
+ System.out.println("ConnectionReconnectCommand.undo()");
+ // KSMConnectionModel connectionModel = (KSMConnectionModel)
+ // connectionEditPart
+ // .getModel();
+ // if (newSourceNodeEditPart != null && prevSourceNodeEditPart != null)
+ // {
+ // KSMNodeModel sourceModel = (KSMNodeModel) prevSourceNodeEditPart
+ // .getModel();
+ // connectionModel.setSource(sourceModel);
+ // prevSourceNodeEditPart.refresh();
+ // newSourceNodeEditPart.refresh();
+ // }
+ // if (newTargetNodeEditPart != null && prevTargetNodeEditPart != null)
+ // {
+ // KSMNodeModel targetModel = (KSMNodeModel) prevTargetNodeEditPart
+ // .getModel();
+ // connectionModel.setTarget(targetModel);
+ // prevTargetNodeEditPart.refresh();
+ // newTargetNodeEditPart.refresh();
+ // }
+ }
+
+ @Override
+ public void redo() {
+ execute();
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeCreateCommand.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeCreateCommand.java
new file mode 100644
index 0000000..b9a4020
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeCreateCommand.java
@@ -0,0 +1,63 @@
+package de.dhbw.horb.ksm.core.editor.commands;
+
+import java.math.BigInteger;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.commands.Command;
+
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.editor.model.NodeRequest;
+import de.dhbw.horb.ksm.model.api.Node;
+
+public class NodeCreateCommand extends Command {
+ private NodeRequest nodeRequest;
+ private Node node = null;
+ private Point absoluteLocation;
+
+ private final static String LOCATION_X = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODE_VISUAL_LOCATION_X);
+ private final static String LOCATION_Y = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODE_VISUAL_LOCATION_Y);
+
+ public void setNodeRequest(NodeRequest nodeRequest) {
+ this.nodeRequest = nodeRequest;
+ }
+
+ public void setAbsoluteLocation(Point location) {
+ this.absoluteLocation = location;
+ }
+
+ @Override
+ public String getLabel() {
+ return "Create Node";
+ }
+
+ @Override
+ public void execute() {
+ final Point relativeLocation = this.absoluteLocation.getCopy();
+ IFigure parentFigure = nodeRequest.getNodeGroupEditPart().getFigure();
+
+ // Translate the location of the 'click'
+ // to relative coordinates in the parent
+ // coordinate system
+ parentFigure.translateFromParent(relativeLocation);
+ parentFigure.translateToRelative(relativeLocation);
+
+ node = nodeRequest.getNodeGroup().createNode();
+ node.getProperties().setInteger(LOCATION_X,
+ BigInteger.valueOf(relativeLocation.x));
+ node.getProperties().setInteger(LOCATION_Y,
+ BigInteger.valueOf(relativeLocation.y));
+ }
+
+ @Override
+ public void undo() {
+ nodeRequest.getNodeGroup().removeNode(node);
+ node = null;
+ }
+
+ public void redo() {
+ this.execute();
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeDeleteCommand.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeDeleteCommand.java
new file mode 100644
index 0000000..56168fb
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeDeleteCommand.java
@@ -0,0 +1,39 @@
+package de.dhbw.horb.ksm.core.editor.commands;
+
+import org.eclipse.gef.commands.Command;
+
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+
+public class NodeDeleteCommand extends Command {
+ private NodeGroup nodeGroup;
+ private Node node;
+
+ public void setNodeGroup(NodeGroup nodeGroup) {
+ this.nodeGroup = nodeGroup;
+ }
+
+ public void setNode(Node node) {
+ this.node = node;
+ }
+
+ @Override
+ public String getLabel() {
+ return "Delete Node";
+ }
+
+ @Override
+ public void execute() {
+ nodeGroup.removeNode(node);
+ }
+
+ @Override
+ public void undo() {
+ nodeGroup.addNode(node);
+ }
+
+ @Override
+ public void redo() {
+ this.execute();
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeGroupCreateCommand.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeGroupCreateCommand.java
new file mode 100644
index 0000000..58b1b4c
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeGroupCreateCommand.java
@@ -0,0 +1,69 @@
+package de.dhbw.horb.ksm.core.editor.commands;
+
+import java.math.BigInteger;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.commands.Command;
+
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.editor.model.NodeGroupRequest;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+
+public class NodeGroupCreateCommand extends Command {
+ private NodeGroupRequest nodeGroupRequest;
+ private NodeGroup nodeGroup = null;
+ private Point absoluteLocation;
+
+ private final static String LOCATION_X = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_LOCATION_X);
+ private final static String LOCATION_Y = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_LOCATION_Y);
+ private final static String HEIGHT = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_HEIGHT);
+ private final static String WIDTH = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_WIDTH);
+
+ public void setNodeGroupRequest(NodeGroupRequest nodeGroupRequest) {
+ this.nodeGroupRequest = nodeGroupRequest;
+ }
+
+ public void setAbsoluteLocation(Point location) {
+ this.absoluteLocation = location;
+ }
+
+ @Override
+ public String getLabel() {
+ return "Create Node";
+ }
+
+ @Override
+ public void execute() {
+ final Point relativeLocation = this.absoluteLocation.getCopy();
+ final IFigure parentFigure = nodeGroupRequest.getEditPart().getFigure();
+
+ // Translate the location of the 'click'
+ // to relative coordinates in the parent
+ // coordinate system
+ parentFigure.translateToRelative(relativeLocation);
+ parentFigure.translateFromParent(relativeLocation);
+
+ nodeGroup = nodeGroupRequest.getNodeGroup().createNodeGroup();
+ nodeGroup.getProperties().setInteger(LOCATION_X,
+ BigInteger.valueOf(relativeLocation.x));
+ nodeGroup.getProperties().setInteger(LOCATION_Y,
+ BigInteger.valueOf(relativeLocation.y));
+
+ nodeGroup.getProperties().setInteger(WIDTH, BigInteger.valueOf(150));
+ nodeGroup.getProperties().setInteger(HEIGHT, BigInteger.valueOf(100));
+ }
+
+ @Override
+ public void undo() {
+ nodeGroupRequest.getNodeGroup().removeNodeGroup(nodeGroup);
+ }
+
+ public void redo() {
+ nodeGroupRequest.getNodeGroup().addNodeGroup(nodeGroup);
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeGroupDeleteCommand.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeGroupDeleteCommand.java
new file mode 100644
index 0000000..53171da
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeGroupDeleteCommand.java
@@ -0,0 +1,38 @@
+package de.dhbw.horb.ksm.core.editor.commands;
+
+import org.eclipse.gef.commands.Command;
+
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+
+public class NodeGroupDeleteCommand extends Command {
+ private NodeGroup parentNodeGroup;
+ private NodeGroup nodeGroup;
+
+ public void setParentNodeGroup(NodeGroup nodeGroup) {
+ this.parentNodeGroup = nodeGroup;
+ }
+
+ public void setNodeGroup(NodeGroup nodeGroup) {
+ this.nodeGroup = nodeGroup;
+ }
+
+ @Override
+ public String getLabel() {
+ return "Delete Node";
+ }
+
+ @Override
+ public void execute() {
+ parentNodeGroup.removeNodeGroup(nodeGroup);
+ }
+
+ @Override
+ public void undo() {
+ parentNodeGroup.addNodeGroup(nodeGroup);
+ }
+
+ @Override
+ public void redo() {
+ this.execute();
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeGroupRenameCommand.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeGroupRenameCommand.java
new file mode 100644
index 0000000..3236675
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeGroupRenameCommand.java
@@ -0,0 +1,61 @@
+package de.dhbw.horb.ksm.core.editor.commands;
+
+import org.eclipse.gef.commands.Command;
+
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeGroupEditPart;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+
+/**
+ * This command change the visual-name of a NodeGroup
+ *
+ * @see NodeRenameCommand
+ */
+public class NodeGroupRenameCommand extends Command {
+ private final NodeGroup nodeGroup;
+ private String newCaption;
+ private String oldCaption;
+
+ public NodeGroupRenameCommand(KSMNodeGroupEditPart child) {
+ this.nodeGroup = child.getModel();
+ }
+
+ public void setNewCaption(String newCaption) {
+ this.newCaption = newCaption;
+ }
+
+ @Override
+ public String getLabel() {
+ return "Move Node";
+ }
+
+ @Override
+ public void execute() {
+ oldCaption = nodeGroup
+ .getProperties()
+ .getString(
+ ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_CAPTION));
+ redo();
+ }
+
+ @Override
+ public void undo() {
+ nodeGroup
+ .getProperties()
+ .setString(
+ ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_CAPTION),
+ oldCaption);
+ }
+
+ @Override
+ public void redo() {
+ nodeGroup
+ .getProperties()
+ .setString(
+ ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_CAPTION),
+ newCaption);
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeGroupSetBoundsCommand.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeGroupSetBoundsCommand.java
new file mode 100644
index 0000000..d66d3c8
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeGroupSetBoundsCommand.java
@@ -0,0 +1,83 @@
+package de.dhbw.horb.ksm.core.editor.commands;
+
+import java.math.BigInteger;
+
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.commands.Command;
+
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeGroupEditPart;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+import de.dhbw.horb.ksm.model.api.Properties;
+
+public class NodeGroupSetBoundsCommand extends Command {
+ private NodeGroup nodeGroup;
+ private Rectangle relativeOldBounds;
+ private Rectangle relativeTargetBounds;
+
+ private final static String LOCATION_X = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_LOCATION_X);
+ private final static String LOCATION_Y = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_LOCATION_Y);
+ private final static String HEIGHT = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_HEIGHT);
+ private final static String WIDTH = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_WIDTH);
+
+ public NodeGroupSetBoundsCommand(KSMNodeGroupEditPart child) {
+ this.nodeGroup = child.getModel();
+ Properties p = nodeGroup.getProperties();
+
+ relativeOldBounds = new Rectangle(/**/
+ /* X */
+ p.getInteger(LOCATION_X).intValue(),
+ /* Y */
+ p.getInteger(LOCATION_Y).intValue(),
+ /* width */
+ p.getInteger(WIDTH).intValue(),
+ /* height */
+ p.getInteger(HEIGHT).intValue());
+ }
+
+ public void setRelativeTargetBounds(Rectangle rectangle) {
+ relativeTargetBounds = rectangle.getCopy();
+ }
+
+ public void setNodeGroup(NodeGroup nodeGroup) {
+ this.nodeGroup = nodeGroup;
+ }
+
+ @Override
+ public String getLabel() {
+ return "Move Node";
+ }
+
+ @Override
+ public void execute() {
+ nodeGroup.getProperties().setInteger(LOCATION_X,
+ BigInteger.valueOf(relativeTargetBounds.x));
+ nodeGroup.getProperties().setInteger(LOCATION_Y,
+ BigInteger.valueOf(relativeTargetBounds.y));
+ nodeGroup.getProperties().setInteger(WIDTH,
+ BigInteger.valueOf(relativeTargetBounds.width));
+ nodeGroup.getProperties().setInteger(HEIGHT,
+ BigInteger.valueOf(relativeTargetBounds.height));
+ }
+
+ @Override
+ public void undo() {
+ nodeGroup.getProperties().setInteger(LOCATION_X,
+ BigInteger.valueOf(relativeOldBounds.x));
+ nodeGroup.getProperties().setInteger(LOCATION_Y,
+ BigInteger.valueOf(relativeOldBounds.y));
+ nodeGroup.getProperties().setInteger(WIDTH,
+ BigInteger.valueOf(relativeOldBounds.width));
+ nodeGroup.getProperties().setInteger(HEIGHT,
+ BigInteger.valueOf(relativeOldBounds.height));
+ }
+
+ @Override
+ public void redo() {
+ execute();
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeMoveCommand.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeMoveCommand.java
new file mode 100644
index 0000000..e971110
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeMoveCommand.java
@@ -0,0 +1,70 @@
+package de.dhbw.horb.ksm.core.editor.commands;
+
+import java.math.BigInteger;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.commands.Command;
+
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeEditPart;
+
+public class NodeMoveCommand extends Command {
+ private KSMNodeEditPart node;
+ private Point relativeTargetLocation;
+ private Point relativeOldLocation;
+
+ private final static String LOCATION_X = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODE_VISUAL_LOCATION_X);
+ private final static String LOCATION_Y = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODE_VISUAL_LOCATION_Y);
+
+ public NodeMoveCommand(KSMNodeEditPart child) {
+ this.node = child;
+ relativeOldLocation = new Point(/**/
+ /* X-Position */
+ node.getModel().getProperties()
+ .getInteger(LOCATION_X).intValue(),
+ /* Y-Position */
+ node.getModel().getProperties()
+ .getInteger(LOCATION_Y).intValue());
+ }
+
+ public void setAbsoluteTargetLocation(Point absoluteTargetLocation) {
+ relativeTargetLocation = absoluteTargetLocation.getCopy();
+ node.getFigure().translateFromParent(relativeTargetLocation);
+ }
+
+ @Override
+ public String getLabel() {
+ return "Move Node";
+ }
+
+ @Override
+ public void execute() {
+ node.getModel()
+ .getProperties()
+ .setInteger(LOCATION_X,
+ BigInteger.valueOf(relativeTargetLocation.x));
+ node.getModel()
+ .getProperties()
+ .setInteger(LOCATION_Y,
+ BigInteger.valueOf(relativeTargetLocation.y));
+ }
+
+ @Override
+ public void undo() {
+ node.getModel()
+ .getProperties()
+ .setInteger(LOCATION_X,
+ BigInteger.valueOf(relativeOldLocation.x));
+ node.getModel()
+ .getProperties()
+ .setInteger(LOCATION_Y,
+ BigInteger.valueOf(relativeOldLocation.y));
+ }
+
+ @Override
+ public void redo() {
+ execute();
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeRenameCommand.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeRenameCommand.java
new file mode 100644
index 0000000..13ef538
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/NodeRenameCommand.java
@@ -0,0 +1,50 @@
+package de.dhbw.horb.ksm.core.editor.commands;
+
+import org.eclipse.gef.commands.Command;
+
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeEditPart;
+import de.dhbw.horb.ksm.model.api.Node;
+
+/**
+ * This command change the visual-name of a Node.
+ *
+ * @see NodeGroupRenameCommand
+ */
+public class NodeRenameCommand extends Command {
+ private final Node nodeGroup;
+ private String newCaption;
+ private String oldCaption;
+
+ private final static String CAPTION = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODE_VISUAL_CAPTION);
+
+ public NodeRenameCommand(KSMNodeEditPart child) {
+ this.nodeGroup = child.getModel();
+ }
+
+ public void setNewCaption(String newCaption) {
+ this.newCaption = newCaption;
+ }
+
+ @Override
+ public String getLabel() {
+ return "Rename Node";
+ }
+
+ @Override
+ public void execute() {
+ oldCaption = nodeGroup.getProperties().getString(CAPTION);
+ redo();
+ }
+
+ @Override
+ public void undo() {
+ nodeGroup.getProperties().setString(CAPTION, oldCaption);
+ }
+
+ @Override
+ public void redo() {
+ nodeGroup.getProperties().setString(CAPTION, newCaption);
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/package.html b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/package.html
new file mode 100644
index 0000000..82bbdb9
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/commands/package.html
@@ -0,0 +1,4 @@
+Commands are Classes who represents user actions in the Applications.
+<br/>
+Commands have execute and undo methods. Using them its possible to provide
+the usual undo/redo experience. \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/dnd/DiagramTemplateTransferDropTargetListener.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/dnd/DiagramTemplateTransferDropTargetListener.java
new file mode 100644
index 0000000..e762c93
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/dnd/DiagramTemplateTransferDropTargetListener.java
@@ -0,0 +1,27 @@
+package de.dhbw.horb.ksm.core.editor.dnd;
+
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.dnd.TemplateTransferDropTargetListener;
+import org.eclipse.gef.requests.CreationFactory;
+
+import de.dhbw.horb.ksm.core.editor.model.NodeGroupRequestFactory;
+import de.dhbw.horb.ksm.core.editor.model.NodeRequestFactory;
+
+public class DiagramTemplateTransferDropTargetListener extends
+ TemplateTransferDropTargetListener {
+
+ public DiagramTemplateTransferDropTargetListener(EditPartViewer viewer) {
+ super(viewer);
+ }
+
+ @Override
+ protected CreationFactory getFactory(Object template) {
+ if (template instanceof NodeRequestFactory) {
+ return (CreationFactory) template;
+ } else if (template instanceof NodeGroupRequestFactory) {
+ return (CreationFactory) template;
+ } else {
+ return null;
+ }
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/figures/KSMNodeFigure.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/figures/KSMNodeFigure.java
new file mode 100644
index 0000000..ec90d60
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/figures/KSMNodeFigure.java
@@ -0,0 +1,52 @@
+package de.dhbw.horb.ksm.core.editor.figures;
+
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.RoundedRectangle;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
+
+public class KSMNodeFigure extends Figure {
+ private RoundedRectangle rectangleFigure;
+ private Label label;
+
+ public KSMNodeFigure() {
+ rectangleFigure = new RoundedRectangle();
+ rectangleFigure.setCornerDimensions(new Dimension(25, 25));
+ rectangleFigure
+ .setForegroundColor(org.eclipse.draw2d.ColorConstants.red);
+ rectangleFigure.setLineWidth(3);
+
+ label = new Label();
+
+ add(rectangleFigure);
+ add(label);
+ }
+
+ public void setNodeColor(RGB color) {
+ rectangleFigure.setForegroundColor(new Color(Display.getCurrent(),
+ color));
+ }
+
+ public String getText() {
+ return label.getText();
+ }
+
+ public Rectangle getTextBounds() {
+ return label.getTextBounds();
+ }
+
+ @Override
+ public void setBounds(Rectangle rect) {
+ super.setBounds(rect);
+ rectangleFigure.setBounds(rect);
+ label.setBounds(rect);
+ }
+
+ public void setCaption(String name) {
+ label.setText(name);
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/figures/KSMNodeGroupFigure.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/figures/KSMNodeGroupFigure.java
new file mode 100644
index 0000000..69ff985
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/figures/KSMNodeGroupFigure.java
@@ -0,0 +1,43 @@
+package de.dhbw.horb.ksm.core.editor.figures;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.LineBorder;
+import org.eclipse.draw2d.Panel;
+import org.eclipse.draw2d.XYLayout;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+public class KSMNodeGroupFigure extends Panel {
+ private Label label;
+
+ public KSMNodeGroupFigure() {
+ setLayoutManager(new XYLayout());
+ setBorder(new LineBorder(ColorConstants.gray, 2, Graphics.LINE_DASHDOT));
+ setBackgroundColor(ColorConstants.white);
+
+ label = new Label();
+ add(label);
+ }
+
+ public String getText() {
+ return label.getText();
+ }
+
+ @Override
+ public void setBounds(Rectangle rect) {
+ super.setBounds(rect);
+ label.setBounds(new Rectangle(0, 0, getBounds().width, label
+ .getPreferredSize().height));
+ }
+
+ public void setCaption(String caption) {
+ label.setText(caption);
+ label.repaint();
+ }
+
+ @Override
+ protected boolean useLocalCoordinates() {
+ return true;
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/ModelProperties.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/ModelProperties.java
new file mode 100644
index 0000000..129220c
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/ModelProperties.java
@@ -0,0 +1,101 @@
+package de.dhbw.horb.ksm.core.editor.model;
+
+import org.eclipse.swt.graphics.RGB;
+
+public enum ModelProperties {
+ INSTANCE;
+
+ public String NODE_VISUAL_LOCATION_X = "integer:visual.location.x";//$NON-NLS-N$
+ public String NODE_VISUAL_LOCATION_Y = "integer:visual.location.y";//$NON-NLS-N$
+ public String NODE_VISUAL_CAPTION = "string:visual.caption";//$NON-NLS-N$
+ public String NODE_VISUAL_COLOR = "string:visual.color";//$NON-NLS-N$
+
+ public String NODEGROUP_VISUAL_LOCATION_X = "integer:visual.location.x";//$NON-NLS-N$
+ public String NODEGROUP_VISUAL_LOCATION_Y = "integer:visual.location.y";//$NON-NLS-N$
+ public String NODEGROUP_VISUAL_WIDTH = "integer:visual.width";//$NON-NLS-N$
+ public String NODEGROUP_VISUAL_HEIGHT = "integer:visual.height";//$NON-NLS-N$
+ public String NODEGROUP_VISUAL_CAPTION = "string:visual.caption";//$NON-NLS-N$
+
+ public String CONNECTION_VISUAL_CAPTION = "integer:visual.caption";//$NON-NLS-N$
+ public String CONNECTION_DATA_FUNCTIONTYPE = "string:data.functionType";//$NON-NLS-N$
+ public String CONNECTION_DATA_FUNCTION = "decimalList:data.functionType";//$NON-NLS-N$
+
+ /**
+ * Strips type from Name
+ */
+ public String stripType(String key) {
+ String[] split = key.split(":");
+ if (split.length == 2) {
+ return split[1];
+ } else {
+ return key;
+ }
+ }
+
+ /**
+ * alias for {@link ModelProperties#stripType(String)}
+ */
+ public String name(String key) {
+ return stripType(key);
+ }
+
+ /**
+ * returns type from property name
+ */
+ public String type(String key) {
+ String[] split = key.split(":");
+ if (split.length > 0) {
+ return split[0];
+ } else {
+ return "";
+ }
+ }
+
+
+ public String rgbToString(RGB rgb) {
+ return String.format("#%02x%02x%02x", rgb.red, rgb.green, rgb.blue);
+ }
+
+ public RGB stringToRGB(String string) {
+ System.out.println("String to rgb: " + string);
+ if ("White".equals(string)) {
+ return new RGB(0xff, 0xff, 0xff);
+ } else if ("Light Yellow".equals(string)) {
+ return new RGB(0xfa, 0xff, 0xa2);
+ } else if ("Medium Yellow".equals(string)) {
+ return new RGB(0xf4, 0xff, 0x4b);
+ } else if ("Yellow".equals(string)) {
+ return new RGB(0xed, 0xfc, 0x00);
+ } else if ("Light Blue".equals(string)) {
+ return new RGB(0xd4, 0xd5, 0xe9);
+ } else if ("Medium Blue".equals(string)) {
+ return new RGB(0x76, 0x78, 0xff);
+ } else if ("Blue".equals(string)) {
+ return new RGB(0x00, 0x02, 0xf8);
+ } else if ("Light Green".equals(string)) {
+ return new RGB(0xc8, 0xf8, 0xc9);
+ } else if ("Medium Green".equals(string)) {
+ return new RGB(0x7a, 0xfa, 0x7e);
+ } else if ("Green".equals(string)) {
+ return new RGB(0x1a, 0xf5, 0x20);
+ } else if ("Light Red".equals(string)) {
+ return new RGB(0xfd, 0xcc, 0xcc);
+ } else if ("Medium Red".equals(string)) {
+ return new RGB(0xf9, 0x59, 0x59);
+ } else if ("Red".equals(string)) {
+ return new RGB(0xf6, 0x20, 0x20);
+ } else if (string != null && string.matches("\\#[a-fA-F0-9]{6}")) {
+ System.out
+ .println("BaseNodePropertyAdvisor.KSMColorCellEditor.stringToRGB()");
+ String sr = string.substring(1, 3);
+ String sg = string.substring(3, 5);
+ String sb = string.substring(5, 7);
+ int r = Integer.parseInt(sr, 16);
+ int g = Integer.parseInt(sg, 16);
+ int b = Integer.parseInt(sb, 16);
+ return new RGB(r, g, b);
+ } else {
+ return new RGB(0, 0, 0);
+ }
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/NodeGroupRequest.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/NodeGroupRequest.java
new file mode 100644
index 0000000..f4fc969
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/NodeGroupRequest.java
@@ -0,0 +1,36 @@
+package de.dhbw.horb.ksm.core.editor.model;
+
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+
+import de.dhbw.horb.ksm.core.editor.parts.KSMEditPart;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeGroupEditPart;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+
+/**
+ * A {@link NodeGroupRequest} instance is created to track the request of
+ * creating a new {@link NodeGroup} Object in the model.
+ */
+public class NodeGroupRequest {
+ private final AbstractGraphicalEditPart nodeGroupEditPart;
+
+ public NodeGroupRequest(KSMNodeGroupEditPart nodeGroupEditPart) {
+ this.nodeGroupEditPart = nodeGroupEditPart;
+ }
+
+ public NodeGroupRequest(KSMEditPart ksmEditPart) {
+ this.nodeGroupEditPart = ksmEditPart;
+ }
+
+ public NodeGroup getNodeGroup() {
+ if (nodeGroupEditPart instanceof KSMEditPart) {
+ KSMEditPart editPart = (KSMEditPart) nodeGroupEditPart;
+ return editPart.getModel().getNodeGroup();
+ } else {
+ return (NodeGroup) nodeGroupEditPart.getModel();
+ }
+ }
+
+ public AbstractGraphicalEditPart getEditPart() {
+ return nodeGroupEditPart;
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/NodeGroupRequestFactory.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/NodeGroupRequestFactory.java
new file mode 100644
index 0000000..a749a93
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/NodeGroupRequestFactory.java
@@ -0,0 +1,46 @@
+package de.dhbw.horb.ksm.core.editor.model;
+
+import org.eclipse.gef.requests.CreationFactory;
+import org.eclipse.jface.viewers.StructuredSelection;
+
+import de.dhbw.horb.ksm.core.editor.parts.KSMEditPart;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeEditPart;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeGroupEditPart;
+import de.dhbw.horb.ksm.core.editor.ui.DiagramEditor;
+
+public class NodeGroupRequestFactory implements CreationFactory {
+ private final DiagramEditor diagramEditor;
+
+ public NodeGroupRequestFactory(DiagramEditor diagramEditor) {
+ this.diagramEditor = diagramEditor;
+ }
+
+ @Override
+ public Object getNewObject() {
+ StructuredSelection selection = (StructuredSelection) diagramEditor
+ .getSite().getSelectionProvider().getSelection();
+ if (selection.getFirstElement() instanceof KSMNodeGroupEditPart) {
+ // in selected NodeGroup
+ KSMNodeGroupEditPart nodeGroupEditPart = (KSMNodeGroupEditPart) selection
+ .getFirstElement();
+ return new NodeGroupRequest(nodeGroupEditPart);
+ } else if (selection.getFirstElement() instanceof KSMEditPart) {
+ // In Root-NodeGropu
+ KSMEditPart ksmEditPart = (KSMEditPart) selection.getFirstElement();
+ return new NodeGroupRequest(ksmEditPart);
+ } else if (selection.getFirstElement() instanceof KSMNodeEditPart) {
+ // Create in this Node's Parent NodeGroup
+ KSMNodeEditPart ksmNodeEditPart = (KSMNodeEditPart) selection.getFirstElement();
+ // Parent on NodeEditPart is always NodeGroupEditPart
+ return new NodeGroupRequest((KSMNodeGroupEditPart) ksmNodeEditPart.getParent());
+ } else {
+ System.out.println("Bad selection: " + selection);
+ return null;
+ }
+ }
+
+ @Override
+ public Object getObjectType() {
+ return NodeGroupRequest.class;
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/NodeRequest.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/NodeRequest.java
new file mode 100644
index 0000000..6b1acb7
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/NodeRequest.java
@@ -0,0 +1,34 @@
+package de.dhbw.horb.ksm.core.editor.model;
+
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+
+import de.dhbw.horb.ksm.core.editor.parts.KSMEditPart;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeGroupEditPart;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+
+/**
+ * Only used to track a node request
+ */
+public class NodeRequest {
+ private final NodeGroup nodeGroup;
+ private final AbstractGraphicalEditPart nodeGroupEditPart;
+
+ public NodeRequest(KSMNodeGroupEditPart nodeGroupEditPart) {
+ this.nodeGroupEditPart = nodeGroupEditPart;
+ this.nodeGroup = nodeGroupEditPart.getModel();
+ ;
+ }
+
+ public NodeRequest(KSMEditPart ksmEditPart) {
+ this.nodeGroupEditPart = ksmEditPart;
+ this.nodeGroup = ksmEditPart.getModel().getNodeGroup();
+ }
+
+ public NodeGroup getNodeGroup() {
+ return nodeGroup;
+ }
+
+ public AbstractGraphicalEditPart getNodeGroupEditPart() {
+ return nodeGroupEditPart;
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/NodeRequestFactory.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/NodeRequestFactory.java
new file mode 100644
index 0000000..508bd60
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/NodeRequestFactory.java
@@ -0,0 +1,43 @@
+package de.dhbw.horb.ksm.core.editor.model;
+
+import org.eclipse.gef.requests.CreationFactory;
+import org.eclipse.jface.viewers.StructuredSelection;
+
+import de.dhbw.horb.ksm.core.editor.parts.KSMEditPart;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeGroupEditPart;
+import de.dhbw.horb.ksm.core.editor.ui.DiagramEditor;
+
+public class NodeRequestFactory implements CreationFactory {
+ private final DiagramEditor diagramEditor;
+
+ public NodeRequestFactory(DiagramEditor diagramEditor) {
+ this.diagramEditor = diagramEditor;
+ }
+
+ @Override
+ public Object getNewObject() {
+ StructuredSelection selection = getCurrentSelection();
+ Object firstElement = selection.getFirstElement();
+ if (firstElement instanceof KSMNodeGroupEditPart) {
+ KSMNodeGroupEditPart nodeGroupEditPart = (KSMNodeGroupEditPart) firstElement;
+ return new NodeRequest(nodeGroupEditPart);
+ } else if (firstElement instanceof KSMEditPart) {
+ // in case the root (<KSM>) is "selected"
+ KSMEditPart ksmEditPart = (KSMEditPart) firstElement;
+ return new NodeRequest(ksmEditPart);
+ } else {
+ // Selection is not applicable for creating a Node inside
+ return null;
+ }
+ }
+
+ private StructuredSelection getCurrentSelection() {
+ return (StructuredSelection) diagramEditor.getSite()
+ .getSelectionProvider().getSelection();
+ }
+
+ @Override
+ public Object getObjectType() {
+ return NodeRequest.class;
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/property/BaseConnectionPropertyAdvisor.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/property/BaseConnectionPropertyAdvisor.java
new file mode 100644
index 0000000..1c8a3d2
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/property/BaseConnectionPropertyAdvisor.java
@@ -0,0 +1,15 @@
+package de.dhbw.horb.ksm.core.editor.model.property;
+
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.extension.AbstractPropertyDescriptorAdvisor;
+
+/**
+ * Add Basic NodeProperties.
+ */
+public class BaseConnectionPropertyAdvisor extends AbstractPropertyDescriptorAdvisor {
+
+ @Override
+ protected void init() {
+ addProperty(ModelProperties.INSTANCE.CONNECTION_VISUAL_CAPTION, "Caption");
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/property/BaseNodeGroupPropertyAdvisor.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/property/BaseNodeGroupPropertyAdvisor.java
new file mode 100644
index 0000000..a05a066
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/property/BaseNodeGroupPropertyAdvisor.java
@@ -0,0 +1,15 @@
+package de.dhbw.horb.ksm.core.editor.model.property;
+
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.extension.AbstractPropertyDescriptorAdvisor;
+
+/**
+ * Add Basic NodeProperties.
+ */
+public class BaseNodeGroupPropertyAdvisor extends AbstractPropertyDescriptorAdvisor {
+
+ @Override
+ protected void init() {
+ addProperty(ModelProperties.INSTANCE.NODEGROUP_VISUAL_CAPTION, "Caption");
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/property/BaseNodePropertyAdvisor.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/property/BaseNodePropertyAdvisor.java
new file mode 100644
index 0000000..83346e6
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/property/BaseNodePropertyAdvisor.java
@@ -0,0 +1,63 @@
+package de.dhbw.horb.ksm.core.editor.model.property;
+
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ColorCellEditor;
+import org.eclipse.swt.widgets.ColorDialog;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.extension.AbstractPropertyDescriptorAdvisor;
+
+/**
+ * Add Basic NodeProperties.
+ */
+public class BaseNodePropertyAdvisor extends AbstractPropertyDescriptorAdvisor {
+
+ @Override
+ protected void init() {
+ addProperty(ModelProperties.INSTANCE.NODE_VISUAL_CAPTION, "Caption");
+
+ descriptors.add(new KSMColorPropertyDescriptor(
+ ModelProperties.INSTANCE.NODE_VISUAL_COLOR, "Color"));
+ }
+
+ private class KSMColorPropertyDescriptor extends PropertyDescriptor {
+ public KSMColorPropertyDescriptor(Object id, String displayName) {
+ super(id, displayName);
+ }
+
+ @Override
+ public CellEditor createPropertyEditor(Composite parent) {
+ CellEditor editor = new KSMColorCellEditor(parent);
+ return editor;
+ }
+ }
+
+ private class KSMColorCellEditor extends ColorCellEditor {
+
+ public KSMColorCellEditor(Composite parent) {
+ super(parent);
+ }
+
+ @Override
+ protected Object openDialogBox(Control cellEditorWindow) {
+ ColorDialog dialog = new ColorDialog(cellEditorWindow.getShell());
+ Object value = getValue();
+ if (value instanceof String) {
+ dialog.setRGB(ModelProperties.INSTANCE.stringToRGB((String) value));
+ }
+ value = dialog.open();
+ return ModelProperties.INSTANCE.rgbToString(dialog.getRGB());
+ }
+
+
+ @Override
+ protected void updateContents(Object value) {
+ if (value instanceof String) {
+ super.updateContents(ModelProperties.INSTANCE.stringToRGB((String) value));
+ }
+ }
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/property/ModelPropertySource.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/property/ModelPropertySource.java
new file mode 100644
index 0000000..ffa922e
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/model/property/ModelPropertySource.java
@@ -0,0 +1,161 @@
+package de.dhbw.horb.ksm.core.editor.model.property;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.extension.AbstractPropertyDescriptorAdvisor;
+import de.dhbw.horb.ksm.model.api.Connection;
+import de.dhbw.horb.ksm.model.api.KSM;
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+import de.dhbw.horb.ksm.model.api.Properties;
+
+/**
+ * TODO other types than string
+ */
+public abstract class ModelPropertySource implements IPropertySource {
+ private final String type;
+
+ ModelPropertySource(final String type) {
+ this.type = type;
+ }
+
+ protected abstract Properties getProperties();
+
+ @Override
+ public Object getEditableValue() {
+ return null;
+ }
+
+ @Override
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ ArrayList<IPropertyDescriptor> descriptors = new ArrayList<IPropertyDescriptor>();
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
+ .getExtensionPoint("de.dhbw.horb.ksm.core.model.property");
+ if (extensionPoint == null) {
+ return new IPropertyDescriptor[] {};
+ }
+
+ IConfigurationElement[] config = extensionPoint
+ .getConfigurationElements();
+
+ try {
+ for (IConfigurationElement e : config) {
+ if (type.equals(e.getAttribute("type"))) {
+ Object execClass = e.createExecutableExtension("class");
+
+ if (execClass instanceof AbstractPropertyDescriptorAdvisor) {
+ AbstractPropertyDescriptorAdvisor ex = (AbstractPropertyDescriptorAdvisor) execClass;
+ descriptors.addAll(ex.getDescriptors());
+ }
+ }
+ }
+ } catch (CoreException ex) {
+ System.out.println(ex.getMessage());
+ ex.printStackTrace();
+ }
+ return descriptors.toArray(new IPropertyDescriptor[] {});
+ }
+
+ @Override
+ public Object getPropertyValue(Object id) {
+ if (id instanceof String) {
+ String type = ModelProperties.INSTANCE.type((String) id);
+ String name = ModelProperties.INSTANCE.name((String) id);
+ if (type.equals("string")) {
+ return getProperties().getString(name);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public boolean isPropertySet(Object id) {
+ return getPropertyValue(id) != null;
+ }
+
+ @Override
+ public void resetPropertyValue(Object id) {
+ System.out.println("reset " + id);
+ }
+
+ @Override
+ public void setPropertyValue(Object id, Object value) {
+ if (id instanceof String) {
+ String type = ModelProperties.INSTANCE.type((String) id);
+ String name = ModelProperties.INSTANCE.name((String) id);
+ if (type.equals("string") && value instanceof String) {
+ getProperties().setString(name, (String) value);
+ }
+ }
+ }
+
+ /**
+ * Specialized type for {@link KSM} Model-Objects
+ */
+ public static class KSMPropertySource extends ModelPropertySource {
+ private final KSM model;
+
+ public KSMPropertySource(final KSM model) {
+ super("ksm");
+ this.model = model;
+ }
+
+ @Override
+ protected Properties getProperties() {
+ return model.getProperties();
+ }
+ }
+
+ /**
+ * Specialized type for {@link NodeGroup} Model-Objects
+ */
+ public static class NodeGroupPropertySource extends ModelPropertySource {
+ private final NodeGroup model;
+
+ public NodeGroupPropertySource(final NodeGroup model) {
+ super("nodegroup");
+ this.model = model;
+ }
+
+ @Override
+ protected Properties getProperties() {
+ return model.getProperties();
+ }
+ }
+
+ public static class NodePropertySource extends ModelPropertySource {
+ private final Node model;
+
+ public NodePropertySource(final Node model) {
+ super("node");
+ this.model = model;
+ }
+
+ @Override
+ protected Properties getProperties() {
+ return model.getProperties();
+ }
+ }
+
+ public static class ConnectionPropertySource extends ModelPropertySource {
+ private final Connection model;
+
+ public ConnectionPropertySource(final Connection model) {
+ super("connection");
+ this.model = model;
+ }
+
+ @Override
+ protected Properties getProperties() {
+ return model.getProperties();
+ }
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/KSMConnectionEditPart.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/KSMConnectionEditPart.java
new file mode 100644
index 0000000..e12c738
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/KSMConnectionEditPart.java
@@ -0,0 +1,204 @@
+package de.dhbw.horb.ksm.core.editor.parts;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import org.eclipse.draw2d.FanRouter;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PolygonDecoration;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editparts.AbstractConnectionEditPart;
+import org.eclipse.gef.editpolicies.ConnectionEditPolicy;
+import org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy;
+import org.eclipse.gef.requests.GroupRequest;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+import de.dhbw.horb.ksm.core.editor.commands.ConnectionDeleteCommand;
+import de.dhbw.horb.ksm.core.editor.model.property.ModelPropertySource;
+import de.dhbw.horb.ksm.core.editor.parts.routing.ModifiedAutomaticRouter;
+import de.dhbw.horb.ksm.core.editor.parts.routing.RoundedPolylineConnection;
+import de.dhbw.horb.ksm.model.api.Connection;
+import de.dhbw.horb.ksm.model.api.Node;
+
+/**
+ * Adapts the Model Object {@link de.dhbw.horb.ksm.xmlschema.api.Connection} to
+ * the Editor GUI.
+ */
+public class KSMConnectionEditPart extends AbstractConnectionEditPart implements
+ PropertyChangeListener {
+ private final static FanRouter FAN_ROUTER;
+ @SuppressWarnings("unused")
+ private final static SelfReferencingConnectionRouter SELF_CONNECTION_ROUTER;
+
+ static {
+ FAN_ROUTER = new FanRouter();
+ FAN_ROUTER.setSeparation(32);
+ SELF_CONNECTION_ROUTER = new SelfReferencingConnectionRouter();
+ }
+
+ /**
+ * register with the model for property changes
+ */
+ @Override
+ public void activate() {
+ if (isActive()) {
+ return;
+ }
+ super.activate();
+ getModel().addPropertyChangeListener(this);
+ getModel().getProperties().addPropertyChangeListener(this);
+ }
+
+ /**
+ * deregister with the model
+ */
+ @Override
+ public void deactivate() {
+ if (!isActive()) {
+ return;
+ }
+ super.deactivate();
+ getModel().removePropertyChangeListener(this);
+ getModel().getProperties().removePropertyChangeListener(this);
+ }
+
+ @Override
+ public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
+ if (adapter.equals(IPropertySource.class)) {
+ // Property Description for this Model-Object
+ return new ModelPropertySource.ConnectionPropertySource(getModel());
+ }
+ return super.getAdapter(adapter);
+ }
+
+ @Override
+ public Connection getModel() {
+ return (Connection) super.getModel();
+ }
+
+ @Override
+ protected void createEditPolicies() {
+ installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE,
+ new ConnectionEndpointEditPolicy() {
+ protected void addSelectionHandles() {
+ super.addSelectionHandles();
+ getConnectionFigure().setLineWidth(2);
+ }
+
+ protected Shape getConnectionFigure() {
+ return (Shape) ((GraphicalEditPart) getHost())
+ .getFigure();
+ }
+
+ protected void removeSelectionHandles() {
+ super.removeSelectionHandles();
+ getConnectionFigure().setLineWidth(0);
+ }
+ });
+
+ // Provides Command to delete the Connection hold by this EditPart
+ installEditPolicy(EditPolicy.CONNECTION_ROLE,
+ new ConnectionEditPolicy() {
+ @Override
+ protected Command getDeleteCommand(GroupRequest arg0) {
+ ConnectionDeleteCommand command = new ConnectionDeleteCommand();
+ command.setConnection(KSMConnectionEditPart.this
+ .getModel());
+ command.setSourceNode((Node) getSource().getModel());
+ return command;
+ }
+ });
+ }
+
+ /**
+ * Returns a newly created Figure to represent the connection.
+ *
+ * @return The created Figure.
+ */
+ @Override
+ protected IFigure createFigure() {
+ RoundedPolylineConnection roundedConnection = new RoundedPolylineConnection();
+ setFigureProperties(roundedConnection);
+ return roundedConnection;
+ }
+
+ private void setFigureProperties(org.eclipse.draw2d.Connection connection) {
+ RoundedPolylineConnection roundedConnection = (RoundedPolylineConnection) connection;
+ // if (((Node)
+ // getParent().getModel()).getId().equals(getModel().getTo())) {
+ // // Connection auf sich selbst
+ // roundedConnection.setTolerance(1);
+ // roundedConnection.setCornerLength(32);
+ // roundedConnection.setCurved(false);
+ // roundedConnection.setTargetDecoration(new PolygonDecoration());
+ // roundedConnection.setConnectionRouter(SELF_CONNECTION_ROUTER);
+ // } else {
+ // Connection auf einen anderen Knoten
+ roundedConnection.setTolerance(5);
+ roundedConnection.setCornerLength(32);
+ roundedConnection.setCurved(true);
+ roundedConnection.setTargetDecoration(new PolygonDecoration());
+ roundedConnection.setConnectionRouter(FAN_ROUTER);
+ // }
+ }
+
+ @Override
+ public void refresh() {
+ // The connection maybe has been re-connected
+ // so the Connection Router must
+ // be changed
+ setFigureProperties(getConnectionFigure());
+ super.refresh();
+ }
+
+ /**
+ * Inserts a "middle" Point between start and end point. with
+ * y=start_point.x + offset*index where index is the number of this
+ * connection in a list of all self-referencing connections of this figure
+ */
+ public static class SelfReferencingConnectionRouter extends
+ ModifiedAutomaticRouter {
+ @Override
+ protected void handleCollision(
+ org.eclipse.draw2d.Connection connection, PointList list,
+ int index) {
+ PointList points = connection.getPoints();
+ points.removeAllPoints();
+ Point startPoint, midpoint, endPoint;
+
+ startPoint = getStartPoint(connection);
+ startPoint.x -= 80;
+
+ endPoint = getEndPoint(connection);
+ endPoint.x += 40;
+
+ midpoint = new Point(startPoint);
+ midpoint.y += 20 + 20 * index;
+ midpoint.x = (startPoint.x + endPoint.x) / 2;
+
+ connection.translateToRelative(startPoint);
+ points.addPoint(startPoint);
+
+ connection.translateToRelative(midpoint);
+ points.addPoint(midpoint);
+
+ connection.translateToRelative(endPoint);
+ points.addPoint(endPoint);
+ }
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ final String pName = evt.getPropertyName();
+ boolean handled = false;
+
+ if (!handled) {
+ System.out.println("Unhandled KSM event: " + pName + " - " + evt);
+ }
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/KSMEditPart.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/KSMEditPart.java
new file mode 100644
index 0000000..6f2bc17
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/KSMEditPart.java
@@ -0,0 +1,110 @@
+package de.dhbw.horb.ksm.core.editor.parts;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.XYLayout;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+import de.dhbw.horb.ksm.core.editor.model.property.ModelPropertySource;
+import de.dhbw.horb.ksm.core.editor.policies.DiagramLayoutEditPolicy;
+import de.dhbw.horb.ksm.core.editor.policies.NodeGroupComponentEditPolicy;
+import de.dhbw.horb.ksm.model.api.KSM;
+
+/**
+ * The Edit part adapts the root NodeGroup from the {@link KSM} model Object to
+ * the Editor-GUI.
+ */
+public class KSMEditPart extends AbstractGraphicalEditPart implements
+ PropertyChangeListener {
+
+ @Override
+ public void activate() {
+ if (isActive()) {
+ return;
+ }
+ super.activate();
+ getModel().getProperties().addPropertyChangeListener(this);
+ getModel().getNodeGroup().addPropertyChangeListener(this);
+ }
+
+ @Override
+ public Object getAdapter(@SuppressWarnings("rawtypes") Class key) {
+ if (key.equals(IPropertySource.class)) {
+ // Property Description for this Model-Object
+ return new ModelPropertySource.KSMPropertySource(getModel());
+ }
+ return super.getAdapter(key);
+ }
+
+ protected void createEditPolicies() {
+ // Delete
+ installEditPolicy(EditPolicy.COMPONENT_ROLE,
+ new NodeGroupComponentEditPolicy());
+
+ // install a custom layout policy that handles dragging nodes around
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new DiagramLayoutEditPolicy());
+ }
+
+ protected IFigure createFigure() {
+ IFigure pane = new Figure() {
+ @Override
+ protected boolean useLocalCoordinates() {
+ return false;
+ }
+ };
+ pane.setLayoutManager(new XYLayout());
+ return pane;
+ }
+
+ @Override
+ public void deactivate() {
+ if (!isActive()) {
+ return;
+ }
+ super.deactivate();
+ getModel().getProperties().removePropertyChangeListener(this);
+ getModel().getNodeGroup().removePropertyChangeListener(this);
+ }
+
+ @Override
+ public KSM getModel() {
+ return (KSM) super.getModel();
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ protected List getModelChildren() {
+ List list = new ArrayList();
+ list.addAll(getModel().getNodeGroup().getNodes());
+ list.addAll(getModel().getNodeGroup().getNodeGroups());
+ return list;
+ }
+
+ public void propertyChange(PropertyChangeEvent event) {
+ boolean handled = false;
+ String pName = event.getPropertyName();
+ if (event.getSource() == getModel().getProperties()) {
+
+ } else if (event.getSource() == getModel().getNodeGroup()) {
+ if ("nodes".equals(pName) || "nodegroups".equals(pName)) {
+ handled = true;
+ refreshChildren();
+ }
+ }
+ if (!handled) {
+ System.out.println("Unhandled Datemodell event: " + event);
+ }
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ getFigure().revalidate();
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/KSMNodeEditPart.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/KSMNodeEditPart.java
new file mode 100644
index 0000000..c79a6f9
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/KSMNodeEditPart.java
@@ -0,0 +1,273 @@
+package de.dhbw.horb.ksm.core.editor.parts;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.ChopboxAnchor;
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.NodeEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+import de.dhbw.horb.ksm.core.editor.figures.KSMNodeFigure;
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.editor.model.property.ModelPropertySource;
+import de.dhbw.horb.ksm.core.editor.parts.editmanager.NodeDirectEditManager;
+import de.dhbw.horb.ksm.core.editor.policies.NodeComponentEditPolicy;
+import de.dhbw.horb.ksm.core.editor.policies.NodeDirectEditPolicy;
+import de.dhbw.horb.ksm.core.editor.policies.NodeGraphicalNodeEditPolicy;
+import de.dhbw.horb.ksm.model.api.Connection;
+import de.dhbw.horb.ksm.model.api.KSM;
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.Properties;
+
+@SuppressWarnings({ "rawtypes" })
+public class KSMNodeEditPart extends AbstractGraphicalEditPart implements
+ PropertyChangeListener, NodeEditPart {
+
+ class NodeConnectionAnchor extends ChopboxAnchor {
+ public NodeConnectionAnchor(IFigure figure) {
+ super(figure);
+ }
+ }
+
+ private NodeDirectEditManager manager;
+
+ private final static String LOCATION_X = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODE_VISUAL_LOCATION_X);
+ private final static String LOCATION_Y = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODE_VISUAL_LOCATION_Y);
+ private final static String CAPTION = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODE_VISUAL_CAPTION);
+ private final static String COLOR = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODE_VISUAL_COLOR);
+
+ /**
+ * register with the model for property changes
+ */
+ @Override
+ public void activate() {
+ if (isActive()) {
+ return;
+ }
+ super.activate();
+ getModel().addPropertyChangeListener(this);
+ getModel().getProperties().addPropertyChangeListener(this);
+ }
+
+ @Override
+ protected void createEditPolicies() {
+ // Delete
+ installEditPolicy(EditPolicy.COMPONENT_ROLE,
+ new NodeComponentEditPolicy());
+
+ // Connect, Reconnect, disconnect
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,
+ new NodeGraphicalNodeEditPolicy());
+
+ // DirectEditPolicy applies DirectEditRequests (see performRequest())
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE,
+ new NodeDirectEditPolicy());
+ }
+
+ @Override
+ protected IFigure createFigure() {
+ return new KSMNodeFigure();
+ }
+
+ /**
+ * deregister with the model
+ */
+ @Override
+ public void deactivate() {
+ if (!isActive()) {
+ return;
+ }
+ super.deactivate();
+ getModel().removePropertyChangeListener(this);
+ getModel().getProperties().removePropertyChangeListener(this);
+ }
+
+ @Override
+ public Object getAdapter(Class key) {
+ if (key.equals(IPropertySource.class)) {
+ // Property Description for this Model-Object
+ return new ModelPropertySource.NodePropertySource(getModel());
+ }
+ return super.getAdapter(key);
+ }
+
+ @Override
+ public KSMNodeFigure getFigure() {
+ return (KSMNodeFigure) super.getFigure();
+ }
+
+ @Override
+ public Node getModel() {
+ return (Node) super.getModel();
+ }
+
+ @Override
+ protected List getModelSourceConnections() {
+ return getModel().getConnections();
+ }
+
+ @Override
+ protected List getModelTargetConnections() {
+ List<Object> list = new ArrayList<Object>();
+ KSM model2 = (KSM) getRoot().getContents().getModel();
+
+ // FIXME design flaw
+ for (Node n : model2.getAllNodes()) {
+ for (Connection c : n.getConnections()) {
+ if (c.getTo() != null && c.getTo().equals(getModel().getId())) {
+ list.add(c);
+ }
+ }
+ }
+ return list;
+ }
+
+ @Override
+ public ConnectionAnchor getSourceConnectionAnchor(
+ ConnectionEditPart connection) {
+ return new NodeConnectionAnchor(getFigure());
+ }
+
+ @Override
+ public ConnectionAnchor getSourceConnectionAnchor(Request request) {
+ return new NodeConnectionAnchor(getFigure());
+ }
+
+ @Override
+ public ConnectionAnchor getTargetConnectionAnchor(
+ ConnectionEditPart connection) {
+ return new NodeConnectionAnchor(getFigure());
+ }
+
+ @Override
+ public ConnectionAnchor getTargetConnectionAnchor(Request request) {
+ return new NodeConnectionAnchor(getFigure());
+ }
+
+ @Override
+ public void performRequest(Request request) {
+ if (request.getType() == RequestConstants.REQ_DIRECT_EDIT) {
+ if (manager == null) {
+ manager = new NodeDirectEditManager(this);
+ }
+ manager.show();
+ }
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent changeEvent) {
+ boolean handled = false;
+ final String pName = changeEvent.getPropertyName();
+ if (changeEvent.getSource() == getModel()) {
+ if ("connections".equals(pName)) {
+ handled = true;
+ // Refresh source
+ refreshSourceConnections();
+
+ // refresh target, find target model
+ Connection connection;
+ if (changeEvent.getNewValue() != null)
+ connection = (Connection) changeEvent.getNewValue();
+ else
+ connection = (Connection) changeEvent.getOldValue();
+
+ KSM ksm = (KSM) getRoot().getContents().getModel();
+ Node lookupNode = ksm.lookupNode(connection.getTo());
+
+ // find target editpart
+ List<KSMNodeEditPart> editParts = new ArrayList<KSMNodeEditPart>();
+ for (Object key : getViewer().getEditPartRegistry().keySet()) {
+ if (key.equals(lookupNode)) {
+ KSMNodeEditPart editPart = (KSMNodeEditPart) getViewer()
+ .getEditPartRegistry().get(key);
+ editParts.add(editPart);
+ }
+ }
+ for (KSMNodeEditPart ksmNodeEditPart : editParts) {
+ ksmNodeEditPart.refreshTargetConnections();
+ }
+ }
+ }
+ if (changeEvent.getSource() == getModel().getProperties()) {
+ if (ModelProperties.INSTANCE.NODE_VISUAL_LOCATION_X.equals(pName)) {
+ handled = true;
+ refresh();
+ } else if (ModelProperties.INSTANCE.NODE_VISUAL_LOCATION_Y
+ .equals(pName)) {
+ handled = true;
+ refresh();
+ } else if (ModelProperties.INSTANCE.NODE_VISUAL_CAPTION
+ .equals(pName)) {
+ handled = true;
+ refreshVisuals();
+ } else if (ModelProperties.INSTANCE.NODE_VISUAL_COLOR.equals(pName)) {
+ handled = true;
+ refreshVisuals();
+ }
+ }
+
+ if (!handled) {
+ System.out.println("Unhandled Datemodell event: " + changeEvent);
+ }
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ Properties properties = getModel().getProperties();
+
+ BigInteger posX = properties.getInteger(LOCATION_X);
+ if (posX == null) {
+ posX = BigInteger.valueOf(10);
+ properties.setInteger(LOCATION_X, posX);
+ }
+ BigInteger posY = properties.getInteger(LOCATION_Y);
+ if (posY == null) {
+ posY = BigInteger.valueOf(10);
+ properties.setInteger(LOCATION_Y, posY);
+ }
+
+ GraphicalEditPart parent = (GraphicalEditPart) getParent();
+
+ Point loc = new Point(posX.intValue(), posY.intValue());
+ Dimension size = new Dimension(150, 40);
+ Rectangle rectangle = new Rectangle(loc, size);
+
+ String caption = properties.getString(CAPTION);
+ if (caption == null) {
+ caption = "ein Titel";
+ properties.setString(CAPTION, caption);
+ }
+ getFigure().setCaption(caption);
+
+ String color = properties.getString(COLOR);
+ if (color != null) {
+ getFigure().setNodeColor(
+ ModelProperties.INSTANCE.stringToRGB(color));
+ }
+
+ // Tell parent NodeGroup that this Node should be constraint by
+ // _rectangle_
+ getFigure().translateToParent(rectangle);
+ parent.setLayoutConstraint(this, getFigure(), rectangle);
+
+ getFigure().repaint();
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/KSMNodeGroupEditPart.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/KSMNodeGroupEditPart.java
new file mode 100644
index 0000000..e482cc8
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/KSMNodeGroupEditPart.java
@@ -0,0 +1,252 @@
+package de.dhbw.horb.ksm.core.editor.parts;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.ChopboxAnchor;
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.NodeEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+import de.dhbw.horb.ksm.core.editor.figures.KSMNodeGroupFigure;
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.editor.model.property.ModelPropertySource;
+import de.dhbw.horb.ksm.core.editor.parts.editmanager.NodeGroupDirectEditManager;
+import de.dhbw.horb.ksm.core.editor.policies.DiagramLayoutEditPolicy;
+import de.dhbw.horb.ksm.core.editor.policies.NodeGroupComponentEditPolicy;
+import de.dhbw.horb.ksm.core.editor.policies.NodeGroupDirectEditPolicy;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+import de.dhbw.horb.ksm.model.api.Properties;
+
+/**
+ * {@link KSMNodeGroupEditPart} is the Editor Part of {@link NodeGroup} class.
+ */
+@SuppressWarnings({ "rawtypes" })
+public class KSMNodeGroupEditPart extends AbstractGraphicalEditPart implements
+ PropertyChangeListener, NodeEditPart {
+
+ class NodeConnectionAnchor extends ChopboxAnchor {
+ public NodeConnectionAnchor(IFigure figure) {
+ super(figure);
+ }
+ }
+
+ private NodeGroupDirectEditManager manager;
+
+ private final static String LOCATION_X = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_LOCATION_X);
+ private final static String LOCATION_Y = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_LOCATION_Y);
+ private final static String HEIGHT = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_HEIGHT);
+ private final static String WIDTH = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_WIDTH);
+ private final static String CAPTION = ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_CAPTION);
+
+ /**
+ * register with the model for property changes.
+ */
+ @Override
+ public void activate() {
+ if (isActive()) {
+ return;
+ }
+ super.activate();
+ getModel().addPropertyChangeListener(this);
+ getModel().getProperties().addPropertyChangeListener(this);
+ }
+
+ @Override
+ public Object getAdapter(Class key) {
+ if (key.equals(IPropertySource.class)) {
+ // Property Description for this Model-Object
+ return new ModelPropertySource.NodeGroupPropertySource(getModel());
+ }
+ return super.getAdapter(key);
+ }
+
+ // Override from AbstractEditPart
+ @Override
+ protected void createEditPolicies() {
+ // Delete
+ installEditPolicy(EditPolicy.COMPONENT_ROLE,
+ new NodeGroupComponentEditPolicy());
+
+ // DirectEditPolicy applies DirectEditRequests (see performRequest())
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE,
+ new NodeGroupDirectEditPolicy(this));
+
+ // install a custom layout policy that handles dragging nodes around
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new DiagramLayoutEditPolicy());
+ }
+
+ // Override from AbstractGraphicalEditPart
+ @Override
+ protected IFigure createFigure() {
+ return new KSMNodeGroupFigure();
+ }
+
+ /**
+ * deregister with the model
+ */
+ @Override
+ public void deactivate() {
+ if (!isActive()) {
+ return;
+ }
+ super.deactivate();
+ getModel().removePropertyChangeListener(this);
+ getModel().getProperties().removePropertyChangeListener(this);
+ }
+
+ @Override
+ public KSMNodeGroupFigure getFigure() {
+ return (KSMNodeGroupFigure) super.getFigure();
+ }
+
+ @Override
+ public NodeGroup getModel() {
+ return (NodeGroup) super.getModel();
+ }
+
+ @Override
+ protected List getModelChildren() {
+ List<Object> childs = new ArrayList<Object>();
+ childs.addAll(getModel().getNodes());
+ childs.addAll(getModel().getNodeGroups());
+ return childs;
+ }
+
+ // override from NodeEditPart
+ @Override
+ public ConnectionAnchor getSourceConnectionAnchor(
+ ConnectionEditPart connection) {
+ return new NodeConnectionAnchor(getFigure());
+ }
+
+ @Override
+ public ConnectionAnchor getSourceConnectionAnchor(Request request) {
+ return new NodeConnectionAnchor(getFigure());
+ }
+
+ @Override
+ public ConnectionAnchor getTargetConnectionAnchor(
+ ConnectionEditPart connection) {
+ return new NodeConnectionAnchor(getFigure());
+ }
+
+ @Override
+ public ConnectionAnchor getTargetConnectionAnchor(Request request) {
+ return new NodeConnectionAnchor(getFigure());
+ }
+
+ @Override
+ public void performRequest(Request request) {
+ if (request.getType() == RequestConstants.REQ_DIRECT_EDIT) {
+ if (manager == null) {
+ manager = new NodeGroupDirectEditManager(this);
+ }
+ manager.show();
+ }
+ }
+
+ // XXX
+ @Override
+ public void propertyChange(PropertyChangeEvent changeEvent) {
+ String pName = changeEvent.getPropertyName();
+ boolean handled = false;
+
+ if (changeEvent.getSource() == getModel()) {
+ if ("nodes".equals(pName) || "nodegroups".equals(pName)) {
+ handled = true;
+ // Es wurden in diese NodeGroup Unterelemente eingefügt
+ refreshChildren();
+ }
+ } else if (changeEvent.getSource() == getModel().getProperties()) {
+ if (ModelProperties.INSTANCE.NODEGROUP_VISUAL_LOCATION_X
+ .equals(pName)) {
+ handled = true;
+ refresh();
+ } else if (ModelProperties.INSTANCE.NODEGROUP_VISUAL_LOCATION_Y
+ .equals(pName)) {
+ handled = true;
+ refresh();
+ } else if (ModelProperties.INSTANCE.NODEGROUP_VISUAL_WIDTH
+ .equals(pName)) {
+ handled = true;
+ refresh();
+ } else if (ModelProperties.INSTANCE.NODEGROUP_VISUAL_HEIGHT
+ .equals(pName)) {
+ handled = true;
+ refresh();
+ } else if (ModelProperties.INSTANCE.NODEGROUP_VISUAL_CAPTION
+ .equals(pName)) {
+ handled = true;
+ refreshVisuals();
+ }
+ }
+
+ if (!handled) {
+ System.out.println("Unhandled Datemodell event: " + changeEvent);
+ }
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ NodeGroup model2 = getModel();
+ Properties properties = model2.getProperties();
+ BigInteger posX = properties.getInteger(LOCATION_X);
+ if (posX == null) {
+ posX = BigInteger.valueOf(10);
+ properties.setInteger(LOCATION_X, posX);
+ }
+ BigInteger posY = properties.getInteger(LOCATION_Y);
+ if (posY == null) {
+ posY = BigInteger.valueOf(10);
+ properties.setInteger(LOCATION_Y, posY);
+ }
+
+ BigInteger width = properties.getInteger(WIDTH);
+ if (width == null) {
+ width = BigInteger.valueOf(100);
+ properties.setInteger(WIDTH, width);
+ }
+ BigInteger height = properties.getInteger(HEIGHT);
+ if (height == null) {
+ height = BigInteger.valueOf(100);
+ properties.setInteger(HEIGHT, height);
+ }
+
+ Point loc = new Point(posX.intValue(), posY.intValue());
+
+ Dimension size = new Dimension(width.intValue(), height.intValue());
+ Rectangle rectangle = new Rectangle(loc, size);
+
+ String caption = properties.getString(CAPTION);
+ if (caption == null) {
+ caption = "NodeGroup";
+ properties.setString(CAPTION, caption);
+ }
+ getFigure().setCaption(caption);
+
+ // tells the parent part (in this case DiagramPart) that this part
+ // and its figure are to be constrained to the given rectangle
+ // coordinates are relative
+ GraphicalEditPart parent = (GraphicalEditPart) getParent();
+ parent.setLayoutConstraint(this, getFigure(), rectangle);
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/PartFactory.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/PartFactory.java
new file mode 100644
index 0000000..e61335c
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/PartFactory.java
@@ -0,0 +1,35 @@
+package de.dhbw.horb.ksm.core.editor.parts;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartFactory;
+
+import de.dhbw.horb.ksm.model.api.Connection;
+import de.dhbw.horb.ksm.model.api.KSM;
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+
+/**
+ * this Factory make EditParts from the Data Model root Object
+ * {@link KSMDiagramModel}.
+ */
+public class PartFactory implements EditPartFactory {
+ @Override
+ public EditPart createEditPart(EditPart context, Object model) {
+ EditPart part;
+
+ if (model instanceof KSM) {
+ part = new KSMEditPart();
+ } else if (model instanceof NodeGroup) {
+ part = new KSMNodeGroupEditPart();
+ } else if (model instanceof Node) {
+ part = new KSMNodeEditPart();
+ } else if (model instanceof Connection) {
+ part = new KSMConnectionEditPart();
+ } else {
+ return null;
+ }
+
+ part.setModel(model);
+ return part;
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/editmanager/MyCellEditorLocator.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/editmanager/MyCellEditorLocator.java
new file mode 100644
index 0000000..49291d2
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/editmanager/MyCellEditorLocator.java
@@ -0,0 +1,28 @@
+package de.dhbw.horb.ksm.core.editor.parts.editmanager;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.tools.CellEditorLocator;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Text;
+
+
+public class MyCellEditorLocator implements CellEditorLocator {
+ private IFigure figure;
+
+ public MyCellEditorLocator(IFigure figure) {
+ this.figure = figure;
+ }
+
+ @Override
+ public void relocate(CellEditor celleditor) {
+ Text textEntry = (Text) celleditor.getControl();
+ Point pref = textEntry.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+
+ Rectangle rect = figure.getBounds().getCopy();
+ figure.translateToAbsolute(rect);
+ textEntry.setBounds(rect.x - 1, rect.y - 1, pref.x + 1, pref.y + 1);
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/editmanager/NodeDirectEditManager.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/editmanager/NodeDirectEditManager.java
new file mode 100644
index 0000000..bb8a127
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/editmanager/NodeDirectEditManager.java
@@ -0,0 +1,62 @@
+package de.dhbw.horb.ksm.core.editor.parts.editmanager;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.widgets.Text;
+
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeEditPart;
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.Properties;
+
+public class NodeDirectEditManager extends DirectEditManager {
+ private Font scaledFont;
+ private final Properties properties;
+
+ public NodeDirectEditManager(KSMNodeEditPart nodeGroupEditPart) {
+ super(nodeGroupEditPart, TextCellEditor.class, new MyCellEditorLocator(
+ nodeGroupEditPart.getFigure()));
+ Node model = nodeGroupEditPart.getModel();
+ properties = model.getProperties();
+ }
+
+ @Override
+ protected void bringDown() {
+ Font disposeFont = this.scaledFont;
+ this.scaledFont = null;
+ super.bringDown();
+ if (disposeFont != null) {
+ disposeFont.dispose();
+ }
+ }
+
+ @Override
+ protected void unhookListeners() {
+ super.unhookListeners();
+ }
+
+ @Override
+ protected void initCellEditor() {
+ Text text = (Text) getCellEditor().getControl();
+ String caption = properties.getString(ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODE_VISUAL_CAPTION));
+ if (caption == null) {
+ caption = "-";
+ }
+ getCellEditor().setValue(caption);
+ IFigure figure = ((GraphicalEditPart) getEditPart()).getFigure();
+ scaledFont = figure.getFont();
+ FontData data = scaledFont.getFontData()[0];
+ Dimension fontSize = new Dimension(0, data.getHeight());
+ data.setHeight(fontSize.height);
+ scaledFont = new Font(null, data);
+
+ text.setFont(scaledFont);
+ text.selectAll();
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/editmanager/NodeGroupDirectEditManager.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/editmanager/NodeGroupDirectEditManager.java
new file mode 100644
index 0000000..69d192e
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/editmanager/NodeGroupDirectEditManager.java
@@ -0,0 +1,62 @@
+package de.dhbw.horb.ksm.core.editor.parts.editmanager;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.widgets.Text;
+
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeGroupEditPart;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+import de.dhbw.horb.ksm.model.api.Properties;
+
+public class NodeGroupDirectEditManager extends DirectEditManager {
+ private Font scaledFont;
+ private final Properties properties;
+
+ public NodeGroupDirectEditManager(KSMNodeGroupEditPart nodeGroupEditPart) {
+ super(nodeGroupEditPart, TextCellEditor.class, new MyCellEditorLocator(
+ nodeGroupEditPart.getFigure()));
+ NodeGroup model = nodeGroupEditPart.getModel();
+ properties = model.getProperties();
+ }
+
+ @Override
+ protected void bringDown() {
+ Font disposeFont = this.scaledFont;
+ this.scaledFont = null;
+ super.bringDown();
+ if (disposeFont != null) {
+ disposeFont.dispose();
+ }
+ }
+
+ @Override
+ protected void unhookListeners() {
+ super.unhookListeners();
+ }
+
+ @Override
+ protected void initCellEditor() {
+ Text text = (Text) getCellEditor().getControl();
+ String caption = properties.getString(ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODEGROUP_VISUAL_CAPTION));
+ if (caption == null) {
+ caption = "-";
+ }
+ getCellEditor().setValue(caption);
+ IFigure figure = ((GraphicalEditPart) getEditPart()).getFigure();
+ scaledFont = figure.getFont();
+ FontData data = scaledFont.getFontData()[0];
+ Dimension fontSize = new Dimension(0, data.getHeight());
+ data.setHeight(fontSize.height);
+ scaledFont = new Font(null, data);
+
+ text.setFont(scaledFont);
+ text.selectAll();
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/outline/TreeKSMEditPart.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/outline/TreeKSMEditPart.java
new file mode 100644
index 0000000..b21a759
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/outline/TreeKSMEditPart.java
@@ -0,0 +1,53 @@
+package de.dhbw.horb.ksm.core.editor.parts.outline;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.gef.editparts.AbstractTreeEditPart;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+import de.dhbw.horb.ksm.core.editor.model.property.ModelPropertySource;
+import de.dhbw.horb.ksm.model.api.KSM;
+
+@SuppressWarnings({ "rawtypes" })
+public class TreeKSMEditPart extends AbstractTreeEditPart implements
+ PropertyChangeListener {
+
+ public TreeKSMEditPart(KSM model) {
+ super(model);
+ }
+
+ @Override
+ public Object getAdapter(Class key) {
+ if (key.equals(IPropertySource.class)) {
+ // Property Description for this Model-Object
+ return new ModelPropertySource.KSMPropertySource(getModel());
+ }
+ return super.getAdapter(key);
+ }
+
+ protected List getModelChildren() {
+ return Arrays.asList(getModel().getNodeGroup());
+ }
+
+ public void activate() {
+ super.activate();
+ getModel().getNodeGroup().addPropertyChangeListener(this);
+ }
+
+ public void deactivate() {
+ getModel().getNodeGroup().removePropertyChangeListener(this);
+ super.deactivate();
+ }
+
+ @Override
+ public KSM getModel() {
+ return (KSM) super.getModel();
+ }
+
+ public void propertyChange(PropertyChangeEvent change) {
+ refreshChildren();
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/outline/TreeNodeEditPart.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/outline/TreeNodeEditPart.java
new file mode 100644
index 0000000..56c9fdc
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/outline/TreeNodeEditPart.java
@@ -0,0 +1,81 @@
+package de.dhbw.horb.ksm.core.editor.parts.outline;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.editparts.AbstractTreeEditPart;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+import de.dhbw.horb.ksm.core.Activator;
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.editor.model.property.ModelPropertySource;
+import de.dhbw.horb.ksm.core.editor.policies.NodeComponentEditPolicy;
+import de.dhbw.horb.ksm.model.api.Node;
+
+/**
+ * represent a {@link Node} in a TreeViewer (e.g. OutlinePage)
+ */
+public class TreeNodeEditPart extends AbstractTreeEditPart implements
+ PropertyChangeListener {
+
+ public TreeNodeEditPart(Node model) {
+ super(model);
+ }
+
+ @Override
+ public Object getAdapter(@SuppressWarnings("rawtypes") Class key) {
+ if (key.equals(IPropertySource.class)) {
+ // Property Description for this Model-Object
+ return new ModelPropertySource.NodePropertySource(getModel());
+ }
+ return super.getAdapter(key);
+ }
+
+ @Override
+ public Node getModel() {
+ return (Node) super.getModel();
+ }
+
+ @Override
+ public void activate() {
+ super.activate();
+ getModel().addPropertyChangeListener(this);
+ getModel().getProperties().addPropertyChangeListener(this);
+ }
+
+ @Override
+ public void deactivate() {
+ getModel().getProperties().removePropertyChangeListener(this);
+ getModel().removePropertyChangeListener(this);
+ super.deactivate();
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent change) {
+ refreshVisuals();
+ }
+
+ @Override
+ protected void createEditPolicies() {
+ installEditPolicy(EditPolicy.COMPONENT_ROLE,
+ new NodeComponentEditPolicy());
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ final String caption = getModel()
+ .getProperties()
+ .getString(
+ ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODE_VISUAL_CAPTION));
+ if (caption != null) {
+ setWidgetText("Node: " + caption);
+ } else {
+ setWidgetText("Node: " + getModel().getId());
+ }
+
+ setWidgetImage(Activator.getImageDescriptor("icons/16/ksm-node.png")
+ .createImage());
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/outline/TreeNodeGroupEditPart.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/outline/TreeNodeGroupEditPart.java
new file mode 100644
index 0000000..2e5d184
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/outline/TreeNodeGroupEditPart.java
@@ -0,0 +1,80 @@
+package de.dhbw.horb.ksm.core.editor.parts.outline;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.editparts.AbstractTreeEditPart;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+import de.dhbw.horb.ksm.core.Activator;
+import de.dhbw.horb.ksm.core.editor.model.property.ModelPropertySource;
+import de.dhbw.horb.ksm.core.editor.policies.NodeGroupComponentEditPolicy;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+
+/**
+ * represent a {@link NodeGroup} in a TreeViewer (e.g. OutlinePage)
+ */
+public class TreeNodeGroupEditPart extends AbstractTreeEditPart implements
+ PropertyChangeListener {
+
+ public TreeNodeGroupEditPart(NodeGroup model) {
+ super(model);
+ }
+
+ @Override
+ public void activate() {
+ super.activate();
+ getModel().addPropertyChangeListener(this);
+ }
+
+ @Override
+ public Object getAdapter(@SuppressWarnings("rawtypes") Class key) {
+ if (key.equals(IPropertySource.class)) {
+ // Property Description for this Model-Object
+ return new ModelPropertySource.NodeGroupPropertySource(getModel());
+ }
+ return super.getAdapter(key);
+ }
+
+ @Override
+ protected void createEditPolicies() {
+ installEditPolicy(EditPolicy.COMPONENT_ROLE,
+ new NodeGroupComponentEditPolicy());
+ }
+
+ @Override
+ public void deactivate() {
+ getModel().removePropertyChangeListener(this);
+ super.deactivate();
+ }
+
+ @Override
+ public NodeGroup getModel() {
+ return (NodeGroup) super.getModel();
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ protected List getModelChildren() {
+ List<Object> childs = new ArrayList<Object>();
+ childs.addAll(getModel().getNodeGroups());
+ childs.addAll(getModel().getNodes());
+ return childs;
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ refreshChildren();
+ refreshVisuals();
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ setWidgetText("NodeGroup: " + getModel().getId());
+ setWidgetImage(Activator.getImageDescriptor(
+ "icons/16/ksm-nodegroup.png").createImage());
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/outline/TreePartFactory.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/outline/TreePartFactory.java
new file mode 100644
index 0000000..a746399
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/outline/TreePartFactory.java
@@ -0,0 +1,31 @@
+package de.dhbw.horb.ksm.core.editor.parts.outline;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartFactory;
+
+import de.dhbw.horb.ksm.model.api.Connection;
+import de.dhbw.horb.ksm.model.api.KSM;
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+
+// TreePart used in Outline Page
+public class TreePartFactory implements EditPartFactory {
+
+ public EditPart createEditPart(EditPart context, Object model) {
+ EditPart part;
+ if (model instanceof KSM) {
+ part = new TreeKSMEditPart((KSM) model);
+ } else if (model instanceof NodeGroup) {
+ part = new TreeNodeGroupEditPart((NodeGroup) model);
+ } else if (model instanceof Node) {
+ part = new TreeNodeEditPart((Node) model);
+ } else if (model instanceof Connection) {
+ System.out.println("TreePartFactory.createEditPart()");
+ return null;
+ } else {
+ System.out.println("TreePartFactory.createEditPart() "+ model );
+ return null;
+ }
+ return part;
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/routing/ModifiedAutomaticRouter.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/routing/ModifiedAutomaticRouter.java
new file mode 100644
index 0000000..8015042
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/routing/ModifiedAutomaticRouter.java
@@ -0,0 +1,226 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package de.dhbw.horb.ksm.core.editor.parts.routing;
+
+import java.util.ArrayList;
+
+import org.eclipse.draw2d.AbstractRouter;
+import org.eclipse.draw2d.AutomaticRouter;
+import org.eclipse.draw2d.Connection;
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.ConnectionRouter;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.internal.MultiValueMap;
+
+/**
+ * modified version of {@link AutomaticRouter}
+ */
+
+@SuppressWarnings({"restriction","rawtypes", "unchecked"})
+public abstract class ModifiedAutomaticRouter extends AbstractRouter {
+
+ private ConnectionRouter nextRouter;
+ private MultiValueMap connections = new MultiValueMap();
+
+ private class HashKey {
+
+ private ConnectionAnchor anchor1, anchor2;
+
+ HashKey(Connection conn) {
+ anchor1 = conn.getSourceAnchor();
+ anchor2 = conn.getTargetAnchor();
+ }
+
+ public boolean equals(Object object) {
+ boolean isEqual = false;
+ HashKey hashKey;
+
+ if (object instanceof HashKey) {
+ hashKey = (HashKey) object;
+ ConnectionAnchor hkA1 = hashKey.getFirstAnchor();
+ ConnectionAnchor hkA2 = hashKey.getSecondAnchor();
+
+ isEqual = (hkA1.equals(anchor1) && hkA2.equals(anchor2))
+ || (hkA1.equals(anchor2) && hkA2.equals(anchor1));
+ }
+ return isEqual;
+ }
+
+ public ConnectionAnchor getFirstAnchor() {
+ return anchor1;
+ }
+
+ public ConnectionAnchor getSecondAnchor() {
+ return anchor2;
+ }
+
+ public int hashCode() {
+ return anchor1.hashCode() ^ anchor2.hashCode();
+ }
+ }
+
+ /**
+ * @see org.eclipse.draw2d.ConnectionRouter#getConstraint(Connection)
+ */
+ public Object getConstraint(Connection connection) {
+ if (next() != null)
+ return next().getConstraint(connection);
+ return null;
+ }
+
+ /**
+ * Handles collisions between 2 or more Connections. Collisions are
+ * currently defined as 2 connections with no bendpoints and whose start and
+ * end points coincide. In other words, the 2 connections are the exact same
+ * line.
+ * @param conn the connection
+ *
+ * @param list
+ * The PointList of a connection that collides with another
+ * connection
+ * @param index
+ * The index of the current connection in the list of colliding
+ * connections
+ */
+ protected abstract void handleCollision(Connection conn, PointList list, int index);
+
+ /**
+ * @see org.eclipse.draw2d.ConnectionRouter#invalidate(Connection)
+ */
+ public void invalidate(Connection conn) {
+ if (next() != null)
+ next().invalidate(conn);
+ if (conn.getSourceAnchor() == null || conn.getTargetAnchor() == null)
+ return;
+ HashKey connectionKey = new HashKey(conn);
+ ArrayList connectionList = connections.get(connectionKey);
+ int affected = connections.remove(connectionKey, conn);
+ if (affected != -1) {
+ for (int i = affected; i < connectionList.size(); i++)
+ ((Connection) connectionList.get(i)).revalidate();
+ } else
+ connections.removeValue(conn);
+
+ }
+
+ /**
+ * Returns the next router in the chain.
+ *
+ * @return The next router
+ * @since 2.0
+ */
+ protected ConnectionRouter next() {
+ return nextRouter;
+ }
+
+ /**
+ * @see org.eclipse.draw2d.ConnectionRouter#remove(Connection)
+ */
+ public void remove(Connection conn) {
+ if (conn.getSourceAnchor() == null || conn.getTargetAnchor() == null)
+ return;
+ HashKey connectionKey = new HashKey(conn);
+ ArrayList connectionList = connections.get(connectionKey);
+ if (connectionList != null) {
+ int index = connections.remove(connectionKey, conn);
+ for (int i = index + 1; i < connectionList.size(); i++)
+ ((Connection) connectionList.get(i)).revalidate();
+ }
+ if (next() != null)
+ next().remove(conn);
+ }
+
+ /**
+ * Routes the given connection. Calls the 'next' router first (if one
+ * exists) and if no bendpoints were added by the next router, collisions
+ * are dealt with by calling {@link #handleCollision(PointList, int)}.
+ *
+ * @param conn
+ * The connection to route
+ */
+ public void route(Connection conn) {
+ if (next() != null)
+ next().route(conn);
+ else {
+ conn.getPoints().removeAllPoints();
+ setEndPoints(conn);
+ }
+
+ if (conn.getPoints().size() == 2) {
+ PointList points = conn.getPoints();
+ HashKey connectionKey = new HashKey(conn);
+ ArrayList<Object> connectionList = connections.get(connectionKey);
+
+ if (connectionList != null) {
+
+ int index;
+
+ if (connectionList.contains(conn)) {
+ index = connectionList.indexOf(conn) + 1;
+ } else {
+ index = connectionList.size() + 1;
+ connections.put(connectionKey, conn);
+ }
+
+ handleCollision(conn, points, index);
+ conn.setPoints(points);
+ } else {
+ connections.put(connectionKey, conn);
+ handleCollision(conn, points, 0);
+ }
+ }
+ }
+
+ /**
+ * An AutomaticRouter needs no constraints for the connections it routes.
+ * This method invalidates the connections and calls
+ * {@link #setConstraint(Connection, Object)} on the {@link #next()} router.
+ *
+ * @see org.eclipse.draw2d.ConnectionRouter#setConstraint(Connection,
+ * Object)
+ */
+ public void setConstraint(Connection connection, Object constraint) {
+ invalidate(connection);
+ if (next() != null)
+ next().setConstraint(connection, constraint);
+ }
+
+ /**
+ * Sets the start and end points for the given connection.
+ *
+ * @param conn
+ * The connection
+ */
+ protected void setEndPoints(Connection conn) {
+ PointList points = conn.getPoints();
+ points.removeAllPoints();
+ Point start = getStartPoint(conn);
+ Point end = getEndPoint(conn);
+ conn.translateToRelative(start);
+ conn.translateToRelative(end);
+ points.addPoint(start);
+ points.addPoint(end);
+ conn.setPoints(points);
+ }
+
+ /**
+ * Sets the next router.
+ *
+ * @param router
+ * The ConnectionRouter
+ * @since 2.0
+ */
+ public void setNextRouter(ConnectionRouter router) {
+ nextRouter = router;
+ }
+
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/routing/RoundedPolyline.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/routing/RoundedPolyline.java
new file mode 100644
index 0000000..8d80d97
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/routing/RoundedPolyline.java
@@ -0,0 +1,374 @@
+package de.dhbw.horb.ksm.core.editor.parts.routing;
+
+/*
+ * Copyright (c) 2004-2005 Massachusetts Institute of Technology. This code was
+ * developed as part of the Haystack (http://haystack.lcs.mit.edu/) research
+ * project at MIT. Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including without
+ * limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/*
+ * Created on Oct 27, 2004
+ */
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.PrecisionPoint;
+
+/**
+ * Renders a line that can be curved if necessary<br>
+ * The curve is computed thanks to a <i>Bezier</i> algorithm.
+ *
+ * @author Clément Démoulins
+ * @author Jean-Baptiste Voron
+ */
+public class RoundedPolyline extends Polyline {
+
+ /** Is the arc curved ? */
+ private boolean rounded = false;
+
+ /** Width of the rounded corner */
+ private int cornerLen = 32;
+
+ /**
+ * Sets the length of the corner on each edge.
+ *
+ * @param len
+ * the dimensions of the corner
+ */
+ public final void setCornerLength(int len) {
+ cornerLen = len;
+ }
+
+ /**
+ * Set a flag to indicate whether the arc must be curved or not
+ *
+ * @param flag
+ * <code>true</code> for a curved arc
+ */
+ public final void setCurved(boolean flag) {
+ this.rounded = flag;
+ }
+
+ /**
+ * Scale the distance between the two points such that the distance is equal
+ * to the cornerLen
+ *
+ * @param pt1
+ * point 1
+ * @param pt2
+ * point 2
+ * @param isExtremity
+ * <code>true</code> if p1 or p2 is an extremity of the arc.
+ * @return taille
+ */
+ private Dimension getCornerDimension(Point pt1, Point pt2,
+ boolean isExtremity) {
+ double scale = ((double) cornerLen) / pt1.getDistance(pt2);
+ if (!isExtremity) {
+ scale = Math.min(0.5, scale);
+ } else {
+ scale = Math.min(1, scale);
+ }
+ return pt1.getDifference(pt2).scale(scale);
+ }
+
+ /**
+ * @see Shape#outlineShape(Graphics) {@inheritDoc}
+ */
+ @Override
+ protected final void outlineShape(Graphics g) {
+
+ // If the arc must not be curved... Just render a polyline
+ if (!rounded) {
+ super.outlineShape(g);
+ return;
+ }
+
+ // If not... Render a RoundedPolyline
+ PointList pointList = getPoints();
+
+ if (pointList.size() == 2) {
+ g.drawLine(pointList.getFirstPoint(), pointList.getLastPoint());
+ } else if (pointList.size() >= 2) {
+ /*
+ * For each loop, a curve is draw between 3 points : p0, p1, p2 For
+ * reduce the curve effect, we calcul two internediate point :
+ * startCurve and endCurve (see method getCornerDimension). Finally
+ * we draw the segment [p0, startCurve], the curve (startCurve, p1,
+ * endCurve) and the segment [endCurve, p2]
+ */
+ Point startCurve, endCurve = null, prevEndCurve;
+ for (int i = 2; i < pointList.size(); i++) {
+ Point p0 = pointList.getPoint(i - 2);
+ Point p1 = pointList.getPoint(i - 1);
+ Point p2 = pointList.getPoint(i);
+
+ prevEndCurve = endCurve;
+
+ Dimension curveSize1 = getCornerDimension(p0, p1, (i == 2));
+ startCurve = p1.getTranslated(curveSize1);
+
+ Dimension curveSize2 = getCornerDimension(p2, p1,
+ (i + 1 == pointList.size()));
+ endCurve = p1.getTranslated(curveSize2);
+
+ // Draw the curve, we choose the method according to the curve
+ // size.
+ if ((i == 2 && p0.getDifference(p1).equals(curveSize1))
+ || (i + 1 == pointList.size() && p2.getDifference(p1)
+ .equals(curveSize2))
+ || p0.getDifference(p1).scale(0.5).equals(curveSize1)
+ || p2.getDifference(p1).scale(0.5).equals(curveSize2)) {
+ // g.pushState();
+ // g.setForegroundColor(ColorConstants.blue);
+ drawBezier(g, startCurve, p1, endCurve, 6.0 / cornerLen);
+ // g.popState();
+ } else {
+ drawBezier(g, startCurve, p1, endCurve, p1, 6.0 / cornerLen);
+ }
+ // drawCurve(g, startCurve, p1, endCurve, 1);
+
+ // if first point
+ if (i == 2) {
+ g.drawLine(p0, startCurve);
+ }
+ // if last point
+ if (i + 1 == pointList.size()) {
+ g.drawLine(endCurve, p2);
+ }
+ // other point
+ if (i > 2 && i < pointList.size() && prevEndCurve != null) {
+ g.drawLine(prevEndCurve, startCurve);
+ }
+ }
+ }
+ }
+
+ /**
+ * Classe qui va calculer les coordonnées de chaque point de la courbe
+ */
+ static class BezierDimension {
+ private double a, b, c, d;
+
+ /**
+ * based on: http://www.moshplant.com/direct-or/bezier/math.html<br>
+ * <br>
+ * based on the spec:<br>
+ * value(t) = a.t.t.t + b.t.t + c.t + d<br>
+ * p0 = d<br>
+ * p1 = p0+c/3<br>
+ * p2 = p1+(c+b)/3<br>
+ * p3 = p0+c+b+a
+ *
+ * @param p0
+ * start point
+ * @param p1
+ * start control point
+ * @param p2
+ * end control point
+ * @param p3
+ * end point
+ */
+ public BezierDimension(double p0, double p1, double p2, double p3) {
+ d = p0;
+ c = 3 * (p1 - p0);
+ b = 3 * (p2 - p1) - c;
+ a = p3 - p0 - c - b;
+ }
+
+ /**
+ * @param t
+ * pas compris dans l'interval [0,1]
+ * @return la coordonnée calculée
+ */
+ public int getValue(double t) {
+ return (int) Math
+ .round((a * t * t * t) + (b * t * t) + (c * t) + d);
+ }
+ };
+
+ /**
+ * Dessine une spline en utilisant l'algo dispo sur ce site :
+ * http://www.moshplant.com/direct-or/bezier/math.html
+ *
+ * @param g
+ * Graphics qui permet de dessiner
+ * @param startPt
+ * point de départ
+ * @param startCtrlPt
+ * premier point de control
+ * @param endPt
+ * point d'arrivé
+ * @param endCtrlPt
+ * deuxième point de control
+ * @param step
+ * pas
+ */
+ private static void drawBezier(Graphics g, Point startPt,
+ Point startCtrlPt, Point endPt, Point endCtrlPt, double step) {
+ BezierDimension x = new BezierDimension(startPt.x, startCtrlPt.x,
+ endCtrlPt.x, endPt.x);
+ BezierDimension y = new BezierDimension(startPt.y, startCtrlPt.y,
+ endCtrlPt.y, endPt.y);
+ double t = 0;
+ Point midPt = startPt;
+ while (t < 1) {
+ Point nextPt = new Point();
+ nextPt.setLocation(x.getValue(t), y.getValue(t));
+ // g.drawPoint(midPt.x, midPt.y);
+ g.drawLine(midPt, nextPt);
+ t += step;
+ midPt = nextPt;
+ }
+ g.drawLine(midPt, endPt);
+ }
+
+ /**
+ * Dessine une courbe de bézier
+ *
+ * @param g
+ * Graphics qui permet de dessiner
+ * @param p0
+ * point de départ
+ * @param p1
+ * point de control
+ * @param p2
+ * point d'arrivé
+ * @param step
+ * pas
+ */
+ private static void drawBezier(Graphics g, Point p0, Point p1, Point p2,
+ double step) {
+ // PointList tmp = new PointList();
+ // tmp.addPoint(p0);
+ // tmp.addPoint(p1);
+ // tmp.addPoint(p2);
+ // g.drawPolygon(tmp);
+ double t = step;
+ Point prev = p0;
+ g.pushState();
+ // g.setForegroundColor(ColorConstants.blue);
+ while (t < 1) {
+ double td = t;
+ double tdd = 1 - td;
+ PrecisionPoint p = new PrecisionPoint();
+ p.preciseX = (tdd * tdd * p0.x) + (2 * td * tdd * p1.x)
+ + (td * td * p2.x);
+ p.preciseY = (tdd * tdd * p0.y) + (2 * td * tdd * p1.y)
+ + (td * td * p2.y);
+ p.updateInts();
+ // g.drawPoint(prev.x, prev.y);
+ g.drawLine(prev, p);
+ t += step;
+ prev = p;
+ }
+ g.drawLine(prev, p2);
+ g.popState();
+ }
+
+ /**
+ * @param pl
+ * point list
+ * @param level
+ * recursion level
+ * @return curve point list
+ */
+ private static PointList calculCurve(PointList pl, int level) {
+ if (level > 0 && pl.size() > 2) {
+ PointList npl = new PointList();
+ Point p0, p1, p2;
+ Point mx4, p;
+
+ npl.addPoint(pl.getFirstPoint());
+
+ int i = 2;
+ while (i < pl.size()) {
+ p0 = pl.getPoint(i - 2);
+ p1 = pl.getPoint(i - 1);
+ p2 = pl.getPoint(i);
+ mx4 = new Point();
+ mx4.x = p0.x + 2 * p1.x + p2.x;
+ mx4.y = p0.y + 2 * p1.y + p2.y;
+
+ p = new Point();
+ p.x = (mx4.x / 2 + 3 * p0.x + 3 * p1.x) / 8;
+ p.y = (mx4.y / 2 + 3 * p0.y + 3 * p1.y) / 8;
+ npl.addPoint(p);
+
+ p = new Point();
+ p.x = (((int) (3 * mx4.x) / 4) + p1.x) / 4;
+ p.y = (((int) (3 * mx4.y) / 4) + p1.y) / 4;
+ npl.addPoint(p);
+
+ p = new Point();
+ p.x = (mx4.x / 2 + 3 * p2.x + 3 * p1.x) / 8;
+ p.y = (mx4.y / 2 + 3 * p2.y + 3 * p1.y) / 8;
+ npl.addPoint(p);
+
+ i++;
+ }
+ npl.addPoint(pl.getLastPoint());
+
+ return calculCurve(npl, level - 1);
+ }
+
+ return pl;
+ }
+
+ /**
+ * Another method for draw a curve.
+ *
+ * @param g
+ * Graphics for drawing
+ * @param p0
+ * start point
+ * @param p1
+ * control point
+ * @param p2
+ * end point
+ * @param level
+ * recursion level
+ */
+ @SuppressWarnings("unused")
+ private static void drawCurve(Graphics g, Point p0, Point p1, Point p2,
+ int level) {
+ PointList initList = new PointList();
+ initList.addPoint(p0);
+ initList.addPoint(p1);
+ initList.addPoint(p2);
+ PointList pl = calculCurve(initList, level);
+
+ // System.err.println(pl.size());
+ g.drawPolyline(pl);
+ // for (int i = 0; i < pl.size(); i++) {
+ // Point p = pl.getPoint(i);
+ // g.drawPoint(p.x, p.y);
+ // System.err.println(p);
+ // }
+
+ // PointList tmp = new PointList();
+ // tmp.addPoint(p0);
+ // tmp.addPoint(p1);
+ // tmp.addPoint(p2);
+ // g.drawPolygon(tmp);
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/routing/RoundedPolylineConnection.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/routing/RoundedPolylineConnection.java
new file mode 100644
index 0000000..40ec14e
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/parts/routing/RoundedPolylineConnection.java
@@ -0,0 +1,338 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package de.dhbw.horb.ksm.core.editor.parts.routing;
+
+import org.eclipse.draw2d.AnchorListener;
+import org.eclipse.draw2d.ArrowLocator;
+import org.eclipse.draw2d.Connection;
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.ConnectionLocator;
+import org.eclipse.draw2d.ConnectionRouter;
+import org.eclipse.draw2d.DelegatingLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.RotatableDecoration;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+/**
+ * An implementation of {@link Connection} based on Polyline. PolylineConnection
+ * adds the following additional features:
+ * <UL>
+ * <LI>
+ * A {@link ConnectionRouter} may be provided which will be used to determine
+ * the connections points.
+ * <LI>
+ * Children may be added. The bounds calculation is extended such that the
+ * bounds is the smallest Rectangle which is large enough to display the
+ * Polyline and all of its children figures.
+ * <LI>
+ * A {@link DelegatingLayout} is set as the default layout. A delegating layout
+ * allows children to position themselves via {@link Locator Locators}.
+ * </UL>
+ * <P>
+ */
+public class RoundedPolylineConnection extends RoundedPolyline implements
+ Connection, AnchorListener {
+
+ private ConnectionAnchor startAnchor, endAnchor;
+ private ConnectionRouter connectionRouter = ConnectionRouter.NULL;
+ private RotatableDecoration startArrow, endArrow;
+
+ {
+ setLayoutManager(new DelegatingLayout());
+ addPoint(new Point(0, 0));
+ addPoint(new Point(100, 100));
+ }
+
+ /**
+ * Hooks the source and target anchors.
+ *
+ * @see Figure#addNotify()
+ */
+ @Override
+ public final void addNotify() {
+ super.addNotify();
+ hookSourceAnchor();
+ hookTargetAnchor();
+ }
+
+ /**
+ * Called by the anchors of this connection when they have moved,
+ * revalidating this polyline connection.
+ *
+ * @param anchor
+ * the anchor that moved
+ */
+ public final void anchorMoved(ConnectionAnchor anchor) {
+ revalidate();
+ }
+
+ /**
+ * Returns the bounds which holds all the points in this polyline
+ * connection. Returns any previously existing bounds, else calculates by
+ * unioning all the children's dimensions.
+ *
+ * @return the bounds
+ */
+ @Override
+ public final Rectangle getBounds() {
+ if (bounds == null) {
+ super.getBounds();
+ for (int i = 0; i < getChildren().size(); i++) {
+ IFigure child = (IFigure) getChildren().get(i);
+ bounds.union(child.getBounds());
+ }
+ }
+ return bounds;
+ }
+
+ /**
+ * Returns the <code>ConnectionRouter</code> used to layout this connection.
+ * Will not return <code>null</code>.
+ *
+ * @return this connection's router
+ */
+ public final ConnectionRouter getConnectionRouter() {
+ return connectionRouter;
+ }
+
+ /**
+ * Returns this connection's routing constraint from its connection router.
+ * May return <code>null</code>.
+ *
+ * @return the connection's routing constraint
+ */
+ public final Object getRoutingConstraint() {
+ if (getConnectionRouter() != null) {
+ return getConnectionRouter().getConstraint(this);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * @return the anchor at the start of this polyline connection (may be null)
+ */
+ public final ConnectionAnchor getSourceAnchor() {
+ return startAnchor;
+ }
+
+ /**
+ * @return the source decoration (may be null)
+ */
+ protected final RotatableDecoration getSourceDecoration() {
+ return startArrow;
+ }
+
+ /**
+ * @return the anchor at the end of this polyline connection (may be null)
+ */
+ public final ConnectionAnchor getTargetAnchor() {
+ return endAnchor;
+ }
+
+ /**
+ * @return the target decoration (may be null)
+ *
+ * @since 2.0
+ */
+ protected final RotatableDecoration getTargetDecoration() {
+ return endArrow;
+ }
+
+ /**
+ *
+ */
+ private void hookSourceAnchor() {
+ if (getSourceAnchor() != null) {
+ getSourceAnchor().addAnchorListener(this);
+ }
+ }
+
+ /**
+ *
+ */
+ private void hookTargetAnchor() {
+ if (getTargetAnchor() != null) {
+ getTargetAnchor().addAnchorListener(this);
+ }
+ }
+
+ /**
+ * Layouts this polyline. If the start and end anchors are present, the
+ * connection router is used to route this, after which it is laid out. It
+ * also fires a moved method.
+ */
+ @Override
+ @SuppressWarnings("deprecation")
+ public final void layout() {
+ if (getSourceAnchor() != null && getTargetAnchor() != null) {
+ getConnectionRouter().route(this);
+ }
+
+ Rectangle oldBounds = bounds;
+ super.layout();
+ bounds = null;
+
+ if (!getBounds().contains(oldBounds)) {
+ getParent().translateToParent(oldBounds);
+ getUpdateManager().addDirtyRegion(getParent(), oldBounds);
+ }
+
+ repaint();
+ fireMoved();
+ }
+
+ /**
+ * Called just before the receiver is being removed from its parent. Results
+ * in removing itself from the connection router.
+ *
+ * @since 2.0
+ */
+ @Override
+ public final void removeNotify() {
+ unhookSourceAnchor();
+ unhookTargetAnchor();
+ getConnectionRouter().remove(this);
+ super.removeNotify();
+ }
+
+ /**
+ * @see edu.mit.csail.relo.eclipse.gef.IFigure#revalidate()
+ */
+ @Override
+ public final void revalidate() {
+ super.revalidate();
+ getConnectionRouter().invalidate(this);
+ }
+
+ /**
+ * Sets the connection router which handles the layout of this polyline.
+ * Generally set by the parent handling the polyline connection.
+ *
+ * @param cr
+ * the connection router
+ */
+ public final void setConnectionRouter(ConnectionRouter cr) {
+ ConnectionRouter router = cr;
+ if (router == null) {
+ router = ConnectionRouter.NULL;
+ }
+ if (connectionRouter != router) {
+ connectionRouter.remove(this);
+ Object old = connectionRouter;
+ connectionRouter = router;
+ firePropertyChange(Connection.PROPERTY_CONNECTION_ROUTER, old,
+ router);
+ revalidate();
+ }
+ }
+
+ /**
+ * Sets the routing constraint for this connection.
+ *
+ * @param cons
+ * the constraint
+ */
+ public final void setRoutingConstraint(Object cons) {
+ if (getConnectionRouter() != null) {
+ getConnectionRouter().setConstraint(this, cons);
+ }
+ revalidate();
+ }
+
+ /**
+ * Sets the anchor to be used at the start of this polyline connection.
+ *
+ * @param anchor
+ * the new source anchor
+ */
+ public final void setSourceAnchor(ConnectionAnchor anchor) {
+ unhookSourceAnchor();
+ // No longer needed, revalidate does this.
+ // getConnectionRouter().invalidate(this);
+ startAnchor = anchor;
+ if (getParent() != null) {
+ hookSourceAnchor();
+ }
+ revalidate();
+ }
+
+ /**
+ * Sets the decoration to be used at the start of the {@link Connection}.
+ *
+ * @param dec
+ * the new source decoration
+ * @since 2.0
+ */
+ public final void setSourceDecoration(RotatableDecoration dec) {
+ if (getSourceDecoration() != null) {
+ remove(getSourceDecoration());
+ }
+ startArrow = dec;
+ if (dec != null) {
+ add(dec, new ArrowLocator(this, ConnectionLocator.SOURCE));
+ }
+ }
+
+ /**
+ * Sets the anchor to be used at the end of the polyline connection. Removes
+ * this listener from the old anchor and adds it to the new anchor.
+ *
+ * @param anchor
+ * the new target anchor
+ */
+ public final void setTargetAnchor(ConnectionAnchor anchor) {
+ unhookTargetAnchor();
+ // No longer needed, revalidate does this.
+ // getConnectionRouter().invalidate(this);
+ endAnchor = anchor;
+ if (getParent() != null) {
+ hookTargetAnchor();
+ }
+ revalidate();
+ }
+
+ /**
+ * Sets the decoration to be used at the end of the {@link Connection}.
+ *
+ * @param dec
+ * the new target decoration
+ */
+ public final void setTargetDecoration(RotatableDecoration dec) {
+ if (getTargetDecoration() != null) {
+ remove(getTargetDecoration());
+ }
+ endArrow = dec;
+ if (dec != null) {
+ add(dec, new ArrowLocator(this, ConnectionLocator.TARGET));
+ }
+ }
+
+ /**
+ *
+ */
+ private void unhookSourceAnchor() {
+ if (getSourceAnchor() != null) {
+ getSourceAnchor().removeAnchorListener(this);
+ }
+ }
+
+ /**
+ *
+ */
+ private void unhookTargetAnchor() {
+ if (getTargetAnchor() != null) {
+ getTargetAnchor().removeAnchorListener(this);
+ }
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/DiagramLayoutEditPolicy.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/DiagramLayoutEditPolicy.java
new file mode 100644
index 0000000..a2c1620
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/DiagramLayoutEditPolicy.java
@@ -0,0 +1,121 @@
+package de.dhbw.horb.ksm.core.editor.policies;
+
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.editpolicies.ResizableEditPolicy;
+import org.eclipse.gef.editpolicies.XYLayoutEditPolicy;
+import org.eclipse.gef.requests.CreateRequest;
+
+import de.dhbw.horb.ksm.core.editor.commands.NodeCreateCommand;
+import de.dhbw.horb.ksm.core.editor.commands.NodeGroupCreateCommand;
+import de.dhbw.horb.ksm.core.editor.commands.NodeGroupSetBoundsCommand;
+import de.dhbw.horb.ksm.core.editor.commands.NodeMoveCommand;
+import de.dhbw.horb.ksm.core.editor.model.NodeGroupRequest;
+import de.dhbw.horb.ksm.core.editor.model.NodeRequest;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeEditPart;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeGroupEditPart;
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+
+/**
+ * The Layout Policy constrains figures inside the applied figure by a location
+ * and size.
+ */
+public class DiagramLayoutEditPolicy extends XYLayoutEditPolicy {
+
+ /**
+ * This method returns if the given Child is resizable or not
+ */
+ @Override
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ if (child instanceof KSMNodeEditPart) {
+ // Nodes are not resizeable
+ return new NonResizableEditPolicy();
+ } else if (child instanceof KSMNodeGroupEditPart) {
+ // But NodeGroups are
+ return new ResizableEditPolicy();
+ } else {
+ return new NonResizableEditPolicy();
+ }
+ }
+
+ @Override
+ protected Command createAddCommand(EditPart child, Object constraint) {
+ return null; // no support for adding
+ }
+
+ @Override
+ protected Command createChangeConstraintCommand(EditPart child,
+ Object constraint) {
+ if (child.getModel() instanceof Node) {
+ NodeMoveCommand locationCommand = new NodeMoveCommand(
+ (KSMNodeEditPart) child);
+ locationCommand.setAbsoluteTargetLocation(((Rectangle) constraint)
+ .getLocation());
+ return locationCommand;
+ } else if (child.getModel() instanceof NodeGroup) {
+ Rectangle rectange = (Rectangle) constraint;
+ NodeGroupSetBoundsCommand command = new NodeGroupSetBoundsCommand(
+ (KSMNodeGroupEditPart) child);
+ command.setRelativeTargetBounds(rectange);
+ return command;
+ } else {
+ System.out.println("createChangeConstraintCommand for unknown child: " + child);
+ }
+ return null;
+ }
+
+ @Override
+ protected Command getCreateCommand(CreateRequest createRequest) {
+ if (createRequest.getNewObjectType() == NodeRequest.class) {
+ NodeRequest nodeRequest = (NodeRequest) createRequest
+ .getNewObject();
+ if (nodeRequest != null) {
+ NodeCreateCommand command = new NodeCreateCommand();
+ command.setNodeRequest(nodeRequest);
+ command.setAbsoluteLocation(createRequest.getLocation());
+ return command;
+ }
+ } else if (createRequest.getNewObjectType() == NodeGroupRequest.class) {
+ NodeGroupRequest nodeGroupRequest = (NodeGroupRequest) createRequest
+ .getNewObject();
+ if (nodeGroupRequest != null) {
+ NodeGroupCreateCommand command = new NodeGroupCreateCommand();
+ command.setNodeGroupRequest(nodeGroupRequest);
+ command.setAbsoluteLocation(createRequest.getLocation());
+ return command;
+ }
+ }
+
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ // @Override
+ // protected Command createChangeConstraintCommand(
+ // ChangeBoundsRequest request, EditPart child, Object constraint) {
+ // if (child.getModel() instanceof NodeGroup) {
+ // Rectangle rectange = (Rectangle) constraint;
+ // NodeGroup nodeGroup = (NodeGroup) child.getModel();
+ // NodeGroupResizeCommand command = new NodeGroupResizeCommand();
+ // command.setNodeGroup(nodeGroup);
+ // command.setRectange(rectange);
+ //
+ // return command;
+ // } else {
+ // return super.createChangeConstraintCommand(request, child,
+ // constraint);
+ // }
+ // }
+
+ protected Command getDeleteDependantCommand(Request request) {
+ System.out
+ .println("DiagramLayoutEditPolicy.getDeleteDependantCommand()");
+ return null; // no support for deleting a dependant
+ }
+
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeComponentEditPolicy.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeComponentEditPolicy.java
new file mode 100644
index 0000000..acf74bd
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeComponentEditPolicy.java
@@ -0,0 +1,36 @@
+package de.dhbw.horb.ksm.core.editor.policies;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.ComponentEditPolicy;
+import org.eclipse.gef.requests.GroupRequest;
+
+import de.dhbw.horb.ksm.core.editor.commands.NodeDeleteCommand;
+import de.dhbw.horb.ksm.core.editor.parts.KSMEditPart;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeGroupEditPart;
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+
+/**
+ * Implements the action of deleting a node
+ *
+ */
+public class NodeComponentEditPolicy extends ComponentEditPolicy {
+ @Override
+ protected Command createDeleteCommand(GroupRequest request) {
+ NodeGroup nodeGroup;
+ if (getHost().getParent() instanceof KSMNodeGroupEditPart) {
+ KSMNodeGroupEditPart parent = (KSMNodeGroupEditPart) getHost()
+ .getParent();
+ nodeGroup = parent.getModel();
+ } else if (getHost().getParent() instanceof KSMEditPart) {
+ KSMEditPart parent = (KSMEditPart) getHost().getParent();
+ nodeGroup = parent.getModel().getNodeGroup();
+ } else {
+ return null;
+ }
+ NodeDeleteCommand deleteCommand = new NodeDeleteCommand();
+ deleteCommand.setNodeGroup(nodeGroup);
+ deleteCommand.setNode((Node) getHost().getModel());
+ return deleteCommand;
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeDirectEditPolicy.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeDirectEditPolicy.java
new file mode 100644
index 0000000..7f6ebe7
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeDirectEditPolicy.java
@@ -0,0 +1,30 @@
+package de.dhbw.horb.ksm.core.editor.policies;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.DirectEditPolicy;
+import org.eclipse.gef.requests.DirectEditRequest;
+
+import de.dhbw.horb.ksm.core.editor.commands.NodeRenameCommand;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeEditPart;
+
+/**
+ * This Policy controls the "click-to-edit" action of a Node-Figure
+ *
+ * @see KSMNodeEditPart#performRequest(org.eclipse.gef.Request)
+ * @see KSMNodeEditPart#installEditPolicy(Object, org.eclipse.gef.EditPolicy)
+ */
+public class NodeDirectEditPolicy extends DirectEditPolicy {
+ @Override
+ protected Command getDirectEditCommand(DirectEditRequest request) {
+ NodeRenameCommand command = new NodeRenameCommand(
+ (KSMNodeEditPart) getHost());
+ command.setNewCaption((String) request.getCellEditor().getValue());
+ return command;
+ }
+
+ @Override
+ protected void showCurrentEditValue(DirectEditRequest request) {
+ KSMNodeEditPart host2 = (KSMNodeEditPart) getHost();
+ host2.getFigure().repaint();
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeGraphicalNodeEditPolicy.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeGraphicalNodeEditPolicy.java
new file mode 100644
index 0000000..f3bd0d9
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeGraphicalNodeEditPolicy.java
@@ -0,0 +1,51 @@
+package de.dhbw.horb.ksm.core.editor.policies;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy;
+import org.eclipse.gef.requests.CreateConnectionRequest;
+import org.eclipse.gef.requests.ReconnectRequest;
+
+import de.dhbw.horb.ksm.core.editor.commands.ConnectionCreateCommand;
+import de.dhbw.horb.ksm.core.editor.commands.ConnectionReconnectCommand;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeEditPart;
+import de.dhbw.horb.ksm.model.api.Node;
+
+public class NodeGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
+
+ /** Execute at start of the connection procedure **/
+ @Override
+ protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
+ ConnectionCreateCommand command = new ConnectionCreateCommand();
+ command.setSource((Node) getHost().getModel());
+ request.setStartCommand(command);
+ return command;
+ }
+
+ /** Exececute when the user finished connecting **/
+ @Override
+ protected Command getConnectionCompleteCommand(
+ CreateConnectionRequest request) {
+ ConnectionCreateCommand command = (ConnectionCreateCommand) request
+ .getStartCommand();
+ command.setTarget((Node) getHost().getModel());
+ return command;
+ }
+
+ @Override
+ protected Command getReconnectTargetCommand(ReconnectRequest request) {
+ ConnectionReconnectCommand command = new ConnectionReconnectCommand();
+ command.setConnection(request.getConnectionEditPart());
+ command.setOldTarget((KSMNodeEditPart) getHost());
+ command.setTarget((KSMNodeEditPart) request.getTarget());
+ return command;
+ }
+
+ @Override
+ protected Command getReconnectSourceCommand(ReconnectRequest request) {
+ ConnectionReconnectCommand command = new ConnectionReconnectCommand();
+ command.setConnection(request.getConnectionEditPart());
+ command.setOldSource((KSMNodeEditPart) getHost());
+ command.setSource((KSMNodeEditPart) request.getTarget());
+ return command;
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeGroupComponentEditPolicy.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeGroupComponentEditPolicy.java
new file mode 100644
index 0000000..fdb8515
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeGroupComponentEditPolicy.java
@@ -0,0 +1,35 @@
+package de.dhbw.horb.ksm.core.editor.policies;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.ComponentEditPolicy;
+import org.eclipse.gef.requests.GroupRequest;
+
+import de.dhbw.horb.ksm.core.editor.commands.NodeGroupDeleteCommand;
+import de.dhbw.horb.ksm.core.editor.parts.KSMEditPart;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeGroupEditPart;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+
+/**
+ * Implements the action of deleting a {@link KSMNodeGroupEditPart}
+ */
+public class NodeGroupComponentEditPolicy extends ComponentEditPolicy {
+ @Override
+ protected Command createDeleteCommand(GroupRequest request) {
+ NodeGroup nodeGroup;
+ if (getHost().getParent() instanceof KSMNodeGroupEditPart) {
+ KSMNodeGroupEditPart parent = (KSMNodeGroupEditPart) getHost()
+ .getParent();
+ nodeGroup = parent.getModel();
+ } else if (getHost().getParent() instanceof KSMEditPart) {
+ KSMEditPart parent = (KSMEditPart) getHost().getParent();
+ nodeGroup = parent.getModel().getNodeGroup();
+ } else {
+ return null;
+ }
+
+ NodeGroupDeleteCommand deleteCommand = new NodeGroupDeleteCommand();
+ deleteCommand.setParentNodeGroup(nodeGroup);
+ deleteCommand.setNodeGroup((NodeGroup) getHost().getModel());
+ return deleteCommand;
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeGroupDirectEditPolicy.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeGroupDirectEditPolicy.java
new file mode 100644
index 0000000..afb00af
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/NodeGroupDirectEditPolicy.java
@@ -0,0 +1,36 @@
+package de.dhbw.horb.ksm.core.editor.policies;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.DirectEditPolicy;
+import org.eclipse.gef.requests.DirectEditRequest;
+
+import de.dhbw.horb.ksm.core.editor.commands.NodeGroupRenameCommand;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeGroupEditPart;
+
+/**
+ * This Policy controls the "click-to-edit" action of a NodeGroup-Figure.
+ *
+ * @see KSMNodeGroupEditPart#performRequest(org.eclipse.gef.Request)
+ * @see KSMNodeGroupEditPart#installEditPolicy(Object,
+ * org.eclipse.gef.EditPolicy)
+ */
+public class NodeGroupDirectEditPolicy extends DirectEditPolicy {
+ private final KSMNodeGroupEditPart ksmNodeGroupEditPart;
+
+ public NodeGroupDirectEditPolicy(KSMNodeGroupEditPart ksmNodeGroupEditPart) {
+ this.ksmNodeGroupEditPart = ksmNodeGroupEditPart;
+ }
+
+ @Override
+ protected void showCurrentEditValue(DirectEditRequest request) {
+ }
+
+ @Override
+ protected Command getDirectEditCommand(DirectEditRequest request) {
+ String newCaption = (String) request.getCellEditor().getValue();
+ NodeGroupRenameCommand command = new NodeGroupRenameCommand(
+ this.ksmNodeGroupEditPart);
+ command.setNewCaption(newCaption);
+ return command;
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/package.html b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/package.html
new file mode 100644
index 0000000..1931589
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/policies/package.html
@@ -0,0 +1,9 @@
+This package contains so called Edit Policies. They are responsible for actions on
+the data model.
+<br />
+See PropertyTreeEditPart for Policies regarding Node Properties in TreeViews (Outline)
+<br />
+See NodeTreeEditPart for Policies regarding Nodes in TreeViews or NodePart in the GEF Editor.
+<br />
+<br />
+Policies uses commands (see ksmcore.editor.commands) to describe their actions. \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/ui/DiagramCreationWizard.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/ui/DiagramCreationWizard.java
new file mode 100644
index 0000000..e0454ea
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/ui/DiagramCreationWizard.java
@@ -0,0 +1,104 @@
+package de.dhbw.horb.ksm.core.editor.ui;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.util.Calendar;
+
+import javax.xml.bind.JAXBException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+import org.eclipse.ui.part.FileEditorInput;
+
+import de.dhbw.horb.ksm.model.api.KSM;
+import de.dhbw.horb.ksm.model.impl.KSMFactory;
+
+public class DiagramCreationWizard extends Wizard implements INewWizard {
+ private WizardPage wizardPage;
+ private IStructuredSelection selection;
+ private IWorkbench workbench;
+
+ // Abstract methods from IWorkbenchWizard
+ @Override
+ public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
+ this.workbench = workbench;
+ this.selection = currentSelection;
+ }
+
+ // Overridden from Wizard
+ @Override
+ public void addPages() {
+ // by default the superclass doesn't have any pages - here we add one
+ this.wizardPage = new WizardPage(this.workbench, this.selection);
+ addPage(this.wizardPage);
+ }
+
+ @Override
+ public boolean performFinish() {
+ return this.wizardPage.finish();
+ }
+}
+
+class WizardPage extends WizardNewFileCreationPage {
+
+ private IWorkbench workbench;
+
+ public WizardPage(IWorkbench aWorkbench, IStructuredSelection selection) {
+ super("ksmPage1", selection);
+ this.setTitle("Create a Kybernetic Model");
+ this.setDescription("Create a Kybernetic Model");
+ this.workbench = aWorkbench;
+ }
+
+ public boolean finish() {
+ IFile newFile = createNewFile();
+ if (newFile == null)
+ return false; // ie.- creation was unsuccessful
+
+ // Since the file resource was created fine, open it for editing
+ // iff requested by the user
+ try {
+ IWorkbenchWindow dwindow = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = dwindow.getActivePage();
+ FileEditorInput fileEditorInput = new FileEditorInput(newFile);
+ if (page != null)
+ page.openEditor(fileEditorInput, DiagramEditor.EDITOR_ID);
+ } catch (org.eclipse.ui.PartInitException e) {
+ e.printStackTrace();
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ Calendar c = Calendar.getInstance();
+ String postfix = c.get(Calendar.DAY_OF_MONTH) + "-"
+ + c.get(Calendar.MONTH) + "-" + c.get(Calendar.YEAR);
+ this.setFileName("ksm-model-" + postfix + ".ksm");
+ setPageComplete(validatePage());
+ }
+
+ protected InputStream getInitialContents() {
+ // by default the superclass returns null for this
+ KSM createEmptyKSM = KSMFactory.createEmptyKSM();
+ ByteArrayOutputStream os = new ByteArrayOutputStream(256);
+ try {
+ KSMFactory.saveKSM(createEmptyKSM, os);
+ } catch (JAXBException e) {
+ // XXX use Logger
+ e.printStackTrace();
+ return null;
+ }
+ return new ByteArrayInputStream(os.toByteArray());
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/ui/DiagramEditor.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/ui/DiagramEditor.java
new file mode 100644
index 0000000..c1e2540
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/editor/ui/DiagramEditor.java
@@ -0,0 +1,329 @@
+package de.dhbw.horb.ksm.core.editor.ui;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.util.EventObject;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.gef.DefaultEditDomain;
+import org.eclipse.gef.KeyHandler;
+import org.eclipse.gef.KeyStroke;
+import org.eclipse.gef.dnd.TemplateTransferDragSourceListener;
+import org.eclipse.gef.editparts.ScalableRootEditPart;
+import org.eclipse.gef.editparts.ZoomManager;
+import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
+import org.eclipse.gef.palette.ConnectionCreationToolEntry;
+import org.eclipse.gef.palette.PaletteDrawer;
+import org.eclipse.gef.palette.PaletteGroup;
+import org.eclipse.gef.palette.PaletteRoot;
+import org.eclipse.gef.palette.SelectionToolEntry;
+import org.eclipse.gef.palette.ToolEntry;
+import org.eclipse.gef.ui.actions.ActionRegistry;
+import org.eclipse.gef.ui.parts.ContentOutlinePage;
+import org.eclipse.gef.ui.parts.GraphicalEditorWithPalette;
+import org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler;
+import org.eclipse.gef.ui.parts.TreeViewer;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.ISaveablePart;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.dialogs.SaveAsDialog;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.IPageSite;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+import de.dhbw.horb.ksm.core.Activator;
+import de.dhbw.horb.ksm.core.KSMMessages;
+import de.dhbw.horb.ksm.core.editor.dnd.DiagramTemplateTransferDropTargetListener;
+import de.dhbw.horb.ksm.core.editor.model.NodeGroupRequestFactory;
+import de.dhbw.horb.ksm.core.editor.model.NodeRequestFactory;
+import de.dhbw.horb.ksm.core.editor.parts.PartFactory;
+import de.dhbw.horb.ksm.core.editor.parts.outline.TreePartFactory;
+import de.dhbw.horb.ksm.model.api.KSM;
+import de.dhbw.horb.ksm.model.impl.KSMFactory;
+
+public class DiagramEditor extends GraphicalEditorWithPalette {
+ public static final String EDITOR_ID = "ksm.core.editor";
+
+ private PaletteRoot paletteRoot;
+ private KeyHandler sharedKeyHandler;
+
+ private boolean savePreviouslyNeeded;
+
+ private KSM ksmModel = KSMFactory.createEmptyKSM();
+
+ public DiagramEditor() {
+ setEditDomain(new DefaultEditDomain(this));
+ }
+
+ public KSM getModel() {
+ return ksmModel;
+ }
+
+ protected KeyHandler getCommonKeyHandler() {
+ if (sharedKeyHandler == null) {
+ sharedKeyHandler = new KeyHandler();
+ sharedKeyHandler
+ .put(KeyStroke.getPressed(SWT.DEL, 127, 0),
+ getActionRegistry().getAction(
+ ActionFactory.DELETE.getId()));
+ }
+ return sharedKeyHandler;
+ }
+
+ @Override
+ protected void configureGraphicalViewer() {
+ super.configureGraphicalViewer();
+ getGraphicalViewer().setRootEditPart(new ScalableRootEditPart());
+
+ // set the factory to use for creating EditParts for elements in the
+ // model
+ getGraphicalViewer().setEditPartFactory(new PartFactory());
+ getGraphicalViewer().setKeyHandler(
+ new GraphicalViewerKeyHandler(getGraphicalViewer())
+ .setParent(getCommonKeyHandler()));
+
+ }
+
+ @Override
+ public void commandStackChanged(EventObject event) {
+ if (isDirty()) {
+ if (!this.savePreviouslyNeeded) {
+ this.savePreviouslyNeeded = true;
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ firePropertyChange(ISaveablePart.PROP_DIRTY);
+ }
+ } else {
+ savePreviouslyNeeded = false;
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ firePropertyChange(ISaveablePart.PROP_DIRTY);
+ }
+ super.commandStackChanged(event);
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class type) {
+ if (type == IContentOutlinePage.class) {
+ return new KSMContentOutlinePage();
+ } else if (type == ZoomManager.class) {
+ return ((ScalableRootEditPart) getGraphicalViewer()
+ .getRootEditPart()).getZoomManager();
+
+ }
+ return super.getAdapter(type);
+ }
+
+ @Override
+ protected void setInput(IEditorInput input) {
+ super.setInput(input);
+ setPartName(input.getName());
+ IFile file = ((IFileEditorInput) input).getFile();
+ try { // attempt to read from a file
+ InputStream istream = file.getContents(false);
+ ksmModel = KSMFactory.loadKSM(istream);
+ } catch (Exception e) { // but if there's an error, create a new diagram
+ e.printStackTrace();
+ ksmModel = KSMFactory.createEmptyKSM();
+ }
+ }
+
+ @Override
+ protected void initializeGraphicalViewer() {
+ // this uses the PartFactory set in configureGraphicalViewer
+ // to create an EditPart for the diagram and sets it as the
+ // content for the viewer
+ getGraphicalViewer().setContents(this.ksmModel);
+ getGraphicalViewer().addDropTargetListener(
+ new DiagramTemplateTransferDropTargetListener(
+ getGraphicalViewer()));
+ }
+
+ @Override
+ protected void initializePaletteViewer() {
+ super.initializePaletteViewer();
+ getPaletteViewer().addDragSourceListener(
+ new TemplateTransferDragSourceListener(getPaletteViewer()));
+ }
+
+ /**
+ * Save Editor content to File.
+ */
+ @Override
+ public void doSave(final IProgressMonitor monitor) {
+ SafeRunner.run(new ISafeRunnable() {
+ @Override
+ public void run() throws Exception {
+ // TODO remove unecessary copy action
+ IFile file = ((IFileEditorInput) getEditorInput()).getFile();
+ ByteArrayOutputStream os = new ByteArrayOutputStream(512);
+ KSMFactory.saveKSM(ksmModel, os);
+
+ ByteArrayInputStream is = new ByteArrayInputStream(os
+ .toByteArray());
+ file.setContents(is, true, false, monitor);
+ getCommandStack().markSaveLocation();
+ }
+
+ @Override
+ public void handleException(Throwable exception) {
+ exception.printStackTrace();
+ }
+ });
+ }
+
+ @Override
+ public void doSaveAs() {
+ final SaveAsDialog dialog = new SaveAsDialog(getSite()
+ .getWorkbenchWindow().getShell());
+ dialog.setOriginalFile(((IFileEditorInput) getEditorInput()).getFile());
+ dialog.open();
+ final IPath path = dialog.getResult();
+
+ if (path == null)
+ return;
+
+ final IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ final IFile file = workspace.getRoot().getFile(path);
+
+ WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
+ public void execute(final IProgressMonitor monitor)
+ throws CoreException {
+ try {
+ ByteArrayOutputStream os = new ByteArrayOutputStream(512);
+ KSMFactory.saveKSM(ksmModel, os);
+
+ ByteArrayInputStream is = new ByteArrayInputStream(
+ os.toByteArray());
+ file.create(is, true, monitor);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ };
+
+ try {
+ new ProgressMonitorDialog(getSite().getWorkbenchWindow().getShell())
+ .run(false, true, op);
+ setInput(new FileEditorInput((IFile) file));
+ getCommandStack().markSaveLocation();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public boolean isDirty() {
+ // rely on the command stack to determine dirty flag
+ return getCommandStack().isDirty();
+ }
+
+ @Override
+ public boolean isSaveAsAllowed() {
+ // allow Save As
+ return true;
+ }
+
+ @Override
+ protected PaletteRoot getPaletteRoot() {
+ if (this.paletteRoot == null) {
+ ToolEntry tool;
+ paletteRoot = new PaletteRoot();
+
+ PaletteGroup controlGroup = new PaletteGroup("Control Group"); //$NON-NLS-1$
+
+ tool = new SelectionToolEntry();
+ controlGroup.add(tool);
+ paletteRoot.setDefaultEntry(tool);
+
+ tool = new ConnectionCreationToolEntry(
+ KSMMessages.PaletteFactory_Connection,
+ KSMMessages.PaletteFactory_CreateConnection,
+ null,
+ Activator
+ .getImageDescriptor("icons/16/ksm-connection-new.png"), //$NON-NLS-1$
+ Activator
+ .getImageDescriptor("icons/32/ksm-connection-new.png")); //$NON-NLS-1$
+ controlGroup.add(tool);
+
+ paletteRoot.add(controlGroup);
+
+ PaletteDrawer drawer = new PaletteDrawer(
+ KSMMessages.PaletteFactory_Components, null);
+
+ tool = new CombinedTemplateCreationEntry(
+ KSMMessages.PaletteFactory_Node,
+ KSMMessages.PaletteFactory_CreateNode,
+ new NodeRequestFactory(this),
+ Activator.getImageDescriptor("icons/16/ksm-node-new.png"), //$NON-NLS-1$
+ Activator.getImageDescriptor("icons/32/ksm-node-new.png")); //$NON-NLS-1$
+ drawer.add(tool);
+
+ tool = new CombinedTemplateCreationEntry("Node-Group",
+ "Create Node Group", new NodeGroupRequestFactory(this),
+ Activator.getImageDescriptor("icons/16/ksm-nodegroup-new.png"), //$NON-NLS-1$
+ Activator.getImageDescriptor("icons/32/ksm-nodegroup-new.png")); //$NON-NLS-1$
+ drawer.add(tool);
+
+ paletteRoot.add(drawer);
+ }
+
+ return paletteRoot;
+ }
+
+ // OutlineView Content
+ private class KSMContentOutlinePage extends ContentOutlinePage {
+
+ public KSMContentOutlinePage() {
+ super(new TreeViewer());
+ }
+
+ public void init(IPageSite pageSite) {
+ super.init(pageSite);
+ ActionRegistry registry = DiagramEditor.this.getActionRegistry();
+ IActionBars bars = pageSite.getActionBars();
+ String id = ActionFactory.UNDO.getId();
+ bars.setGlobalActionHandler(id, registry.getAction(id));
+ id = ActionFactory.REDO.getId();
+ bars.setGlobalActionHandler(id, registry.getAction(id));
+ id = ActionFactory.DELETE.getId();
+ bars.setGlobalActionHandler(id, registry.getAction(id));
+ id = ActionFactory.PRINT.getId();
+ bars.setGlobalActionHandler(id, registry.getAction(id));
+
+ bars.updateActionBars();
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ getViewer().setKeyHandler(DiagramEditor.this.getCommonKeyHandler());
+ getViewer().setEditDomain(DiagramEditor.this.getEditDomain());
+ getViewer().setEditPartFactory(new TreePartFactory());
+ getViewer().setContents(DiagramEditor.this.getModel());
+
+ DiagramEditor.this.getSelectionSynchronizer()
+ .addViewer(getViewer());
+ }
+
+ public void dispose() {
+ DiagramEditor.this.getSelectionSynchronizer().removeViewer(
+ getViewer());
+ super.dispose();
+ }
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/extension/AbstractPropertyDescriptorAdvisor.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/extension/AbstractPropertyDescriptorAdvisor.java
new file mode 100644
index 0000000..fca8cda
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/extension/AbstractPropertyDescriptorAdvisor.java
@@ -0,0 +1,102 @@
+package de.dhbw.horb.ksm.core.extension;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+
+/**
+ * This class is intented to be subclassed to add extra properties to the model.
+ *
+ * See Extension Point de.dhbw.horb.ksm.core.model.property for details.
+ *
+ * TODO Boolean and Lists
+ */
+public abstract class AbstractPropertyDescriptorAdvisor {
+ protected List<IPropertyDescriptor> descriptors = new ArrayList<IPropertyDescriptor>();
+
+ public AbstractPropertyDescriptorAdvisor() {
+ init();
+ }
+
+ protected abstract void init();
+
+ public List<IPropertyDescriptor> getDescriptors() {
+ return descriptors;
+ }
+
+ public void addProperty(String key, String caption) {
+ String type = ModelProperties.INSTANCE.type(key);
+ // String propertyName = ModelProperties.INSTANCE.name(key);
+ if ("string".equals(type)) {
+ descriptors.add(new TextPropertyDescriptor(key, caption));
+ } else if ("decimal".equals(type)) {
+ descriptors.add(new BigDecimalTextPropertyDescriptor(key, caption));
+ } else if ("integer".equals(type)) {
+ descriptors.add(new BigIntegerTextPropertyDescriptor(key, caption));
+ } else if ("boolean".equals(type)) {
+ // XXX
+ } else if ("stringList".equals(type)) {
+ // XXX
+ } else if ("decimalList".equals(type)) {
+ // XXX
+ } else if ("integerList".equals(type)) {
+ // XXX
+ }
+ }
+
+ /*****/
+
+ private class BigDecimalTextPropertyDescriptor extends
+ TextPropertyDescriptor {
+ ICellEditorValidator validator = new ICellEditorValidator() {
+ @Override
+ public String isValid(Object value) {
+ try {
+ new BigInteger((String) value);
+ return null; // valid
+ } catch (NumberFormatException e) {
+ return "value must be a Integer value";
+ }
+ }
+ };
+
+ public BigDecimalTextPropertyDescriptor(Object id, String displayName) {
+ super(id, displayName);
+ }
+
+ @Override
+ protected ICellEditorValidator getValidator() {
+ return validator;
+ }
+ }
+
+ private class BigIntegerTextPropertyDescriptor extends
+ TextPropertyDescriptor {
+ ICellEditorValidator validator = new ICellEditorValidator() {
+ @Override
+ public String isValid(Object value) {
+ try {
+ new BigInteger((String) value);
+ return null; // valid
+ } catch (NumberFormatException e) {
+ return "value must be a Integer value";
+ }
+ }
+ };
+
+ public BigIntegerTextPropertyDescriptor(Object id, String displayName) {
+ super(id, displayName);
+ }
+
+ @Override
+ protected ICellEditorValidator getValidator() {
+ return validator;
+ }
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/handler/CallEditorPerspective.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/handler/CallEditorPerspective.java
new file mode 100644
index 0000000..7cafd90
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/handler/CallEditorPerspective.java
@@ -0,0 +1,37 @@
+package de.dhbw.horb.ksm.core.handler;
+
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.IPerspectiveRegistry;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import de.dhbw.horb.ksm.core.perspectives.KSMEditorPerspective;
+
+/**
+ * Handler to open the KSM-Editor Perspective (no other exists atm)
+ */
+public class CallEditorPerspective extends AbstractHandler implements IHandler {
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IWorkbenchWindow workbenchWindow;
+ IWorkbenchPage activePage;
+ IPerspectiveRegistry perspReg;
+ IPerspectiveDescriptor perspId;
+
+ workbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
+ activePage = workbenchWindow.getActivePage();
+
+ perspReg = workbenchWindow.getWorkbench().getPerspectiveRegistry();
+ perspId = perspReg.findPerspectiveWithId(KSMEditorPerspective.ID);
+
+ //Set Perspective
+ activePage.setPerspective(perspId);
+ return null;
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/messages.properties b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/messages.properties
new file mode 100644
index 0000000..ae93c6b
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/messages.properties
@@ -0,0 +1,6 @@
+ApplicationWorkbenchWindowAdvisor_Title=Kybernetisches System Modell
+PaletteFactory_Components=Components
+PaletteFactory_Connection=Connection
+PaletteFactory_CreateConnection=Create a connection
+PaletteFactory_CreateNode=Create a new Node
+PaletteFactory_Node=Node
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/perspectives/KSMEditorPerspective.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/perspectives/KSMEditorPerspective.java
new file mode 100644
index 0000000..9b30305
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/perspectives/KSMEditorPerspective.java
@@ -0,0 +1,37 @@
+package de.dhbw.horb.ksm.core.perspectives;
+
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+public class KSMEditorPerspective implements IPerspectiveFactory {
+ public static final String ID = "ksm.core.perspectives.KSMEditorPerspective"; //$NON-NLS-N$
+ private IPageLayout factory;
+
+ public KSMEditorPerspective() {
+ super();
+ }
+
+ public void createInitialLayout(IPageLayout factory) {
+ this.factory = factory;
+ factory.setEditorAreaVisible(true);
+ addViews();
+ }
+
+ private void addViews() {
+ IFolderLayout topLeft = factory.createFolder("topLeft", //$NON-NLS-N$
+ IPageLayout.LEFT, 0.30f, factory.getEditorArea());
+
+ topLeft.addView(de.dhbw.horb.ksm.core.view.Navigator.VIEW_ID);
+
+ IFolderLayout topRight = factory.createFolder("topRight",
+ IPageLayout.RIGHT, 0.30f, factory.getEditorArea());
+ topRight.addView("org.eclipse.ui.views.ContentOutline"); //$NON-NLS-N$
+
+ IFolderLayout bottom = factory.createFolder("bottom",
+ IPageLayout.BOTTOM, 0.60f, factory.getEditorArea());
+ bottom.addView("org.eclipse.ui.views.PropertySheet"); //$NON-NLS-N$
+
+ // org.eclipse.ui.internal.PerspectiveBarNewContributionItem
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/project/KSMProjectNature.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/project/KSMProjectNature.java
new file mode 100644
index 0000000..d66dae0
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/project/KSMProjectNature.java
@@ -0,0 +1,39 @@
+package de.dhbw.horb.ksm.core.project;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ * Class repersnation of the KSM Project nature.
+ *
+ * @see NewKSMProjectWizard
+ */
+public class KSMProjectNature implements IProjectNature {
+
+ private IProject project;
+
+ @Override
+ public void configure() throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void deconfigure() throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public IProject getProject() {
+ return project;
+ }
+
+ @Override
+ public void setProject(IProject project) {
+ this.project = project;
+
+ }
+
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/project/NewKSMProjectWizard.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/project/NewKSMProjectWizard.java
new file mode 100644
index 0000000..490cac8
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/project/NewKSMProjectWizard.java
@@ -0,0 +1,38 @@
+package de.dhbw.horb.ksm.core.project;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
+
+/**
+ * Create a new KSM Project and add KSM Project Nature.
+ *
+ * <a href="http://www.eclipse.org/articles/Article-Builders/builders.html"
+ * >link1</a>.
+ *
+ * <a href=
+ * "http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/resAdv_natures.htm"
+ * >link2</a>
+ */
+public class NewKSMProjectWizard extends BasicNewProjectResourceWizard {
+ @Override
+ public boolean performFinish() {
+ if (super.performFinish()) {
+ IProject project = getNewProject();
+ try {
+ IProjectDescription description = project.getDescription();
+ String[] natures = description.getNatureIds();
+ String[] newNatures = new String[natures.length + 1];
+ System.arraycopy(natures, 0, newNatures, 0, natures.length);
+ newNatures[natures.length] = "de.dhbw.horb.ksm.core.ksmProjectNature";
+ description.setNatureIds(newNatures);
+ project.setDescription(description, null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ return true;
+ } else
+ return false;
+ }
+}
diff --git a/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/view/Navigator.java b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/view/Navigator.java
new file mode 100644
index 0000000..7338eaf
--- /dev/null
+++ b/de.dhbw.horb.ksm.core/src/de/dhbw/horb/ksm/core/view/Navigator.java
@@ -0,0 +1,7 @@
+package de.dhbw.horb.ksm.core.view;
+
+import org.eclipse.ui.navigator.CommonNavigator;
+
+public class Navigator extends CommonNavigator {
+ public static final String VIEW_ID = "ksm.core.view.navigator";
+}
diff --git a/de.dhbw.horb.ksm.model/.classpath b/de.dhbw.horb.ksm.model/.classpath
new file mode 100644
index 0000000..f2d4146
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry exported="true" kind="lib" path=""/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/de.dhbw.horb.ksm.model/.project b/de.dhbw.horb.ksm.model/.project
new file mode 100644
index 0000000..d4cc79f
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>de.dhbw.horb.ksm.model</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/de.dhbw.horb.ksm.model/.settings/org.eclipse.jdt.core.prefs b/de.dhbw.horb.ksm.model/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..7f8ee0f
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Mon May 09 21:11:35 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/de.dhbw.horb.ksm.model/META-INF/MANIFEST.MF b/de.dhbw.horb.ksm.model/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..2b9089b
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Model
+Bundle-SymbolicName: de.dhbw.horb.ksm.model
+Bundle-Version: 1.0.0
+Export-Package: de.dhbw.horb.ksm.model.api,
+ de.dhbw.horb.ksm.model.generated,
+ de.dhbw.horb.ksm.model.impl
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/de.dhbw.horb.ksm.model/build.properties b/de.dhbw.horb.ksm.model/build.properties
new file mode 100644
index 0000000..0d1ebd0
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/build.properties
@@ -0,0 +1,4 @@
+source.. = .
+output.. = .
+bin.includes = META-INF/,\
+ de/
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/Connection.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/Connection.class
new file mode 100644
index 0000000..a5b84f8
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/Connection.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/KSM.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/KSM.class
new file mode 100644
index 0000000..4791d37
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/KSM.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/Node.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/Node.class
new file mode 100644
index 0000000..9f3d931
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/Node.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/NodeGroup.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/NodeGroup.class
new file mode 100644
index 0000000..c7617d8
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/NodeGroup.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/Properties.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/Properties.class
new file mode 100644
index 0000000..2102337
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/api/Properties.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/ObjectFactory.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/ObjectFactory.class
new file mode 100644
index 0000000..f66af7d
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/ObjectFactory.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XConnection.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XConnection.class
new file mode 100644
index 0000000..79bee93
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XConnection.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XConnections.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XConnections.class
new file mode 100644
index 0000000..3f8a93a
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XConnections.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XKSM.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XKSM.class
new file mode 100644
index 0000000..48a41a4
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XKSM.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XNode.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XNode.class
new file mode 100644
index 0000000..caf192f
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XNode.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XNodeGroup.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XNodeGroup.class
new file mode 100644
index 0000000..7b6777a
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XNodeGroup.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XProperties.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XProperties.class
new file mode 100644
index 0000000..8840d2c
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XProperties.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyBase.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyBase.class
new file mode 100644
index 0000000..e740f5d
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyBase.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyBaseList.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyBaseList.class
new file mode 100644
index 0000000..701b36a
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyBaseList.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyBoolean.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyBoolean.class
new file mode 100644
index 0000000..8ee2a84
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyBoolean.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyDecimal.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyDecimal.class
new file mode 100644
index 0000000..3efb49a
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyDecimal.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyDecimalList.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyDecimalList.class
new file mode 100644
index 0000000..7a2c4e5
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyDecimalList.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyInteger.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyInteger.class
new file mode 100644
index 0000000..dc8500a
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyInteger.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyIntegerList.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyIntegerList.class
new file mode 100644
index 0000000..fe93b0f
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyIntegerList.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyString.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyString.class
new file mode 100644
index 0000000..09f2537
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyString.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyStringList.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyStringList.class
new file mode 100644
index 0000000..e6ef11b
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/XPropertyStringList.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/package-info.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/package-info.class
new file mode 100644
index 0000000..66782ff
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/generated/package-info.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/ConnectionImpl.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/ConnectionImpl.class
new file mode 100644
index 0000000..38797d6
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/ConnectionImpl.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/KSMFactory.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/KSMFactory.class
new file mode 100644
index 0000000..6571d19
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/KSMFactory.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/KSMImpl.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/KSMImpl.class
new file mode 100644
index 0000000..335ed51
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/KSMImpl.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/NodeGroupImpl.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/NodeGroupImpl.class
new file mode 100644
index 0000000..d24dc89
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/NodeGroupImpl.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/NodeImpl.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/NodeImpl.class
new file mode 100644
index 0000000..3225f5d
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/NodeImpl.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/PropertiesImpl.class b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/PropertiesImpl.class
new file mode 100644
index 0000000..3792861
--- /dev/null
+++ b/de.dhbw.horb.ksm.model/de/dhbw/horb/ksm/model/impl/PropertiesImpl.class
Binary files differ
diff --git a/de.dhbw.horb.ksm.qksm/.classpath b/de.dhbw.horb.ksm.qksm/.classpath
new file mode 100644
index 0000000..ad32c83
--- /dev/null
+++ b/de.dhbw.horb.ksm.qksm/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/de.dhbw.horb.ksm.qksm/.gitignore b/de.dhbw.horb.ksm.qksm/.gitignore
new file mode 100644
index 0000000..e660fd9
--- /dev/null
+++ b/de.dhbw.horb.ksm.qksm/.gitignore
@@ -0,0 +1 @@
+bin/
diff --git a/de.dhbw.horb.ksm.qksm/.project b/de.dhbw.horb.ksm.qksm/.project
new file mode 100644
index 0000000..2df984b
--- /dev/null
+++ b/de.dhbw.horb.ksm.qksm/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>de.dhbw.horb.ksm.qksm</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/de.dhbw.horb.ksm.qksm/.settings/org.eclipse.jdt.core.prefs b/de.dhbw.horb.ksm.qksm/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..374f01e
--- /dev/null
+++ b/de.dhbw.horb.ksm.qksm/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Fri Apr 29 22:08:31 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/de.dhbw.horb.ksm.qksm/META-INF/MANIFEST.MF b/de.dhbw.horb.ksm.qksm/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..353b055
--- /dev/null
+++ b/de.dhbw.horb.ksm.qksm/META-INF/MANIFEST.MF
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Qksm
+Bundle-SymbolicName: de.dhbw.horb.ksm.qksm;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: de.dhbw.horb.ksm.qksm.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ de.dhbw.horb.ksm.core;bundle-version="1.0.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/de.dhbw.horb.ksm.qksm/build.properties b/de.dhbw.horb.ksm.qksm/build.properties
new file mode 100644
index 0000000..e9863e2
--- /dev/null
+++ b/de.dhbw.horb.ksm.qksm/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/de.dhbw.horb.ksm.qksm/plugin.xml b/de.dhbw.horb.ksm.qksm/plugin.xml
new file mode 100644
index 0000000..14f01db
--- /dev/null
+++ b/de.dhbw.horb.ksm.qksm/plugin.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="de.dhbw.horb.ksm.core.model.property">
+ <advisor
+ class="de.dhbw.horb.ksm.qksm.QKSMNodePropertyDescriptorAdvisor"
+ name="QKSMNodePropertyDescriptorAdvisor"
+ type="node">
+ </advisor>
+ </extension>
+
+</plugin>
diff --git a/de.dhbw.horb.ksm.qksm/src/de/dhbw/horb/ksm/qksm/Activator.java b/de.dhbw.horb.ksm.qksm/src/de/dhbw/horb/ksm/qksm/Activator.java
new file mode 100644
index 0000000..33fb4e7
--- /dev/null
+++ b/de.dhbw.horb.ksm.qksm/src/de/dhbw/horb/ksm/qksm/Activator.java
@@ -0,0 +1,50 @@
+package de.dhbw.horb.ksm.qksm;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "de.dhbw.horb.ksm.qksm"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/de.dhbw.horb.ksm.qksm/src/de/dhbw/horb/ksm/qksm/QKSMNodePropertyDescriptorAdvisor.java b/de.dhbw.horb.ksm.qksm/src/de/dhbw/horb/ksm/qksm/QKSMNodePropertyDescriptorAdvisor.java
new file mode 100644
index 0000000..26f4b5b
--- /dev/null
+++ b/de.dhbw.horb.ksm.qksm/src/de/dhbw/horb/ksm/qksm/QKSMNodePropertyDescriptorAdvisor.java
@@ -0,0 +1,12 @@
+package de.dhbw.horb.ksm.qksm;
+
+import de.dhbw.horb.ksm.core.extension.AbstractPropertyDescriptorAdvisor;
+
+public class QKSMNodePropertyDescriptorAdvisor extends
+ AbstractPropertyDescriptorAdvisor {
+
+ @Override
+ protected void init() {
+ addProperty("string:foobar", "foobar");
+ }
+}
diff --git a/de.dhbw.horb.ksm.simulator/.classpath b/de.dhbw.horb.ksm.simulator/.classpath
new file mode 100644
index 0000000..65582bc
--- /dev/null
+++ b/de.dhbw.horb.ksm.simulator/.classpath
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="lib/org.swtchart_0.7.0.v20110128.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.swtchart.ext_0.7.0.v20110128.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/de.dhbw.horb.ksm.simulator/.gitignore b/de.dhbw.horb.ksm.simulator/.gitignore
new file mode 100644
index 0000000..e660fd9
--- /dev/null
+++ b/de.dhbw.horb.ksm.simulator/.gitignore
@@ -0,0 +1 @@
+bin/
diff --git a/de.dhbw.horb.ksm.simulator/.project b/de.dhbw.horb.ksm.simulator/.project
new file mode 100644
index 0000000..797d7bb
--- /dev/null
+++ b/de.dhbw.horb.ksm.simulator/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>de.dhbw.horb.ksm.simulator</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/de.dhbw.horb.ksm.simulator/.settings/org.eclipse.jdt.core.prefs b/de.dhbw.horb.ksm.simulator/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..4741363
--- /dev/null
+++ b/de.dhbw.horb.ksm.simulator/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Mon May 09 15:47:49 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/de.dhbw.horb.ksm.simulator/META-INF/MANIFEST.MF b/de.dhbw.horb.ksm.simulator/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..727b6a8
--- /dev/null
+++ b/de.dhbw.horb.ksm.simulator/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: KSM Simulator Prototype
+Bundle-SymbolicName: de.dhbw.horb.ksm.simulator;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: de.dhbw.horb.simulator.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ de.dhbw.horb.ksm.core;bundle-version="1.0.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: de.dhbw.horb.ksm.model.api,
+ org.eclipse.gef.commands
+Bundle-ClassPath: lib/org.swtchart_0.7.0.v20110128.jar,
+ lib/org.swtchart.ext_0.7.0.v20110128.jar,
+ .
diff --git a/de.dhbw.horb.ksm.simulator/build.properties b/de.dhbw.horb.ksm.simulator/build.properties
new file mode 100644
index 0000000..2ba7ae7
--- /dev/null
+++ b/de.dhbw.horb.ksm.simulator/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ lib/org.swtchart_0.7.0.v20110128.jar,\
+ lib/org.swtchart.ext_0.7.0.v20110128.jar
diff --git a/de.dhbw.horb.ksm.simulator/icons/16/ksm-simulator.png b/de.dhbw.horb.ksm.simulator/icons/16/ksm-simulator.png
new file mode 100644
index 0000000..89d3780
--- /dev/null
+++ b/de.dhbw.horb.ksm.simulator/icons/16/ksm-simulator.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.simulator/icons/32/ksm-simulator.png b/de.dhbw.horb.ksm.simulator/icons/32/ksm-simulator.png
new file mode 100644
index 0000000..554de7e
--- /dev/null
+++ b/de.dhbw.horb.ksm.simulator/icons/32/ksm-simulator.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.simulator/lib/org.swtchart.ext_0.7.0.v20110128.jar b/de.dhbw.horb.ksm.simulator/lib/org.swtchart.ext_0.7.0.v20110128.jar
new file mode 100644
index 0000000..cb0d4e6
--- /dev/null
+++ b/de.dhbw.horb.ksm.simulator/lib/org.swtchart.ext_0.7.0.v20110128.jar
Binary files differ
diff --git a/de.dhbw.horb.ksm.simulator/lib/org.swtchart_0.7.0.v20110128.jar b/de.dhbw.horb.ksm.simulator/lib/org.swtchart_0.7.0.v20110128.jar
new file mode 100644
index 0000000..6ee142b
--- /dev/null
+++ b/de.dhbw.horb.ksm.simulator/lib/org.swtchart_0.7.0.v20110128.jar
Binary files differ
diff --git a/de.dhbw.horb.ksm.simulator/plugin.xml b/de.dhbw.horb.ksm.simulator/plugin.xml
new file mode 100644
index 0000000..2808e8c
--- /dev/null
+++ b/de.dhbw.horb.ksm.simulator/plugin.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ allowMultiple="false"
+ category="ksm.core.views.KSMCategory"
+ class="de.dhbw.horb.simulator.view.SimulatorView"
+ icon="icons/16/ksm-simulator.png"
+ id="ksm.simulator.views.SimulatorView"
+ name="Simulator"
+ restorable="true">
+ </view>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectives">
+ <perspective
+ class="de.dhbw.horb.simulator.perspective.SimulatorPerspective"
+ fixed="true"
+ icon="icons/32/ksm-simulator.png"
+ id="ksm.simulator.perspectives.SimulatorPerspective"
+ name="Simulator">
+ </perspective>
+ </extension>
+</plugin>
diff --git a/de.dhbw.horb.ksm.simulator/src/de/dhbw/horb/simulator/Activator.java b/de.dhbw.horb.ksm.simulator/src/de/dhbw/horb/simulator/Activator.java
new file mode 100644
index 0000000..274c2dd
--- /dev/null
+++ b/de.dhbw.horb.ksm.simulator/src/de/dhbw/horb/simulator/Activator.java
@@ -0,0 +1,50 @@
+package de.dhbw.horb.simulator;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "Simulator"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/de.dhbw.horb.ksm.simulator/src/de/dhbw/horb/simulator/perspective/SimulatorPerspective.java b/de.dhbw.horb.ksm.simulator/src/de/dhbw/horb/simulator/perspective/SimulatorPerspective.java
new file mode 100644
index 0000000..c040bdc
--- /dev/null
+++ b/de.dhbw.horb.ksm.simulator/src/de/dhbw/horb/simulator/perspective/SimulatorPerspective.java
@@ -0,0 +1,33 @@
+package de.dhbw.horb.simulator.perspective;
+
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+import de.dhbw.horb.simulator.view.SimulatorView;
+
+public class SimulatorPerspective implements IPerspectiveFactory {
+ public static final String ID = "ksm.simulator.perspectives.SimulatorPerspective"; //$NON-NLS-N$
+ private IPageLayout factory;
+
+ public SimulatorPerspective() {
+ super();
+ }
+
+ public void createInitialLayout(IPageLayout factory) {
+ this.factory = factory;
+ factory.setEditorAreaVisible(true);
+ addViews();
+ }
+
+ private void addViews() {
+ IFolderLayout topLeft = factory.createFolder("topLeft", //$NON-NLS-N$
+ IPageLayout.LEFT, 0.30f, factory.getEditorArea());
+
+ topLeft.addView(de.dhbw.horb.ksm.core.view.Navigator.VIEW_ID);
+
+ IFolderLayout topRight = factory.createFolder("bottom",
+ IPageLayout.BOTTOM, 0.30f, factory.getEditorArea());
+ topRight.addView(SimulatorView.VIEW_ID);
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.simulator/src/de/dhbw/horb/simulator/view/SimulatorView.java b/de.dhbw.horb.ksm.simulator/src/de/dhbw/horb/simulator/view/SimulatorView.java
new file mode 100644
index 0000000..2cdf737
--- /dev/null
+++ b/de.dhbw.horb.ksm.simulator/src/de/dhbw/horb/simulator/view/SimulatorView.java
@@ -0,0 +1,184 @@
+package de.dhbw.horb.simulator.view;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.EventObject;
+
+import org.eclipse.gef.commands.CommandStack;
+import org.eclipse.gef.commands.CommandStackListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.part.IPage;
+import org.eclipse.ui.part.MessagePage;
+import org.eclipse.ui.part.Page;
+import org.eclipse.ui.part.PageBook;
+import org.eclipse.ui.part.PageBookView;
+import org.eclipse.ui.part.PageSite;
+import org.swtchart.Chart;
+import org.swtchart.ILineSeries;
+import org.swtchart.ISeries.SeriesType;
+
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.editor.ui.DiagramEditor;
+import de.dhbw.horb.ksm.model.api.Node;
+
+public class SimulatorView extends PageBookView {
+ public final static String VIEW_ID = "ksm.simulator.views.SimulatorView";
+
+ private final String message = "No compatible Editor selected";
+
+ @Override
+ public void setFocus() {
+
+ }
+
+ @Override
+ protected IPage createDefaultPage(PageBook book) {
+ MessagePage page = new MessagePage();
+ initPage(page);
+ page.createControl(book);
+ page.setMessage(message);
+ return page;
+ }
+
+ @Override
+ protected PageRec doCreatePage(IWorkbenchPart part) {
+ if (part instanceof DiagramEditor) {
+ DiagramEditor editor = (DiagramEditor) part;
+ SimulatorPage page = new SimulatorPage(editor);
+ page.init(new PageSite(getViewSite()));
+ page.createControl(getPageBook());
+ return new PageRec(part, page);
+ }
+ return null;
+ }
+
+ @Override
+ protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
+ pageRecord.page.dispose();
+ pageRecord.dispose();
+ }
+
+ @Override
+ protected IWorkbenchPart getBootstrapPart() {
+ IWorkbenchPage page = getSite().getPage();
+ if (page != null) {
+ return page.getActiveEditor();
+ }
+ return null;
+ }
+
+ @Override
+ protected boolean isImportant(IWorkbenchPart part) {
+ return (part instanceof DiagramEditor);
+ }
+
+ private class SimulatorPage extends Page implements CommandStackListener {
+ private Chart chart;
+ private ILineSeries xPositionSeries;
+ private final DiagramEditor editor;
+ private ILineSeries yPositionSeries;
+
+ public SimulatorPage(DiagramEditor editor) {
+ this.editor = editor;
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ chart = new Chart(parent, SWT.NONE);
+
+ chart.getTitle().setVisible(false);
+ chart.getAxisSet().getXAxis(0).getTitle().setText("KSM Knoten");
+ chart.getAxisSet().getYAxis(0).getTitle().setText("Position");
+
+ xPositionSeries = (ILineSeries) chart.getSeriesSet().createSeries(
+ SeriesType.LINE, "X-Position");
+ xPositionSeries.setLineColor(Display.getCurrent().getSystemColor(
+ SWT.COLOR_BLUE));
+ yPositionSeries = (ILineSeries) chart.getSeriesSet().createSeries(
+ SeriesType.LINE, "Y-Position");
+ yPositionSeries.setLineColor(Display.getCurrent().getSystemColor(
+ SWT.COLOR_RED));
+
+ // Enable Strings as X-Axis Ticks
+ chart.getAxisSet().getXAxes()[0].enableCategory(true);
+
+ refresh();
+
+ ((CommandStack) editor.getAdapter(CommandStack.class))
+ .addCommandStackListener(this);
+ }
+
+ @Override
+ public void commandStackChanged(EventObject event) {
+ refresh();
+ }
+
+ private void refresh() {
+ ArrayList<int[]> listXY = new ArrayList<int[]>();
+ ArrayList<String> listCaptions = new ArrayList<String>();
+ for (Node n : editor.getModel().getAllNodes()) {
+ BigInteger locationX = n
+ .getProperties()
+ .getInteger(
+ ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODE_VISUAL_LOCATION_X));
+ BigInteger locationY = n
+ .getProperties()
+ .getInteger(
+ ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODE_VISUAL_LOCATION_Y));
+ listXY.add(new int[] { locationX.intValue(),
+ locationY.intValue() });
+
+ String caption = n
+ .getProperties()
+ .getString(
+ ModelProperties.INSTANCE
+ .stripType(ModelProperties.INSTANCE.NODE_VISUAL_CAPTION));
+ listCaptions.add(caption);
+ }
+ double[] seriesX = new double[listXY.size()];
+ double[] seriesY = new double[listXY.size()];
+ String[] xCaption = new String[listXY.size()];
+ for (int i = 0; i < listXY.size(); i++) {
+ seriesX[i] = listXY.get(i)[0];
+ seriesY[i] = listXY.get(i)[1];
+ xCaption[i] = listCaptions.get(i);
+ }
+
+ // Set Y-Axis Data
+ xPositionSeries.setYSeries(seriesX);
+ yPositionSeries.setYSeries(seriesY);
+
+ // Set X-Axis Description
+ chart.getAxisSet().getXAxes()[0].setCategorySeries(xCaption);
+
+ // adjust the axis range and redraw
+ chart.getAxisSet().adjustRange();
+ chart.redraw();
+ }
+
+ @Override
+ public Control getControl() {
+ return chart;
+ }
+
+ @Override
+ public void setFocus() {
+ chart.setFocus();
+ }
+
+ @Override
+ public void dispose() {
+ ((CommandStack) editor.getAdapter(CommandStack.class))
+ .removeCommandStackListener(this);
+ super.dispose();
+ chart.dispose();
+ }
+ }
+}
diff --git a/de.dhbw.horb.ksm.tableeditor/.classpath b/de.dhbw.horb.ksm.tableeditor/.classpath
new file mode 100644
index 0000000..ad32c83
--- /dev/null
+++ b/de.dhbw.horb.ksm.tableeditor/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/de.dhbw.horb.ksm.tableeditor/.gitignore b/de.dhbw.horb.ksm.tableeditor/.gitignore
new file mode 100644
index 0000000..e660fd9
--- /dev/null
+++ b/de.dhbw.horb.ksm.tableeditor/.gitignore
@@ -0,0 +1 @@
+bin/
diff --git a/de.dhbw.horb.ksm.tableeditor/.project b/de.dhbw.horb.ksm.tableeditor/.project
new file mode 100644
index 0000000..428ea49
--- /dev/null
+++ b/de.dhbw.horb.ksm.tableeditor/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>de.dhbw.horb.ksm.tableeditor</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/de.dhbw.horb.ksm.tableeditor/.settings/org.eclipse.jdt.core.prefs b/de.dhbw.horb.ksm.tableeditor/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..7589268
--- /dev/null
+++ b/de.dhbw.horb.ksm.tableeditor/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Thu Apr 14 00:03:26 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/de.dhbw.horb.ksm.tableeditor/META-INF/MANIFEST.MF b/de.dhbw.horb.ksm.tableeditor/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..eda24a5
--- /dev/null
+++ b/de.dhbw.horb.ksm.tableeditor/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: KSM TableEditor
+Bundle-SymbolicName: de.dhbw.horb.ksm.tableeditor;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Fragment-Host: de.dhbw.horb.ksm.core;bundle-version="1.0.0.qualifier"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ClassPath: .
+Require-Bundle: org.eclipse.core.boot;bundle-version="3.1.200"
diff --git a/de.dhbw.horb.ksm.tableeditor/build.properties b/de.dhbw.horb.ksm.tableeditor/build.properties
new file mode 100644
index 0000000..a396e88
--- /dev/null
+++ b/de.dhbw.horb.ksm.tableeditor/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ fragment.xml
+source.. = src/
diff --git a/de.dhbw.horb.ksm.tableeditor/fragment.xml b/de.dhbw.horb.ksm.tableeditor/fragment.xml
new file mode 100644
index 0000000..867b95b
--- /dev/null
+++ b/de.dhbw.horb.ksm.tableeditor/fragment.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<fragment>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ category="ksm.core.views.KSMCategory"
+ class="de.dhbw.horb.tableeditor.view.TableEditorView"
+ icon="icons/16/ksm-tableeditor.png"
+ id="de.dhbw.horb.ksm.tableditor.view"
+ name="Table Editor"
+ restorable="true">
+ </view>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectives">
+ <perspective
+ class="de.dhbw.horb.tableeditor.perspective.TableEditorPerspective"
+ fixed="true"
+ icon="icons/32/ksm-tableeditor.png"
+ id="ksm.tableeditor.perspectives.TableEditorPerspective"
+ name="Table Editor">
+ <description>
+ Table Editor Perspective
+ </description>
+ </perspective>
+ </extension>
+</fragment>
diff --git a/de.dhbw.horb.ksm.tableeditor/icons/16/ksm-tableeditor.png b/de.dhbw.horb.ksm.tableeditor/icons/16/ksm-tableeditor.png
new file mode 100644
index 0000000..cfd515e
--- /dev/null
+++ b/de.dhbw.horb.ksm.tableeditor/icons/16/ksm-tableeditor.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.tableeditor/icons/32/ksm-tableeditor.png b/de.dhbw.horb.ksm.tableeditor/icons/32/ksm-tableeditor.png
new file mode 100644
index 0000000..16d54a6
--- /dev/null
+++ b/de.dhbw.horb.ksm.tableeditor/icons/32/ksm-tableeditor.png
Binary files differ
diff --git a/de.dhbw.horb.ksm.tableeditor/src/de/dhbw/horb/tableeditor/perspective/TableEditorPerspective.java b/de.dhbw.horb.ksm.tableeditor/src/de/dhbw/horb/tableeditor/perspective/TableEditorPerspective.java
new file mode 100644
index 0000000..9fc3945
--- /dev/null
+++ b/de.dhbw.horb.ksm.tableeditor/src/de/dhbw/horb/tableeditor/perspective/TableEditorPerspective.java
@@ -0,0 +1,37 @@
+package de.dhbw.horb.tableeditor.perspective;
+
+
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+import de.dhbw.horb.tableeditor.view.TableEditorView;
+
+public class TableEditorPerspective implements IPerspectiveFactory {
+ public static final String ID = "ksm.tableeditor.perspectives.TableEditorPerspective"; //$NON-NLS-N$
+ private IPageLayout factory;
+
+ public TableEditorPerspective() {
+ super();
+ }
+
+ public void createInitialLayout(IPageLayout factory) {
+ this.factory = factory;
+ factory.setEditorAreaVisible(true);
+ addViews();
+ }
+
+ private void addViews() {
+ IFolderLayout topLeft = factory.createFolder("topLeft", //$NON-NLS-N$
+ IPageLayout.LEFT, 0.30f, factory.getEditorArea());
+
+ topLeft.addView(de.dhbw.horb.ksm.core.view.Navigator.VIEW_ID);
+
+ IFolderLayout topRight = factory.createFolder("topRight",
+ IPageLayout.RIGHT, 0.30f, factory.getEditorArea());
+ topRight.addView(TableEditorView.VIEW_ID);
+// topRight.addView("org.eclipse.ui.views.ContentOutline"); //$NON-NLS-N$
+
+ // org.eclipse.ui.internal.PerspectiveBarNewContributionItem
+ }
+} \ No newline at end of file
diff --git a/de.dhbw.horb.ksm.tableeditor/src/de/dhbw/horb/tableeditor/view/PropertyLabelProvider.java b/de.dhbw.horb.ksm.tableeditor/src/de/dhbw/horb/tableeditor/view/PropertyLabelProvider.java
new file mode 100644
index 0000000..dd278fa
--- /dev/null
+++ b/de.dhbw.horb.ksm.tableeditor/src/de/dhbw/horb/tableeditor/view/PropertyLabelProvider.java
@@ -0,0 +1,75 @@
+package de.dhbw.horb.tableeditor.view;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.model.api.Connection;
+import de.dhbw.horb.ksm.model.api.KSM;
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+import de.dhbw.horb.ksm.model.api.Properties;
+
+public class PropertyLabelProvider extends ColumnLabelProvider {
+ private final String propertyName;
+
+ public PropertyLabelProvider(String propertyName) {
+ this.propertyName = propertyName;
+ }
+
+ @Override
+ public String getText(Object element) {
+ String value = null;
+ Properties properties = null;
+ if (element instanceof KSM) {
+ properties = ((KSM) element).getProperties();
+ } else if (element instanceof NodeGroup) {
+ properties = ((NodeGroup) element).getProperties();
+ } else if (element instanceof Node) {
+ properties = ((Node) element).getProperties();
+ } else if (element instanceof Connection) {
+ properties = ((Connection) element).getProperties();
+ }
+
+ if (properties != null) {
+ String type = ModelProperties.INSTANCE.type(propertyName);
+ String name = ModelProperties.INSTANCE.name(propertyName);
+ if ("string".equals(type)) {
+ value = properties.getString(name);
+ if (value == null) {
+ value = "<null>";
+ }
+ } else if ("decimal".equals(type)) {
+ BigDecimal bigDecimal = properties.getDecimal(name);
+ if (bigDecimal == null) {
+ value = "<null>";
+ } else {
+ value = bigDecimal.toPlainString();
+ }
+ } else if ("integer".equals(type)) {
+ BigInteger bigInteger = properties.getInteger(name);
+ if (bigInteger == null) {
+ value = "<null>";
+ } else {
+ value = bigInteger.toString();
+ }
+ } else if ("boolean".equals(type)) {
+ // TODO nullchecks...
+ value = properties.getBoolean(name).toString();
+ } else if ("stringList".equals(type)) {
+ value = properties.getStringList(name).toString();
+ } else if ("decimalList".equals(type)) {
+ value = properties.getDecimalList(name).toString();
+ } else if ("integerList".equals(type)) {
+ value = properties.getIntegerList(name).toString();
+ }
+ }
+ if (value == null) {
+ return "<null>";
+ } else {
+ return value;
+ }
+ }
+}
diff --git a/de.dhbw.horb.ksm.tableeditor/src/de/dhbw/horb/tableeditor/view/TableEditorView.java b/de.dhbw.horb.ksm.tableeditor/src/de/dhbw/horb/tableeditor/view/TableEditorView.java
new file mode 100644
index 0000000..886c24d
--- /dev/null
+++ b/de.dhbw.horb.ksm.tableeditor/src/de/dhbw/horb/tableeditor/view/TableEditorView.java
@@ -0,0 +1,281 @@
+package de.dhbw.horb.tableeditor.view;
+
+import java.util.ArrayList;
+import java.util.EventObject;
+import java.util.List;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gef.commands.CommandStack;
+import org.eclipse.gef.commands.CommandStackListener;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.jface.viewers.EditingSupport;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.part.IPage;
+import org.eclipse.ui.part.MessagePage;
+import org.eclipse.ui.part.Page;
+import org.eclipse.ui.part.PageBook;
+import org.eclipse.ui.part.PageBookView;
+import org.eclipse.ui.part.PageSite;
+
+import de.dhbw.horb.ksm.core.Activator;
+import de.dhbw.horb.ksm.core.editor.commands.NodeRenameCommand;
+import de.dhbw.horb.ksm.core.editor.model.ModelProperties;
+import de.dhbw.horb.ksm.core.editor.parts.KSMNodeEditPart;
+import de.dhbw.horb.ksm.core.editor.ui.DiagramEditor;
+import de.dhbw.horb.ksm.model.api.KSM;
+import de.dhbw.horb.ksm.model.api.Node;
+
+public class TableEditorView extends PageBookView {
+ public static final String VIEW_ID = "de.dhbw.horb.ksm.tableditor.view"; //$NON-NLS-1$
+ private final String message = "No compatible Editor selected";
+
+ @Override
+ public void setFocus() {
+
+ }
+
+ @Override
+ protected IPage createDefaultPage(PageBook book) {
+ MessagePage page = new MessagePage();
+ initPage(page);
+ page.createControl(book);
+ page.setMessage(message);
+ return page;
+ }
+
+ @Override
+ protected PageRec doCreatePage(IWorkbenchPart part) {
+ if (part instanceof DiagramEditor) {
+ DiagramEditor editor = (DiagramEditor) part;
+ TableEditorPage page = new TableEditorPage(editor);
+ page.init(new PageSite(getViewSite()));
+ page.createControl(getPageBook());
+ return new PageRec(part, page);
+ }
+ return null;
+ }
+
+ @Override
+ protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
+ pageRecord.page.dispose();
+ pageRecord.dispose();
+ }
+
+ @Override
+ protected IWorkbenchPart getBootstrapPart() {
+ IWorkbenchPage page = getSite().getPage();
+ if (page != null) {
+ return page.getActiveEditor();
+ }
+ return null;
+ }
+
+ @Override
+ protected boolean isImportant(IWorkbenchPart part) {
+ return (part instanceof DiagramEditor);
+ }
+
+ public class TableEditorPage extends Page implements CommandStackListener {
+ private final DiagramEditor editor;
+ private TableViewer tableViewer;
+ private final String columnCaptionCaption = "Caption";
+ private final String columnCaptionX = "X";
+
+ public TableEditorPage(DiagramEditor editor) {
+ this.editor = editor;
+ }
+
+ @Override
+ public void createControl(final Composite parent) {
+ // Create a Table Viewer with Single-Selection Support
+ tableViewer = new TableViewer(parent, SWT.SINGLE);
+ tableViewer.getTable().setLinesVisible(true);
+ tableViewer.getTable().setHeaderVisible(true);
+
+ TableViewerColumn tableViewerColumnCaption = new TableViewerColumn(
+ tableViewer, SWT.NONE);
+ tableViewerColumnCaption
+ .setLabelProvider(new PropertyLabelProvider(
+ ModelProperties.INSTANCE.NODE_VISUAL_CAPTION));
+ tableViewerColumnCaption
+ .setEditingSupport(new StringPropertyEditingSupport(editor,
+ tableViewer.getTable(), tableViewerColumnCaption
+ .getViewer(),
+ ModelProperties.INSTANCE.NODE_VISUAL_CAPTION));
+
+ TableColumn columnCaption = tableViewerColumnCaption.getColumn();
+ columnCaption.setText(columnCaptionCaption);
+ columnCaption.setWidth(100);
+ columnCaption.setResizable(true);
+ columnCaption.setMoveable(true);
+
+ TableViewerColumn tableViewerColumnX = new TableViewerColumn(
+ tableViewer, SWT.NONE);
+ tableViewerColumnX.setLabelProvider(new PropertyLabelProvider(
+ ModelProperties.INSTANCE.NODE_VISUAL_LOCATION_X));
+
+ TableColumn columnX = tableViewerColumnX.getColumn();
+ columnX.setText(columnCaptionX);
+ columnX.setWidth(100);
+ columnX.setResizable(true);
+ columnX.setMoveable(true);
+
+ tableViewer.setContentProvider(new ArrayContentProvider());
+
+ ((CommandStack) editor.getAdapter(CommandStack.class))
+ .addCommandStackListener(this);
+ refreshTable();
+
+ editor.getEditorSite()
+ .getSelectionProvider()
+ .addSelectionChangedListener(
+ new ISelectionChangedListener() {
+
+ @Override
+ public void selectionChanged(
+ SelectionChangedEvent event) {
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection s = (IStructuredSelection) selection;
+ System.out.println(s.getFirstElement());
+ if (s.getFirstElement() instanceof KSMNodeEditPart) {
+ KSMNodeEditPart nodeEditPart = (KSMNodeEditPart) s
+ .getFirstElement();
+ System.out.println(nodeEditPart
+ .getModel());
+ tableViewer.setSelection(
+ new StructuredSelection(
+ nodeEditPart
+ .getModel()),
+ true);
+ }
+ }
+ }
+ });
+
+ }
+
+ protected void refreshTable() {
+ KSM model = editor.getModel();
+ List<Node> list = new ArrayList<Node>();
+ for (Node node : model.getAllNodes()) {
+ list.add(node); // XXX change getAllNodes to return a list
+ }
+ tableViewer.setInput(list.toArray());
+ }
+
+ @Override
+ public Control getControl() {
+ return tableViewer.getControl();
+ }
+
+ @Override
+ public void setFocus() {
+ tableViewer.getTable().setFocus();
+ }
+
+ @Override
+ public void commandStackChanged(EventObject event) {
+ refreshTable();
+ }
+
+ @Override
+ public void dispose() {
+ ((CommandStack) editor.getAdapter(CommandStack.class))
+ .removeCommandStackListener(this);
+ super.dispose();
+ }
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ }
+
+ public class StringPropertyEditingSupport extends EditingSupport {
+ private final String stringPropertyName;
+ private final Table table;
+ private final DiagramEditor editor;
+
+ public StringPropertyEditingSupport(DiagramEditor editor,
+ final Table table, final ColumnViewer columnViewer,
+ final String stringPropertyName) {
+ super(columnViewer);
+ this.editor = editor;
+ this.table = table;
+ this.stringPropertyName = ModelProperties.INSTANCE
+ .stripType(stringPropertyName);
+ }
+
+ @Override
+ protected void setValue(Object element, Object value) {
+ if (element instanceof Node && value instanceof String) {
+ CommandStack commandStack = (CommandStack) editor
+ .getAdapter(CommandStack.class);
+ GraphicalViewer graphicalViewer = (GraphicalViewer) editor
+ .getAdapter(GraphicalViewer.class);
+
+ Object object = graphicalViewer.getEditPartRegistry().get(
+ element);
+ if (object instanceof KSMNodeEditPart) {
+ KSMNodeEditPart ep = (KSMNodeEditPart) object;
+ NodeRenameCommand nodeRenameCommand = new NodeRenameCommand(
+ ep);
+ nodeRenameCommand.setNewCaption((String) value);
+ commandStack.execute(nodeRenameCommand);
+ } else {
+ Platform.getLog(Platform.getBundle(Activator.PLUGIN_ID))
+ .log(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
+ "Cant get EditPart for "
+ + element.toString()));
+ }
+ }
+ }
+
+ @Override
+ protected Object getValue(Object element) {
+ if (element instanceof Node) {
+ return ((Node) element).getProperties().getString(
+ stringPropertyName);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ protected CellEditor getCellEditor(Object element) {
+ if (element instanceof Node) {
+ String value = (String) getValue(element);
+ TextCellEditor textCellEditor = new TextCellEditor(table);
+ textCellEditor.setValue(value);
+ return textCellEditor;
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ protected boolean canEdit(Object element) {
+ return true;
+ }
+ }
+}
diff --git a/ksm-model/.classpath b/ksm-model/.classpath
new file mode 100644
index 0000000..9a299c7
--- /dev/null
+++ b/ksm-model/.classpath
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="test"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+ <classpathentry kind="lib" path="lib/mockito-all-1.8.5.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/ksm-model/.gitignore b/ksm-model/.gitignore
new file mode 100644
index 0000000..9e80e4d
--- /dev/null
+++ b/ksm-model/.gitignore
@@ -0,0 +1,3 @@
+bin
+bin-test
+test-results
diff --git a/ksm-model/.project b/ksm-model/.project
new file mode 100644
index 0000000..1fb1c58
--- /dev/null
+++ b/ksm-model/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ksm-model</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/ksm-model/build.xml b/ksm-model/build.xml
new file mode 100644
index 0000000..e349d65
--- /dev/null
+++ b/ksm-model/build.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="ksm-datamodel" default="package" basedir=".">
+ <property name="project.name" value="ksm-model" />
+ <property name="project.version" value="1" />
+
+ <filelist id="classpath.compile">
+ <file name="lib/jaxb-api.jar" />
+ </filelist>
+
+ <filelist id="classpath.test">
+ <file name="lib/jaxb-api.jar" />
+ <file name="lib/jaxb-impl.jar" />
+ <file name="lib/junit-4.8.2.jar" />
+ <file name="lib/hamcrest.jar" />
+ <file name="lib/mockito-all-1.8.5.jar" />
+ <file name="bin" />
+ <file name="bin-test" />
+ </filelist>
+
+ <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
+ <classpath>
+ <fileset dir="lib" includes="*.jar" />
+ </classpath>
+ </taskdef>
+
+ <target name="clean" description="Säubert das Projektverzeichnis von temporären Daten">
+ <delete dir="bin" />
+ <delete dir="bin-test" />
+ <delete dir="test-results" />
+ </target>
+
+ <target name="compile" description="Kompiliert die Java Units">
+ <mkdir dir="bin" />
+ <javac srcdir="src" destdir="bin" includeantruntime="false">
+ <classpath>
+ <filelist refid="classpath.compile" />
+ </classpath>
+ </javac>
+ </target>
+
+ <target name="package" depends="clean,compile" description="Erzeugt ein Java Archive zum Verteilen der Library">
+ <jar destfile="${project.name}-${project.version}.jar">
+ <fileset dir="bin" includes="**/*" />
+ </jar>
+ </target>
+
+ <target name="test" depends="compile" description="Lässt junit-Tests laufen">
+ <mkdir dir="bin-test" />
+ <mkdir dir="test-results" />
+ <javac srcdir="test" destdir="bin-test" includeantruntime="false">
+ <classpath>
+ <filelist refid="classpath.test" />
+ </classpath>
+ </javac>
+ <junit showoutput="true">
+ <classpath>
+ <filelist refid="classpath.test" />
+ </classpath>
+ <batchtest todir="test-results">
+ <fileset dir="bin-test" includes="**/Test*" />
+ <formatter type="plain" />
+ </batchtest>
+ </junit>
+ </target>
+
+ <target name="compile-xml" description="Kompiliert das XML-Schema zu Java Klassen">
+ <delete failonerror="false">
+ <fileset dir="src/de/dhbw/horb/ksm/model/generated" />
+ </delete>
+ <xjc schema="xml/ksm-${project.version}.xsd" destdir="src" package="de.dhbw.horb.ksm.model.generated" />
+ </target>
+</project>
diff --git a/ksm-model/doc/Altes Format.txt b/ksm-model/doc/Altes Format.txt
new file mode 100644
index 0000000..e585a4a
--- /dev/null
+++ b/ksm-model/doc/Altes Format.txt
@@ -0,0 +1,257 @@
+KSM RCP (SA-1) Format:
+======================
+
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<diagram>
+ <connections>
+ <connection>
+ <source>1c862df6-80e5-445b-a41c-ed677973abfb</source>
+ <target>e36a0368-d8f6-40a2-bd29-375352045da8</target>
+ </connection>
+ </connections>
+ <nodes name="Node 01">
+ <id>1c862df6-80e5-445b-a41c-ed677973abfb</id>
+ <location>
+ <x>128</x>
+ <y>90</y>
+ </location>
+ <nodeProperties/>
+ </nodes>
+ <nodes name="Node 11">
+ <id>e36a0368-d8f6-40a2-bd29-375352045da8</id>
+ <location>
+ <x>531</x>
+ <y>104</y>
+ </location>
+ <nodeProperties/>
+ </nodes>
+</diagram>
+
+
+KSM/Swing Format:
+=================
+
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<KyberneticSystemModel>
+ <nodes>
+ <node>
+ <node_ID>0</node_ID>
+ <x_pos>469</x_pos>
+ <y_pos>423</y_pos>
+ <name>new_Node_0</name>
+ <comment />
+ <allowModeration>false</allowModeration>
+ <moderationsteps>1</moderationsteps>
+ <Moderation>1.0</Moderation>
+ <adaptionRate>0.2</adaptionRate>
+ <Reaction>1.0</Reaction>
+ <moderationMethod>linear</moderationMethod>
+ <color>White</color>
+ <std_height>50</std_height>
+ <std_width>220</std_width>
+ <bShowProgressBar>true</bShowProgressBar>
+ <bCustomizeNodeTransparent>false</bCustomizeNodeTransparent>
+ <bCustomizeNodeBorder>true</bCustomizeNodeBorder>
+ <iTextVerticalFactor>33</iTextVerticalFactor>
+ <sIconPath />
+ <scaleFct>
+ </scaleFct>
+ <belongsToHierarchy>0</belongsToHierarchy>
+ <hierarchyDepth>0</hierarchyDepth>
+ <useScaleFct>false</useScaleFct>
+ <inWeightEdges>
+ <inWeightEdge>
+ <tupel_value>0.0</tupel_value>
+ </inWeightEdge>
+ <inWeightEdge>
+ <tupel_value>1.0</tupel_value>
+ </inWeightEdge>
+ <inWeightEdge>
+ <tupel_value>0.0</tupel_value>
+ </inWeightEdge>
+ </inWeightEdges>
+ <UserValue>
+ <tupel_value>3.0</tupel_value>
+ </UserValue>
+ <MinValue>
+ <tupel_value>0.0</tupel_value>
+ </MinValue>
+ <MaxValue>
+ <tupel_value>5.0</tupel_value>
+ </MaxValue>
+ <extern>
+ <tupel_value>0.0</tupel_value>
+ </extern>
+ <scaleCoeffizient>1.0</scaleCoeffizient>
+ </node>
+ <node>
+ <node_ID>1</node_ID>
+ <x_pos>299</x_pos>
+ <y_pos>216</y_pos>
+ <name>new_Node_1</name>
+ <comment />
+ <allowModeration>false</allowModeration>
+ <moderationsteps>1</moderationsteps>
+ <Moderation>1.0</Moderation>
+ <adaptionRate>0.2</adaptionRate>
+ <Reaction>1.0</Reaction>
+ <moderationMethod>linear</moderationMethod>
+ <color>White</color>
+ <std_height>50</std_height>
+ <std_width>220</std_width>
+ <bShowProgressBar>true</bShowProgressBar>
+ <bCustomizeNodeTransparent>false</bCustomizeNodeTransparent>
+ <bCustomizeNodeBorder>true</bCustomizeNodeBorder>
+ <iTextVerticalFactor>33</iTextVerticalFactor>
+ <sIconPath />
+ <scaleFct>
+ </scaleFct>
+ <belongsToHierarchy>0</belongsToHierarchy>
+ <hierarchyDepth>0</hierarchyDepth>
+ <useScaleFct>false</useScaleFct>
+ <inWeightEdges>
+ <inWeightEdge>
+ <tupel_value>0.0</tupel_value>
+ </inWeightEdge>
+ <inWeightEdge>
+ <tupel_value>0.0</tupel_value>
+ </inWeightEdge>
+ <inWeightEdge>
+ <tupel_value>0.0</tupel_value>
+ </inWeightEdge>
+ </inWeightEdges>
+ <UserValue>
+ <tupel_value>3.0</tupel_value>
+ </UserValue>
+ <MinValue>
+ <tupel_value>0.0</tupel_value>
+ </MinValue>
+ <MaxValue>
+ <tupel_value>5.0</tupel_value>
+ </MaxValue>
+ <extern>
+ <tupel_value>0.0</tupel_value>
+ </extern>
+ <scaleCoeffizient>1.0</scaleCoeffizient>
+ </node>
+ <node>
+ <node_ID>2</node_ID>
+ <x_pos>650</x_pos>
+ <y_pos>257</y_pos>
+ <name>new_Node_2</name>
+ <comment />
+ <allowModeration>false</allowModeration>
+ <moderationsteps>1</moderationsteps>
+ <Moderation>1.0</Moderation>
+ <adaptionRate>0.2</adaptionRate>
+ <Reaction>1.0</Reaction>
+ <moderationMethod>linear</moderationMethod>
+ <color>White</color>
+ <std_height>50</std_height>
+ <std_width>220</std_width>
+ <bShowProgressBar>true</bShowProgressBar>
+ <bCustomizeNodeTransparent>false</bCustomizeNodeTransparent>
+ <bCustomizeNodeBorder>true</bCustomizeNodeBorder>
+ <iTextVerticalFactor>33</iTextVerticalFactor>
+ <sIconPath />
+ <scaleFct>
+ </scaleFct>
+ <belongsToHierarchy>0</belongsToHierarchy>
+ <hierarchyDepth>0</hierarchyDepth>
+ <useScaleFct>false</useScaleFct>
+ <inWeightEdges>
+ <inWeightEdge>
+ <tupel_value>1.0</tupel_value>
+ </inWeightEdge>
+ <inWeightEdge>
+ <tupel_value>0.0</tupel_value>
+ </inWeightEdge>
+ <inWeightEdge>
+ <tupel_value>0.0</tupel_value>
+ </inWeightEdge>
+ </inWeightEdges>
+ <UserValue>
+ <tupel_value>3.0</tupel_value>
+ </UserValue>
+ <MinValue>
+ <tupel_value>0.0</tupel_value>
+ </MinValue>
+ <MaxValue>
+ <tupel_value>5.0</tupel_value>
+ </MaxValue>
+ <extern>
+ <tupel_value>0.0</tupel_value>
+ </extern>
+ <scaleCoeffizient>1.0</scaleCoeffizient>
+ </node>
+ </nodes>
+ <arrows>
+ <arrow>
+ <start_node>1</start_node>
+ <end_node>0</end_node>
+ <start_pos>6</start_pos>
+ <end_pos>1</end_pos>
+ <bend_xpos>497</bend_xpos>
+ <bend_ypos>313</bend_ypos>
+ <saved>true</saved>
+ <funcType>gui.functions.FuncStraightLine</funcType>
+ <arrowfunction>
+ <m>1.0</m>
+ <b>0.0</b>
+ <position>0</position>
+ <FuncDraggingPoints>
+ <FuncDraggingPoint>
+ <moveHorz>false</moveHorz>
+ <moveVert>true</moveVert>
+ <first>true</first>
+ <last>false</last>
+ <funcPx>0.0</funcPx>
+ <funcPy>0.0</funcPy>
+ </FuncDraggingPoint>
+ <FuncDraggingPoint>
+ <moveHorz>false</moveHorz>
+ <moveVert>true</moveVert>
+ <first>false</first>
+ <last>true</last>
+ <funcPx>1.0</funcPx>
+ <funcPy>1.0</funcPy>
+ </FuncDraggingPoint>
+ </FuncDraggingPoints>
+ </arrowfunction>
+ </arrow>
+ <arrow>
+ <start_node>0</start_node>
+ <end_node>2</end_node>
+ <start_pos>3</start_pos>
+ <end_pos>8</end_pos>
+ <bend_xpos>674</bend_xpos>
+ <bend_ypos>388</bend_ypos>
+ <saved>true</saved>
+ <funcType>gui.functions.FuncStraightLine</funcType>
+ <arrowfunction>
+ <m>1.0</m>
+ <b>0.0</b>
+ <position>0</position>
+ <FuncDraggingPoints>
+ <FuncDraggingPoint>
+ <moveHorz>false</moveHorz>
+ <moveVert>true</moveVert>
+ <first>true</first>
+ <last>false</last>
+ <funcPx>0.0</funcPx>
+ <funcPy>0.0</funcPy>
+ </FuncDraggingPoint>
+ <FuncDraggingPoint>
+ <moveHorz>false</moveHorz>
+ <moveVert>true</moveVert>
+ <first>false</first>
+ <last>true</last>
+ <funcPx>1.0</funcPx>
+ <funcPy>1.0</funcPy>
+ </FuncDraggingPoint>
+ </FuncDraggingPoints>
+ </arrowfunction>
+ </arrow>
+ </arrows>
+ <hierarchies />
+</KyberneticSystemModel>
diff --git a/ksm-model/doc/KSM-Datamodel.asciidoc b/ksm-model/doc/KSM-Datamodel.asciidoc
new file mode 100644
index 0000000..1bc1634
--- /dev/null
+++ b/ksm-model/doc/KSM-Datamodel.asciidoc
@@ -0,0 +1,289 @@
+KSM Datenmodell
+===============
+Yves Fischer <i08005@ba-horb.de>
+
+:lang: de
+:doctype: book
+:toc:
+:toc-title: Inhaltsbla
+:encoding: utf-8
+:data-uri:
+
+
+Einleitung
+----------
+Mit der Entwicklung einer KSM Anwendung auf Eclipse-RCP Basis war es
+nötig ein Datenmodell zu entwerfen welches zum MVC-ähnlichen Muster
+des Eclipse Graphical Editor Framework (GEF) kompatibel ist.
+
+Grundsätzlich lassen sich alle Datenmodelle mit GEF abbilden, jedoch existierte
+in KSM/Swing nur ein stark mit der GUI und Logik verflochtenes und fehlerhaftes
+Datenmodell, dessen Serialisierung mit einer XML-Bibliothek erfolgte die nicht
+mehr weiter verwendet werden soll.
+
+Da es nicht beabsichtigt ist die KSM/Swing Anwendung auf kurze Zeit abzulösen
+liegt es nahe, dass das Datenmodell universell einsetzbar sein sollte.
+Mit der Umstellung von KSM/Swing auf ein neues Datenmodell ist einerseits
+die Daten-Kompatibiltät zwischen KSM/Swing und KSM/RCP gegeben und das
+Ziel die XML-Serialisierung in KSM/Swing zu überarbeiten kann einfacher erreicht
+werden.
+
+Dieses Dokument beschreibt die Implementation einer API zum Zugriff auf
+das in XML-Schema beschriebene Datenformat.
+
+Dieses Datenformat erlaubt es darüberhinaus freie Felder zu definieren welche
+ebenfalls in diesem Dokument spezifiert werden.
+
+Das XML-Schema
+--------------
+Die Namespace URL für das XML-Schema lautet:
+
+ http://www.ba-horb.de/~ksm/xml/ksm-1
+
+die Schemadatei ist abrufbar unter:
+
+ http://www.ba-horb.de/~ksm/xml/ksm-1.xsd
+
+Das XML-Schema ist angereichert um JAXB-Annotationen die den XML-Schema-Java-Compiler
+bei der Klassenerzeugung steuert.
+
+Typen des Datenmodell
+---------------------
+Die Bibltiohekt besteht aus einem Package in dem Interfaces die API-Beschreiben
+und einem Package mit Implementationen dieser Interfaces die jedoch für den Benutzer
+unsichtbar und daher austauschbar sind.
+
+Das folgende Diagram zeigt das Interface das dem Benutzer zur Verfügung steht:
+
+ de.dhbw.horb.ksm. xmlschema.api
+ +----------------------------------------------------------+
+ | +-------------+ +---------------+ +------------+ |
+ | |_____KSM_____| *|___NodeGroup___| *|____Node____| |
+ | |getNodeGroup +---+getNodeGroups()+---+getC.tions()| |
+ | |getVersion() | |getNodes() | | | |
+ | | | | | | | |
+ | +---^---------+ +---------------+ +--+---+-----+ |
+ | | \ | ________________/ | |
+ | | \1 |1 /1 |* |
+ | | +-+-----+-+--+ +---+--------+ |
+ | | |_Properties_|1 |_Connection_| |
+ | | |getString() +----------------+getTo() | |
+ | | |getInteger()| | | |
+ | | |...... | | | |
+ | | +------------+ +------------+ |
+ | | |
+ +----------------------------------------------------------+
+ |
+ de.dhbw.horb.ksm. xmlschema.impl
+ +-------------------------------+
+ | | |
+ | +------------------+ |
+ | |____KSMFactory____| |
+ | |createEmptyKSM() | |
+ | |saveKSM() | |
+ | |loadKSM() | |
+ | +------------------+ |
+ +-------------------------------+
+
+
+Ein Diagramm wird erstellt indem ein neues ('createEmptyKSM()') erstellt wird oder eines
+geladen wird ('loadKSM()'). Die weitere Navigation erfolgt durch Absteigen in dem
+Objekt-Baum der durch NodeGroup- und schliesslich Node-Objekte gebildet wird.
+
+Datentypen der Eigenschaften
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Im Modell gibt es die Datentypen KSM, NodeGroup, Node und Connection (siehe Klassen-Diagramm).
+Zusätzlich gibt es die Klasse Properties mit der an die Datentypen zusätzliche Eigenschaften
+mit einem Text-Bezeichner angehängt werden können.
+
+Für die Eigenschaften stehen folgende Typen zur Verfügung: ''string'', ''integer'', ''boolean'',
+''integerList'', ''decimalList'', ''stringList''. Der Datentyp erschliesst sich aus dem Namen.
+
+Prinzipiell kann jeder Bezeichner für jeden Datentyp einmal verwendet werden, ein Bezeichner sollte
+jedoch wegen der Ãœbersichtlichkeit nur einmal verwendet werden.
+
+Verwendung der ChangeListener
+-----------------------------
+Die Klassen __NodeGroup__, __Node__ und __Properties__ implementieren Change-Listener
+auf die sich Listener-Klassen registrieren können um über Änderungen am Datenmodell
+informiert zu werden.
+
+Dies wird beispielsweise benötigt, wenn zwei Programmteile wie ein Eigenschaften-Editor
+in Tabellenform und ein grafischer Editor voneinander unabhängig auf das Datenmodell
+zugreifen und beispielsweise die Farbe eines Knoten ändern.
+
+Die Spalte 'Index' zeigt an ob das Event eine Index-Eigenschaft hat die andeutet
+welches Element in einer Liste geändert wurde.
+
+Die Spalte 'Version' zeigt an, ab welcher Version des Datenformat (=Version dieses
+Dokumentes, Version Attribut in <ksm> Element) dieser Event unterstützt wird.
+
+.__NodeGroup__-Events
+[width="80%",cols="3,2,2,10",options="header"]
+|=========================================================
+|Property-Name | Version | Index? |Beschreibung
+|nodes | 1+ | ✓ | Eine __Node__ wurde dieser __NodeGroup__
+ hinzugefügt oder entfernt
+|=========================================================
+
+.__Node__-Events
+[width="80%",cols="3,2,2,10",options="header"]
+|=========================================================
+|Property-Name | Version | Index? |Beschreibung
+|connections | 1+ | ✓ | Eine __Connection__ wurde erstellt oder gelöscht
+|=========================================================
+
+.__Properties__-Events
+[width="80%",cols="3,2,2,10",options="header"]
+|=========================================================
+|Property-Name | Version | Index? |Beschreibung
+|string: 'X' | 1+ | ✗ | Eine Zeichenketten Eigenschaft mit Name 'X' wurde geändert
+|decimal: 'X' | 1+ | ✗ | Eine Fliesskommazahl Eigenschaft mit Name 'X' wurde geändert
+|integer: 'X' | 1+ | ✗ | Eine ganzzahlige Eigenschaft mit Name 'X' wurde geändert
+|boolean: 'X' | 1+ | ✗ | Eine boolsche Eigenschaft mit Name 'X' wurde geändert
+|integerList: 'X' | 1+ | ✓ | Eine Ganzzahl Liste mit Name 'X' wurde manipuliert
+|decimalList: 'X' | 1+ | ✓ | Eine Fliesskommazahl Liste mit Name 'X' wurde manipuliert
+|stringList: 'X' | 1+ | ✓ | Eine Zeichenketten Liste mit Name 'X' wurde manipuliert
+|=========================================================
+
+Eigenschaften (Properties)
+--------------------------
+Allen Elementen im Datenmodell lassen sich dynamische, dass heist nicht in einem
+Schema festgelegte, Eigenschaften zuwiesen.
+Dies hat zur Folge, dass eine Anwendung sowohl den Fall handhaben muss, dass eine
+erwartete Eigenschaft nicht vorhanden ist als auch, dass Eigenschaften vorhanden sind
+die unbekannt sind und ignoriert werden müssen.
+Dazu steht der Anwendung jedoch das Attribut 'Version' im Schema (siehe KSM#getVersion())
+zur Verfügung, welches auf eine Version von diesem Dokument zeigt.
+
+Dieser Ansatz wurde gewählt, da sich gezeigt hat, dass die Studienarbeiten im KSM-Projekt
+einen begrenzten Fokus haben und es daher für einen einzelnen Studenten schwer möglich ist,
+alle benötigten Datenfelder zu definieren.
+Das bisherige KSM-Datenformat handhabt dies, indem das XML-Schema beliebig verändert
+wurde und damit sinnlos wurde.
+Da dies unvermeidbar ist wird es mit diesem Ansatz aktiv unterstützt.
+
+Eine alternative Herangehensweise wäre die Verwendung von verschiedenen XML-Schemas gewesen
+wobei mit jeder Erweiterung ein zusätzlicher Namensraum eingeführt wird. Dies
+schien jedoch sehr viel umständlicher und unnötig kompliziert.
+
+Eigenschaften von Modellen (KSM)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Die Spalte 'Typ' zeigt den Datentyp der Eigenschaft an. Die Spalte 'Schlüssel'
+den Bezeichner welcher in Kombination mit dem Typ eindeutig ist.
+
+Die Spalte 'Version' zeigt an, ab welcher Version des Datenformat (=Version dieses
+Dokumentes, Version Attribut in <ksm> Element) dieser Event unterstützt wird.
+
+.KSM Properties
+[width="80%",cols="3,4,2,10",options="header"]
+|=========================================================
+|Typ | Schlüssel | Version | Beschreibung
+|nichts | ist | definiert | -
+|=========================================================
+
+Eigenschaften von Knoten (Node)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.Node Properties
+[width="80%",cols="3,4,1,10",options="header"]
+|=========================================================
+|Typ | Schlüssel | Ver. | Beschreibung
+| string | visual.caption | 1+ | Titel der Node im Editor.
+| string | visual.color | 1+ | Farbliches Merkmal der Node
+ Hexadezimal im 8-Bit RGB Format
+ wie folgt: +#RRGGBB+.
+| integer | visual.location.x | 1+ | X-Position relativ zur übergeordneten NodeGroup
+| integer | visual.location.y | 1+ | Y-Position relativ zur übergeordneten NodeGroup
+| decimal | data.user_value | 1+ | User Value (?)
+| decimal | data.min_value | 1+ | Minimal Value (?)
+| decimal | data.max_value | 1+ | Maximal Value (?)
+| decimal | data.extern | 1+ | Extern Value (?)
+|=========================================================
+
+Als Erbe aus dem KSM/Swing Projekt kann ''visual.color'' die folgenden Werte
+annehmen, diese sollen auf den folgenden RGB-Wert übertragen werden:
+
+ * +White+ -> +#ffffff+
+ * +Light Yellow+ -> +#faffa2+
+ * +Medium Yellow+ -> +#f4ff4b+
+ * +Yellow+ -> +#edfc00+
+ * +Light Blue+ -> +#d4d5e9+
+ * +Medium Blue+ -> +#7678ff+
+ * +Blue+ -> +#0002f8+
+ * +Light Green+ -> +#c8f8c9+
+ * +Medium Green+ -> +#7afa7e+
+ * +Green+ -> +#1af520+
+ * +Light Red+ -> +#fdcccc+
+ * +Medium Red+ -> +#f95959+
+ * +Red+ -> +#f62020+
+
+Eigenschaften von Verbindungen (Connection)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.Connection Properties
+[width="80%",cols="3,4,1,10",options="header"]
+|=========================================================
+|Typ | Schlüssel | Ver. | Beschreibung
+| string | visual.caption | 1+ | Titel der Connection im Editor.
+| string | visual.color | 1+ | Farbliches Merkmal der Connection
+| string | data.functionType | 1+ | Ein Funktionstyp von:
+ 'straight-line', 'individual',
+ 'parable', 'parabolic-sections'.
+| decimalList | data.function | 1+ | KSM-Simulator Funktionsparameter dieses Knoten
+|=========================================================
+''data.function'' enthält eine Liste von Argumenten für die verwendete, durch ''data.functionType''
+festgelegte Funktion.
+
+Eigenschaften von Gruppen (NodeGroup)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.NodeGroup Properties
+[width="80%",cols="3,4,1,10",options="header"]
+|=============================================================
+| Typ | Schlüssel | Ver. | Beschreibung
+| string | visual.caption | 1+ | Titel der Group im Editor.
+| string | visual.color | 1+ | Farbliches Merkmal der Group
+| integer | visual.location.x | 1+ | X-Position relativ zu übergeordneten NodeGroup
+| integer | visual.location.y | 1+ | Y-Position relativ zu übergeordneten NodeGroup
+|=============================================================
+
+
+Dokumentation der Implementierung
+---------------------------------
+Das am Anfang vorgestellte Objektmodell wird durch Interfaces im Package
+'de.dhbw.horb.ksm. xmlschema.api' umgesetzt.
+
+Eine Implementierung dieser Interfaces findet sich im Package
+'de.dhbw.horb.ksm. xmlschema.impl'. Von dieser Implementierung ist für
+äusseren Zugriff nur die Klasse 'KSMFactory' vorgesehen, welche Methoden
+zum Laden und Speichern von KSM-Modellen zur Verfügung stellt.
+
+Die Implementierung benutzt vom XML-Schema-Compiler (xjc) von JAXB generierte
+Klassen die im Package 'de.dhbw.horb.ksm. xmlschema.generated' liegen.
+Das generieren wird vom Ant-Task 'compile-xjc' und Annotationen im Schema gesteuert.
+
+Der Zugriff auf das geladene Modell erfolgt auschliesslich über die in den Interfaces
+vorgesehen Methoden, ein direkter Zugriff ist nicht möglich.
+
+Neben dem Quellcode in src/ gibt es im Projektverzeichniss noch das Verzeichnis test/
+welches JUnit-4 Tests enthält die die Implementierung nahezu 100% abdecken. Die
+Tests sind dabei zum Teil im Stil des Behavior Driven Development (BDD) geschrieben unter
+Zuhilfename der Bibliothek mockito.
+
+Vorgehensweise bei Änderungen
+-----------------------------
+1. Eintragung der Änderung in diesem Dokument
+2. Erhöhen der Versionszahl
+3. Erstellen eines Eintrags in der Revisions Historie in diesem Dokument
+4. Anpassen der Versionszahl in build.xml 'project.version'
+5. Erstellen einer HTML- und PDF Version von diesem Dokument (asciidoc/a2x).
+
+Revisions Historie
+------------------
+.Revisions
+[width="80%",cols="1,3,4,10",options="header"]
+|=========================================================
+| Ver. | Datum | Person | Änderung
+| 1 | 2011-03-24 | Yves Fischer | Beginn der Historie, KSM Version 1
+| 1 | 2011-04-26 | Fischer, Dreher | Erläuterung Datentypen.
+ Festlegung Funktionsname/Parameter von
+ Connection's.
+|========================================================= \ No newline at end of file
diff --git a/ksm-model/doc/KSM-Datamodel.html b/ksm-model/doc/KSM-Datamodel.html
new file mode 100644
index 0000000..de607e2
--- /dev/null
+++ b/ksm-model/doc/KSM-Datamodel.html
@@ -0,0 +1,1165 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<meta name="generator" content="AsciiDoc 8.5.2" />
+<title>KSM Datenmodell</title>
+<style type="text/css">
+/* Debug borders */
+p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
+/*
+ border: 1px solid red;
+*/
+}
+
+body {
+ margin: 1em 5% 1em 5%;
+}
+
+a {
+ color: blue;
+ text-decoration: underline;
+}
+a:visited {
+ color: fuchsia;
+}
+
+em {
+ font-style: italic;
+ color: navy;
+}
+
+strong {
+ font-weight: bold;
+ color: #083194;
+}
+
+tt {
+ color: navy;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ color: #527bbd;
+ font-family: sans-serif;
+ margin-top: 1.2em;
+ margin-bottom: 0.5em;
+ line-height: 1.3;
+}
+
+h1, h2, h3 {
+ border-bottom: 2px solid silver;
+}
+h2 {
+ padding-top: 0.5em;
+}
+h3 {
+ float: left;
+}
+h3 + * {
+ clear: left;
+}
+
+div.sectionbody {
+ font-family: serif;
+ margin-left: 0;
+}
+
+hr {
+ border: 1px solid silver;
+}
+
+p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+}
+
+ul, ol, li > p {
+ margin-top: 0;
+}
+
+pre {
+ padding: 0;
+ margin: 0;
+}
+
+span#author {
+ color: #527bbd;
+ font-family: sans-serif;
+ font-weight: bold;
+ font-size: 1.1em;
+}
+span#email {
+}
+span#revnumber, span#revdate, span#revremark {
+ font-family: sans-serif;
+}
+
+div#footer {
+ font-family: sans-serif;
+ font-size: small;
+ border-top: 2px solid silver;
+ padding-top: 0.5em;
+ margin-top: 4.0em;
+}
+div#footer-text {
+ float: left;
+ padding-bottom: 0.5em;
+}
+div#footer-badges {
+ float: right;
+ padding-bottom: 0.5em;
+}
+
+div#preamble {
+ margin-top: 1.5em;
+ margin-bottom: 1.5em;
+}
+div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
+div.admonitionblock {
+ margin-top: 1.0em;
+ margin-bottom: 1.5em;
+}
+div.admonitionblock {
+ margin-top: 2.0em;
+ margin-bottom: 2.0em;
+ margin-right: 10%;
+ color: #606060;
+}
+
+div.content { /* Block element content. */
+ padding: 0;
+}
+
+/* Block element titles. */
+div.title, caption.title {
+ color: #527bbd;
+ font-family: sans-serif;
+ font-weight: bold;
+ text-align: left;
+ margin-top: 1.0em;
+ margin-bottom: 0.5em;
+}
+div.title + * {
+ margin-top: 0;
+}
+
+td div.title:first-child {
+ margin-top: 0.0em;
+}
+div.content div.title:first-child {
+ margin-top: 0.0em;
+}
+div.content + div.title {
+ margin-top: 0.0em;
+}
+
+div.sidebarblock > div.content {
+ background: #ffffee;
+ border: 1px solid silver;
+ padding: 0.5em;
+}
+
+div.listingblock > div.content {
+ border: 1px solid silver;
+ background: #f4f4f4;
+ padding: 0.5em;
+}
+
+div.quoteblock, div.verseblock {
+ padding-left: 1.0em;
+ margin-left: 1.0em;
+ margin-right: 10%;
+ border-left: 5px solid #dddddd;
+ color: #777777;
+}
+
+div.quoteblock > div.attribution {
+ padding-top: 0.5em;
+ text-align: right;
+}
+
+div.verseblock > div.content {
+ white-space: pre;
+}
+div.verseblock > div.attribution {
+ padding-top: 0.75em;
+ text-align: left;
+}
+/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
+div.verseblock + div.attribution {
+ text-align: left;
+}
+
+div.admonitionblock .icon {
+ vertical-align: top;
+ font-size: 1.1em;
+ font-weight: bold;
+ text-decoration: underline;
+ color: #527bbd;
+ padding-right: 0.5em;
+}
+div.admonitionblock td.content {
+ padding-left: 0.5em;
+ border-left: 3px solid #dddddd;
+}
+
+div.exampleblock > div.content {
+ border-left: 3px solid #dddddd;
+ padding-left: 0.5em;
+}
+
+div.imageblock div.content { padding-left: 0; }
+span.image img { border-style: none; }
+a.image:visited { color: white; }
+
+dl {
+ margin-top: 0.8em;
+ margin-bottom: 0.8em;
+}
+dt {
+ margin-top: 0.5em;
+ margin-bottom: 0;
+ font-style: normal;
+ color: navy;
+}
+dd > *:first-child {
+ margin-top: 0.1em;
+}
+
+ul, ol {
+ list-style-position: outside;
+}
+ol.arabic {
+ list-style-type: decimal;
+}
+ol.loweralpha {
+ list-style-type: lower-alpha;
+}
+ol.upperalpha {
+ list-style-type: upper-alpha;
+}
+ol.lowerroman {
+ list-style-type: lower-roman;
+}
+ol.upperroman {
+ list-style-type: upper-roman;
+}
+
+div.compact ul, div.compact ol,
+div.compact p, div.compact p,
+div.compact div, div.compact div {
+ margin-top: 0.1em;
+ margin-bottom: 0.1em;
+}
+
+div.tableblock > table {
+ border: 3px solid #527bbd;
+}
+thead, p.table.header {
+ font-family: sans-serif;
+ font-weight: bold;
+}
+tfoot {
+ font-weight: bold;
+}
+td > div.verse {
+ white-space: pre;
+}
+p.table {
+ margin-top: 0;
+}
+/* Because the table frame attribute is overriden by CSS in most browsers. */
+div.tableblock > table[frame="void"] {
+ border-style: none;
+}
+div.tableblock > table[frame="hsides"] {
+ border-left-style: none;
+ border-right-style: none;
+}
+div.tableblock > table[frame="vsides"] {
+ border-top-style: none;
+ border-bottom-style: none;
+}
+
+
+div.hdlist {
+ margin-top: 0.8em;
+ margin-bottom: 0.8em;
+}
+div.hdlist tr {
+ padding-bottom: 15px;
+}
+dt.hdlist1.strong, td.hdlist1.strong {
+ font-weight: bold;
+}
+td.hdlist1 {
+ vertical-align: top;
+ font-style: normal;
+ padding-right: 0.8em;
+ color: navy;
+}
+td.hdlist2 {
+ vertical-align: top;
+}
+div.hdlist.compact tr {
+ margin: 0;
+ padding-bottom: 0;
+}
+
+.comment {
+ background: yellow;
+}
+
+.footnote, .footnoteref {
+ font-size: 0.8em;
+}
+
+span.footnote, span.footnoteref {
+ vertical-align: super;
+}
+
+#footnotes {
+ margin: 20px 0 20px 0;
+ padding: 7px 0 0 0;
+}
+
+#footnotes div.footnote {
+ margin: 0 0 5px 0;
+}
+
+#footnotes hr {
+ border: none;
+ border-top: 1px solid silver;
+ height: 1px;
+ text-align: left;
+ margin-left: 0;
+ width: 20%;
+ min-width: 100px;
+}
+
+
+@media print {
+ div#footer-badges { display: none; }
+}
+
+div#toc {
+ margin-bottom: 2.5em;
+}
+
+div#toctitle {
+ color: #527bbd;
+ font-family: sans-serif;
+ font-size: 1.1em;
+ font-weight: bold;
+ margin-top: 1.0em;
+ margin-bottom: 0.1em;
+}
+
+div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+div.toclevel2 {
+ margin-left: 2em;
+ font-size: 0.9em;
+}
+div.toclevel3 {
+ margin-left: 4em;
+ font-size: 0.9em;
+}
+div.toclevel4 {
+ margin-left: 6em;
+ font-size: 0.9em;
+}
+/* Workarounds for IE6's broken and incomplete CSS2. */
+
+div.sidebar-content {
+ background: #ffffee;
+ border: 1px solid silver;
+ padding: 0.5em;
+}
+div.sidebar-title, div.image-title {
+ color: #527bbd;
+ font-family: sans-serif;
+ font-weight: bold;
+ margin-top: 0.0em;
+ margin-bottom: 0.5em;
+}
+
+div.listingblock div.content {
+ border: 1px solid silver;
+ background: #f4f4f4;
+ padding: 0.5em;
+}
+
+div.quoteblock-attribution {
+ padding-top: 0.5em;
+ text-align: right;
+}
+
+div.verseblock-content {
+ white-space: pre;
+}
+div.verseblock-attribution {
+ padding-top: 0.75em;
+ text-align: left;
+}
+
+div.exampleblock-content {
+ border-left: 3px solid #dddddd;
+ padding-left: 0.5em;
+}
+
+/* IE6 sets dynamically generated links as visited. */
+div#toc a:visited { color: blue; }
+</style>
+<script type="text/javascript">
+/*<![CDATA[*/
+window.onload = function(){asciidoc.footnotes();}
+var asciidoc = { // Namespace.
+
+/////////////////////////////////////////////////////////////////////
+// Table Of Contents generator
+/////////////////////////////////////////////////////////////////////
+
+/* Author: Mihai Bazon, September 2002
+ * http://students.infoiasi.ro/~mishoo
+ *
+ * Table Of Content generator
+ * Version: 0.4
+ *
+ * Feel free to use this script under the terms of the GNU General Public
+ * License, as long as you do not remove or alter this notice.
+ */
+
+ /* modified by Troy D. Hanson, September 2006. License: GPL */
+ /* modified by Stuart Rackham, 2006, 2009. License: GPL */
+
+// toclevels = 1..4.
+toc: function (toclevels) {
+
+ function getText(el) {
+ var text = "";
+ for (var i = el.firstChild; i != null; i = i.nextSibling) {
+ if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
+ text += i.data;
+ else if (i.firstChild != null)
+ text += getText(i);
+ }
+ return text;
+ }
+
+ function TocEntry(el, text, toclevel) {
+ this.element = el;
+ this.text = text;
+ this.toclevel = toclevel;
+ }
+
+ function tocEntries(el, toclevels) {
+ var result = new Array;
+ var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
+ // Function that scans the DOM tree for header elements (the DOM2
+ // nodeIterator API would be a better technique but not supported by all
+ // browsers).
+ var iterate = function (el) {
+ for (var i = el.firstChild; i != null; i = i.nextSibling) {
+ if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
+ var mo = re.exec(i.tagName);
+ if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
+ result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
+ }
+ iterate(i);
+ }
+ }
+ }
+ iterate(el);
+ return result;
+ }
+
+ var toc = document.getElementById("toc");
+ var entries = tocEntries(document.getElementById("content"), toclevels);
+ for (var i = 0; i < entries.length; ++i) {
+ var entry = entries[i];
+ if (entry.element.id == "")
+ entry.element.id = "_toc_" + i;
+ var a = document.createElement("a");
+ a.href = "#" + entry.element.id;
+ a.appendChild(document.createTextNode(entry.text));
+ var div = document.createElement("div");
+ div.appendChild(a);
+ div.className = "toclevel" + entry.toclevel;
+ toc.appendChild(div);
+ }
+ if (entries.length == 0)
+ toc.parentNode.removeChild(toc);
+},
+
+
+/////////////////////////////////////////////////////////////////////
+// Footnotes generator
+/////////////////////////////////////////////////////////////////////
+
+/* Based on footnote generation code from:
+ * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
+ */
+
+footnotes: function () {
+ var cont = document.getElementById("content");
+ var noteholder = document.getElementById("footnotes");
+ var spans = cont.getElementsByTagName("span");
+ var refs = {};
+ var n = 0;
+ for (i=0; i<spans.length; i++) {
+ if (spans[i].className == "footnote") {
+ n++;
+ // Use [\s\S] in place of . so multi-line matches work.
+ // Because JavaScript has no s (dotall) regex flag.
+ note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
+ noteholder.innerHTML +=
+ "<div class='footnote' id='_footnote_" + n + "'>" +
+ "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
+ n + "</a>. " + note + "</div>";
+ spans[i].innerHTML =
+ "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
+ "' title='View footnote' class='footnote'>" + n + "</a>]";
+ var id =spans[i].getAttribute("id");
+ if (id != null) refs["#"+id] = n;
+ }
+ }
+ if (n == 0)
+ noteholder.parentNode.removeChild(noteholder);
+ else {
+ // Process footnoterefs.
+ for (i=0; i<spans.length; i++) {
+ if (spans[i].className == "footnoteref") {
+ var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
+ href = href.match(/#.*/)[0]; // Because IE return full URL.
+ n = refs[href];
+ spans[i].innerHTML =
+ "[<a href='#_footnote_" + n +
+ "' title='View footnote' class='footnote'>" + n + "</a>]";
+ }
+ }
+ }
+}
+
+}
+/*]]>*/
+</script>
+</head>
+<body>
+<div id="header">
+<h1>KSM Datenmodell</h1>
+<span id="author">Yves Fischer</span><br />
+<span id="email"><tt>&lt;<a href="mailto:i08005@ba-horb.de">i08005@ba-horb.de</a>&gt;</tt></span><br />
+</div>
+<div id="content">
+<h2 id="_einleitung">Einleitung</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Mit der Entwicklung einer KSM Anwendung auf Eclipse-RCP Basis war es
+nötig ein Datenmodell zu entwerfen welches zum MVC-ähnlichen Muster
+des Eclipse Graphical Editor Framework (GEF) kompatibel ist.</p></div>
+<div class="paragraph"><p>Grundsätzlich lassen sich alle Datenmodelle mit GEF abbilden, jedoch existierte
+in KSM/Swing nur ein stark mit der GUI und Logik verflochtenes und fehlerhaftes
+Datenmodell, dessen Serialisierung mit einer XML-Bibliothek erfolgte die nicht
+mehr weiter verwendet werden soll.</p></div>
+<div class="paragraph"><p>Da es nicht beabsichtigt ist die KSM/Swing Anwendung auf kurze Zeit abzulösen
+liegt es nahe, dass das Datenmodell universell einsetzbar sein sollte.
+Mit der Umstellung von KSM/Swing auf ein neues Datenmodell ist einerseits
+die Daten-Kompatibiltät zwischen KSM/Swing und KSM/RCP gegeben und das
+Ziel die XML-Serialisierung in KSM/Swing zu überarbeiten kann einfacher erreicht
+werden.</p></div>
+<div class="paragraph"><p>Dieses Dokument beschreibt die Implementation einer API zum Zugriff auf
+das in XML-Schema beschriebene Datenformat.</p></div>
+<div class="paragraph"><p>Dieses Datenformat erlaubt es darüberhinaus freie Felder zu definieren welche
+ebenfalls in diesem Dokument spezifiert werden.</p></div>
+</div>
+<h2 id="_das_xml_schema">Das XML-Schema</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Die Namespace URL für das XML-Schema lautet:</p></div>
+<div class="literalblock">
+<div class="content">
+<pre><tt>http://www.ba-horb.de/~ksm/xml/ksm-1</tt></pre>
+</div></div>
+<div class="paragraph"><p>die Schemadatei ist abrufbar unter:</p></div>
+<div class="literalblock">
+<div class="content">
+<pre><tt>http://www.ba-horb.de/~ksm/xml/ksm-1.xsd</tt></pre>
+</div></div>
+<div class="paragraph"><p>Das XML-Schema ist angereichert um JAXB-Annotationen die den XML-Schema-Java-Compiler
+bei der Klassenerzeugung steuert.</p></div>
+</div>
+<h2 id="_typen_des_datenmodell">Typen des Datenmodell</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Die Bibltiohekt besteht aus einem Package in dem Interfaces die API-Beschreiben
+und einem Package mit Implementationen dieser Interfaces die jedoch für den Benutzer
+unsichtbar und daher austauschbar sind.</p></div>
+<div class="paragraph"><p>Das folgende Diagram zeigt das Interface das dem Benutzer zur Verfügung steht:</p></div>
+<div class="literalblock">
+<div class="content">
+<pre><tt>de.dhbw.horb.ksm. xmlschema.api
++----------------------------------------------------------+
+| +-------------+ +---------------+ +------------+ |
+| |_____KSM_____| *|___NodeGroup___| *|____Node____| |
+| |getNodeGroup +---+getNodeGroups()+---+getC.tions()| |
+| |getVersion() | |getNodes() | | | |
+| | | | | | | |
+| +---^---------+ +---------------+ +--+---+-----+ |
+| | \ | ________________/ | |
+| | \1 |1 /1 |* |
+| | +-+-----+-+--+ +---+--------+ |
+| | |_Properties_|1 |_Connection_| |
+| | |getString() +----------------+getTo() | |
+| | |getInteger()| | | |
+| | |...... | | | |
+| | +------------+ +------------+ |
+| | |
++----------------------------------------------------------+
+ |
+de.dhbw.horb.ksm. xmlschema.impl
++-------------------------------+
+| | |
+| +------------------+ |
+| |____KSMFactory____| |
+| |createEmptyKSM() | |
+| |saveKSM() | |
+| |loadKSM() | |
+| +------------------+ |
++-------------------------------+</tt></pre>
+</div></div>
+<div class="paragraph"><p>Ein Diagramm wird erstellt indem ein neues (<em>createEmptyKSM()</em>) erstellt wird oder eines
+geladen wird (<em>loadKSM()</em>). Die weitere Navigation erfolgt durch Absteigen in dem
+Objekt-Baum der durch NodeGroup- und schliesslich Node-Objekte gebildet wird.</p></div>
+<h3 id="_datentypen_der_eigenschaften">Datentypen der Eigenschaften</h3><div style="clear:left"></div>
+<div class="paragraph"><p>Im Modell gibt es die Datentypen KSM, NodeGroup, Node und Connection (siehe Klassen-Diagramm).
+Zusätzlich gibt es die Klasse Properties mit der an die Datentypen zusätzliche Eigenschaften
+mit einem Text-Bezeichner angehängt werden können.</p></div>
+<div class="paragraph"><p>Für die Eigenschaften stehen folgende Typen zur Verfügung: <em>'string</em>', <em>'integer</em>', <em>'boolean</em>',
+<em>'integerList</em>', <em>'decimalList</em>', <em>'stringList</em>'. Der Datentyp erschliesst sich aus dem Namen.</p></div>
+<div class="paragraph"><p>Prinzipiell kann jeder Bezeichner für jeden Datentyp einmal verwendet werden, ein Bezeichner sollte
+jedoch wegen der Ãœbersichtlichkeit nur einmal verwendet werden.</p></div>
+</div>
+<h2 id="_verwendung_der_changelistener">Verwendung der ChangeListener</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Die Klassen <em>NodeGroup</em>, <em>Node</em> und <em>Properties</em> implementieren Change-Listener
+auf die sich Listener-Klassen registrieren können um über Änderungen am Datenmodell
+informiert zu werden.</p></div>
+<div class="paragraph"><p>Dies wird beispielsweise benötigt, wenn zwei Programmteile wie ein Eigenschaften-Editor
+in Tabellenform und ein grafischer Editor voneinander unabhängig auf das Datenmodell
+zugreifen und beispielsweise die Farbe eines Knoten ändern.</p></div>
+<div class="paragraph"><p>Die Spalte <em>Index</em> zeigt an ob das Event eine Index-Eigenschaft hat die andeutet
+welches Element in einer Liste geändert wurde.</p></div>
+<div class="paragraph"><p>Die Spalte <em>Version</em> zeigt an, ab welcher Version des Datenformat (=Version dieses
+Dokumentes, Version Attribut in &lt;ksm&gt; Element) dieser Event unterstützt wird.</p></div>
+<div class="tableblock">
+<table rules="all"
+width="80%"
+frame="border"
+cellspacing="0" cellpadding="4">
+<caption class="title">Tabelle 1. <em>NodeGroup</em>-Events</caption>
+<col width="17%" />
+<col width="11%" />
+<col width="11%" />
+<col width="58%" />
+<thead>
+<tr>
+<th align="left" valign="top">Property-Name </th>
+<th align="left" valign="top"> Version </th>
+<th align="left" valign="top"> Index? </th>
+<th align="left" valign="top">Beschreibung</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td align="left" valign="top"><p class="table">nodes</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">✓</p></td>
+<td align="left" valign="top"><p class="table">Eine <em>Node</em> wurde dieser <em>NodeGroup</em>
+ hinzugefügt oder entfernt</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="tableblock">
+<table rules="all"
+width="80%"
+frame="border"
+cellspacing="0" cellpadding="4">
+<caption class="title">Tabelle 2. <em>Node</em>-Events</caption>
+<col width="17%" />
+<col width="11%" />
+<col width="11%" />
+<col width="58%" />
+<thead>
+<tr>
+<th align="left" valign="top">Property-Name </th>
+<th align="left" valign="top"> Version </th>
+<th align="left" valign="top"> Index? </th>
+<th align="left" valign="top">Beschreibung</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td align="left" valign="top"><p class="table">connections</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">✓</p></td>
+<td align="left" valign="top"><p class="table">Eine <em>Connection</em> wurde erstellt oder gelöscht</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="tableblock">
+<table rules="all"
+width="80%"
+frame="border"
+cellspacing="0" cellpadding="4">
+<caption class="title">Tabelle 3. <em>Properties</em>-Events</caption>
+<col width="17%" />
+<col width="11%" />
+<col width="11%" />
+<col width="58%" />
+<thead>
+<tr>
+<th align="left" valign="top">Property-Name </th>
+<th align="left" valign="top"> Version </th>
+<th align="left" valign="top"> Index? </th>
+<th align="left" valign="top">Beschreibung</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td align="left" valign="top"><p class="table">string: <em>X</em></p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">✗</p></td>
+<td align="left" valign="top"><p class="table">Eine Zeichenketten Eigenschaft mit Name <em>X</em> wurde geändert</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">decimal: <em>X</em></p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">✗</p></td>
+<td align="left" valign="top"><p class="table">Eine Fliesskommazahl Eigenschaft mit Name <em>X</em> wurde geändert</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">integer: <em>X</em></p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">✗</p></td>
+<td align="left" valign="top"><p class="table">Eine ganzzahlige Eigenschaft mit Name <em>X</em> wurde geändert</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">boolean: <em>X</em></p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">✗</p></td>
+<td align="left" valign="top"><p class="table">Eine boolsche Eigenschaft mit Name <em>X</em> wurde geändert</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">integerList: <em>X</em></p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">✓</p></td>
+<td align="left" valign="top"><p class="table">Eine Ganzzahl Liste mit Name <em>X</em> wurde manipuliert</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">decimalList: <em>X</em></p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">✓</p></td>
+<td align="left" valign="top"><p class="table">Eine Fliesskommazahl Liste mit Name <em>X</em> wurde manipuliert</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">stringList: <em>X</em></p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">✓</p></td>
+<td align="left" valign="top"><p class="table">Eine Zeichenketten Liste mit Name <em>X</em> wurde manipuliert</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+<h2 id="_eigenschaften_properties">Eigenschaften (Properties)</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Allen Elementen im Datenmodell lassen sich dynamische, dass heist nicht in einem
+Schema festgelegte, Eigenschaften zuwiesen.
+Dies hat zur Folge, dass eine Anwendung sowohl den Fall handhaben muss, dass eine
+erwartete Eigenschaft nicht vorhanden ist als auch, dass Eigenschaften vorhanden sind
+die unbekannt sind und ignoriert werden müssen.
+Dazu steht der Anwendung jedoch das Attribut <em>Version</em> im Schema (siehe KSM#getVersion())
+zur Verfügung, welches auf eine Version von diesem Dokument zeigt.</p></div>
+<div class="paragraph"><p>Dieser Ansatz wurde gewählt, da sich gezeigt hat, dass die Studienarbeiten im KSM-Projekt
+einen begrenzten Fokus haben und es daher für einen einzelnen Studenten schwer möglich ist,
+alle benötigten Datenfelder zu definieren.
+Das bisherige KSM-Datenformat handhabt dies, indem das XML-Schema beliebig verändert
+wurde und damit sinnlos wurde.
+Da dies unvermeidbar ist wird es mit diesem Ansatz aktiv unterstützt.</p></div>
+<div class="paragraph"><p>Eine alternative Herangehensweise wäre die Verwendung von verschiedenen XML-Schemas gewesen
+wobei mit jeder Erweiterung ein zusätzlicher Namensraum eingeführt wird. Dies
+schien jedoch sehr viel umständlicher und unnötig kompliziert.</p></div>
+<h3 id="_eigenschaften_von_modellen_ksm">Eigenschaften von Modellen (KSM)</h3><div style="clear:left"></div>
+<div class="paragraph"><p>Die Spalte <em>Typ</em> zeigt den Datentyp der Eigenschaft an. Die Spalte <em>Schlüssel</em>
+den Bezeichner welcher in Kombination mit dem Typ eindeutig ist.</p></div>
+<div class="paragraph"><p>Die Spalte <em>Version</em> zeigt an, ab welcher Version des Datenformat (=Version dieses
+Dokumentes, Version Attribut in &lt;ksm&gt; Element) dieser Event unterstützt wird.</p></div>
+<div class="tableblock">
+<table rules="all"
+width="80%"
+frame="border"
+cellspacing="0" cellpadding="4">
+<caption class="title">Tabelle 4. KSM Properties</caption>
+<col width="15%" />
+<col width="21%" />
+<col width="10%" />
+<col width="52%" />
+<thead>
+<tr>
+<th align="left" valign="top">Typ </th>
+<th align="left" valign="top"> Schlüssel </th>
+<th align="left" valign="top"> Version </th>
+<th align="left" valign="top"> Beschreibung</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td align="left" valign="top"><p class="table">nichts</p></td>
+<td align="left" valign="top"><p class="table">ist</p></td>
+<td align="left" valign="top"><p class="table">definiert</p></td>
+<td align="left" valign="top"><p class="table">-</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<h3 id="_eigenschaften_von_knoten_node">Eigenschaften von Knoten (Node)</h3><div style="clear:left"></div>
+<div class="tableblock">
+<table rules="all"
+width="80%"
+frame="border"
+cellspacing="0" cellpadding="4">
+<caption class="title">Tabelle 5. Node Properties</caption>
+<col width="16%" />
+<col width="22%" />
+<col width="5%" />
+<col width="55%" />
+<thead>
+<tr>
+<th align="left" valign="top">Typ </th>
+<th align="left" valign="top"> Schlüssel </th>
+<th align="left" valign="top"> Ver. </th>
+<th align="left" valign="top"> Beschreibung</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td align="left" valign="top"><p class="table">string</p></td>
+<td align="left" valign="top"><p class="table">visual.caption</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">Titel der Node im Editor.</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">string</p></td>
+<td align="left" valign="top"><p class="table">visual.color</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">Farbliches Merkmal der Node
+ Hexadezimal im 8-Bit RGB Format
+ wie folgt: <tt>#RRGGBB</tt>.</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">integer</p></td>
+<td align="left" valign="top"><p class="table">visual.location.x</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">X-Position relativ zur übergeordneten NodeGroup</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">integer</p></td>
+<td align="left" valign="top"><p class="table">visual.location.y</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">Y-Position relativ zur übergeordneten NodeGroup</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">decimal</p></td>
+<td align="left" valign="top"><p class="table">data.user_value</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">User Value (?)</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">decimal</p></td>
+<td align="left" valign="top"><p class="table">data.min_value</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">Minimal Value (?)</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">decimal</p></td>
+<td align="left" valign="top"><p class="table">data.max_value</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">Maximal Value (?)</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">decimal</p></td>
+<td align="left" valign="top"><p class="table">data.extern</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">Extern Value (?)</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="paragraph"><p>Als Erbe aus dem KSM/Swing Projekt kann <em>'visual.color</em>' die folgenden Werte
+annehmen, diese sollen auf den folgenden RGB-Wert übertragen werden:</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+<tt>White</tt> &#8594; <tt>#ffffff</tt>
+</p>
+</li>
+<li>
+<p>
+<tt>Light Yellow</tt> &#8594; <tt>#faffa2</tt>
+</p>
+</li>
+<li>
+<p>
+<tt>Medium Yellow</tt> &#8594; <tt>#f4ff4b</tt>
+</p>
+</li>
+<li>
+<p>
+<tt>Yellow</tt> &#8594; <tt>#edfc00</tt>
+</p>
+</li>
+<li>
+<p>
+<tt>Light Blue</tt> &#8594; <tt>#d4d5e9</tt>
+</p>
+</li>
+<li>
+<p>
+<tt>Medium Blue</tt> &#8594; <tt>#7678ff</tt>
+</p>
+</li>
+<li>
+<p>
+<tt>Blue</tt> &#8594; <tt>#0002f8</tt>
+</p>
+</li>
+<li>
+<p>
+<tt>Light Green</tt> &#8594; <tt>#c8f8c9</tt>
+</p>
+</li>
+<li>
+<p>
+<tt>Medium Green</tt> &#8594; <tt>#7afa7e</tt>
+</p>
+</li>
+<li>
+<p>
+<tt>Green</tt> &#8594; <tt>#1af520</tt>
+</p>
+</li>
+<li>
+<p>
+<tt>Light Red</tt> &#8594; <tt>#fdcccc</tt>
+</p>
+</li>
+<li>
+<p>
+<tt>Medium Red</tt> &#8594; <tt>#f95959</tt>
+</p>
+</li>
+<li>
+<p>
+<tt>Red</tt> &#8594; <tt>#f62020</tt>
+</p>
+</li>
+</ul></div>
+<h3 id="_eigenschaften_von_verbindungen_connection">Eigenschaften von Verbindungen (Connection)</h3><div style="clear:left"></div>
+<div class="tableblock">
+<table rules="all"
+width="80%"
+frame="border"
+cellspacing="0" cellpadding="4">
+<caption class="title">Tabelle 6. Connection Properties</caption>
+<col width="16%" />
+<col width="22%" />
+<col width="5%" />
+<col width="55%" />
+<thead>
+<tr>
+<th align="left" valign="top">Typ </th>
+<th align="left" valign="top"> Schlüssel </th>
+<th align="left" valign="top"> Ver. </th>
+<th align="left" valign="top"> Beschreibung</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td align="left" valign="top"><p class="table">string</p></td>
+<td align="left" valign="top"><p class="table">visual.caption</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">Titel der Connection im Editor.</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">string</p></td>
+<td align="left" valign="top"><p class="table">visual.color</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">Farbliches Merkmal der Connection</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">string</p></td>
+<td align="left" valign="top"><p class="table">data.functionType</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">Ein Funktionstyp von:
+ <em>straight-line</em>, <em>individual</em>,
+ <em>parable</em>, <em>parabolic-sections</em>.</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">decimalList</p></td>
+<td align="left" valign="top"><p class="table">data.function</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">KSM-Simulator Funktionsparameter dieses Knoten</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="paragraph"><p><em>'data.function</em>' enthält eine Liste von Argumenten für die verwendete, durch <em>'data.functionType</em>'
+festgelegte Funktion.</p></div>
+<h3 id="_eigenschaften_von_gruppen_nodegroup">Eigenschaften von Gruppen (NodeGroup)</h3><div style="clear:left"></div>
+<div class="tableblock">
+<table rules="all"
+width="80%"
+frame="border"
+cellspacing="0" cellpadding="4">
+<caption class="title">Tabelle 7. NodeGroup Properties</caption>
+<col width="16%" />
+<col width="22%" />
+<col width="5%" />
+<col width="55%" />
+<thead>
+<tr>
+<th align="left" valign="top"> Typ </th>
+<th align="left" valign="top"> Schlüssel </th>
+<th align="left" valign="top"> Ver. </th>
+<th align="left" valign="top"> Beschreibung</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td align="left" valign="top"><p class="table">string</p></td>
+<td align="left" valign="top"><p class="table">visual.caption</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">Titel der Group im Editor.</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">string</p></td>
+<td align="left" valign="top"><p class="table">visual.color</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">Farbliches Merkmal der Group</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">integer</p></td>
+<td align="left" valign="top"><p class="table">visual.location.x</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">X-Position relativ zu übergeordneten NodeGroup</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">integer</p></td>
+<td align="left" valign="top"><p class="table">visual.location.y</p></td>
+<td align="left" valign="top"><p class="table">1+</p></td>
+<td align="left" valign="top"><p class="table">Y-Position relativ zu übergeordneten NodeGroup</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+<h2 id="_dokumentation_der_implementierung">Dokumentation der Implementierung</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Das am Anfang vorgestellte Objektmodell wird durch Interfaces im Package
+<em>de.dhbw.horb.ksm. xmlschema.api</em> umgesetzt.</p></div>
+<div class="paragraph"><p>Eine Implementierung dieser Interfaces findet sich im Package
+<em>de.dhbw.horb.ksm. xmlschema.impl</em>. Von dieser Implementierung ist für
+äusseren Zugriff nur die Klasse <em>KSMFactory</em> vorgesehen, welche Methoden
+zum Laden und Speichern von KSM-Modellen zur Verfügung stellt.</p></div>
+<div class="paragraph"><p>Die Implementierung benutzt vom XML-Schema-Compiler (xjc) von JAXB generierte
+Klassen die im Package <em>de.dhbw.horb.ksm. xmlschema.generated</em> liegen.
+Das generieren wird vom Ant-Task <em>compile-xjc</em> und Annotationen im Schema gesteuert.</p></div>
+<div class="paragraph"><p>Der Zugriff auf das geladene Modell erfolgt auschliesslich über die in den Interfaces
+vorgesehen Methoden, ein direkter Zugriff ist nicht möglich.</p></div>
+<div class="paragraph"><p>Neben dem Quellcode in src/ gibt es im Projektverzeichniss noch das Verzeichnis test/
+welches JUnit-4 Tests enthält die die Implementierung nahezu 100% abdecken. Die
+Tests sind dabei zum Teil im Stil des Behavior Driven Development (BDD) geschrieben unter
+Zuhilfename der Bibliothek mockito.</p></div>
+</div>
+<h2 id="_vorgehensweise_bei_nderungen">Vorgehensweise bei Änderungen</h2>
+<div class="sectionbody">
+<div class="olist arabic"><ol class="arabic">
+<li>
+<p>
+Eintragung der Änderung in diesem Dokument
+</p>
+</li>
+<li>
+<p>
+Erhöhen der Versionszahl
+</p>
+</li>
+<li>
+<p>
+Erstellen eines Eintrags in der Revisions Historie in diesem Dokument
+</p>
+</li>
+<li>
+<p>
+Anpassen der Versionszahl in build.xml <em>project.version</em>
+</p>
+</li>
+<li>
+<p>
+Erstellen einer HTML- und PDF Version von diesem Dokument (asciidoc/a2x).
+</p>
+</li>
+</ol></div>
+</div>
+<h2 id="_revisions_historie">Revisions Historie</h2>
+<div class="sectionbody">
+<div class="tableblock">
+<table rules="all"
+width="80%"
+frame="border"
+cellspacing="0" cellpadding="4">
+<caption class="title">Tabelle 8. Revisions</caption>
+<col width="5%" />
+<col width="16%" />
+<col width="22%" />
+<col width="55%" />
+<thead>
+<tr>
+<th align="left" valign="top"> Ver. </th>
+<th align="left" valign="top"> Datum </th>
+<th align="left" valign="top"> Person </th>
+<th align="left" valign="top"> Änderung</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td align="left" valign="top"><p class="table">1</p></td>
+<td align="left" valign="top"><p class="table">2011-03-24</p></td>
+<td align="left" valign="top"><p class="table">Yves Fischer</p></td>
+<td align="left" valign="top"><p class="table">Beginn der Historie, KSM Version 1</p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">1</p></td>
+<td align="left" valign="top"><p class="table">2011-04-26</p></td>
+<td align="left" valign="top"><p class="table">Fischer, Dreher</p></td>
+<td align="left" valign="top"><p class="table">Erläuterung Datentypen.
+ Festlegung Funktionsname/Parameter von
+ Connection&#8217;s.</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+</div>
+<div id="footnotes"><hr /></div>
+<div id="footer">
+<div id="footer-text">
+Last updated 2011-04-27 22:54:43 CEST
+</div>
+</div>
+</body>
+</html>
diff --git a/ksm-model/doc/KSM-Datamodel.pdf b/ksm-model/doc/KSM-Datamodel.pdf
new file mode 100644
index 0000000..9d14a46
--- /dev/null
+++ b/ksm-model/doc/KSM-Datamodel.pdf
Binary files differ
diff --git a/ksm-model/doc/asciidoc-dblatex.sty b/ksm-model/doc/asciidoc-dblatex.sty
new file mode 100644
index 0000000..5f8f8a0
--- /dev/null
+++ b/ksm-model/doc/asciidoc-dblatex.sty
@@ -0,0 +1,10 @@
+%%
+%% This style is derived from the docbook one.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{asciidoc}[2008/06/05 AsciiDoc DocBook Style]
+%% Just use the original package and pass the options.
+\RequirePackageWithOptions{docbook}
+
+\usepackage{libertine}
+\usepackage{microtype}
diff --git a/ksm-model/doc/make.sh b/ksm-model/doc/make.sh
new file mode 100755
index 0000000..f815b30
--- /dev/null
+++ b/ksm-model/doc/make.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+asciidoc -v "KSM-Datamodel.asciidoc" &&
+ a2x -v "KSM-Datamodel.asciidoc" --dblatex-opts "-P latex.output.revhistory=0 -P latex.class.options=14pt -P latex.class.article=scrartcl -s asciidoc-dblatex.sty"
diff --git a/ksm-model/ksm-model-1.jar b/ksm-model/ksm-model-1.jar
new file mode 100644
index 0000000..76d1d3d
--- /dev/null
+++ b/ksm-model/ksm-model-1.jar
Binary files differ
diff --git a/ksm-model/lib/hamcrest.jar b/ksm-model/lib/hamcrest.jar
new file mode 100644
index 0000000..bb02e5c
--- /dev/null
+++ b/ksm-model/lib/hamcrest.jar
Binary files differ
diff --git a/ksm-model/lib/jaxb-api.jar b/ksm-model/lib/jaxb-api.jar
new file mode 100644
index 0000000..31e5fa0
--- /dev/null
+++ b/ksm-model/lib/jaxb-api.jar
Binary files differ
diff --git a/ksm-model/lib/jaxb-impl.jar b/ksm-model/lib/jaxb-impl.jar
new file mode 100644
index 0000000..eeaf660
--- /dev/null
+++ b/ksm-model/lib/jaxb-impl.jar
Binary files differ
diff --git a/ksm-model/lib/jaxb-xjc.jar b/ksm-model/lib/jaxb-xjc.jar
new file mode 100644
index 0000000..9ff4ddc
--- /dev/null
+++ b/ksm-model/lib/jaxb-xjc.jar
Binary files differ
diff --git a/ksm-model/lib/jaxb.License.txt b/ksm-model/lib/jaxb.License.txt
new file mode 100644
index 0000000..833a843
--- /dev/null
+++ b/ksm-model/lib/jaxb.License.txt
@@ -0,0 +1,274 @@
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)Version 1.1
+
+1. Definitions.
+
+ 1.1. "Contributor" means each individual or entity that creates or contributes to the creation of Modifications.
+
+ 1.2. "Contributor Version" means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor.
+
+ 1.3. "Covered Software" means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof.
+
+ 1.4. "Executable" means the Covered Software in any form other than Source Code.
+
+ 1.5. "Initial Developer" means the individual or entity that first makes Original Software available under this License.
+
+ 1.6. "Larger Work" means a work which combines Covered Software or portions thereof with code not governed by the terms of this License.
+
+ 1.7. "License" means this document.
+
+ 1.8. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+
+ 1.9. "Modifications" means the Source Code and Executable form of any of the following:
+
+ A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications;
+
+ B. Any new file that contains any part of the Original Software or previous Modification; or
+
+ C. Any new file that is contributed or otherwise made available under the terms of this License.
+
+ 1.10. "Original Software" means the Source Code and Executable form of computer software code that is originally released under this License.
+
+ 1.11. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
+
+ 1.12. "Source Code" means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code.
+
+ 1.13. "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
+
+2. License Grants.
+
+ 2.1. The Initial Developer Grant.
+
+ Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license:
+
+ (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and
+
+ (b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof).
+
+ (c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License.
+
+ (d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices.
+
+ 2.2. Contributor Grant.
+
+ Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
+
+ (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and
+
+ (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
+
+ (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party.
+
+ (d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+ 3.1. Availability of Source Code.
+
+ Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange.
+
+ 3.2. Modifications.
+
+ The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License.
+
+ 3.3. Required Notices.
+
+ You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer.
+
+ 3.4. Application of Additional Terms.
+
+ You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients' rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+ 3.5. Distribution of Executable Versions.
+
+ You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient's rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
+
+ 3.6. Larger Works.
+
+ You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software.
+
+4. Versions of the License.
+
+ 4.1. New Versions.
+
+ Oracle is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License.
+
+ 4.2. Effect of New Versions.
+
+ You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward.
+
+ 4.3. Modified Versions.
+
+ When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+ COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+6. TERMINATION.
+
+ 6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+
+ 6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as "Participant") alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant.
+
+ 6.3. If You assert a patent infringement claim against Participant alleging that the Participant Software directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
+
+ 6.4. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+ UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+ The Covered Software is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" (as that term is defined at 48 C.F.R. ? 252.227-7014(a)(1)) and "commercial computer software documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License.
+
+9. MISCELLANEOUS.
+
+ This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction's conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+ As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
+
+----------
+NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
+The code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California.
+
+
+
+
+The GNU General Public License (GPL) Version 2, June 1991
+
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+ One line to give the program's name and a brief idea of what it does.
+
+ Copyright (C)
+
+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ signature of Ty Coon, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.
+
+
+"CLASSPATH" EXCEPTION TO THE GPL VERSION 2
+
+Certain source files distributed by Oracle are subject to the following clarification and special exception to the GPL Version 2, but only where Oracle has expressly included in the particular source file's header the words "Oracle designates this particular file as subject to the "Classpath" exception as provided by Oracle in the License file that accompanied this code."
+
+Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License Version 2 cover the whole combination.
+
+As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.
diff --git a/ksm-model/lib/jaxb.ThirdPartyLicenseReadme.txt b/ksm-model/lib/jaxb.ThirdPartyLicenseReadme.txt
new file mode 100644
index 0000000..fcb12e0
--- /dev/null
+++ b/ksm-model/lib/jaxb.ThirdPartyLicenseReadme.txt
@@ -0,0 +1,754 @@
+DO NOT TRANSLATE OR LOCALIZE
+
+***************************************************************************
+
+%%The following software may be included in this product:
+XML-NamespaceSupport
+
+Use of any of this software is governed by the terms of the license below:
+
+The "Artistic License"
+
+ Preamble
+
+The intent of this document is to state the conditions under which a
+Package may be copied, such that the Copyright Holder maintains some
+semblance of artistic control over the development of the package,
+while giving the users of the package the right to use and distribute
+the Package in a more-or-less customary fashion, plus the right to make
+reasonable modifications.
+
+Definitions:
+
+ "Package" refers to the collection of files distributed by the
+ Copyright Holder, and derivatives of that collection of files
+ created through textual modification.
+
+ "Standard Version" refers to such a Package if it has not been
+ modified, or has been modified in accordance with the wishes
+ of the Copyright Holder as specified below.
+
+ "Copyright Holder" is whoever is named in the copyright or
+ copyrights for the package.
+
+ "You" is you, if you're thinking about copying or distributing
+ this Package.
+
+ "Reasonable copying fee" is whatever you can justify on the
+ basis of media cost, duplication charges, time of people involved,
+ and so on. (You will not be required to justify it to the
+ Copyright Holder, but only to the computing community at large
+ as a market that must bear the fee.)
+
+ "Freely Available" means that no fee is charged for the item
+ itself, though there may be fees involved in handling the item.
+ It also means that recipients of the item may redistribute it
+ under the same conditions they received it.
+
+1. You may make and give away verbatim copies of the source form of the
+Standard Version of this Package without restriction, provided that you
+duplicate all of the original copyright notices and associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other modifications
+derived from the Public Domain or from the Copyright Holder. A Package
+modified in such a way shall still be considered the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way, provided
+that you insert a prominent notice in each changed file stating how and
+when you changed that file, and provided that you do at least ONE of the
+following:
+
+ a) place your modifications in the Public Domain or otherwise make them
+ Freely Available, such as by posting said modifications to Usenet or
+ an equivalent medium, or placing the modifications on a major archive
+ site such as uunet.uu.net, or by allowing the Copyright Holder to include
+ your modifications in the Standard Version of the Package.
+
+ b) use the modified Package only within your corporation or organization.
+
+ c) rename any non-standard executables so the names do not conflict
+ with standard executables, which must also be provided, and provide
+ a separate manual page for each non-standard executable that clearly
+ documents how it differs from the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+4. You may distribute the programs of this Package in object code or
+executable form, provided that you do at least ONE of the following:
+
+ a) distribute a Standard Version of the executables and library files,
+ together with instructions (in the manual page or equivalent) on where
+ to get the Standard Version.
+
+ b) accompany the distribution with the machine-readable source of
+ the Package with your modifications.
+
+ c) give non-standard executables non-standard names, and clearly
+ document the differences in manual pages (or equivalent), together
+ with instructions on where to get the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+5. You may charge a reasonable copying fee for any distribution of this
+Package. You may charge any fee you choose for support of this
+Package. You may not charge a fee for this Package itself. However,
+you may distribute this Package in aggregate with other (possibly
+commercial) programs as part of a larger (possibly commercial) software
+distribution provided that you do not advertise this Package as a
+product of your own. You may embed this Package's interpreter within
+an executable of yours (by linking); this shall be construed as a mere
+form of aggregation, provided that the complete Standard Version of the
+interpreter is so embedded.
+
+6. The scripts and library files supplied as input to or produced as
+output from the programs of this Package do not automatically fall
+under the copyright of this Package, but belong to whoever generated
+them, and may be sold commercially, and may be aggregated with this
+Package. If such scripts or library files are aggregated with this
+Package via the so-called "undump" or "unexec" methods of producing a
+binary executable image, then distribution of such an image shall
+neither be construed as a distribution of this Package nor shall it
+fall under the restrictions of Paragraphs 3 and 4, provided that you do
+not represent such an executable image as a Standard Version of this
+Package.
+
+7. C subroutines (or comparably compiled subroutines in other
+languages) supplied by you and linked into this Package in order to
+emulate subroutines and variables of the language defined by this
+Package shall not be considered part of this Package, but are the
+equivalent of input as in Paragraph 6, provided these subroutines do
+not change the language in any way that would cause it to fail the
+regression tests for the language.
+
+8. Aggregation of this Package with a commercial distribution is always
+permitted provided that the use of this Package is embedded; that is,
+when no overt attempt is made to make this Package's interfaces visible
+to the end user of the commercial distribution. Such use shall not be
+construed as a distribution of this Package.
+
+9. The name of the Copyright Holder may not be used to endorse or promote
+products derived from this software without specific prior written permission.
+
+10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+ The End
+
+Additional License(s)
+
+Copyright (c) 2001-2005 Robin Berjon. All rights reserved.
+
+***************************************************************************
+
+%%The following software may be included in this product:
+iso-relax.jar
+
+Use of any of this software is governed by the terms of the license below:
+
+The MIT License
+
+ Copyright (c)
+
+ Permission is hereby granted, free of charge, to
+ any person obtaining a copy of this software and
+ associated documentation files (the "Software"),
+ to deal in the Software without restriction,
+ including without limitation the rights to use,
+ copy, modify, merge, publish, distribute,
+ sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is
+ furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission
+ notice shall be included in all copies or
+ substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT
+ WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
+
+
+
+ Copyright ýý 200
+
+Additional License(s)
+
+"copyright" and "license" results in the following hits:
+> * The above copyright notice and this permission notice shall be included
+> * distribute, sublicense, and/or sell copies of the Software, and to
+
+GNU, GPL, LGPL reveals no hit. "?" hits a lot of things but none of them
+are relevant to the licensing terms.
+
+
+***************************************************************************
+
+%%The following software may be included in this product:
+relaxngDatatype.jar
+
+Use of any of this software is governed by the terms of the license below:
+
+Copyright (c) 2001, Thai Open Source Software Center Ltd, Sun Microsystems.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the names of the copyright holders nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Additional License(s)
+
+Got the following hits. No hit for GNU, GPL, LGPL.
+
+> Redistributions of source code must retain the above copyright
+
+> Neither the names of the copyright holders nor the names of its
+
+> this license is the BSD license.
+
+***************************************************************************
+
+%%The following software may be included in this product:
+RELAX NG Object Model/Parser
+
+Use of any of this software is governed by the terms of the license below:
+
+The MIT License
+
+Copyright (c)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Additional License(s)
+
+See https://rngom.dev.java.net/doc/index.html
+
+***************************************************************************
+
+%%The following software may be included in this product:
+RelaxNGCC
+
+Use of any of this software is governed by the terms of the license below:
+
+Copyright (c) 2000-2003 Daisuke Okajima and Kohsuke Kawaguchi.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+3. The end-user documentation included with the redistribution, if
+any, must include the following acknowledgment:
+
+ "This product includes software developed by Daisuke Okajima
+ and Kohsuke Kawaguchi (http://relaxngcc.sf.net/)."
+
+Alternately, this acknowledgment may appear in the software itself,
+if and wherever such third-party acknowledgments normally appear.
+
+4. The names of the copyright holders must not be used to endorse or
+promote products derived from this software without prior written
+permission. For written permission, please contact the copyright
+holders.
+
+5. Products derived from this software may not be called "RELAXNGCC",
+nor may "RELAXNGCC" appear in their name, without prior written
+permission of the copyright holders.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Additional License(s)
+
+None found
+
+***************************************************************************
+
+%%The following software may be included in this product:
+XML Resolver library
+
+Use of any of this software is governed by the terms of the license below:
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+Additional License(s)
+
+All occurrences of copyright, license and (c) refer to the Apache 1.1 license.
+
+No occurrences of GNU, GPL, LGPL.
+
+***************************************************************************
+
+%%The following software may be included in this product:
+Stax API (only)
+
+Use of any of this software is governed by the terms of the license below:
+
+Streaming API for XML (JSR-173) Specification
+Reference Implementation
+License Agreement
+
+READ THE TERMS OF THIS (THE "AGREEMENT") CAREFULLY BEFORE VIEWING OR USING THE
+SOFTWARE LICENS
+ED HEREUNDER. BY VIEWING OR USING THE SOFTWARE, YOU AGREE TO THE TERMS OF THIS
+AGREEMENT. IF
+YOU ARE ACCESSING THE SOFTWARE ELECTRONICALLY, INDICATE YOUR ACCEPTANCE OF THESE
+TERMS BY SELE
+CTING THE "ACCEPT" BUTTON AT THE END OF THIS AGREEMENT. IF YOU DO NOT AGREE TO
+ALL THESE TERMS
+, PROMPTLY RETURN THE UNUSED SOFTWARE TO ORIGINAL CONTRIBUTOR, DEFINED HEREIN.
+
+1.0 DEFINITIONS.
+
+1.1. "BEA" means BEA Systems, Inc., the licensor of the Original Code.
+
+1.2. "Contributor" means BEA and each entity that creates or contributes to the
+creation of Mo
+difications.
+
+1.3. "Covered Code" means the Original Code or Modifications or the combination
+of the Origina
+l Code and Modifications, in each case including portions thereof and
+corresponding documentat
+ion released with the source code.
+
+1.4. "Executable" means Covered Code in any form other than Source Code.
+
+1.5. "FCS" means first commercial shipment of a product.
+
+1.6. "Modifications" means any addition to or deletion from the substance or
+structure of eith
+er the Original Code or any previous Modifications. When Covered Code is
+released as a series
+of files, a Modification is:
+
+(a) Any addition to or deletion from the contents of a file containing Original
+Code or previ
+ous Modifications.
+
+(b) Any new file that contains any part of the Original Code or previous
+Modifications.
+
+1.7. "Original Code" means Source Code of computer software code Reference
+Implementation.
+
+1.8. "Patent Claims" means any patent claim(s), now owned or hereafter acquired,
+including wit
+hout limitation, method, process, and apparatus claims, in any patent for which
+the grantor ha
+s the right to grant a license.
+
+1.9. "Reference Implementation" means the prototype or "proof of concept"
+implementa­tion of
+the Specification developed and made available for license by or on behalf of BEA.
+
+1.10. "Source Code" means the preferred form of the Covered Code for making
+modifications to i
+t, including all modules it contains, plus any associated documentation,
+interface definition
+files, scripts used to control compilation and installation of an Executable, or
+source code d
+ifferential comparisons against either the Original Code or another well known,
+available Cove
+red Code of the Contributor's choice.
+
+1.11. "Specification" means the written specification for the Streaming API for
+XML , Java te
+chnology developed pursuant to the Java Community Process.
+1.12. "Technology Compatibility Kit" or "TCK" means the documentation, testing
+tools and test
+suites associated with the Specification as may be revised by BEA from time to
+time, that is p
+rovided so that an implementer of the Specifi­cation may determine if its
+implementation is co
+mpliant with the Specification.
+
+1.13. "You" (or "Your") means an individual or a legal entity exercising rights
+under, and com
+plying with all of the terms of, this Agreement or a future version of this
+Agreement issued u
+nder Section 6.1. For legal entities, "You" includes any entity which controls,
+is controlled
+by, or is under common control with You. For purposes of this definition,
+"control" means (a)
+the power, direct or indirect, to cause the direction or management of such
+entity, whether by
+ contract or otherwise, or (b) ownership of more than fifty percent (50%) of the
+outstanding s
+hares or beneficial ownership of such entity.
+
+2.0 SOURCE CODE LICENSE.
+
+2.1. Copyright Grant. Subject to the terms of this Agreement, each Contributor
+hereby grants
+You a non-exclusive, worldwide, royalty-free copyright license to reproduce,
+prepare derivativ
+e works of, publicly display, publicly perform, distribute and sublicense the
+Covered Code of
+such Contributor, if any, and such derivative works, in Source Code and
+Executable form.
+
+2.2. Patent Grant. Subject to the terms of this Agreement, each Contributor
+hereby grants Yo
+u a non-exclusive, worldwide, royalty-free patent license under the Patent
+Claims to make, use
+, sell, offer to sell, import and otherwise transfer the Covered Code prepared
+and provided by
+ such Contributor, if any, in Source Code and Executable form. This patent
+license shall apply
+ to the Covered Code if, at the time a Modification is added by the Contributor,
+such addition
+ of the Modification causes such combination to be covered by the Patent Claims.
+The patent li
+cense shall not apply to any other combinations which include the Modification.
+
+2.3. Conditions to Grants. You understand that although each Contributor
+grants the licenses
+ to the Covered Code prepared by it, no assurances are provided by any
+Contributor that the Co
+vered Code does not infringe the patent or other intellectual property rights of
+any other ent
+ity. Each Contributor disclaims any liability to You for claims brought by any
+other entity ba
+sed on infringement of intellectual property rights or otherwise. As a condition
+to exercising
+ the rights and licenses granted hereunder, You hereby assume sole
+responsibility to secure an
+y other intellectual property rights needed, if any. For example, if a third
+party patent lice
+nse is required to allow You to distribute Covered Code, it is Your
+responsibility to acquire
+that license before distributing such code.
+
+2.4. Contributors' Representation. Each Contributor represents that to its
+knowledge it has
+sufficient copyright rights in the Covered Code it provides , if any, to grant
+the copyright l
+icense set forth in this Agreement.
+
+3.0 DISTRIBUION RESTRICTIONS.
+
+3.1. Application of Agreement.
+
+The Modifications which You create or to which You contribute are governed by
+the terms of thi
+s Agreement, including without limitation Section 2.0. The Source Code version
+of Covered Code
+ may be distributed only under the terms of this Agreement or a future version
+of this Agreeme
+nt released under Section 6.1, and You must include a copy of this Agreement
+with every copy o
+f the Source Code You distribute. You may not offer or impose any terms on any
+Source Code ver
+sion that alters or restricts the applicable version of this Agreement or the
+recipients' righ
+ts hereunder. However, You may include an additional document offering the
+additional rights d
+escribed in Section 3.3.
+
+3.2. Description of Modifications.
+
+You must cause all Covered Code to which You contribute to contain a file
+documenting the chan
+ges You made to create that Covered Code and the date of any change. You must
+include a promin
+ent statement that the Modification is derived, directly or indirectly, from
+Original Code pro
+vided by BEA and including the name of BEA in (a) the Source Code, and (b) in
+any notice in an
+ Executable version or related documentation in which You describe the origin or
+ownership of
+the Covered Code.
+
+***************************************************************************
+
+%%The following software may be included in this product:
+XMLWriter
+
+Use of any of this software is governed by the terms of the license below:
+
+XMLWriter IS FREE
+-----------------
+
+I hereby abandon any property rights to XMLWriter 0.1, and release all
+of the XMLWriter 0.1 source code, compiled code, and documentation
+contained in this distribution into the Public Domain. XMLWriter
+comes with NO WARRANTY or guarantee of fitness for any purpose.
+
+
+David Megginson
+david@megginson.com
+2000-04-19
+
+Additional License(s)
+
+I grep-ed the source. GNU and GPL has no hits, '?' yieds 11 hits but none of them
+are license related. "copyright" and "license" yield no hits either.
+
+***************************************************************************
+
diff --git a/ksm-model/lib/junit-4.8.2.jar b/ksm-model/lib/junit-4.8.2.jar
new file mode 100644
index 0000000..5b4bb84
--- /dev/null
+++ b/ksm-model/lib/junit-4.8.2.jar
Binary files differ
diff --git a/ksm-model/lib/mockito-all-1.8.5.jar b/ksm-model/lib/mockito-all-1.8.5.jar
new file mode 100644
index 0000000..4b0395e
--- /dev/null
+++ b/ksm-model/lib/mockito-all-1.8.5.jar
Binary files differ
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/api/Connection.java b/ksm-model/src/de/dhbw/horb/ksm/model/api/Connection.java
new file mode 100644
index 0000000..24da47f
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/api/Connection.java
@@ -0,0 +1,11 @@
+package de.dhbw.horb.ksm.model.api;
+
+import java.beans.PropertyChangeListener;
+
+public interface Connection {
+ public String getTo();
+ void setTo(String id);
+ public Properties getProperties();
+ void addPropertyChangeListener(PropertyChangeListener listener);
+ void removePropertyChangeListener(PropertyChangeListener listener);
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/api/KSM.java b/ksm-model/src/de/dhbw/horb/ksm/model/api/KSM.java
new file mode 100644
index 0000000..f3665e1
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/api/KSM.java
@@ -0,0 +1,62 @@
+package de.dhbw.horb.ksm.model.api;
+
+import java.util.List;
+
+public interface KSM {
+ /**
+ * Gibt die Wurzel-NodeGroup dieses Modells zurück.
+ *
+ * @return
+ */
+ NodeGroup getNodeGroup();
+
+ /**
+ * Schlägt das NodeGroup-Objekt mit dieser id nach.
+ *
+ * Durchläuft dazu alle NodeGroups im Modell
+ *
+ * @param id
+ * @return gesuchte NodeGroup oder null
+ */
+ NodeGroup lookupNodeGroup(String id);
+
+ /**
+ * Schlägt das Node-Objekt mit dieser id nach.
+ *
+ * Durchläuft dazu alle NodeGroups im Modell
+ *
+ * @param id
+ * @return gesuchte Node oder null
+ */
+ Node lookupNode(String id);
+
+ /**
+ * Gibt einen Iterator über alle Node Objekte im Model zurück.
+ *
+ * @return
+ */
+ Iterable<Node> getAllNodes();
+
+ /**
+ * gibt alle auf diesen Knoten zeigendenden Verbindungen
+ *
+ * @param n
+ * zu überprüfender Knoten
+ * @return alle einkommenden Verbindungen.
+ */
+ List<Node> getIncomingConnections(Node n);
+
+ /**
+ * Gibt die mit diesem Modell verknüfpten Eigenschaften
+ *
+ * @return eigenschaften als Properites Object
+ */
+ Properties getProperties();
+
+ /**
+ * Gibt das version-Attribut
+ *
+ * @return version attribut des modells
+ */
+ String getVersion();
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/api/Node.java b/ksm-model/src/de/dhbw/horb/ksm/model/api/Node.java
new file mode 100644
index 0000000..b7589f9
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/api/Node.java
@@ -0,0 +1,39 @@
+package de.dhbw.horb.ksm.model.api;
+
+import java.beans.PropertyChangeListener;
+import java.util.List;
+
+public interface Node {
+ String getId();
+
+ Properties getProperties();
+
+ /**
+ * Erzeugt eine Neue Verbindung.
+ *
+ * Der Aufrufer muss dafür Sorge tragen, dass das Ziel gesetzt wird.
+ *
+ * @return neue Verbindung (Connection Object)
+ */
+ Connection createConnection(String to);
+
+ /**
+ * @see Node#createConnection(String)
+ */
+ Connection createConnection(Node toNode);
+
+ boolean removeConnection(Connection connection);
+
+ /**
+ * Nur lesbare Liste von Verbindungen
+ *
+ * @return
+ */
+ List<Connection> getConnections();
+
+ void addPropertyChangeListener(PropertyChangeListener listener);
+
+ void removePropertyChangeListener(PropertyChangeListener listener);
+
+ void addConnection(Connection connection);
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/api/NodeGroup.java b/ksm-model/src/de/dhbw/horb/ksm/model/api/NodeGroup.java
new file mode 100644
index 0000000..8473b37
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/api/NodeGroup.java
@@ -0,0 +1,94 @@
+package de.dhbw.horb.ksm.model.api;
+
+import java.beans.PropertyChangeListener;
+import java.util.List;
+
+public interface NodeGroup {
+ /**
+ * @return <b>unmodifiable</b> list of all nodes in this NodeGroup
+ */
+ List<Node> getNodes();
+
+ /**
+ * @return <b>unmodifiable</b> list of all nodegroups in this nodegroup
+ */
+ List<NodeGroup> getNodeGroups();
+
+ /**
+ * Create new Node in this NodeGroup.
+ *
+ * fire indexed PropertyChange Event with name "nodes" and index of this new
+ * node.
+ */
+ Node createNode();
+
+ /**
+ * Add a, previously created, Node to this NodeGroup.
+ *
+ *
+ * fire indexed PropertyChange Event with name "nodes" and index of this new
+ * node.
+ */
+ void addNode(Node node);
+
+ /**
+ * Create new NodeGroup in this NodeGroup.
+ *
+ * fire indexed PropertyChange Event with name "nodegroups" and index of
+ * this new nodegroup.
+ */
+ NodeGroup createNodeGroup();
+
+ /**
+ * Add a, previously created, NodeGroup to this NodeGroup.
+ *
+ *
+ * fire indexed PropertyChange Event with name "nodegroups" and index of this new
+ * node.
+ */
+ void addNodeGroup(NodeGroup nodeGroup);
+
+ /**
+ * @return id attribute of this nodegroup
+ */
+ String getId();
+
+ /**
+ * All properties of this node-group
+ */
+ Properties getProperties();
+
+ /**
+ * Remove node from this nodegroup.
+ *
+ * fire indexed propertychangeevent with propertyname nodes
+ *
+ * @return true if operation was successful
+ */
+ boolean removeNode(Node node);
+
+ /**
+ * Remove a sub-{@link NodeGroup} from this {@link NodeGroup}.
+ *
+ * fire indexed propertychange event with propertyname nodegroups.
+ *
+ * @param nodeGroup
+ * a nodeGroup reference
+ */
+ boolean removeNodeGroup(NodeGroup nodeGroup);
+
+ /**
+ * Register new PropertyChangeListener.
+ *
+ * @param listener
+ */
+ void addPropertyChangeListener(PropertyChangeListener listener);
+
+ /**
+ * Remove previously registered PropertyChangeListener
+ *
+ * @param listener
+ */
+ void removePropertyChangeListener(PropertyChangeListener listener);
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/api/Properties.java b/ksm-model/src/de/dhbw/horb/ksm/model/api/Properties.java
new file mode 100644
index 0000000..a0ef027
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/api/Properties.java
@@ -0,0 +1,138 @@
+package de.dhbw.horb.ksm.model.api;
+
+import java.beans.PropertyChangeListener;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.List;
+
+public interface Properties {
+ /**
+ * Get Simple String Property by Name
+ */
+ String getString(String name);
+
+ /**
+ * Get Simple Decimal Property by Name
+ */
+ BigDecimal getDecimal(String name);
+
+ /**
+ * Get Simple Integer Property by Name
+ */
+ BigInteger getInteger(String name);
+
+ /**
+ * Get simple Boolean Property by name
+ */
+ Boolean getBoolean(String name);
+
+ /**
+ * Set Simple String Property by Name.
+ *
+ * fires PropertyChange Event with name "string:NAME" where NAME is
+ * Parameter name
+ */
+ void setString(String name, String value);
+
+ /**
+ * Set Simple Decimal Property by Name
+ *
+ * fires PropertyChange Event with name "decimal:NAME" where NAME is
+ * Parameter name
+ */
+ void setDecimal(String name, BigDecimal value);
+
+ /**
+ * Set Simple Integer Property by Name
+ *
+ * fires PropertyChange Event with name "integer:NAME" where NAME is
+ * Parameter name
+ */
+ void setInteger(String name, BigInteger value);
+
+ /**
+ * Set simple Boolean Property by Name
+ *
+ * fires PropertyChange Event with name "boolean:NAME" where NAME is
+ * Parameter name
+ */
+ void setBoolean(String string, Boolean b);
+
+ /**
+ * get StringList Property by name
+ */
+ List<String> getStringList(String name);
+
+ /**
+ * get DecimalList Property by name
+ */
+ List<BigDecimal> getDecimalList(String name);
+
+ /**
+ * get IntegerList Property by name
+ */
+ List<BigInteger> getIntegerList(String name);
+
+ /**
+ * Create new StringList Property
+ *
+ * fires PropertyChange Event with name "stringList:NAME" where NAME is
+ * parameter name and Index is the Position in the list
+ */
+ List<String> createStringList(String name);
+
+ /**
+ * Create new DecimalList Property
+ *
+ * fires PropertyChange Event with name "decimalList:NAME" where NAME is
+ * parameter name and Index is the Position in the list
+ */
+ List<BigDecimal> createDecimalList(String name);
+
+ /**
+ * Create new IntegerList Property
+ *
+ * fires PropertyChange Event with name "integerList:NAME" where NAME is
+ * parameter name and Index is the Position in the list
+ */
+ List<BigInteger> createIntegerList(String name);
+
+ /**
+ * Remove StringList Property
+ *
+ * fire PropertyChange Event with name "stringList:NAME" where NAME is
+ * the parameter name
+ */
+ boolean removeStringList(String name);
+
+ /**
+ * Remove DecimalList Property
+ *
+ * fire PropertyChange Event with name "decimalList:NAME" where NAME is
+ * the parameter name
+ */
+ boolean removeDecimalList(String name);
+
+ /**
+ * Remove IntegerList Property
+ *
+ *
+ * fire PropertyChange Event with name "integerList:NAME" where NAME is
+ * the parameter name
+ */
+ boolean removeIntegerList(String name);
+
+ /**
+ * Register new PropertyChangeListener.
+ *
+ * @param listener
+ */
+ void addPropertyChangeListener(PropertyChangeListener listener);
+
+ /**
+ * Remove previously registered PropertyChangeListener
+ *
+ * @param listener
+ */
+ void removePropertyChangeListener(PropertyChangeListener listener);
+} \ No newline at end of file
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/ObjectFactory.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/ObjectFactory.java
new file mode 100644
index 0000000..93f1dd9
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/ObjectFactory.java
@@ -0,0 +1,159 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+
+package de.dhbw.horb.ksm.model.generated;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the de.dhbw.horb.ksm.xmlschema.generated package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: de.dhbw.horb.ksm.xmlschema.generated
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link XKSM }
+ *
+ */
+ public XKSM createXKSM() {
+ return new XKSM();
+ }
+
+ /**
+ * Create an instance of {@link XNodeGroup }
+ *
+ */
+ public XNodeGroup createXNodeGroup() {
+ return new XNodeGroup();
+ }
+
+ /**
+ * Create an instance of {@link XProperties }
+ *
+ */
+ public XProperties createXProperties() {
+ return new XProperties();
+ }
+
+ /**
+ * Create an instance of {@link XPropertyDecimal }
+ *
+ */
+ public XPropertyDecimal createXPropertyDecimal() {
+ return new XPropertyDecimal();
+ }
+
+ /**
+ * Create an instance of {@link XPropertyBaseList }
+ *
+ */
+ public XPropertyBaseList createXPropertyBaseList() {
+ return new XPropertyBaseList();
+ }
+
+ /**
+ * Create an instance of {@link XPropertyStringList }
+ *
+ */
+ public XPropertyStringList createXPropertyStringList() {
+ return new XPropertyStringList();
+ }
+
+ /**
+ * Create an instance of {@link XPropertyIntegerList }
+ *
+ */
+ public XPropertyIntegerList createXPropertyIntegerList() {
+ return new XPropertyIntegerList();
+ }
+
+ /**
+ * Create an instance of {@link XPropertyBase }
+ *
+ */
+ public XPropertyBase createXPropertyBase() {
+ return new XPropertyBase();
+ }
+
+ /**
+ * Create an instance of {@link XPropertyDecimalList }
+ *
+ */
+ public XPropertyDecimalList createXPropertyDecimalList() {
+ return new XPropertyDecimalList();
+ }
+
+ /**
+ * Create an instance of {@link XNode }
+ *
+ */
+ public XNode createXNode() {
+ return new XNode();
+ }
+
+ /**
+ * Create an instance of {@link XPropertyString }
+ *
+ */
+ public XPropertyString createXPropertyString() {
+ return new XPropertyString();
+ }
+
+ /**
+ * Create an instance of {@link XPropertyBoolean }
+ *
+ */
+ public XPropertyBoolean createXPropertyBoolean() {
+ return new XPropertyBoolean();
+ }
+
+ /**
+ * Create an instance of {@link XConnections }
+ *
+ */
+ public XConnections createXConnections() {
+ return new XConnections();
+ }
+
+ /**
+ * Create an instance of {@link XConnection }
+ *
+ */
+ public XConnection createXConnection() {
+ return new XConnection();
+ }
+
+ /**
+ * Create an instance of {@link XPropertyInteger }
+ *
+ */
+ public XPropertyInteger createXPropertyInteger() {
+ return new XPropertyInteger();
+ }
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/XConnection.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XConnection.java
new file mode 100644
index 0000000..7426aae
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XConnection.java
@@ -0,0 +1,97 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+
+package de.dhbw.horb.ksm.model.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for CONNECTION_TYPE complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="CONNECTION_TYPE">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="properties" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}PROPERTIES_TYPE"/>
+ * &lt;/sequence>
+ * &lt;attribute name="to" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}NODE_ID_TYPE" />
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "CONNECTION_TYPE", propOrder = {
+ "properties"
+})
+public class XConnection {
+
+ @XmlElement(required = true)
+ protected XProperties properties;
+ @XmlAttribute(name = "to")
+ protected String to;
+
+ /**
+ * Gets the value of the properties property.
+ *
+ * @return
+ * possible object is
+ * {@link XProperties }
+ *
+ */
+ public XProperties getProperties() {
+ return properties;
+ }
+
+ /**
+ * Sets the value of the properties property.
+ *
+ * @param value
+ * allowed object is
+ * {@link XProperties }
+ *
+ */
+ public void setProperties(XProperties value) {
+ this.properties = value;
+ }
+
+ /**
+ * Gets the value of the to property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTo() {
+ return to;
+ }
+
+ /**
+ * Sets the value of the to property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTo(String value) {
+ this.to = value;
+ }
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/XConnections.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XConnections.java
new file mode 100644
index 0000000..317a00d
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XConnections.java
@@ -0,0 +1,74 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+
+package de.dhbw.horb.ksm.model.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for CONNECTIONS_TYPE complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="CONNECTIONS_TYPE">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="connection" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}CONNECTION_TYPE" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "CONNECTIONS_TYPE", propOrder = {
+ "connection"
+})
+public class XConnections {
+
+ protected List<XConnection> connection;
+
+ /**
+ * Gets the value of the connection property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the connection property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getConnection().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link XConnection }
+ *
+ *
+ */
+ public List<XConnection> getConnection() {
+ if (connection == null) {
+ connection = new ArrayList<XConnection>();
+ }
+ return this.connection;
+ }
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/XKSM.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XKSM.java
new file mode 100644
index 0000000..027eb3f
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XKSM.java
@@ -0,0 +1,124 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+
+package de.dhbw.horb.ksm.model.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType>
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="nodegroup" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}NODEGROUP_TYPE"/>
+ * &lt;element name="properties" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}PROPERTIES_TYPE" minOccurs="0"/>
+ * &lt;/sequence>
+ * &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "nodegroup",
+ "properties"
+})
+public class XKSM {
+
+ @XmlElement(required = true)
+ protected XNodeGroup nodegroup;
+ protected XProperties properties;
+ @XmlAttribute(name = "version", required = true)
+ protected String version;
+
+ /**
+ * Gets the value of the nodegroup property.
+ *
+ * @return
+ * possible object is
+ * {@link XNodeGroup }
+ *
+ */
+ public XNodeGroup getNodegroup() {
+ return nodegroup;
+ }
+
+ /**
+ * Sets the value of the nodegroup property.
+ *
+ * @param value
+ * allowed object is
+ * {@link XNodeGroup }
+ *
+ */
+ public void setNodegroup(XNodeGroup value) {
+ this.nodegroup = value;
+ }
+
+ /**
+ * Gets the value of the properties property.
+ *
+ * @return
+ * possible object is
+ * {@link XProperties }
+ *
+ */
+ public XProperties getProperties() {
+ return properties;
+ }
+
+ /**
+ * Sets the value of the properties property.
+ *
+ * @param value
+ * allowed object is
+ * {@link XProperties }
+ *
+ */
+ public void setProperties(XProperties value) {
+ this.properties = value;
+ }
+
+ /**
+ * Gets the value of the version property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * Sets the value of the version property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setVersion(String value) {
+ this.version = value;
+ }
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/XNode.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XNode.java
new file mode 100644
index 0000000..28593d3
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XNode.java
@@ -0,0 +1,124 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+
+package de.dhbw.horb.ksm.model.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for NODE_TYPE complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="NODE_TYPE">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="properties" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}PROPERTIES_TYPE"/>
+ * &lt;element name="connections" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}CONNECTIONS_TYPE" minOccurs="0"/>
+ * &lt;/sequence>
+ * &lt;attribute name="id" use="required" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}NODE_ID_TYPE" />
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "NODE_TYPE", propOrder = {
+ "properties",
+ "connections"
+})
+public class XNode {
+
+ @XmlElement(required = true)
+ protected XProperties properties;
+ protected XConnections connections;
+ @XmlAttribute(name = "id", required = true)
+ protected String id;
+
+ /**
+ * Gets the value of the properties property.
+ *
+ * @return
+ * possible object is
+ * {@link XProperties }
+ *
+ */
+ public XProperties getProperties() {
+ return properties;
+ }
+
+ /**
+ * Sets the value of the properties property.
+ *
+ * @param value
+ * allowed object is
+ * {@link XProperties }
+ *
+ */
+ public void setProperties(XProperties value) {
+ this.properties = value;
+ }
+
+ /**
+ * Gets the value of the connections property.
+ *
+ * @return
+ * possible object is
+ * {@link XConnections }
+ *
+ */
+ public XConnections getConnections() {
+ return connections;
+ }
+
+ /**
+ * Sets the value of the connections property.
+ *
+ * @param value
+ * allowed object is
+ * {@link XConnections }
+ *
+ */
+ public void setConnections(XConnections value) {
+ this.connections = value;
+ }
+
+ /**
+ * Gets the value of the id property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Sets the value of the id property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setId(String value) {
+ this.id = value;
+ }
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/XNodeGroup.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XNodeGroup.java
new file mode 100644
index 0000000..6040e94
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XNodeGroup.java
@@ -0,0 +1,163 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+
+package de.dhbw.horb.ksm.model.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for NODEGROUP_TYPE complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="NODEGROUP_TYPE">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="node" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}NODE_TYPE" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;element name="nodegroup" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}NODEGROUP_TYPE" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;element name="properties" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}PROPERTIES_TYPE"/>
+ * &lt;/sequence>
+ * &lt;attribute name="id" use="required" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}NODE_ID_TYPE" />
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "NODEGROUP_TYPE", propOrder = {
+ "node",
+ "nodegroup",
+ "properties"
+})
+public class XNodeGroup {
+
+ protected List<XNode> node;
+ protected List<XNodeGroup> nodegroup;
+ @XmlElement(required = true)
+ protected XProperties properties;
+ @XmlAttribute(name = "id", required = true)
+ protected String id;
+
+ /**
+ * Gets the value of the node property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the node property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getNode().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link XNode }
+ *
+ *
+ */
+ public List<XNode> getNode() {
+ if (node == null) {
+ node = new ArrayList<XNode>();
+ }
+ return this.node;
+ }
+
+ /**
+ * Gets the value of the nodegroup property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the nodegroup property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getNodegroup().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link XNodeGroup }
+ *
+ *
+ */
+ public List<XNodeGroup> getNodegroup() {
+ if (nodegroup == null) {
+ nodegroup = new ArrayList<XNodeGroup>();
+ }
+ return this.nodegroup;
+ }
+
+ /**
+ * Gets the value of the properties property.
+ *
+ * @return
+ * possible object is
+ * {@link XProperties }
+ *
+ */
+ public XProperties getProperties() {
+ return properties;
+ }
+
+ /**
+ * Sets the value of the properties property.
+ *
+ * @param value
+ * allowed object is
+ * {@link XProperties }
+ *
+ */
+ public void setProperties(XProperties value) {
+ this.properties = value;
+ }
+
+ /**
+ * Gets the value of the id property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Sets the value of the id property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setId(String value) {
+ this.id = value;
+ }
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/XProperties.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XProperties.java
new file mode 100644
index 0000000..67febaa
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XProperties.java
@@ -0,0 +1,268 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+
+package de.dhbw.horb.ksm.model.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for PROPERTIES_TYPE complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="PROPERTIES_TYPE">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="string" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}PROPERTY_STRING_TYPE" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;element name="decimal" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}PROPERTY_DECIMAL_TYPE" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;element name="integer" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}PROPERTY_INTEGER_TYPE" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;element name="boolean" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}PROPERTY_BOOLEAN_TYPE" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;element name="stringList" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}PROPERTY_STRING_LIST_TYPE" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;element name="decimalList" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}PROPERTY_DECIMAL_LIST_TYPE" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;element name="integerList" type="{http://www.ba-horb.de/~ksm/xml/ksm-1}PROPERTY_INTEGER_LIST_TYPE" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "PROPERTIES_TYPE", propOrder = {
+ "string",
+ "decimal",
+ "integer",
+ "_boolean",
+ "stringList",
+ "decimalList",
+ "integerList"
+})
+public class XProperties {
+
+ protected List<XPropertyString> string;
+ protected List<XPropertyDecimal> decimal;
+ protected List<XPropertyInteger> integer;
+ @XmlElement(name = "boolean")
+ protected List<XPropertyBoolean> _boolean;
+ protected List<XPropertyStringList> stringList;
+ protected List<XPropertyDecimalList> decimalList;
+ protected List<XPropertyIntegerList> integerList;
+
+ /**
+ * Gets the value of the string property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the string property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getString().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link XPropertyString }
+ *
+ *
+ */
+ public List<XPropertyString> getString() {
+ if (string == null) {
+ string = new ArrayList<XPropertyString>();
+ }
+ return this.string;
+ }
+
+ /**
+ * Gets the value of the decimal property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the decimal property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getDecimal().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link XPropertyDecimal }
+ *
+ *
+ */
+ public List<XPropertyDecimal> getDecimal() {
+ if (decimal == null) {
+ decimal = new ArrayList<XPropertyDecimal>();
+ }
+ return this.decimal;
+ }
+
+ /**
+ * Gets the value of the integer property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the integer property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getInteger().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link XPropertyInteger }
+ *
+ *
+ */
+ public List<XPropertyInteger> getInteger() {
+ if (integer == null) {
+ integer = new ArrayList<XPropertyInteger>();
+ }
+ return this.integer;
+ }
+
+ /**
+ * Gets the value of the boolean property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the boolean property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getBoolean().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link XPropertyBoolean }
+ *
+ *
+ */
+ public List<XPropertyBoolean> getBoolean() {
+ if (_boolean == null) {
+ _boolean = new ArrayList<XPropertyBoolean>();
+ }
+ return this._boolean;
+ }
+
+ /**
+ * Gets the value of the stringList property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the stringList property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getStringList().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link XPropertyStringList }
+ *
+ *
+ */
+ public List<XPropertyStringList> getStringList() {
+ if (stringList == null) {
+ stringList = new ArrayList<XPropertyStringList>();
+ }
+ return this.stringList;
+ }
+
+ /**
+ * Gets the value of the decimalList property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the decimalList property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getDecimalList().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link XPropertyDecimalList }
+ *
+ *
+ */
+ public List<XPropertyDecimalList> getDecimalList() {
+ if (decimalList == null) {
+ decimalList = new ArrayList<XPropertyDecimalList>();
+ }
+ return this.decimalList;
+ }
+
+ /**
+ * Gets the value of the integerList property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the integerList property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getIntegerList().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link XPropertyIntegerList }
+ *
+ *
+ */
+ public List<XPropertyIntegerList> getIntegerList() {
+ if (integerList == null) {
+ integerList = new ArrayList<XPropertyIntegerList>();
+ }
+ return this.integerList;
+ }
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyBase.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyBase.java
new file mode 100644
index 0000000..aca1cd6
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyBase.java
@@ -0,0 +1,97 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+
+package de.dhbw.horb.ksm.model.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+
+/**
+ * <p>Java class for PROPERTY_BASE_TYPE complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="PROPERTY_BASE_TYPE">
+ * &lt;simpleContent>
+ * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>anySimpleType">
+ * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
+ * &lt;/extension>
+ * &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "PROPERTY_BASE_TYPE", propOrder = {
+ "value"
+})
+public class XPropertyBase {
+
+ @XmlValue
+ @XmlSchemaType(name = "anySimpleType")
+ protected Object value;
+ @XmlAttribute(name = "name", required = true)
+ @XmlSchemaType(name = "anySimpleType")
+ protected String name;
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link Object }
+ *
+ */
+ public Object getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Object }
+ *
+ */
+ public void setValue(Object value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyBaseList.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyBaseList.java
new file mode 100644
index 0000000..fef8e2f
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyBaseList.java
@@ -0,0 +1,75 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+
+package de.dhbw.horb.ksm.model.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for PROPERTY_LIST_BASE_TYPE complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="PROPERTY_LIST_BASE_TYPE">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;/sequence>
+ * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "PROPERTY_LIST_BASE_TYPE")
+@XmlSeeAlso({
+ XPropertyStringList.class,
+ XPropertyIntegerList.class,
+ XPropertyDecimalList.class
+})
+public class XPropertyBaseList {
+
+ @XmlAttribute(name = "name", required = true)
+ @XmlSchemaType(name = "anySimpleType")
+ protected String name;
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyBoolean.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyBoolean.java
new file mode 100644
index 0000000..ba8d519
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyBoolean.java
@@ -0,0 +1,88 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+
+package de.dhbw.horb.ksm.model.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+
+/**
+ * <p>Java class for PROPERTY_BOOLEAN_TYPE complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="PROPERTY_BOOLEAN_TYPE">
+ * &lt;simpleContent>
+ * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>boolean">
+ * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
+ * &lt;/extension>
+ * &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "PROPERTY_BOOLEAN_TYPE", propOrder = {
+ "value"
+})
+public class XPropertyBoolean {
+
+ @XmlValue
+ protected boolean value;
+ @XmlAttribute(name = "name", required = true)
+ @XmlSchemaType(name = "anySimpleType")
+ protected String name;
+
+ /**
+ * Gets the value of the value property.
+ *
+ */
+ public boolean isValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ */
+ public void setValue(boolean value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyDecimal.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyDecimal.java
new file mode 100644
index 0000000..105552b
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyDecimal.java
@@ -0,0 +1,97 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+
+package de.dhbw.horb.ksm.model.generated;
+
+import java.math.BigDecimal;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+
+/**
+ * <p>Java class for PROPERTY_DECIMAL_TYPE complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="PROPERTY_DECIMAL_TYPE">
+ * &lt;simpleContent>
+ * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>decimal">
+ * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
+ * &lt;/extension>
+ * &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "PROPERTY_DECIMAL_TYPE", propOrder = {
+ "value"
+})
+public class XPropertyDecimal {
+
+ @XmlValue
+ protected BigDecimal value;
+ @XmlAttribute(name = "name", required = true)
+ @XmlSchemaType(name = "anySimpleType")
+ protected String name;
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link BigDecimal }
+ *
+ */
+ public BigDecimal getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigDecimal }
+ *
+ */
+ public void setValue(BigDecimal value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyDecimalList.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyDecimalList.java
new file mode 100644
index 0000000..9078b5c
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyDecimalList.java
@@ -0,0 +1,77 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+
+package de.dhbw.horb.ksm.model.generated;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for PROPERTY_DECIMAL_LIST_TYPE complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="PROPERTY_DECIMAL_LIST_TYPE">
+ * &lt;complexContent>
+ * &lt;extension base="{http://www.ba-horb.de/~ksm/xml/ksm-1}PROPERTY_LIST_BASE_TYPE">
+ * &lt;sequence>
+ * &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}decimal" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;/sequence>
+ * &lt;/extension>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "PROPERTY_DECIMAL_LIST_TYPE", propOrder = {
+ "value"
+})
+public class XPropertyDecimalList
+ extends XPropertyBaseList
+{
+
+ protected List<BigDecimal> value;
+
+ /**
+ * Gets the value of the value property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the value property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getValue().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link BigDecimal }
+ *
+ *
+ */
+ public List<BigDecimal> getValue() {
+ if (value == null) {
+ value = new ArrayList<BigDecimal>();
+ }
+ return this.value;
+ }
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyInteger.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyInteger.java
new file mode 100644
index 0000000..2fe2d51
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyInteger.java
@@ -0,0 +1,97 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+
+package de.dhbw.horb.ksm.model.generated;
+
+import java.math.BigInteger;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+
+/**
+ * <p>Java class for PROPERTY_INTEGER_TYPE complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="PROPERTY_INTEGER_TYPE">
+ * &lt;simpleContent>
+ * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>integer">
+ * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
+ * &lt;/extension>
+ * &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "PROPERTY_INTEGER_TYPE", propOrder = {
+ "value"
+})
+public class XPropertyInteger {
+
+ @XmlValue
+ protected BigInteger value;
+ @XmlAttribute(name = "name", required = true)
+ @XmlSchemaType(name = "anySimpleType")
+ protected String name;
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setValue(BigInteger value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyIntegerList.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyIntegerList.java
new file mode 100644
index 0000000..c6ee73d
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyIntegerList.java
@@ -0,0 +1,77 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+
+package de.dhbw.horb.ksm.model.generated;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for PROPERTY_INTEGER_LIST_TYPE complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="PROPERTY_INTEGER_LIST_TYPE">
+ * &lt;complexContent>
+ * &lt;extension base="{http://www.ba-horb.de/~ksm/xml/ksm-1}PROPERTY_LIST_BASE_TYPE">
+ * &lt;sequence>
+ * &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}integer" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;/sequence>
+ * &lt;/extension>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "PROPERTY_INTEGER_LIST_TYPE", propOrder = {
+ "value"
+})
+public class XPropertyIntegerList
+ extends XPropertyBaseList
+{
+
+ protected List<BigInteger> value;
+
+ /**
+ * Gets the value of the value property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the value property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getValue().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link BigInteger }
+ *
+ *
+ */
+ public List<BigInteger> getValue() {
+ if (value == null) {
+ value = new ArrayList<BigInteger>();
+ }
+ return this.value;
+ }
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyString.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyString.java
new file mode 100644
index 0000000..df2bf36
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyString.java
@@ -0,0 +1,96 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+
+package de.dhbw.horb.ksm.model.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+
+/**
+ * <p>Java class for PROPERTY_STRING_TYPE complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="PROPERTY_STRING_TYPE">
+ * &lt;simpleContent>
+ * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
+ * &lt;/extension>
+ * &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "PROPERTY_STRING_TYPE", propOrder = {
+ "value"
+})
+public class XPropertyString {
+
+ @XmlValue
+ protected String value;
+ @XmlAttribute(name = "name", required = true)
+ @XmlSchemaType(name = "anySimpleType")
+ protected String name;
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyStringList.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyStringList.java
new file mode 100644
index 0000000..ffddcbb
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/XPropertyStringList.java
@@ -0,0 +1,76 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+
+package de.dhbw.horb.ksm.model.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for PROPERTY_STRING_LIST_TYPE complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="PROPERTY_STRING_LIST_TYPE">
+ * &lt;complexContent>
+ * &lt;extension base="{http://www.ba-horb.de/~ksm/xml/ksm-1}PROPERTY_LIST_BASE_TYPE">
+ * &lt;sequence>
+ * &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;/sequence>
+ * &lt;/extension>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "PROPERTY_STRING_LIST_TYPE", propOrder = {
+ "value"
+})
+public class XPropertyStringList
+ extends XPropertyBaseList
+{
+
+ protected List<String> value;
+
+ /**
+ * Gets the value of the value property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the value property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getValue().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link String }
+ *
+ *
+ */
+ public List<String> getValue() {
+ if (value == null) {
+ value = new ArrayList<String>();
+ }
+ return this.value;
+ }
+
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/generated/package-info.java b/ksm-model/src/de/dhbw/horb/ksm/model/generated/package-info.java
new file mode 100644
index 0000000..1cb8266
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/generated/package-info.java
@@ -0,0 +1,9 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2011.04.27 at 01:09:52 PM MESZ
+//
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.ba-horb.de/~ksm/xml/ksm-1", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package de.dhbw.horb.ksm.model.generated;
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/impl/ConnectionImpl.java b/ksm-model/src/de/dhbw/horb/ksm/model/impl/ConnectionImpl.java
new file mode 100644
index 0000000..7acb87d
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/impl/ConnectionImpl.java
@@ -0,0 +1,49 @@
+package de.dhbw.horb.ksm.model.impl;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+
+import de.dhbw.horb.ksm.model.api.Connection;
+import de.dhbw.horb.ksm.model.api.Properties;
+import de.dhbw.horb.ksm.model.generated.XConnection;
+
+class ConnectionImpl implements Connection {
+ final XConnection xconn;
+ private final Properties properties;
+ private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
+
+ @Override
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ pcs.addPropertyChangeListener(listener);
+ }
+
+ @Override
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ pcs.removePropertyChangeListener(listener);
+ }
+
+ public ConnectionImpl(XConnection xconn) {
+ this.xconn = xconn;
+ if (xconn.getProperties() == null) {
+ xconn.setProperties(KSMFactory.objectFactory.createXProperties());
+ }
+ this.properties = new PropertiesImpl(xconn.getProperties());
+ }
+
+ @Override
+ public String getTo() {
+ return xconn.getTo();
+ }
+
+ @Override
+ public void setTo(String id) {
+ String oldValue = getTo();
+ xconn.setTo(id);
+ pcs.firePropertyChange("to", oldValue, getTo());
+ }
+
+ @Override
+ public Properties getProperties() {
+ return properties;
+ }
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/impl/KSMFactory.java b/ksm-model/src/de/dhbw/horb/ksm/model/impl/KSMFactory.java
new file mode 100644
index 0000000..9a33684
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/impl/KSMFactory.java
@@ -0,0 +1,74 @@
+package de.dhbw.horb.ksm.model.impl;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.namespace.QName;
+import javax.xml.transform.sax.SAXSource;
+
+import org.xml.sax.InputSource;
+
+import de.dhbw.horb.ksm.model.api.KSM;
+import de.dhbw.horb.ksm.model.generated.ObjectFactory;
+import de.dhbw.horb.ksm.model.generated.XKSM;
+
+public class KSMFactory {
+ private static JAXBContext jc = null;
+ static ObjectFactory objectFactory = new ObjectFactory();
+
+ static {
+ try {
+ jc = JAXBContext.newInstance(XKSM.class);
+ } catch (JAXBException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static KSM loadKSM(File file) throws FileNotFoundException,
+ JAXBException {
+ return loadKSM(new FileInputStream(file));
+ }
+
+ public static KSM loadKSM(InputStream is) throws JAXBException {
+ Unmarshaller u = jc.createUnmarshaller();
+
+ JAXBElement<XKSM> xksm = u.unmarshal(new SAXSource(new InputSource(is)), XKSM.class);
+
+ return new KSMImpl(xksm.getValue());
+ }
+
+ public static KSM createEmptyKSM() {
+ ObjectFactory of = new ObjectFactory();
+ XKSM xksm = of.createXKSM();
+ KSMImpl ksm = new KSMImpl(xksm);
+ return ksm;
+ }
+
+ public static void saveKSM(KSM ksm, File file)
+ throws FileNotFoundException, JAXBException {
+ saveKSM(ksm, new FileOutputStream(file));
+ }
+
+ public static void saveKSM(KSM ksm, OutputStream os) throws JAXBException {
+ if (ksm instanceof KSMImpl) {
+ KSMImpl ksmimpl = (KSMImpl) ksm;
+ JAXBElement<XKSM> x = new JAXBElement<XKSM>(new QName("ksm"),
+ XKSM.class, ksmimpl.getXksm());
+ Marshaller m = jc.createMarshaller();
+
+ m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ m.marshal(x, os);
+ } else {
+ throw new JAXBException("Illegal KSM Object type");
+ }
+ }
+}
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/impl/KSMImpl.java b/ksm-model/src/de/dhbw/horb/ksm/model/impl/KSMImpl.java
new file mode 100644
index 0000000..1980e1e
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/impl/KSMImpl.java
@@ -0,0 +1,109 @@
+package de.dhbw.horb.ksm.model.impl;
+
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import de.dhbw.horb.ksm.model.api.Connection;
+import de.dhbw.horb.ksm.model.api.KSM;
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+import de.dhbw.horb.ksm.model.generated.XKSM;
+import de.dhbw.horb.ksm.model.generated.XNodeGroup;
+
+class KSMImpl implements KSM {
+ private final XKSM xksm;
+ private NodeGroupImpl nodeGroup;
+ private PropertiesImpl properties;
+
+ public KSMImpl(XKSM xksm) {
+ this.xksm = xksm;
+ if (xksm.getNodegroup() == null) {
+ XNodeGroup xNodeGroup = KSMFactory.objectFactory.createXNodeGroup();
+ xNodeGroup.setId(UUID.randomUUID().toString());
+ xksm.setNodegroup(xNodeGroup);
+ }
+ this.nodeGroup = new NodeGroupImpl(xksm.getNodegroup());
+ if (xksm.getProperties() == null) {
+ xksm.setProperties(KSMFactory.objectFactory.createXProperties());
+ }
+ this.properties = new PropertiesImpl(xksm.getProperties());
+ }
+
+ XKSM getXksm() {
+ return xksm;
+ }
+
+ @Override
+ public NodeGroup getNodeGroup() {
+ return nodeGroup;
+ }
+
+ @Override
+ public PropertiesImpl getProperties() {
+ return properties;
+ }
+
+ @Override
+ public String getVersion() {
+ return xksm.getVersion();
+ }
+
+ @Override
+ public NodeGroup lookupNodeGroup(String id) {
+ if (id == null)
+ return null;
+
+ ArrayDeque<NodeGroup> queue = new ArrayDeque<NodeGroup>();
+ queue.add(getNodeGroup());
+ while (!queue.isEmpty()) {
+ NodeGroup group = queue.pop();
+ if (group.getId().equals(id)) {
+ return group;
+ } else {
+ queue.addAll(group.getNodeGroups());
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public Node lookupNode(String id) {
+ if (id == null)
+ return null;
+
+ for (Node node : getAllNodes()) {
+ if (id.equals(node.getId())) {
+ return node;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public Iterable<Node> getAllNodes() {
+ List<Node> nodes = new ArrayList<Node>();
+ ArrayDeque<NodeGroup> queue = new ArrayDeque<NodeGroup>();
+ queue.add(getNodeGroup());
+ while (!queue.isEmpty()) {
+ NodeGroup group = queue.pop();
+ nodes.addAll(group.getNodes());
+ queue.addAll(group.getNodeGroups());
+ }
+ return nodes;
+ }
+
+ @Override
+ public List<Node> getIncomingConnections(Node node) {
+ List<Node> nodes = new ArrayList<Node>();
+ for (Node otherNode : getAllNodes()) {
+ for (Connection connection : otherNode.getConnections()) {
+ if (connection.getTo().equals(node.getId())) {
+ nodes.add(otherNode);
+ }
+ }
+ }
+ return nodes;
+ }
+} \ No newline at end of file
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/impl/NodeGroupImpl.java b/ksm-model/src/de/dhbw/horb/ksm/model/impl/NodeGroupImpl.java
new file mode 100644
index 0000000..6457c78
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/impl/NodeGroupImpl.java
@@ -0,0 +1,153 @@
+package de.dhbw.horb.ksm.model.impl;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.UUID;
+
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+import de.dhbw.horb.ksm.model.generated.XNode;
+import de.dhbw.horb.ksm.model.generated.XNodeGroup;
+
+class NodeGroupImpl implements NodeGroup {
+
+ private final XNodeGroup xnodegroup;
+ private final List<Node> nodes = new ArrayList<Node>();
+ private final List<NodeGroup> nodeGroups = new ArrayList<NodeGroup>();
+ private final PropertiesImpl properties;
+ private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
+
+ @Override
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ pcs.addPropertyChangeListener(listener);
+ }
+
+ @Override
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ pcs.removePropertyChangeListener(listener);
+ }
+
+ public NodeGroupImpl(XNodeGroup xnodegroup) {
+ this.xnodegroup = xnodegroup;
+ if (xnodegroup.getProperties() == null) {
+ xnodegroup.setProperties(KSMFactory.objectFactory
+ .createXProperties());
+ }
+ this.properties = new PropertiesImpl(xnodegroup.getProperties());
+ for (XNode xnode : xnodegroup.getNode()) {
+ nodes.add(new NodeImpl(xnode));
+ }
+ for (XNodeGroup xOtherNodeGroup : xnodegroup.getNodegroup()) {
+ nodeGroups.add(new NodeGroupImpl(xOtherNodeGroup));
+ }
+ }
+
+ @Override
+ public List<Node> getNodes() {
+ return Collections.unmodifiableList(nodes);
+ }
+
+ @Override
+ public List<NodeGroup> getNodeGroups() {
+ return Collections.unmodifiableList(nodeGroups);
+ }
+
+ @Override
+ public Node createNode() {
+ XNode xNode = KSMFactory.objectFactory.createXNode();
+ xNode.setId(UUID.randomUUID().toString());
+ NodeImpl node = new NodeImpl(xNode);
+ addNode(node);
+ return node;
+ }
+
+ @Override
+ public void addNode(Node node) {
+ if (node instanceof NodeImpl) {
+ NodeImpl nodeImpl = (NodeImpl) node;
+ xnodegroup.getNode().add(nodeImpl.xnode);
+ nodes.add(nodeImpl);
+ pcs.fireIndexedPropertyChange("nodes", nodes.indexOf(nodeImpl),
+ null, node);
+ } else {
+ throw new IllegalArgumentException(
+ "The node Object must be of type NodeImpl");
+ }
+ }
+
+ @Override
+ public void addNodeGroup(NodeGroup nodeGroup) {
+ if (nodeGroup instanceof NodeGroupImpl) {
+ NodeGroupImpl nodeGruopImpl = (NodeGroupImpl) nodeGroup;
+ xnodegroup.getNodegroup().add(nodeGruopImpl.xnodegroup);
+ nodeGroups.add(nodeGruopImpl);
+ pcs.fireIndexedPropertyChange("nodegroups",
+ nodes.indexOf(nodeGruopImpl), null, nodeGroup);
+ } else {
+ throw new IllegalArgumentException(
+ "The nodeGroup Object must be of type NodeGroupImpl");
+ }
+ }
+
+ @Override
+ public boolean removeNode(Node node) {
+ if (node instanceof NodeImpl) {
+ NodeImpl nodeImpl = (NodeImpl) node;
+ int index = nodes.indexOf(node);
+ boolean success = nodes.remove(node)
+ && xnodegroup.getNode().remove(nodeImpl.xnode);
+ if (success) {
+ pcs.fireIndexedPropertyChange("nodes", index, node, null);
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public NodeGroup createNodeGroup() {
+ XNodeGroup subXNodeGroup = KSMFactory.objectFactory.createXNodeGroup();
+ subXNodeGroup.setId(UUID.randomUUID().toString());
+
+ NodeGroup nodeGroup = new NodeGroupImpl(subXNodeGroup);
+ addNodeGroup(nodeGroup);
+ return nodeGroup;
+ }
+
+ @Override
+ public boolean removeNodeGroup(NodeGroup nodeGroup) {
+ if (nodeGroup instanceof NodeGroupImpl) {
+ NodeGroupImpl nodeGroupImpl = (NodeGroupImpl) nodeGroup;
+ int index = nodeGroups.indexOf(nodeGroupImpl);
+ boolean success = nodeGroups.remove(nodeGroupImpl);
+ success &= xnodegroup.getNodegroup().remove(
+ nodeGroupImpl.xnodegroup);
+ if (success) {
+ pcs.fireIndexedPropertyChange("nodegroups", index, nodeGroup,
+ null);
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ throw new IllegalArgumentException(
+ "The nodeGroup Object must be of type NodeGroupImpl");
+ }
+ }
+
+ @Override
+ public String getId() {
+ return xnodegroup.getId();
+ }
+
+ @Override
+ public PropertiesImpl getProperties() {
+ return properties;
+ }
+} \ No newline at end of file
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/impl/NodeImpl.java b/ksm-model/src/de/dhbw/horb/ksm/model/impl/NodeImpl.java
new file mode 100644
index 0000000..9cd47cd
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/impl/NodeImpl.java
@@ -0,0 +1,109 @@
+package de.dhbw.horb.ksm.model.impl;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import de.dhbw.horb.ksm.model.api.Connection;
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.Properties;
+import de.dhbw.horb.ksm.model.generated.XConnection;
+import de.dhbw.horb.ksm.model.generated.XNode;
+
+class NodeImpl implements Node {
+ private static final String PROPERTY_CONNECTIONS = "connections";
+ final XNode xnode;
+ private final Properties properties;
+ private List<Connection> connections = new ArrayList<Connection>();
+ private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
+
+ public NodeImpl(XNode xnode) {
+ this.xnode = xnode;
+ if (xnode.getConnections() == null) {
+ xnode.setConnections(KSMFactory.objectFactory.createXConnections());
+ }
+ for (XConnection xconn : xnode.getConnections().getConnection()) {
+ connections.add(new ConnectionImpl(xconn));
+ }
+ if (xnode.getProperties() == null) {
+ xnode.setProperties(KSMFactory.objectFactory.createXProperties());
+ }
+ this.properties = new PropertiesImpl(xnode.getProperties());
+ }
+
+ @Override
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ pcs.addPropertyChangeListener(listener);
+ }
+
+ @Override
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ pcs.removePropertyChangeListener(listener);
+ }
+
+ @Override
+ public List<Connection> getConnections() {
+ return Collections.unmodifiableList(connections);
+ }
+
+ @Override
+ public String getId() {
+ return xnode.getId();
+ }
+
+ @Override
+ public Properties getProperties() {
+ return properties;
+ }
+
+ @Override
+ public Connection createConnection(String to) {
+ XConnection xConnection = KSMFactory.objectFactory.createXConnection();
+ Connection connection = new ConnectionImpl(xConnection);
+ connection.setTo(to);
+
+ addConnection(connection);
+ return connection;
+ }
+
+ @Override
+ public Connection createConnection(Node toNode) {
+ return createConnection(toNode.getId());
+ }
+
+ @Override
+ public void addConnection(Connection connection) {
+ if (connection instanceof ConnectionImpl) {
+ ConnectionImpl c = (ConnectionImpl) connection;
+ xnode.getConnections().getConnection().add(c.xconn);
+ connections.add(connection);
+
+ pcs.fireIndexedPropertyChange(PROPERTY_CONNECTIONS,
+ connections.indexOf(connection), null, connection);
+ } else {
+ throw new IllegalArgumentException("Argument connection must be of type ConnectionImpl");
+ }
+ }
+
+ @Override
+ public boolean removeConnection(Connection connection) {
+ if (connection instanceof ConnectionImpl) {
+ int index = connections.indexOf(connection);
+ ConnectionImpl c = (ConnectionImpl) connection;
+
+ boolean ret = connections.remove(connection)
+ && xnode.getConnections().getConnection().remove(c.xconn);
+ if (ret) {
+ pcs.fireIndexedPropertyChange(PROPERTY_CONNECTIONS, index,
+ connection, null);
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ throw new IllegalArgumentException("Argument connection must be of type ConnectionImpl");
+ }
+ }
+} \ No newline at end of file
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/impl/PropertiesImpl.java b/ksm-model/src/de/dhbw/horb/ksm/model/impl/PropertiesImpl.java
new file mode 100644
index 0000000..80639d5
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/impl/PropertiesImpl.java
@@ -0,0 +1,356 @@
+package de.dhbw.horb.ksm.model.impl;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.List;
+
+import de.dhbw.horb.ksm.model.api.Properties;
+import de.dhbw.horb.ksm.model.generated.XProperties;
+import de.dhbw.horb.ksm.model.generated.XPropertyBoolean;
+import de.dhbw.horb.ksm.model.generated.XPropertyDecimal;
+import de.dhbw.horb.ksm.model.generated.XPropertyDecimalList;
+import de.dhbw.horb.ksm.model.generated.XPropertyInteger;
+import de.dhbw.horb.ksm.model.generated.XPropertyIntegerList;
+import de.dhbw.horb.ksm.model.generated.XPropertyString;
+import de.dhbw.horb.ksm.model.generated.XPropertyStringList;
+
+class PropertiesImpl implements Properties {
+
+ private final XProperties xproperties;
+
+ private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
+
+ public PropertiesImpl(XProperties properties) {
+ this.xproperties = properties;
+ }
+
+ @Override
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ pcs.addPropertyChangeListener(listener);
+ }
+
+ @Override
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ pcs.removePropertyChangeListener(listener);
+ }
+
+ private XPropertyString getStringXProperty(String name) {
+ if (name == null)
+ return null;
+ if (xproperties.getString() == null)
+ return null;
+ for (XPropertyString x : xproperties.getString()) {
+ if (name.equals(x.getName())) {
+ return x;
+ }
+ }
+ return null;
+ }
+
+ private XPropertyDecimal getDecimalXProperty(String name) {
+ if (name == null)
+ return null;
+ if (xproperties.getDecimal() == null)
+ return null;
+ for (XPropertyDecimal x : xproperties.getDecimal()) {
+ if (name.equals(x.getName())) {
+ return x;
+ }
+ }
+ return null;
+ }
+
+ private XPropertyInteger getIntegerXProperty(String name) {
+ if (name == null)
+ return null;
+ if (xproperties.getInteger() == null)
+ return null;
+ for (XPropertyInteger x : xproperties.getInteger()) {
+ if (name.equals(x.getName())) {
+ return x;
+ }
+ }
+ return null;
+ }
+
+ private XPropertyBoolean getBooleanXProperty(String name) {
+ if (name == null)
+ return null;
+ if (xproperties.getBoolean() == null)
+ return null;
+ for (XPropertyBoolean x : xproperties.getBoolean()) {
+ if (name.equals(x.getName())) {
+ return x;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public String getString(String name) {
+ XPropertyString stringProperty = getStringXProperty(name);
+ if (stringProperty == null) {
+ return null;
+ } else {
+ return (String) stringProperty.getValue();
+ }
+ }
+
+ @Override
+ public BigDecimal getDecimal(String name) {
+ XPropertyDecimal decimalProperty = getDecimalXProperty(name);
+ if (decimalProperty == null) {
+ return null;
+ } else {
+ return (BigDecimal) decimalProperty.getValue();
+ }
+ }
+
+ @Override
+ public BigInteger getInteger(String name) {
+ XPropertyInteger integerProperty = getIntegerXProperty(name);
+ if (integerProperty == null) {
+ return null;
+ } else {
+ return integerProperty.getValue();
+ }
+ }
+
+ @Override
+ public Boolean getBoolean(String name) {
+ XPropertyBoolean booleanProperty = getBooleanXProperty(name);
+ if (booleanProperty == null) {
+ return null;
+ } else {
+ return booleanProperty.isValue();
+ }
+ }
+
+ private XPropertyDecimalList getDecimalListXProperty(String name) {
+ if (name == null)
+ return null;
+ for (XPropertyDecimalList x : xproperties.getDecimalList()) {
+ if (name.equals(x.getName())) {
+ return x;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public List<BigDecimal> getDecimalList(String name) {
+ XPropertyDecimalList xDecimalList = getDecimalListXProperty(name);
+ if (xDecimalList == null)
+ return null;
+ else
+ return xDecimalList.getValue();
+ }
+
+ @Override
+ public void setString(final String name, final String value) {
+ XPropertyString stringProperty = getStringXProperty(name);
+ if (stringProperty == null) {
+ stringProperty = KSMFactory.objectFactory.createXPropertyString();
+ stringProperty.setName(name);
+ xproperties.getString().add(stringProperty);
+ stringProperty.setValue(value);
+ pcs.firePropertyChange("string:" + name, null, value);
+ } else {
+ Object oldValue = stringProperty.getValue();
+ stringProperty.setValue(value);
+ pcs.firePropertyChange("string:" + name, oldValue, value);
+ }
+ }
+
+ @Override
+ public void setDecimal(final String name, final BigDecimal value) {
+ XPropertyDecimal property = getDecimalXProperty(name);
+ if (property == null) {
+ property = KSMFactory.objectFactory.createXPropertyDecimal();
+ property.setName(name);
+ xproperties.getDecimal().add(property);
+ property.setValue(value);
+ pcs.firePropertyChange("decimal:" + name, null, value);
+ } else {
+ BigDecimal oldValue = property.getValue();
+ property.setValue(value);
+ pcs.firePropertyChange("decimal:" + name, oldValue, value);
+ }
+ }
+
+ @Override
+ public void setInteger(String name, BigInteger value) {
+ XPropertyInteger property = getIntegerXProperty(name);
+ if (property == null) {
+ property = KSMFactory.objectFactory.createXPropertyInteger();
+ property.setName(name);
+ xproperties.getInteger().add(property);
+ property.setValue(value);
+ pcs.firePropertyChange("integer:" + name, null, value);
+ } else {
+ BigInteger oldValue = property.getValue();
+ property.setValue(value);
+ pcs.firePropertyChange("integer:" + name, oldValue, value);
+ }
+
+ }
+
+ @Override
+ public void setBoolean(String name, Boolean value) {
+ XPropertyBoolean property = getBooleanXProperty(name);
+ if (property == null) {
+ property = KSMFactory.objectFactory.createXPropertyBoolean();
+ property.setName(name);
+ xproperties.getBoolean().add(property);
+ property.setValue(value);
+ pcs.firePropertyChange("boolean:" + name, null, value);
+ } else {
+ Boolean oldValue = property.isValue();
+ property.setValue(value);
+ pcs.firePropertyChange("boolean:" + name, oldValue, value);
+ }
+
+ }
+
+ private XPropertyStringList getStringListXProperty(String name) {
+ if (name == null)
+ return null;
+ for (XPropertyStringList x : xproperties.getStringList()) {
+ if (name.equals(x.getName())) {
+ return x;
+ }
+ }
+ return null;
+ }
+
+ public XPropertyIntegerList getIntegerListXProperty(String name) {
+ if (name == null)
+ return null;
+ for (XPropertyIntegerList x : xproperties.getIntegerList()) {
+ if (name.equals(x.getName())) {
+ return x;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public List<BigInteger> getIntegerList(String name) {
+ XPropertyIntegerList xIntegerList = getIntegerListXProperty(name);
+ if (xIntegerList == null)
+ return null;
+ else
+ return xIntegerList.getValue();
+ }
+
+ @Override
+ public List<String> getStringList(String name) {
+ XPropertyStringList xStringList = getStringListXProperty(name);
+ if (xStringList == null)
+ return null;
+ else
+ return xStringList.getValue();
+ }
+
+ /**
+ *
+ * @return null if name==null or property already exists
+ */
+ @Override
+ public List<String> createStringList(String name) {
+ if (name == null)
+ return null;
+ if (getStringList(name) != null) {
+ return null;
+ }
+ XPropertyStringList list = KSMFactory.objectFactory
+ .createXPropertyStringList();
+ list.setName(name);
+ xproperties.getStringList().add(list);
+ pcs.fireIndexedPropertyChange("stringList" + name, xproperties
+ .getStringList().indexOf(list), null, list.getValue());
+ return list.getValue();
+ }
+
+ /**
+ *
+ * @return null if name==null or property already exists
+ */
+ @Override
+ public List<BigDecimal> createDecimalList(String name) {
+ if (name == null)
+ return null;
+ if (getDecimalList(name) != null) {
+ return null;
+ }
+ XPropertyDecimalList list = KSMFactory.objectFactory
+ .createXPropertyDecimalList();
+ list.setName(name);
+ xproperties.getDecimalList().add(list);
+ pcs.fireIndexedPropertyChange("decimalList" + name, xproperties
+ .getDecimalList().indexOf(list), null, list.getValue());
+ return list.getValue();
+ }
+
+ /**
+ *
+ * @return null if name==null or property already exists
+ */
+ @Override
+ public List<BigInteger> createIntegerList(String name) {
+ if (name == null)
+ return null;
+ if (getIntegerList(name) != null) {
+ return null;
+ }
+ XPropertyIntegerList list = KSMFactory.objectFactory
+ .createXPropertyIntegerList();
+ list.setName(name);
+ xproperties.getIntegerList().add(list);
+ pcs.fireIndexedPropertyChange("integerList" + name, xproperties
+ .getIntegerList().indexOf(list), null, list.getValue());
+ return list.getValue();
+ }
+
+ @Override
+ public boolean removeStringList(String name) {
+ XPropertyStringList oldValue = getStringListXProperty(name);
+ int index = xproperties.getStringList().indexOf(oldValue);
+ boolean ret = xproperties.getStringList().remove(oldValue);
+ if (ret) {
+ pcs.fireIndexedPropertyChange("stringList" + name, index, oldValue,
+ null);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean removeDecimalList(String name) {
+ XPropertyDecimalList oldValue = getDecimalListXProperty(name);
+ int index = xproperties.getDecimalList().indexOf(oldValue);
+ boolean ret = xproperties.getDecimalList().remove(oldValue);
+ if (ret) {
+ pcs.fireIndexedPropertyChange("decimalList", index, oldValue, null);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean removeIntegerList(String name) {
+ XPropertyIntegerList oldValue = getIntegerListXProperty(name);
+ int index = xproperties.getDecimalList().indexOf(oldValue);
+ boolean ret = xproperties.getDecimalList().remove(oldValue);
+ if (ret) {
+ pcs.fireIndexedPropertyChange("integerList", index, oldValue, null);
+ return true;
+ } else {
+ return false;
+ }
+ }
+} \ No newline at end of file
diff --git a/ksm-model/src/de/dhbw/horb/ksm/model/impl/package.html b/ksm-model/src/de/dhbw/horb/ksm/model/impl/package.html
new file mode 100644
index 0000000..f1c8aee
--- /dev/null
+++ b/ksm-model/src/de/dhbw/horb/ksm/model/impl/package.html
@@ -0,0 +1,3 @@
+Diese Package enthält die Implementierung des entsprechenden .api Packages.
+<br />
+Nach aussen ist nur die Klasse KSMFactory sichtbar \ No newline at end of file
diff --git a/ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestConnection.java b/ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestConnection.java
new file mode 100644
index 0000000..dcc2e2b
--- /dev/null
+++ b/ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestConnection.java
@@ -0,0 +1,30 @@
+package de.dhbw.horb.ksm.xmlschema;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import de.dhbw.horb.ksm.model.api.Connection;
+import de.dhbw.horb.ksm.model.api.KSM;
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+import de.dhbw.horb.ksm.model.impl.KSMFactory;
+
+public class TestConnection {
+ @Test
+ public void testConnectionEvents() {
+ PropertyChangeListener listenerMock = Mockito
+ .mock(PropertyChangeListener.class);
+
+ KSM ksm = KSMFactory.createEmptyKSM();
+ NodeGroup nodeGroup = ksm.getNodeGroup();
+ Node node = nodeGroup.createNode();
+ node.addPropertyChangeListener(listenerMock);
+ Connection connection = node.createConnection("bla");
+ node.removeConnection(connection);
+ Mockito.verify(listenerMock, Mockito.times(2)).propertyChange(
+ Mockito.any(PropertyChangeEvent.class));
+ }
+}
diff --git a/ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestKSM.java b/ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestKSM.java
new file mode 100644
index 0000000..4d85e34
--- /dev/null
+++ b/ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestKSM.java
@@ -0,0 +1,47 @@
+package de.dhbw.horb.ksm.xmlschema;
+
+import javax.xml.bind.JAXBException;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import de.dhbw.horb.ksm.model.api.Connection;
+import de.dhbw.horb.ksm.model.api.KSM;
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+import de.dhbw.horb.ksm.model.impl.KSMFactory;
+
+public class TestKSM {
+ @Test
+ public void testLookup() throws JAXBException {
+ KSM myKSM = KSMFactory.createEmptyKSM();
+ Node node1 = myKSM.getNodeGroup().createNode();
+ NodeGroup nodeGroup1 = myKSM.getNodeGroup().createNodeGroup();
+ Node node2 = nodeGroup1.createNode();
+
+ Assert.assertSame(node1, myKSM.lookupNode(node1.getId()));
+ Assert.assertSame(node2, myKSM.lookupNode(node2.getId()));
+
+ KSM reloadedKSM = Utils.saveAndReload(myKSM);
+ Assert.assertEquals(node1.getId(), reloadedKSM
+ .lookupNode(node1.getId()).getId());
+
+ Assert.assertEquals(node2.getId(), reloadedKSM
+ .lookupNode(node2.getId()).getId());
+
+ Assert.assertSame(nodeGroup1, myKSM.lookupNodeGroup(nodeGroup1.getId()));
+ Assert.assertEquals(nodeGroup1.getId(),
+ reloadedKSM.lookupNodeGroup(nodeGroup1.getId()).getId());
+ }
+
+ @Test
+ public void testIncomingConnections() {
+ KSM myKSM = KSMFactory.createEmptyKSM();
+ Node node1 = myKSM.getNodeGroup().createNode();
+ Node node2 = myKSM.getNodeGroup().createNode();
+ @SuppressWarnings("unused")
+ Connection connection = node1.createConnection(node2);
+ Node incomingNode = myKSM.getIncomingConnections(node2).get(0);
+ Assert.assertSame(node1, incomingNode);
+ }
+} \ No newline at end of file
diff --git a/ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestNode.java b/ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestNode.java
new file mode 100644
index 0000000..0ab305d
--- /dev/null
+++ b/ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestNode.java
@@ -0,0 +1,87 @@
+package de.dhbw.horb.ksm.xmlschema;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import javax.xml.bind.JAXBException;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import de.dhbw.horb.ksm.model.api.Connection;
+import de.dhbw.horb.ksm.model.api.KSM;
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+import de.dhbw.horb.ksm.model.impl.KSMFactory;
+
+public class TestNode {
+ private static final String PROP_VALUE = "hello-world";
+ private static final String PROP_NAME = "visual.name";
+
+ @Test
+ public void testNodeAndStringProperty() throws JAXBException {
+ KSM ksm = KSMFactory.createEmptyKSM();
+ Assert.assertNotNull(ksm);
+
+ NodeGroup nodeGroup = ksm.getNodeGroup();
+ Node node = nodeGroup.createNode();
+ node.getProperties().setString(PROP_NAME, PROP_VALUE);
+
+ NodeGroup createNodeGroup = nodeGroup.createNodeGroup();
+ createNodeGroup.createNode();
+
+ KSM ksmCopy = Utils.saveAndReload(ksm);
+
+ Assert.assertEquals(1, ksmCopy.getNodeGroup().getNodes().size());
+ Assert.assertEquals(PROP_VALUE, ksmCopy.getNodeGroup().getNodes()
+ .get(0).getProperties().getString(PROP_NAME));
+ }
+
+ @Test
+ public void testNodeConnectionsCreate() throws JAXBException {
+ KSM ksm = KSMFactory.createEmptyKSM();
+ Node node1 = ksm.getNodeGroup().createNode();
+ Node node2 = ksm.getNodeGroup().createNode();
+
+ @SuppressWarnings("unused")
+ Connection connection = node1.createConnection(node2);
+
+ String to = node1.getConnections().get(0).getTo();
+ Assert.assertSame(node2, ksm.lookupNode(to));
+
+ KSM ksmCopy = Utils.saveAndReload(ksm);
+ Assert.assertEquals(node2.getId(), ksmCopy.lookupNode(to).getId());
+ }
+
+ @Test
+ public void testNodeConnectionsRemove() {
+ KSM ksm = KSMFactory.createEmptyKSM();
+ Node node1 = ksm.getNodeGroup().createNode();
+ Node node2 = ksm.getNodeGroup().createNode();
+
+ Connection connection = node1.createConnection(node2);
+ Assert.assertEquals(1, node1.getConnections().size());
+
+ Assert.assertTrue(node1.removeConnection(connection));
+ Assert.assertFalse(node1.removeConnection(connection));
+ Assert.assertFalse(node1.removeConnection(connection));
+ Assert.assertEquals(0, node1.getConnections().size());
+ Assert.assertEquals(0, ksm.getIncomingConnections(node2).size());
+ }
+
+ @Test
+ public void testNodeGroupEvents() {
+ PropertyChangeListener listenerMock = Mockito
+ .mock(PropertyChangeListener.class);
+
+ KSM ksm = KSMFactory.createEmptyKSM();
+ NodeGroup nodeGroup = ksm.getNodeGroup();
+ Node node = nodeGroup.createNode();
+ node.addPropertyChangeListener(listenerMock);
+ Connection connection = node.createConnection("bla");
+ node.removeConnection(connection);
+ Mockito.verify(listenerMock, Mockito.times(2)).propertyChange(
+ Mockito.any(PropertyChangeEvent.class));
+ }
+} \ No newline at end of file
diff --git a/ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestNodeGroup.java b/ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestNodeGroup.java
new file mode 100644
index 0000000..5ae6e40
--- /dev/null
+++ b/ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestNodeGroup.java
@@ -0,0 +1,102 @@
+package de.dhbw.horb.ksm.xmlschema;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import javax.xml.bind.JAXBException;
+
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import junit.framework.Assert;
+import de.dhbw.horb.ksm.model.api.KSM;
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+import de.dhbw.horb.ksm.model.impl.KSMFactory;
+
+public class TestNodeGroup {
+ @Test
+ public void testCreateNodeGroup() throws JAXBException {
+ KSM ksm = KSMFactory.createEmptyKSM();
+ Assert.assertNotNull(ksm);
+
+ NodeGroup root = ksm.getNodeGroup();
+ NodeGroup subNodeGroup = root.createNodeGroup();
+
+ KSM ksmCopy = Utils.saveAndReload(ksm);
+ Assert.assertEquals(root.getId(), ksmCopy.getNodeGroup().getId());
+
+ Assert.assertEquals(ksm.getNodeGroup().getNodeGroups().size(), ksmCopy
+ .getNodeGroup().getNodeGroups().size());
+ Assert.assertEquals(ksm.getNodeGroup().getNodeGroups().get(0).getId(),
+ subNodeGroup.getId());
+ }
+
+ @Test
+ public void testRemoveNode() throws JAXBException {
+ KSM ksm = KSMFactory.createEmptyKSM();
+ Node node1 = ksm.getNodeGroup().createNode();
+ Node node2 = ksm.getNodeGroup().createNode();
+ Assert.assertTrue(ksm.getNodeGroup().removeNode(node1));
+ Assert.assertEquals(1, ksm.getNodeGroup().getNodes().size());
+
+ KSM ksmCopy = Utils.saveAndReload(ksm);
+ Node lookupNode2 = ksmCopy.lookupNode(node2.getId());
+ Assert.assertTrue(ksmCopy.getNodeGroup().removeNode(lookupNode2));
+ Assert.assertEquals(0, ksmCopy.getNodeGroup().getNodes().size());
+ }
+
+ @Test
+ public void testRemoveNodeGroup() throws JAXBException {
+ KSM ksm = KSMFactory.createEmptyKSM();
+ NodeGroup nodeGroup1 = ksm.getNodeGroup().createNodeGroup();
+ NodeGroup nodeGroup2 = ksm.getNodeGroup().createNodeGroup();
+ Assert.assertTrue(ksm.getNodeGroup().removeNodeGroup(nodeGroup1));
+ Assert.assertEquals(1, ksm.getNodeGroup().getNodeGroups().size());
+
+ KSM ksmCopy = Utils.saveAndReload(ksm);
+ NodeGroup lookupNodeGroup2 = ksmCopy.lookupNodeGroup(nodeGroup2.getId());
+ Assert.assertTrue(ksmCopy.getNodeGroup().removeNodeGroup(lookupNodeGroup2));
+ Assert.assertEquals(0, ksmCopy.getNodeGroup().getNodes().size());
+ }
+
+ @Test
+ public void testAddNode() throws JAXBException {
+ KSM ksm = KSMFactory.createEmptyKSM();
+ Node node = ksm.getNodeGroup().createNode();
+ ksm.getNodeGroup().removeNode(node);
+ ksm.getNodeGroup().addNode(node);
+
+ Assert.assertEquals(1, ksm.getNodeGroup().getNodes().size());
+ }
+
+ @Test
+ public void testAddNodeGroup() throws JAXBException {
+ KSM ksm = KSMFactory.createEmptyKSM();
+ NodeGroup nodeGroup = ksm.getNodeGroup().createNodeGroup();
+ Assert.assertTrue(ksm.getNodeGroup().removeNodeGroup(nodeGroup));
+ ksm.getNodeGroup().addNodeGroup(nodeGroup);
+
+ Assert.assertEquals(1, ksm.getNodeGroup().getNodeGroups().size());
+ }
+
+ @Test
+ public void testNodeGroupEvents() {
+ PropertyChangeListener listenerMock = Mockito
+ .mock(PropertyChangeListener.class);
+ KSM ksm = KSMFactory.createEmptyKSM();
+ NodeGroup nodeGroup = ksm.getNodeGroup();
+ nodeGroup.addPropertyChangeListener(listenerMock);
+ nodeGroup.createNode();
+ NodeGroup nodeGroup2 = nodeGroup.createNodeGroup();
+ Mockito.verify(listenerMock, Mockito.times(2)).propertyChange(
+ Mockito.any(PropertyChangeEvent.class));
+
+ Mockito.reset(listenerMock);
+ nodeGroup2.addPropertyChangeListener(listenerMock);
+ nodeGroup2.createNode();
+ nodeGroup.createNodeGroup();
+ Mockito.verify(listenerMock, Mockito.times(2)).propertyChange(
+ Mockito.any(PropertyChangeEvent.class));
+ }
+}
diff --git a/ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestProperties.java b/ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestProperties.java
new file mode 100644
index 0000000..985325f
--- /dev/null
+++ b/ksm-model/test/de/dhbw/horb/ksm/xmlschema/TestProperties.java
@@ -0,0 +1,119 @@
+package de.dhbw.horb.ksm.xmlschema;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.List;
+
+import javax.xml.bind.JAXBException;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import de.dhbw.horb.ksm.model.api.Connection;
+import de.dhbw.horb.ksm.model.api.KSM;
+import de.dhbw.horb.ksm.model.api.Node;
+import de.dhbw.horb.ksm.model.api.NodeGroup;
+import de.dhbw.horb.ksm.model.api.Properties;
+import de.dhbw.horb.ksm.model.impl.KSMFactory;
+
+public class TestProperties extends TestCase {
+ @Test
+ public void testStringDecimalIntegerWithSameName() throws JAXBException {
+ KSM myKSM = KSMFactory.createEmptyKSM();
+ NodeGroup rootNodeGroup = myKSM.getNodeGroup();
+ Properties properties = rootNodeGroup.getProperties();
+ properties.setString("testbla", "blabla");
+ properties.setDecimal("testbla", new BigDecimal(123.213123));
+ properties.setInteger("testbla", new BigInteger("123123"));
+ properties.setBoolean("testbla", false);
+ KSM myKSMCopy = Utils.saveAndReload(myKSM);
+ Assert.assertEquals(properties.getString("testbla"), myKSMCopy
+ .getNodeGroup().getProperties().getString("testbla"));
+ Assert.assertEquals(properties.getDecimal("testbla"), myKSMCopy
+ .getNodeGroup().getProperties().getDecimal("testbla"));
+ Assert.assertEquals(properties.getInteger("testbla"), myKSMCopy
+ .getNodeGroup().getProperties().getInteger("testbla"));
+ }
+
+ @Test
+ public void testListProperties() throws JAXBException {
+ KSM myKSM = KSMFactory.createEmptyKSM();
+ NodeGroup rootNodeGroup = myKSM.getNodeGroup();
+ Properties properties = rootNodeGroup.getProperties();
+ {
+ List<BigDecimal> decimalList = properties
+ .createDecimalList("meine.Liste");
+ Assert.assertNotNull(decimalList);
+ Assert.assertNull(properties.createDecimalList("meine.Liste"));
+ }
+ {
+ List<String> stringList = properties
+ .createStringList("meine.stringListe");
+ Assert.assertNotNull(stringList);
+ Assert.assertNull(properties.createStringList("meine.stringListe"));
+ }
+ {
+ properties.removeStringList("meine.stringListe");
+ System.out.println(properties.getStringList("meine.stringListe"));
+ Assert.assertTrue(properties.removeDecimalList("meine.Liste"));
+ }
+ }
+
+ @Test
+ public void testPropertiesKSMNodeNodeGroupConnection() {
+ KSM ksm = KSMFactory.createEmptyKSM();
+ Assert.assertNotNull(ksm.getProperties());
+
+ NodeGroup nodeGroup = ksm.getNodeGroup();
+ Assert.assertNotNull(nodeGroup.getProperties());
+
+ Node node = nodeGroup.createNode();
+ Assert.assertNotNull(node.getProperties());
+
+ Node node2 = nodeGroup.createNode();
+ Connection connection = node.createConnection(node2);
+ Assert.assertNotNull(connection.getProperties());
+ }
+
+ @Test
+ public void testPropertiesEvents() {
+ PropertyChangeListener listenerMock = Mockito
+ .mock(PropertyChangeListener.class);
+ KSM ksm = KSMFactory.createEmptyKSM();
+ Properties properties = ksm.getProperties();
+
+ properties.addPropertyChangeListener(listenerMock);
+ Mockito.reset(listenerMock);
+ properties.setString("a", "b");
+ Mockito.verify(listenerMock).propertyChange(Mockito.any(PropertyChangeEvent.class));
+
+ Mockito.reset(listenerMock);
+ properties.setDecimal("a", new BigDecimal(5));
+ Mockito.verify(listenerMock).propertyChange(Mockito.any(PropertyChangeEvent.class));
+
+ Mockito.reset(listenerMock);
+ properties.setInteger("a", BigInteger.valueOf(1000));
+ Mockito.verify(listenerMock).propertyChange(Mockito.any(PropertyChangeEvent.class));
+
+ Mockito.reset(listenerMock);
+ properties.setBoolean("a", true);
+ Mockito.verify(listenerMock).propertyChange(Mockito.any(PropertyChangeEvent.class));
+
+ Mockito.reset(listenerMock);
+ properties.createStringList("foo");
+ Mockito.verify(listenerMock).propertyChange(Mockito.any(PropertyChangeEvent.class));
+
+ Mockito.reset(listenerMock);
+ properties.createDecimalList("foo");
+ Mockito.verify(listenerMock).propertyChange(Mockito.any(PropertyChangeEvent.class));
+
+ Mockito.reset(listenerMock);
+ properties.createIntegerList("foo");
+ Mockito.verify(listenerMock).propertyChange(Mockito.any(PropertyChangeEvent.class));
+ }
+}
diff --git a/ksm-model/test/de/dhbw/horb/ksm/xmlschema/Utils.java b/ksm-model/test/de/dhbw/horb/ksm/xmlschema/Utils.java
new file mode 100644
index 0000000..4ac54c8
--- /dev/null
+++ b/ksm-model/test/de/dhbw/horb/ksm/xmlschema/Utils.java
@@ -0,0 +1,18 @@
+package de.dhbw.horb.ksm.xmlschema;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.bind.JAXBException;
+
+import de.dhbw.horb.ksm.model.api.KSM;
+import de.dhbw.horb.ksm.model.impl.KSMFactory;
+
+public class Utils {
+ static KSM saveAndReload(KSM ksm ) throws JAXBException {
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ KSMFactory.saveKSM(ksm, os);
+ ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
+ return KSMFactory.loadKSM(is);
+ }
+}
diff --git a/ksm-model/xml/example-1.xml b/ksm-model/xml/example-1.xml
new file mode 100644
index 0000000..d96d87a
--- /dev/null
+++ b/ksm-model/xml/example-1.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ksm xmlns="http://hb.dhbw-stuttgart.de/~ksm/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://hb.dhbw-stuttgart.de/~ksm/1.0 ksm-1.0.xsd"
+ version="1.0">
+ <nodegroup id="root">
+ <node id="56-7567-567567-657657-567">
+ <properties>
+ <string name="visual.caption">a node</string>
+ <string name="visual.color">#ffeecc</string>
+ <decimal name="visual.location.x">420</decimal>
+ <decimal name="visual.location.y">420</decimal>
+ <stringList name="meineTolleList">
+ <value>TestValue</value>
+ </stringList>
+ <decimalList name="nochEine">
+ <value>1.2</value>
+ </decimalList>
+ </properties>
+ <connections />
+ </node>
+
+
+ <nodegroup id="0123123-123123-123123-123213">
+ <node id="56-7567-12345-657657-567">
+ <properties>
+ <string name="visual.color">#ffeecc</string>
+ <decimal name="visual.location.x">420</decimal>
+ <decimal name="visual.location.y">420</decimal>
+ </properties>
+ <connections>
+ <connection to="56-7567-567567-657657-567">
+ <properties>
+ <string name="visual.caption">A Connection</string>
+ <string name="visual.color">#ffeecc</string>
+ <decimal name="data.weight">5</decimal>
+ </properties>
+ </connection>
+ </connections>
+ </node>
+ <properties>
+ <string name="visual.caption">a Hierarchy</string>
+ <string name="visual.color">#ffeecc</string>
+ <decimal name="visual.location.x">420</decimal>
+ <decimal name="visual.location.y">420</decimal>
+ </properties>
+ </nodegroup>
+ <properties />
+ </nodegroup>
+</ksm>
diff --git a/ksm-model/xml/ksm-1.xsd b/ksm-model/xml/ksm-1.xsd
new file mode 100644
index 0000000..d0d872b
--- /dev/null
+++ b/ksm-model/xml/ksm-1.xsd
@@ -0,0 +1,238 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ba-horb.de/~ksm/xml/ksm-1"
+ xmlns:tns="http://www.ba-horb.de/~ksm/xml/ksm-1" elementFormDefault="qualified"
+ xmlns:jxb="http://java.sun.com/xml/ns/jaxb" jxb:version="1.0">
+
+ <!-- Wurzelelement eines KSM Dokument -->
+ <element name="ksm">
+ <complexType>
+ <annotation>
+ <appinfo>
+ <jxb:class name="XKSM" />
+ </appinfo>
+ </annotation>
+ <sequence>
+ <element name="nodegroup" type="tns:NODEGROUP_TYPE"
+ minOccurs="1" maxOccurs="1">
+ </element>
+ <element name="properties" type="tns:PROPERTIES_TYPE"
+ minOccurs="0" maxOccurs="1"></element>
+ </sequence>
+ <attribute name="version" type="string" use="required" />
+ </complexType>
+ </element>
+
+ <complexType name="PROPERTY_BASE_TYPE">
+ <annotation>
+ <appinfo>
+ <jxb:class name="XPropertyBase" />
+ </appinfo>
+ </annotation>
+ <simpleContent>
+ <extension base="anySimpleType">
+ <attribute name="name" use="required" />
+ </extension>
+ </simpleContent>
+ </complexType>
+
+ <complexType name="PROPERTY_STRING_TYPE">
+ <annotation>
+ <appinfo>
+ <jxb:class name="XPropertyString" />
+ </appinfo>
+ </annotation>
+ <simpleContent>
+ <extension base="string">
+ <attribute name="name" use="required" />
+ </extension>
+ </simpleContent>
+ </complexType>
+
+ <complexType name="PROPERTY_BOOLEAN_TYPE">
+ <annotation>
+ <appinfo>
+ <jxb:class name="XPropertyBoolean" />
+ </appinfo>
+ </annotation>
+ <simpleContent>
+ <extension base="boolean">
+ <attribute name="name" use="required" />
+ </extension>
+ </simpleContent>
+ </complexType>
+
+ <complexType name="PROPERTY_DECIMAL_TYPE">
+ <annotation>
+ <appinfo>
+ <jxb:class name="XPropertyDecimal" />
+ </appinfo>
+ </annotation>
+ <simpleContent>
+ <extension base="decimal">
+ <attribute name="name" use="required" />
+ </extension>
+ </simpleContent>
+ </complexType>
+
+ <complexType name="PROPERTY_INTEGER_TYPE">
+ <annotation>
+ <appinfo>
+ <jxb:class name="XPropertyInteger" />
+ </appinfo>
+ </annotation>
+ <simpleContent>
+ <extension base="integer">
+ <attribute name="name" use="required" />
+ </extension>
+ </simpleContent>
+ </complexType>
+
+ <complexType name="PROPERTY_LIST_BASE_TYPE">
+ <annotation>
+ <appinfo>
+ <jxb:class name="XPropertyBaseList" />
+ </appinfo>
+ </annotation>
+ <sequence>
+ </sequence>
+ <attribute name="name" use="required"></attribute>
+ </complexType>
+
+ <complexType name="PROPERTY_STRING_LIST_TYPE">
+ <annotation>
+ <appinfo>
+ <jxb:class name="XPropertyStringList" />
+ </appinfo>
+ </annotation>
+ <complexContent>
+ <extension base="tns:PROPERTY_LIST_BASE_TYPE">
+ <sequence>
+ <element name="value" type="string" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="PROPERTY_DECIMAL_LIST_TYPE">
+ <annotation>
+ <appinfo>
+ <jxb:class name="XPropertyDecimalList" />
+ </appinfo>
+ </annotation>
+ <complexContent>
+ <extension base="tns:PROPERTY_LIST_BASE_TYPE">
+ <sequence>
+ <element name="value" type="decimal" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="PROPERTY_INTEGER_LIST_TYPE">
+ <annotation>
+ <appinfo>
+ <jxb:class name="XPropertyIntegerList" />
+ </appinfo>
+ </annotation>
+ <complexContent>
+ <extension base="tns:PROPERTY_LIST_BASE_TYPE">
+ <sequence>
+ <element name="value" type="integer" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- EinelListe von Eigenschaften -->
+ <complexType name="PROPERTIES_TYPE">
+ <annotation>
+ <appinfo>
+ <jxb:class name="XProperties" />
+ </appinfo>
+ </annotation>
+ <sequence>
+ <element name="string" type="tns:PROPERTY_STRING_TYPE"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="decimal" type="tns:PROPERTY_DECIMAL_TYPE"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="integer" type="tns:PROPERTY_INTEGER_TYPE"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="boolean" type="tns:PROPERTY_BOOLEAN_TYPE"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="stringList" type="tns:PROPERTY_STRING_LIST_TYPE"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="decimalList" type="tns:PROPERTY_DECIMAL_LIST_TYPE"
+ minOccurs="0" maxOccurs="unbounded" />
+ <element name="integerList" type="tns:PROPERTY_INTEGER_LIST_TYPE"
+ minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ </complexType>
+
+ <!-- KSM Node (Knoten), hat Eigenschaften, hat Verbindungen zu anderen Knoten -->
+ <complexType name="NODE_TYPE">
+ <annotation>
+ <appinfo>
+ <jxb:class name="XNode" />
+ </appinfo>
+ </annotation>
+ <sequence>
+ <element name="properties" type="tns:PROPERTIES_TYPE"
+ minOccurs="1" maxOccurs="1" />
+ <element name="connections" type="tns:CONNECTIONS_TYPE"
+ minOccurs="0" maxOccurs="1" />
+ </sequence>
+ <attribute name="id" type="tns:NODE_ID_TYPE" use="required" />
+ </complexType>
+
+ <!-- Eine NodeGroup fasst mehrere Knoten zusammen, auch bekannt als Hirachien -->
+ <complexType name="NODEGROUP_TYPE">
+ <annotation>
+ <appinfo>
+ <jxb:class name="XNodeGroup" />
+ </appinfo>
+ </annotation>
+ <sequence>
+ <element name="node" type="tns:NODE_TYPE" minOccurs="0"
+ maxOccurs="unbounded" />
+ <element name="nodegroup" type="tns:NODEGROUP_TYPE"
+ minOccurs="0" maxOccurs="unbounded"></element>
+ <element name="properties" type="tns:PROPERTIES_TYPE"
+ minOccurs="1" maxOccurs="1" />
+ </sequence>
+ <attribute name="id" type="tns:NODE_ID_TYPE" use="required" />
+ </complexType>
+
+ <!-- Connections. Eine Node eine beliebige Anzahl gerichteter Verbindungen
+ zu einer anderen Node haben -->
+ <complexType name="CONNECTIONS_TYPE">
+ <annotation>
+ <appinfo>
+ <jxb:class name="XConnections" />
+ </appinfo>
+ </annotation>
+ <sequence>
+ <element name="connection" type="tns:CONNECTION_TYPE"
+ minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ </complexType>
+
+ <!-- Eine gerichtete Verbindung zu einer anderen Node. -->
+ <complexType name="CONNECTION_TYPE">
+ <annotation>
+ <appinfo>
+ <jxb:class name="XConnection" />
+ </appinfo>
+ </annotation>
+ <sequence>
+ <element name="properties" type="tns:PROPERTIES_TYPE"
+ minOccurs="1" maxOccurs="1" />
+ </sequence>
+ <attribute name="to" type="tns:NODE_ID_TYPE" />
+ </complexType>
+
+ <simpleType name="NODE_ID_TYPE">
+ <restriction base="string"></restriction>
+ </simpleType>
+</schema> \ No newline at end of file