\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/index.html b/doc/codemetropolis-toolchain-commons/index.html
new file mode 100644
index 00000000..80d6593e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/index.html
@@ -0,0 +1 @@
+codemetropolis-toolchain-commons
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/CdfConverter.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/CdfConverter.html
new file mode 100644
index 00000000..5c6d7471
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/CdfConverter.html
@@ -0,0 +1 @@
+CdfConverter
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/CdfConverter.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/CdfConverter.java.html
new file mode 100644
index 00000000..e02cd369
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/CdfConverter.java.html
@@ -0,0 +1,40 @@
+CdfConverter.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/ConverterEvent.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/ConverterEvent.html
new file mode 100644
index 00000000..68ece474
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/ConverterEvent.html
@@ -0,0 +1 @@
+ConverterEvent
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/ConverterEvent.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/ConverterEvent.java.html
new file mode 100644
index 00000000..ca6a2013
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/ConverterEvent.java.html
@@ -0,0 +1,17 @@
+ConverterEvent.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/index.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/index.html
new file mode 100644
index 00000000..0170eb55
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.cdf.converter
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/index.source.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/index.source.html
new file mode 100644
index 00000000..daec2671
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.converter/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.cdf.converter
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/CdfReaderException.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/CdfReaderException.html
new file mode 100644
index 00000000..66e007d4
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/CdfReaderException.html
@@ -0,0 +1 @@
+CdfReaderException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/CdfReaderException.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/CdfReaderException.java.html
new file mode 100644
index 00000000..e3b6440b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/CdfReaderException.java.html
@@ -0,0 +1,30 @@
+CdfReaderException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/CdfWriterException.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/CdfWriterException.html
new file mode 100644
index 00000000..bf289c60
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/CdfWriterException.html
@@ -0,0 +1 @@
+CdfWriterException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/CdfWriterException.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/CdfWriterException.java.html
new file mode 100644
index 00000000..7a6122c1
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/CdfWriterException.java.html
@@ -0,0 +1,28 @@
+CdfWriterException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/index.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/index.html
new file mode 100644
index 00000000..7f2610a4
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.cdf.exceptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/index.source.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/index.source.html
new file mode 100644
index 00000000..abaf378c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf.exceptions/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.cdf.exceptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfElement.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfElement.html
new file mode 100644
index 00000000..36cc0fc3
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfElement.html
@@ -0,0 +1 @@
+CdfElement
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfElement.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfElement.java.html
new file mode 100644
index 00000000..0a4f3dfb
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfElement.java.html
@@ -0,0 +1,137 @@
+CdfElement.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfProperty$Type.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfProperty$Type.html
new file mode 100644
index 00000000..a7a9d933
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfProperty$Type.html
@@ -0,0 +1 @@
+CdfProperty.Type
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfProperty.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfProperty.html
new file mode 100644
index 00000000..2653a56a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfProperty.html
@@ -0,0 +1 @@
+CdfProperty
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfProperty.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfProperty.java.html
new file mode 100644
index 00000000..09b3f866
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfProperty.java.html
@@ -0,0 +1,45 @@
+CdfProperty.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfTree$Iterator.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfTree$Iterator.html
new file mode 100644
index 00000000..bf36fc3a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfTree$Iterator.html
@@ -0,0 +1 @@
+CdfTree.Iterator
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfTree.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfTree.html
new file mode 100644
index 00000000..d759623d
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfTree.html
@@ -0,0 +1 @@
+CdfTree
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfTree.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfTree.java.html
new file mode 100644
index 00000000..185751f6
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/CdfTree.java.html
@@ -0,0 +1,97 @@
+CdfTree.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/index.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/index.html
new file mode 100644
index 00000000..5aa1e3a6
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.cdf
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/index.source.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/index.source.html
new file mode 100644
index 00000000..cecde5fa
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cdf/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.cdf
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableDepthComparator.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableDepthComparator.html
new file mode 100644
index 00000000..27b41c27
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableDepthComparator.html
@@ -0,0 +1 @@
+BuildableDepthComparator
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableDepthComparator.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableDepthComparator.java.html
new file mode 100644
index 00000000..08d6c606
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableDepthComparator.java.html
@@ -0,0 +1,15 @@
+BuildableDepthComparator.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableDescendantLevelComparator.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableDescendantLevelComparator.html
new file mode 100644
index 00000000..541dab6c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableDescendantLevelComparator.html
@@ -0,0 +1 @@
+BuildableDescendantLevelComparator
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableDescendantLevelComparator.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableDescendantLevelComparator.java.html
new file mode 100644
index 00000000..12362fd6
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableDescendantLevelComparator.java.html
@@ -0,0 +1,15 @@
+BuildableDescendantLevelComparator.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableSizeComparator.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableSizeComparator.html
new file mode 100644
index 00000000..b6de336e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableSizeComparator.html
@@ -0,0 +1 @@
+BuildableSizeComparator
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableSizeComparator.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableSizeComparator.java.html
new file mode 100644
index 00000000..f5fcb102
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableSizeComparator.java.html
@@ -0,0 +1,16 @@
+BuildableSizeComparator.java
package codemetropolis.toolchain.commons.cmxml.comparators;
+
+import java.util.Comparator;
+
+import codemetropolis.toolchain.commons.cmxml.Buildable;
+
+public class BuildableSizeComparator implements Comparator<Buildable> {
+
+ @Override
+ public int compare(Buildable b1, Buildable b2) {
+ int result = b1.getSizeX() - b2.getSizeX();
+ return result == 0 ? b1.getSizeZ() - b2.getSizeZ() : result;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableWidthComparator.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableWidthComparator.html
new file mode 100644
index 00000000..76502210
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableWidthComparator.html
@@ -0,0 +1 @@
+BuildableWidthComparator
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableWidthComparator.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableWidthComparator.java.html
new file mode 100644
index 00000000..f4c14c2d
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/BuildableWidthComparator.java.html
@@ -0,0 +1,15 @@
+BuildableWidthComparator.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/index.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/index.html
new file mode 100644
index 00000000..0844a36f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.cmxml.comparators
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/index.source.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/index.source.html
new file mode 100644
index 00000000..741cfdc7
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.comparators/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.cmxml.comparators
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlReaderException.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlReaderException.html
new file mode 100644
index 00000000..b1ceea86
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlReaderException.html
@@ -0,0 +1 @@
+CmxmlReaderException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlReaderException.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlReaderException.java.html
new file mode 100644
index 00000000..39d91c0c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlReaderException.java.html
@@ -0,0 +1,28 @@
+CmxmlReaderException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlValidationFailedException.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlValidationFailedException.html
new file mode 100644
index 00000000..4cee2758
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlValidationFailedException.html
@@ -0,0 +1 @@
+CmxmlValidationFailedException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlValidationFailedException.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlValidationFailedException.java.html
new file mode 100644
index 00000000..51532625
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlValidationFailedException.java.html
@@ -0,0 +1,28 @@
+CmxmlValidationFailedException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlWriterException.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlWriterException.html
new file mode 100644
index 00000000..7b2e795a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlWriterException.html
@@ -0,0 +1 @@
+CmxmlWriterException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlWriterException.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlWriterException.java.html
new file mode 100644
index 00000000..018d2d4c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/CmxmlWriterException.java.html
@@ -0,0 +1,28 @@
+CmxmlWriterException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/index.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/index.html
new file mode 100644
index 00000000..d5f8bad1
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.cmxml.exceptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/index.source.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/index.source.html
new file mode 100644
index 00000000..9a464665
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml.exceptions/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.cmxml.exceptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Attribute.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Attribute.html
new file mode 100644
index 00000000..a78e5077
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Attribute.html
@@ -0,0 +1 @@
+Attribute
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Attribute.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Attribute.java.html
new file mode 100644
index 00000000..8193e636
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Attribute.java.html
@@ -0,0 +1,26 @@
+Attribute.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Buildable$Type.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Buildable$Type.html
new file mode 100644
index 00000000..e1626012
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Buildable$Type.html
@@ -0,0 +1 @@
+Buildable.Type
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Buildable.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Buildable.html
new file mode 100644
index 00000000..f5e4f108
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Buildable.html
@@ -0,0 +1 @@
+Buildable
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Buildable.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Buildable.java.html
new file mode 100644
index 00000000..82a4d760
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Buildable.java.html
@@ -0,0 +1,464 @@
+Buildable.java
package codemetropolis.toolchain.commons.cmxml;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Stack;
+
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class Buildable implements Comparable<Buildable> {
+
+ public enum Type {
+ GROUND,
+ GARDEN,
+ FLOOR,
+ CELLAR,
+ CONTAINER;
+ }
+
+ private String id;
+ private String name;
+ private Type type;
+ private Point position;
+ private Point size;
+ private List<Attribute> attributes;
+ private List<Buildable> children;
+ private Buildable parent;
+ private String cdfNames;
+
+ public Buildable(String id, String name, Type type) {
+ this(id, name, type, new Point(), new Point());
+ }
+
+ public Buildable(String id, String name, Type type, Point position, Point size) {
+ this.id = id;
+ this.name = name;
+ this.type = type;
+ this.position = position;
+ this.size = size;
+ this.attributes = new ArrayList<Attribute>();
+ this.children = new ArrayList<Buildable>();
+ }
+
+ public boolean isOverlapping(Buildable b) {
+ return b.getPositionX() < this.getPositionX() + this.getSizeX() &&
+ b.getPositionX() + b.getSizeX() > this.getPositionX() &&
+ b.getPositionZ() < this.getPositionZ() + this.getSizeZ() &&
+ b.getPositionZ() + b.getSizeZ() > this.getPositionZ();
+ }
+
+ public boolean isOverlapping(int x1, int z1, int x2, int z2) {
+ return x1 < this.getPositionX() + this.getSizeX() &&
+ x2 > this.getPositionX() &&
+ z1 < this.getPositionZ() + this.getSizeZ() &&
+ z2 > this.getPositionZ();
+ }
+
+ public boolean isOverlapping(int x, int z) {
+ return x <= this.getPositionX() + this.getSizeX() &&
+ x >= this.getPositionX() &&
+ z <= this.getPositionZ() + this.getSizeZ() &&
+ z >= this.getPositionZ();
+ }
+
+ public Point getCenter() {
+ return new Point(
+ position.getX() + size.getX() / 2,
+ position.getY() + size.getY() / 2,
+ position.getZ() + size.getZ() / 2
+ );
+ }
+
+ public String getFullName() {
+ return getFullName(".");
+ }
+
+ public String getFullName(String separator) {
+ StringBuilder sb = new StringBuilder();
+ Buildable[] ancestors = getAncestors();
+ for(int i = 1; i < ancestors.length; i++)
+ sb.append(ancestors[i].getName()).append(separator);
+ sb.append(getName());
+ return sb.toString();
+ }
+
+ public boolean hasAttribute(String name) {
+ for(Attribute a : attributes) {
+ if(a.getName().equals(name))
+ return true;
+ }
+ return false;
+ }
+
+ public String getAttributeValue(String name) {
+ for(Attribute a : attributes) {
+ if(a.getName().equals(name))
+ return a.getValue();
+ }
+ return null;
+ }
+
+ public Buildable[] getAncestors() {
+ List<Buildable> result = new ArrayList<Buildable>();
+ Buildable temp = this;
+ while(!temp.isRoot()) {
+ result.add(0, temp.getParent());
+ temp = temp.getParent();
+ }
+ return result.toArray(new Buildable[result.size()]);
+ }
+
+ public List<Buildable> getSiblings() {
+ List<Buildable> result = new ArrayList<Buildable>();
+ if(!isRoot()) {
+ for(Buildable b : parent.getChildren()) {
+ if(b != this) {
+ result.add(b);
+ }
+ }
+ }
+ return result;
+ }
+
+ public Buildable getLastLeftDescendant() {
+ Buildable b = this;
+ while(b.getFirstChild() != null) {
+ b = b.getFirstChild();
+ }
+ return b;
+ }
+
+ public int getNumberOfDescendants() {
+ return getDescendants().size();
+ }
+
+ public List<Buildable> getDescendants() {
+ List<Buildable> result = new ArrayList<Buildable>();
+ Stack<Buildable> temp = new Stack<Buildable>();
+ temp.push(this);
+ while(!temp.isEmpty()) {
+ Buildable current = temp.pop();
+ if(current.getNumberOfChildren() > 0) {
+ for(Buildable child : current.getChildren()) {
+ result.add(child);
+ temp.push(child);
+ }
+ }
+ }
+ return result;
+ }
+
+ public int getDescendantLevel() {
+ if(this.isRoot()) return 1;
+ return parent.getDescendantLevel() + 1;
+ }
+
+ public void addAttribute(Attribute a) {
+ attributes.add(a);
+ }
+
+ public void addAttribute(String name, String value) {
+ Attribute a = new Attribute(
+ name,
+ value
+ );
+ attributes.add(a);
+ }
+
+ public void addAttributes(Attribute... attributes) {
+ for(Attribute a : attributes) {
+ this.attributes.add(a);
+ }
+ }
+
+ public void clearAttributes() {
+ attributes.clear();
+ }
+
+ public void addChild(Buildable b) {
+ if(!b.isRoot()) b.parent.children.remove(b);
+ children.add(b);
+ b.parent = this;
+ }
+
+ public void addChildren(Buildable... children) {
+ for(Buildable b : children) {
+ addChild(b);
+ }
+ }
+
+ public void addChildren(Collection<Buildable> children) {
+ for(Buildable b : children) {
+ addChild(b);
+ }
+ }
+
+ public void clearChildren() {
+ for(Buildable c : children) {
+ c.parent = null;
+ }
+ children.clear();
+ }
+
+ public Buildable getFirstChild() {
+ if(!children.isEmpty()) {
+ return children.get(0);
+ }
+ return null;
+ }
+
+ public Buildable getLastChild() {
+ if(!children.isEmpty()) {
+ return children.get(children.size()-1);
+ }
+ return null;
+ }
+
+ public int getNumberOfChildren() {
+ return children.size();
+ }
+
+ public int getNumberOfAttributes() {
+ return attributes.size();
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Type getType() {
+ return type;
+ }
+
+ public void setType(Type type) {
+ this.type = type;
+ }
+
+ public int getPositionX() {
+ return position.getX();
+ }
+
+ public int getPositionY() {
+ return position.getY();
+ }
+
+ public int getPositionZ() {
+ return position.getZ();
+ }
+
+ public void setPositionX(int x) {
+ position.setX(x);
+ }
+
+ public void setPositionXR(int x) { //Recursive version: also sets the position of children
+ for(Buildable b : this.getDescendants()) {
+ b.setPositionX(b.getPositionX() - position.getX() + x);
+ }
+ position.setX(x);
+ }
+
+ public void setPositionY(int y) {
+ position.setY(y);
+ }
+
+ public void setPositionYR(int y) { //Recursive version: also sets the position of children
+ for(Buildable b : this.getDescendants()) {
+ b.setPositionY(b.getPositionY() - position.getY() + y);
+ }
+ position.setY(y);
+ }
+
+ public void setPositionZ(int z) {
+ position.setZ(z);
+ }
+
+ public void setPositionZR(int z) { //Recursive version: also sets the position of children
+ for(Buildable b : this.getDescendants()) {
+ b.setPositionZ(b.getPositionZ() - position.getZ() + z);
+ }
+ position.setZ(z);
+ }
+
+ public int getSizeX() {
+ return size.getX();
+ }
+
+ public int getSizeY() {
+ return size.getY();
+ }
+
+ public int getSizeZ() {
+ return size.getZ();
+ }
+
+ public void setSizeX(int x) {
+ size.setX(x);
+ }
+
+ public void setSizeY(int y) {
+ size.setY(y);
+ }
+
+ public void setSizeZ(int z) {
+ size.setZ(z);
+ }
+
+ public Attribute[] getAttributes() {
+ return attributes.toArray(new Attribute[attributes.size()]);
+ }
+
+ public Buildable[] getChildren() {
+ return children.toArray(new Buildable[children.size()]);
+ }
+
+ public Buildable getParent() {
+ return parent;
+ }
+
+ public boolean isRoot() {
+ return parent == null;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getCdfNames() {
+ return cdfNames;
+ }
+
+ public void setCdfNames(String cdfNames) {
+ this.cdfNames = cdfNames;
+ }
+
+ @Override
+ public int compareTo(Buildable b) {
+ return size.getX() * size.getY() * size.getZ() - b.getSizeX() * b.getSizeY() * b.getSizeZ();
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((type == null) ? 0 : type.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Buildable other = (Buildable) obj;
+ if (id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!id.equals(other.id))
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ if (type != other.type)
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return toString(0, false);
+ }
+
+ public String toEscapedString() {
+ return toString(0, true);
+ }
+
+ String toString(int indent, boolean escape) {
+ String id = this.id;
+ String name = this.name;
+ if(escape) {
+ id = StringEscapeUtils.escapeXml10(id);
+ name = StringEscapeUtils.escapeXml10(name);
+ }
+
+ StringBuilder indentSb = new StringBuilder();
+ for(int i = 0; i < indent; i++)
+ indentSb.append("\t");
+
+ StringBuilder sb = new StringBuilder();
+ sb.append(
+ indentSb + "<buildable id=\"" + id + "\" name=\"" + name + "\" type=\"" + type.toString().toLowerCase() + "\">\n"
+ + indentSb + "\t<position x=\"" + position.getX() + "\" y=\"" + position.getY() + "\" z=\"" + position.getZ() + "\"/>\n"
+ + indentSb + "\t<size x=\"" + size.getX() + "\" y=\"" + size.getY() + "\" z=\"" + size.getZ() + "\"/>\n"
+ + indentSb + "\t<attributes>\n"
+ );
+ for(Attribute a : attributes) {
+ sb.append(indentSb + "\t\t<attribute name=\"" + a.getName() + "\" value=\"" + (escape ? StringEscapeUtils.escapeXml10(a.getValue()) : a.getValue()) + "\"/>\n");
+ }
+ sb.append(
+ indentSb + "\t</attributes>\n"
+ + indentSb + "\t<children>\n");
+ for(Buildable c : children) {
+ sb.append(c.toString(indent + 2, escape));
+ }
+ sb.append(
+ indentSb + "\t</children>\n"
+ + indentSb + "</buildable>\n"
+ );
+ return sb.toString();
+ }
+
+ public Element toXmlElement(Document doc, boolean recursive) {
+ Element buildable = doc.createElement("buildable");
+ buildable.setAttribute("id", id);
+ buildable.setAttribute("name", name);
+ buildable.setAttribute("type", type.toString().toLowerCase());
+ buildable.setIdAttribute("id", true);
+
+ Element position = doc.createElement("position");
+ position.setAttribute("x", "" + this.position.getX());
+ position.setAttribute("y", "" + this.position.getY());
+ position.setAttribute("z", "" + this.position.getZ());
+ buildable.appendChild(position);
+
+ Element size = doc.createElement("size");
+ size.setAttribute("x", "" + this.size.getX());
+ size.setAttribute("y", "" + this.size.getY());
+ size.setAttribute("z", "" + this.size.getZ());
+ buildable.appendChild(size);
+
+ Element attributes = doc.createElement("attributes");
+ buildable.appendChild(attributes);
+
+ for(Attribute a : this.attributes) {
+ Element attr = doc.createElement("attribute");
+ attr.setAttribute("name", "" + a.getName());
+ attr.setAttribute("value", "" + a.getValue());
+ attributes.appendChild(attr);
+ }
+
+ Element children = doc.createElement("children");
+ buildable.appendChild(children);
+ if(recursive)
+ for(Buildable c : this.children) {
+ children.appendChild(c.toXmlElement(doc, true));
+ }
+
+ return buildable;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/BuildableTree$Iterator.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/BuildableTree$Iterator.html
new file mode 100644
index 00000000..4f406ef7
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/BuildableTree$Iterator.html
@@ -0,0 +1 @@
+BuildableTree.Iterator
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/BuildableTree.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/BuildableTree.html
new file mode 100644
index 00000000..200a78b0
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/BuildableTree.html
@@ -0,0 +1 @@
+BuildableTree
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/BuildableTree.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/BuildableTree.java.html
new file mode 100644
index 00000000..96c86c04
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/BuildableTree.java.html
@@ -0,0 +1,254 @@
+BuildableTree.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/CmxmlValidator.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/CmxmlValidator.html
new file mode 100644
index 00000000..eb7e2eea
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/CmxmlValidator.html
@@ -0,0 +1 @@
+CmxmlValidator
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/CmxmlValidator.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/CmxmlValidator.java.html
new file mode 100644
index 00000000..14d7124a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/CmxmlValidator.java.html
@@ -0,0 +1,33 @@
+CmxmlValidator.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Point.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Point.html
new file mode 100644
index 00000000..dd2a6770
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Point.html
@@ -0,0 +1 @@
+Point
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Point.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Point.java.html
new file mode 100644
index 00000000..a36b64c3
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/Point.java.html
@@ -0,0 +1,53 @@
+Point.java
package codemetropolis.toolchain.commons.cmxml;
+
+public class Point {
+
+ private int x;
+ private int y;
+ private int z;
+
+ public Point() {}
+
+ public Point(int x, int z) {
+ this(x, 0, z);
+ }
+
+ public Point(int x, int y, int z) {
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ }
+
+ public Point translate(Point offset) {
+ return new Point(
+ x + offset.getX(),
+ y + offset.getY(),
+ z + offset.getZ());
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ protected void setX(int x) {
+ this.x = x;
+ }
+
+ public int getY() {
+ return y;
+ }
+
+ protected void setY(int y) {
+ this.y = y;
+ }
+
+ public int getZ() {
+ return z;
+ }
+
+ protected void setZ(int z) {
+ this.z = z;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/index.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/index.html
new file mode 100644
index 00000000..37656ca2
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.cmxml
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/index.source.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/index.source.html
new file mode 100644
index 00000000..989b2a9f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.cmxml/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.cmxml
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/CodeMetropolisException.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/CodeMetropolisException.html
new file mode 100644
index 00000000..0e649176
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/CodeMetropolisException.html
@@ -0,0 +1 @@
+CodeMetropolisException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/CodeMetropolisException.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/CodeMetropolisException.java.html
new file mode 100644
index 00000000..52bad2e3
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/CodeMetropolisException.java.html
@@ -0,0 +1,28 @@
+CodeMetropolisException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/InvalidSchemeException.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/InvalidSchemeException.html
new file mode 100644
index 00000000..d0bb866a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/InvalidSchemeException.html
@@ -0,0 +1 @@
+InvalidSchemeException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/InvalidSchemeException.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/InvalidSchemeException.java.html
new file mode 100644
index 00000000..f2c7f82d
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/InvalidSchemeException.java.html
@@ -0,0 +1,28 @@
+InvalidSchemeException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/SchemeNotSetException.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/SchemeNotSetException.html
new file mode 100644
index 00000000..2239a2c9
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/SchemeNotSetException.html
@@ -0,0 +1 @@
+SchemeNotSetException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/SchemeNotSetException.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/SchemeNotSetException.java.html
new file mode 100644
index 00000000..8d84a4b6
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/SchemeNotSetException.java.html
@@ -0,0 +1,28 @@
+SchemeNotSetException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/index.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/index.html
new file mode 100644
index 00000000..94ebf66c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.exceptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/index.source.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/index.source.html
new file mode 100644
index 00000000..4fe5a965
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.exceptions/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.exceptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/AbstractExecutor.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/AbstractExecutor.html
new file mode 100644
index 00000000..6eaae9f8
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/AbstractExecutor.html
@@ -0,0 +1 @@
+AbstractExecutor
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/AbstractExecutor.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/AbstractExecutor.java.html
new file mode 100644
index 00000000..858242be
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/AbstractExecutor.java.html
@@ -0,0 +1,63 @@
+AbstractExecutor.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/ExecutorArgs.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/ExecutorArgs.html
new file mode 100644
index 00000000..4f80941e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/ExecutorArgs.html
@@ -0,0 +1 @@
+ExecutorArgs
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/ExecutorArgs.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/ExecutorArgs.java.html
new file mode 100644
index 00000000..36c130a4
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/ExecutorArgs.java.html
@@ -0,0 +1,4 @@
+ExecutorArgs.java
package codemetropolis.toolchain.commons.executor;
+
+public abstract class ExecutorArgs {}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/index.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/index.html
new file mode 100644
index 00000000..be345710
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.executor
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/index.source.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/index.source.html
new file mode 100644
index 00000000..31a3166a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.executor/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.executor
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/FileLogger.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/FileLogger.html
new file mode 100644
index 00000000..b156e9d1
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/FileLogger.html
@@ -0,0 +1 @@
+FileLogger
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/FileLogger.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/FileLogger.java.html
new file mode 100644
index 00000000..7ceb5a19
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/FileLogger.java.html
@@ -0,0 +1,47 @@
+FileLogger.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/FileUtils.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/FileUtils.html
new file mode 100644
index 00000000..e592eafd
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/FileUtils.html
@@ -0,0 +1 @@
+FileUtils
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/FileUtils.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/FileUtils.java.html
new file mode 100644
index 00000000..e2e0033b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/FileUtils.java.html
@@ -0,0 +1,24 @@
+FileUtils.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Resources.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Resources.html
new file mode 100644
index 00000000..dcd69ce5
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Resources.html
@@ -0,0 +1 @@
+Resources
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Resources.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Resources.java.html
new file mode 100644
index 00000000..9db4f818
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Resources.java.html
@@ -0,0 +1,16 @@
+Resources.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Settings.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Settings.html
new file mode 100644
index 00000000..99e45219
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Settings.html
@@ -0,0 +1 @@
+Settings
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Settings.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Settings.java.html
new file mode 100644
index 00000000..9048ee49
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Settings.java.html
@@ -0,0 +1,16 @@
+Settings.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Time.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Time.html
new file mode 100644
index 00000000..11be37db
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Time.html
@@ -0,0 +1 @@
+Time
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Time.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Time.java.html
new file mode 100644
index 00000000..93c2d493
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/Time.java.html
@@ -0,0 +1,24 @@
+Time.java
package codemetropolis.toolchain.commons.util;
+
+public class Time {
+
+ private long milliseconds;
+
+ public Time(long milliseconds) {
+ this.milliseconds = milliseconds;
+ }
+
+ public int getHours() {
+ return (int) (milliseconds / (1000 * 60 * 60));
+ }
+
+ public int getMinutes() {
+ return (int) ((milliseconds / (1000 * 60)) % 60);
+ }
+
+ public int getSeconds() {
+ return (int) (milliseconds / 1000) % 60 ;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/XmlValidator.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/XmlValidator.html
new file mode 100644
index 00000000..d182609f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/XmlValidator.html
@@ -0,0 +1 @@
+XmlValidator
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/XmlValidator.java.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/XmlValidator.java.html
new file mode 100644
index 00000000..a8afdff7
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/XmlValidator.java.html
@@ -0,0 +1,55 @@
+XmlValidator.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/index.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/index.html
new file mode 100644
index 00000000..64adbecc
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.util
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/index.source.html b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/index.source.html
new file mode 100644
index 00000000..a3fe88cb
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/codemetropolis.toolchain.commons.util/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.commons.util
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_java/index.html b/doc/codemetropolis-toolchain-commons/src_main_java/index.html
new file mode 100644
index 00000000..be56666e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_java/index.html
@@ -0,0 +1 @@
+src/main/java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-commons/src_main_resources/index.html b/doc/codemetropolis-toolchain-commons/src_main_resources/index.html
new file mode 100644
index 00000000..6b51781c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-commons/src_main_resources/index.html
@@ -0,0 +1 @@
+src/main/resources
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/index.html b/doc/codemetropolis-toolchain-converter/index.html
new file mode 100644
index 00000000..574166c9
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/index.html
@@ -0,0 +1 @@
+codemetropolis-toolchain-converter
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory.test/BrowsingHistoryConverterTests.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory.test/BrowsingHistoryConverterTests.html
new file mode 100644
index 00000000..873cc4cf
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory.test/BrowsingHistoryConverterTests.html
@@ -0,0 +1 @@
+BrowsingHistoryConverterTests
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory.test/BrowsingHistoryConverterTests.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory.test/BrowsingHistoryConverterTests.java.html
new file mode 100644
index 00000000..d4cfa045
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory.test/BrowsingHistoryConverterTests.java.html
@@ -0,0 +1,182 @@
+BrowsingHistoryConverterTests.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory.test/index.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory.test/index.html
new file mode 100644
index 00000000..8c1b8273
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory.test/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.converter.browsinghistory.test
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory.test/index.source.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory.test/index.source.html
new file mode 100644
index 00000000..b295d48c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory.test/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.converter.browsinghistory.test
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory/BrowsingHistoryConverter.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory/BrowsingHistoryConverter.html
new file mode 100644
index 00000000..043f8f38
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory/BrowsingHistoryConverter.html
@@ -0,0 +1 @@
+BrowsingHistoryConverter
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory/BrowsingHistoryConverter.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory/BrowsingHistoryConverter.java.html
new file mode 100644
index 00000000..ceb46e0c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory/BrowsingHistoryConverter.java.html
@@ -0,0 +1,160 @@
+BrowsingHistoryConverter.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory/index.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory/index.html
new file mode 100644
index 00000000..722f4598
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.converter.browsinghistory
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory/index.source.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory/index.source.html
new file mode 100644
index 00000000..6f529445
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.browsinghistory/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.converter.browsinghistory
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/ConverterLoader.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/ConverterLoader.html
new file mode 100644
index 00000000..626162e1
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/ConverterLoader.html
@@ -0,0 +1 @@
+ConverterLoader
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/ConverterLoader.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/ConverterLoader.java.html
new file mode 100644
index 00000000..bddaba13
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/ConverterLoader.java.html
@@ -0,0 +1,30 @@
+ConverterLoader.java
package codemetropolis.toolchain.converter.control;
+
+import java.util.Map;
+
+import codemetropolis.toolchain.commons.cdf.converter.CdfConverter;
+import codemetropolis.toolchain.converter.browsinghistory.BrowsingHistoryConverter;
+import codemetropolis.toolchain.converter.sonarqube.SonarQubeConverter;
+import codemetropolis.toolchain.converter.gitinspector.GitInspectorConverter;
+import codemetropolis.toolchain.converter.sourcemeter.GraphConverter;
+
+public class ConverterLoader {
+
+ private ConverterLoader() {}
+
+ public static CdfConverter load(ConverterType converterType, Map<String, String> params) {
+ switch(converterType) {
+ case GITINSPECTOR:
+ return new GitInspectorConverter(params);
+ case SOURCEMETER:
+ return new GraphConverter(params);
+ case SONARQUBE:
+ return new SonarQubeConverter(params);
+ case BROWSINGHISTORY:
+ return new BrowsingHistoryConverter(params);
+ default:
+ return null;
+ }
+ }
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/ConverterType.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/ConverterType.html
new file mode 100644
index 00000000..4a03ca99
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/ConverterType.html
@@ -0,0 +1 @@
+ConverterType
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/ConverterType.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/ConverterType.java.html
new file mode 100644
index 00000000..f5d31f8f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/ConverterType.java.html
@@ -0,0 +1,9 @@
+ConverterType.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/index.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/index.html
new file mode 100644
index 00000000..e083f0a4
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.converter.control
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/index.source.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/index.source.html
new file mode 100644
index 00000000..d7af7db6
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.control/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.converter.control
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateDocumentFromSourceTest.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateDocumentFromSourceTest.html
new file mode 100644
index 00000000..b2a031d1
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateDocumentFromSourceTest.html
@@ -0,0 +1 @@
+CreateDocumentFromSourceTest
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateDocumentFromSourceTest.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateDocumentFromSourceTest.java.html
new file mode 100644
index 00000000..4d6c1918
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateDocumentFromSourceTest.java.html
@@ -0,0 +1,54 @@
+CreateDocumentFromSourceTest.java
package codemetropolis.toolchain.converter.gitinspector.test;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+import codemetropolis.toolchain.commons.exceptions.CodeMetropolisException;
+import codemetropolis.toolchain.converter.gitinspector.GitInspectorConverter;
+
+/**
+ *
+ * @author Zakor Gyula {@literal <ZAGPAAG.SZE>}
+ *
+ */
+
+public class CreateDocumentFromSourceTest {
+ private static String XML_SRC_PATH = "src\\main\\java\\codemetropolis\\toolchain\\converter\\gitinspector\\test\\GitInspectorOutput.xml";
+ private static String INVALID_FORMAT_PATH = "src\\main\\java\\codemetropolis\\toolchain\\converter\\gitinspector\\test\\";
+
+ @Test
+ public void invalidPath() {
+ GitInspectorConverter conv = TestHelper.newGitInspectorConverter();
+ try {
+ conv.createDocumentFromSource("");
+ fail("This test should fail because the resource path is invalid.");
+ } catch (CodeMetropolisException e) {
+ } catch (Exception e) {
+ fail("the wrong type of exception returned.");
+ }
+ }
+
+ @Test
+ public void invalidResource() {
+ GitInspectorConverter conv = TestHelper.newGitInspectorConverter();
+ try {
+ conv.createDocumentFromSource(INVALID_FORMAT_PATH);
+ fail("This test should fail because the target resource is a library.");
+ } catch (CodeMetropolisException e) {
+ } catch (Exception e) {
+ fail("the wrong type of exception returned.");
+ }
+ }
+
+ @Test
+ public void validPath() {
+ GitInspectorConverter conv = TestHelper.newGitInspectorConverter();
+ try {
+ conv.createDocumentFromSource(XML_SRC_PATH);
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+ }
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateElementsTest.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateElementsTest.html
new file mode 100644
index 00000000..287aba40
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateElementsTest.html
@@ -0,0 +1 @@
+CreateElementsTest
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateElementsTest.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateElementsTest.java.html
new file mode 100644
index 00000000..7a327e6f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateElementsTest.java.html
@@ -0,0 +1,104 @@
+CreateElementsTest.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateRootelemenTest.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateRootelemenTest.html
new file mode 100644
index 00000000..26f30225
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateRootelemenTest.html
@@ -0,0 +1 @@
+CreateRootelemenTest
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateRootelemenTest.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateRootelemenTest.java.html
new file mode 100644
index 00000000..716601f3
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/CreateRootelemenTest.java.html
@@ -0,0 +1,35 @@
+CreateRootelemenTest.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/DownscalePossibleLargeNumericValueTest.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/DownscalePossibleLargeNumericValueTest.html
new file mode 100644
index 00000000..6a1d29bf
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/DownscalePossibleLargeNumericValueTest.html
@@ -0,0 +1 @@
+DownscalePossibleLargeNumericValueTest
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/DownscalePossibleLargeNumericValueTest.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/DownscalePossibleLargeNumericValueTest.java.html
new file mode 100644
index 00000000..eaf83f72
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/DownscalePossibleLargeNumericValueTest.java.html
@@ -0,0 +1,57 @@
+DownscalePossibleLargeNumericValueTest.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/GetMetricsFromFirstAuthorElementNodeTest.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/GetMetricsFromFirstAuthorElementNodeTest.html
new file mode 100644
index 00000000..984f1e2c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/GetMetricsFromFirstAuthorElementNodeTest.html
@@ -0,0 +1 @@
+GetMetricsFromFirstAuthorElementNodeTest
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/GetMetricsFromFirstAuthorElementNodeTest.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/GetMetricsFromFirstAuthorElementNodeTest.java.html
new file mode 100644
index 00000000..d8f53fe2
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/GetMetricsFromFirstAuthorElementNodeTest.java.html
@@ -0,0 +1,76 @@
+GetMetricsFromFirstAuthorElementNodeTest.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/GitInspectorConverterTest.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/GitInspectorConverterTest.html
new file mode 100644
index 00000000..cd18b107
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/GitInspectorConverterTest.html
@@ -0,0 +1 @@
+GitInspectorConverterTest
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/GitInspectorConverterTest.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/GitInspectorConverterTest.java.html
new file mode 100644
index 00000000..55fd3758
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/GitInspectorConverterTest.java.html
@@ -0,0 +1,27 @@
+GitInspectorConverterTest.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/ResetMetricsTest.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/ResetMetricsTest.html
new file mode 100644
index 00000000..c2f530fd
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/ResetMetricsTest.html
@@ -0,0 +1 @@
+ResetMetricsTest
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/ResetMetricsTest.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/ResetMetricsTest.java.html
new file mode 100644
index 00000000..8235a676
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/ResetMetricsTest.java.html
@@ -0,0 +1,31 @@
+ResetMetricsTest.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/TestHelper.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/TestHelper.html
new file mode 100644
index 00000000..208bd34b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/TestHelper.html
@@ -0,0 +1 @@
+TestHelper
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/TestHelper.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/TestHelper.java.html
new file mode 100644
index 00000000..4a8df587
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/TestHelper.java.html
@@ -0,0 +1,56 @@
+TestHelper.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/TraverseNodesFromDocumentTest.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/TraverseNodesFromDocumentTest.html
new file mode 100644
index 00000000..41161b04
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/TraverseNodesFromDocumentTest.html
@@ -0,0 +1 @@
+TraverseNodesFromDocumentTest
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/TraverseNodesFromDocumentTest.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/TraverseNodesFromDocumentTest.java.html
new file mode 100644
index 00000000..70955c19
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/TraverseNodesFromDocumentTest.java.html
@@ -0,0 +1,64 @@
+TraverseNodesFromDocumentTest.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/UpdateMetricsFromSecondAuthorElementNodeTest.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/UpdateMetricsFromSecondAuthorElementNodeTest.html
new file mode 100644
index 00000000..7e9af190
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/UpdateMetricsFromSecondAuthorElementNodeTest.html
@@ -0,0 +1 @@
+UpdateMetricsFromSecondAuthorElementNodeTest
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/UpdateMetricsFromSecondAuthorElementNodeTest.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/UpdateMetricsFromSecondAuthorElementNodeTest.java.html
new file mode 100644
index 00000000..64c8ca9c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/UpdateMetricsFromSecondAuthorElementNodeTest.java.html
@@ -0,0 +1,73 @@
+UpdateMetricsFromSecondAuthorElementNodeTest.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/UpdateMetricsTest.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/UpdateMetricsTest.html
new file mode 100644
index 00000000..181665b1
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/UpdateMetricsTest.html
@@ -0,0 +1 @@
+UpdateMetricsTest
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/UpdateMetricsTest.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/UpdateMetricsTest.java.html
new file mode 100644
index 00000000..2c392b94
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/UpdateMetricsTest.java.html
@@ -0,0 +1,63 @@
+UpdateMetricsTest.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/index.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/index.html
new file mode 100644
index 00000000..764f2c46
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.converter.gitinspector.test
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/index.source.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/index.source.html
new file mode 100644
index 00000000..e6d1c19a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector.test/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.converter.gitinspector.test
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector/GitInspectorConverter.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector/GitInspectorConverter.html
new file mode 100644
index 00000000..359060b0
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector/GitInspectorConverter.html
@@ -0,0 +1 @@
+GitInspectorConverter
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector/GitInspectorConverter.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector/GitInspectorConverter.java.html
new file mode 100644
index 00000000..2d5e2c9f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector/GitInspectorConverter.java.html
@@ -0,0 +1,180 @@
+GitInspectorConverter.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector/index.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector/index.html
new file mode 100644
index 00000000..9ab74dfd
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.converter.gitinspector
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector/index.source.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector/index.source.html
new file mode 100644
index 00000000..881f78bb
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.gitinspector/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.converter.gitinspector
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarClient.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarClient.html
new file mode 100644
index 00000000..c1404f1c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarClient.html
@@ -0,0 +1 @@
+SonarClient
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarClient.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarClient.java.html
new file mode 100644
index 00000000..1a624712
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarClient.java.html
@@ -0,0 +1,213 @@
+SonarClient.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarConnectException.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarConnectException.html
new file mode 100644
index 00000000..a8c685fe
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarConnectException.html
@@ -0,0 +1 @@
+SonarConnectException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarConnectException.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarConnectException.java.html
new file mode 100644
index 00000000..a6c56563
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarConnectException.java.html
@@ -0,0 +1,30 @@
+SonarConnectException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarMetric$MetricType.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarMetric$MetricType.html
new file mode 100644
index 00000000..373c1d1b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarMetric$MetricType.html
@@ -0,0 +1 @@
+SonarMetric.MetricType
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarMetric.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarMetric.html
new file mode 100644
index 00000000..6485736f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarMetric.html
@@ -0,0 +1 @@
+SonarMetric
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarMetric.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarMetric.java.html
new file mode 100644
index 00000000..76aee065
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarMetric.java.html
@@ -0,0 +1,83 @@
+SonarMetric.java
package codemetropolis.toolchain.converter.sonarqube;
+
+public class SonarMetric {
+
+ private String name;
+ private String value;
+ private MetricType type;
+
+ public SonarMetric(String name, String value, MetricType type) {
+ this.name = name;
+ this.value = value;
+ this.type = type;
+ }
+
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getValue() {
+ return value;
+ }
+ public void setValue(String value) {
+ this.value = value;
+ }
+ public MetricType getType() {
+ return type;
+ }
+ public void setType(MetricType type) {
+ this.type = type;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((type == null) ? 0 : type.hashCode());
+ result = prime * result + ((value == null) ? 0 : value.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ SonarMetric other = (SonarMetric) obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ if (type != other.type)
+ return false;
+ if (value == null) {
+ if (other.value != null)
+ return false;
+ } else if (!value.equals(other.value))
+ return false;
+ return true;
+ }
+
+ public enum MetricType {
+ INT,
+ FLOAT,
+ PERCENT,
+ BOOL,
+ STRING,
+ MILLISEC,
+ DATA,
+ LEVEL,
+ DISTRIB,
+ RATING,
+ WORK_DUR
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarQubeConverter.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarQubeConverter.html
new file mode 100644
index 00000000..dc595f2c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarQubeConverter.html
@@ -0,0 +1 @@
+SonarQubeConverter
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarQubeConverter.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarQubeConverter.java.html
new file mode 100644
index 00000000..c2905dfe
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarQubeConverter.java.html
@@ -0,0 +1,194 @@
+SonarQubeConverter.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarRequest.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarRequest.html
new file mode 100644
index 00000000..986dccc4
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarRequest.html
@@ -0,0 +1 @@
+SonarRequest
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarRequest.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarRequest.java.html
new file mode 100644
index 00000000..dff9f607
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarRequest.java.html
@@ -0,0 +1,107 @@
+SonarRequest.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarResource$Scope.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarResource$Scope.html
new file mode 100644
index 00000000..c78c24b5
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarResource$Scope.html
@@ -0,0 +1 @@
+SonarResource.Scope
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarResource.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarResource.html
new file mode 100644
index 00000000..c1d27c9b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarResource.html
@@ -0,0 +1 @@
+SonarResource
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarResource.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarResource.java.html
new file mode 100644
index 00000000..0ab7c965
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/SonarResource.java.html
@@ -0,0 +1,126 @@
+SonarResource.java
package codemetropolis.toolchain.converter.sonarqube;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+public class SonarResource {
+
+ private int id;
+ private String name;
+ private String key;
+ private Scope scope;
+ private List<SonarMetric> metrics = new ArrayList<>();
+ private List<Integer> childIdList = new ArrayList<>();
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public Scope getScope() {
+ return scope;
+ }
+
+ public void setScope(Scope scope) {
+ this.scope = scope;
+ }
+
+ public List<SonarMetric> getMetrics() {
+ return Collections.unmodifiableList(metrics);
+ }
+
+ public void addMetrics(Collection<SonarMetric> metrics) {
+ this.metrics.addAll(metrics);
+ }
+
+ public void addMetric(SonarMetric... metric) {
+ for(SonarMetric m : metric) {
+ metrics.add(m);
+ }
+ }
+
+ public List<Integer> getChildIdList() {
+ return Collections.unmodifiableList(childIdList);
+ }
+
+ public void addChildren(Collection<Integer> idCollection) {
+ childIdList.addAll(idCollection);
+ }
+
+ public void addChild(int... id) {
+ for(int c : id) {
+ childIdList.add(c);
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((childIdList == null) ? 0 : childIdList.hashCode());
+ result = prime * result + id;
+ result = prime * result + ((metrics == null) ? 0 : metrics.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((scope == null) ? 0 : scope.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ SonarResource other = (SonarResource) obj;
+ if (childIdList == null) {
+ if (other.childIdList != null)
+ return false;
+ } else if (!childIdList.equals(other.childIdList))
+ return false;
+ if (id != other.id)
+ return false;
+ if (metrics == null) {
+ if (other.metrics != null)
+ return false;
+ } else if (!metrics.equals(other.metrics))
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ if (scope != other.scope)
+ return false;
+ return true;
+ }
+
+ public enum Scope{
+ PRJ,
+ DIR,
+ FIL
+ }
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/index.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/index.html
new file mode 100644
index 00000000..df314c47
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.converter.sonarqube
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/index.source.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/index.source.html
new file mode 100644
index 00000000..5d187645
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sonarqube/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.converter.sonarqube
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sourcemeter/GraphConverter.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sourcemeter/GraphConverter.html
new file mode 100644
index 00000000..f2c8d245
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sourcemeter/GraphConverter.html
@@ -0,0 +1 @@
+GraphConverter
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sourcemeter/GraphConverter.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sourcemeter/GraphConverter.java.html
new file mode 100644
index 00000000..5ccb4947
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sourcemeter/GraphConverter.java.html
@@ -0,0 +1,89 @@
+GraphConverter.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sourcemeter/index.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sourcemeter/index.html
new file mode 100644
index 00000000..f7c33c33
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sourcemeter/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.converter.sourcemeter
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sourcemeter/index.source.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sourcemeter/index.source.html
new file mode 100644
index 00000000..7cb37952
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter.sourcemeter/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.converter.sourcemeter
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/CommandLineOptions.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/CommandLineOptions.html
new file mode 100644
index 00000000..e564ff70
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/CommandLineOptions.html
@@ -0,0 +1 @@
+CommandLineOptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/CommandLineOptions.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/CommandLineOptions.java.html
new file mode 100644
index 00000000..0a4f694a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/CommandLineOptions.java.html
@@ -0,0 +1,44 @@
+CommandLineOptions.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/ConverterExecutor$1.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/ConverterExecutor$1.html
new file mode 100644
index 00000000..8221cb21
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/ConverterExecutor$1.html
@@ -0,0 +1 @@
+ConverterExecutor.new ConverterEventListener() {...}
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/ConverterExecutor.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/ConverterExecutor.html
new file mode 100644
index 00000000..78a8cfcc
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/ConverterExecutor.html
@@ -0,0 +1 @@
+ConverterExecutor
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/ConverterExecutor.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/ConverterExecutor.java.html
new file mode 100644
index 00000000..2f13fc89
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/ConverterExecutor.java.html
@@ -0,0 +1,56 @@
+ConverterExecutor.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/ConverterExecutorArgs.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/ConverterExecutorArgs.html
new file mode 100644
index 00000000..4bfe6dcd
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/ConverterExecutorArgs.html
@@ -0,0 +1 @@
+ConverterExecutorArgs
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/ConverterExecutorArgs.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/ConverterExecutorArgs.java.html
new file mode 100644
index 00000000..1336a062
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/ConverterExecutorArgs.java.html
@@ -0,0 +1,50 @@
+ConverterExecutorArgs.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/Main.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/Main.html
new file mode 100644
index 00000000..f77908f5
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/Main.html
@@ -0,0 +1 @@
+Main
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/Main.java.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/Main.java.html
new file mode 100644
index 00000000..2b056f5e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/Main.java.html
@@ -0,0 +1,81 @@
+Main.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/index.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/index.html
new file mode 100644
index 00000000..a1bf798a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.converter
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/index.source.html b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/index.source.html
new file mode 100644
index 00000000..b22c4989
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/codemetropolis.toolchain.converter/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.converter
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-converter/src_main_java/index.html b/doc/codemetropolis-toolchain-converter/src_main_java/index.html
new file mode 100644
index 00000000..2d41bd0b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-converter/src_main_java/index.html
@@ -0,0 +1 @@
+src/main/java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/index.html b/doc/codemetropolis-toolchain-gui/index.html
new file mode 100644
index 00000000..40ed76a2
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/index.html
@@ -0,0 +1 @@
+codemetropolis-toolchain-gui
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/BadConfigFileFomatException.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/BadConfigFileFomatException.html
new file mode 100644
index 00000000..be21b38e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/BadConfigFileFomatException.html
@@ -0,0 +1 @@
+BadConfigFileFomatException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/BadConfigFileFomatException.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/BadConfigFileFomatException.java.html
new file mode 100644
index 00000000..f26ca163
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/BadConfigFileFomatException.java.html
@@ -0,0 +1,41 @@
+BadConfigFileFomatException.java
package codemetropolis.toolchain.gui.beans;
+
+/**
+ * Exception class for handling exceptions that occur because of
+ * the bad format of the configuration file containing the buildable attributes desired to display.
+ * @author Viktor Meszaros {@literal <MEVXAAT.SZE>}
+ */
+public class BadConfigFileFomatException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * @see Exception#Exception()
+ */
+ public BadConfigFileFomatException() {
+
+ }
+
+ /**
+ * @see Exception#Exception(String)
+ */
+ public BadConfigFileFomatException(String message) {
+ super(message);
+ }
+
+ /**
+ * @see Exception#Exception(Throwable)
+ */
+ public BadConfigFileFomatException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * @see Exception#Exception(String, Throwable)
+ */
+ public BadConfigFileFomatException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/ExecutionException.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/ExecutionException.html
new file mode 100644
index 00000000..0e048ca7
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/ExecutionException.html
@@ -0,0 +1 @@
+ExecutionException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/ExecutionException.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/ExecutionException.java.html
new file mode 100644
index 00000000..017e056a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/ExecutionException.java.html
@@ -0,0 +1,41 @@
+ExecutionException.java
package codemetropolis.toolchain.gui.beans;
+
+/**
+ * Exception class for handling exceptions that occur during an execution.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class ExecutionException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * @see Exception#Exception()
+ */
+ public ExecutionException() {
+
+ }
+
+ /**
+ * @see Exception#Exception(String)
+ */
+ public ExecutionException(String message) {
+ super(message);
+ }
+
+ /**
+ * @see Exception#Exception(Throwable)
+ */
+ public ExecutionException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * @see Exception#Exception(String, Throwable)
+ */
+ public ExecutionException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/ExecutionOptions.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/ExecutionOptions.html
new file mode 100644
index 00000000..82efeaab
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/ExecutionOptions.html
@@ -0,0 +1 @@
+ExecutionOptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/ExecutionOptions.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/ExecutionOptions.java.html
new file mode 100644
index 00000000..fe2a2d54
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/ExecutionOptions.java.html
@@ -0,0 +1,121 @@
+ExecutionOptions.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/QuantizationInformation.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/QuantizationInformation.html
new file mode 100644
index 00000000..a8f51369
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/QuantizationInformation.html
@@ -0,0 +1 @@
+QuantizationInformation
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/QuantizationInformation.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/QuantizationInformation.java.html
new file mode 100644
index 00000000..dad350ef
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/QuantizationInformation.java.html
@@ -0,0 +1,44 @@
+QuantizationInformation.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/index.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/index.html
new file mode 100644
index 00000000..df6c37d0
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.gui.beans
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/index.source.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/index.source.html
new file mode 100644
index 00000000..259ac60f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.beans/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.gui.beans
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components.listeners/BrowseListener.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components.listeners/BrowseListener.html
new file mode 100644
index 00000000..69534683
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components.listeners/BrowseListener.html
@@ -0,0 +1 @@
+BrowseListener
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components.listeners/BrowseListener.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components.listeners/BrowseListener.java.html
new file mode 100644
index 00000000..5fcdc261
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components.listeners/BrowseListener.java.html
@@ -0,0 +1,47 @@
+BrowseListener.java
package codemetropolis.toolchain.gui.components.listeners;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileFilter;
+
+import codemetropolis.toolchain.gui.components.CMTextField;
+
+/**
+ * Listener class to handle file and directory browsing.
+ *
+ * @author Abel Szkalisity {@literal <SZAVAET.SZE>}
+ */
+public class BrowseListener implements ActionListener {
+
+ private JFileChooser fileChooser;
+ private CMTextField fileNameTextField;
+
+ /**
+ * Constructs a {@link BrowseListener} instance with the given parameters.
+ *
+ * @param fileNameTextField The {@link CMTextField} instance that will contain the path for the selected file.
+ * @param fileSelectionMode The file selection mode for the {@link JFileChooser}. See
+ * {@link JFileChooser#setFileSelectionMode(int)} for details.
+ * @param filter Optional. If provided, it will be used for the {@link JFileChooser} to filter the visible entities.
+ */
+ public BrowseListener(CMTextField fileNameTextField, int fileSelectionMode, FileFilter filter) {
+ this.fileNameTextField = fileNameTextField;
+
+ this.fileChooser = new JFileChooser();
+ this.fileChooser.setFileSelectionMode(fileSelectionMode);
+ if (filter != null) {
+ this.fileChooser.setFileFilter(filter);
+ }
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent event) {
+ if (fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
+ fileNameTextField.setText(fileChooser.getSelectedFile().getAbsolutePath());
+ }
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components.listeners/index.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components.listeners/index.html
new file mode 100644
index 00000000..d234c33e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components.listeners/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.gui.components.listeners
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components.listeners/index.source.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components.listeners/index.source.html
new file mode 100644
index 00000000..ef11c333
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components.listeners/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.gui.components.listeners
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMButton.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMButton.html
new file mode 100644
index 00000000..97b55926
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMButton.html
@@ -0,0 +1 @@
+CMButton
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMButton.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMButton.java.html
new file mode 100644
index 00000000..2b837d9c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMButton.java.html
@@ -0,0 +1,45 @@
+CMButton.java
package codemetropolis.toolchain.gui.components;
+
+import java.awt.Font;
+
+import javax.swing.JButton;
+
+/**
+ * Custom button class for setting custom defaults for the JButtons we use.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class CMButton extends JButton {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Font BUTTON_FONT = new Font("Source Sans Pro", Font.PLAIN, 16);
+
+ /**
+ * Constructs a {@link CMButton} instance.
+ *
+ * @param label The label for this button.
+ */
+ public CMButton(String label) {
+ super(label);
+
+ setFont(BUTTON_FONT);
+ }
+
+ /**
+ * Constructs a {@link CMButton} instance, and sets its position and size.
+ *
+ * @param label The label for this button.
+ * @param x The x position on the ui.
+ * @param y The y position on the ui.
+ * @param width The width of the element.
+ * @param height The height of the element.
+ */
+ public CMButton(String label, int x, int y, int width, int height) {
+ this(label);
+
+ setBounds(x, y, width, height);
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMCheckBox.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMCheckBox.html
new file mode 100644
index 00000000..0edcbbad
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMCheckBox.html
@@ -0,0 +1 @@
+CMCheckBox
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMCheckBox.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMCheckBox.java.html
new file mode 100644
index 00000000..18becb1a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMCheckBox.java.html
@@ -0,0 +1,36 @@
+CMCheckBox.java
package codemetropolis.toolchain.gui.components;
+
+import javax.swing.JCheckBox;
+
+/**
+ * Custom checkbox class for setting custom defaults for the JCheckBoxes we use.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class CMCheckBox extends JCheckBox {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructs a {@link CMButton} instance.
+ */
+ public CMCheckBox() {
+ setOpaque(false);
+ }
+
+ /**
+ * Constructs a {@link CMCheckBox} instance, and sets its position and size.
+ *
+ * @param x The x position on the ui.
+ * @param y The y position on the ui.
+ * @param width The width of the element.
+ * @param height The height of the element.
+ */
+ public CMCheckBox(int x, int y, int width, int height) {
+ this();
+
+ setBounds(x, y, width, height);
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMComboBox.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMComboBox.html
new file mode 100644
index 00000000..65c6fd01
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMComboBox.html
@@ -0,0 +1 @@
+CMComboBox
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMComboBox.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMComboBox.java.html
new file mode 100644
index 00000000..6963faf4
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMComboBox.java.html
@@ -0,0 +1,46 @@
+CMComboBox.java
package codemetropolis.toolchain.gui.components;
+
+import java.awt.Font;
+
+import javax.swing.JComboBox;
+
+/**
+ * Custom combobox class for setting custom defaults for the JComboBoxes we use.
+ *
+ * @param <T> The type parameter for the {@link JComboBox}.
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class CMComboBox<T> extends JComboBox<T> {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Font COMBO_BOX_FONT = new Font("Source Sans Pro", Font.PLAIN, 16);
+
+ /**
+ * Constructs a {@link CMComboBox} instance.
+ *
+ * @param items The desired contents of this combobox.
+ */
+ public CMComboBox(T[] items) {
+ super(items);
+
+ setFont(COMBO_BOX_FONT);
+ }
+
+ /**
+ * Constructs a {@link CMComboBox} instance, and sets its position and size.
+ *
+ * @param items The desired contents of this combobox.
+ * @param x The x position on the ui.
+ * @param y The y position on the ui.
+ * @param width The width of the element.
+ * @param height The height of the element.
+ */
+ public CMComboBox(T[] items, int x, int y, int width, int height) {
+ this(items);
+
+ setBounds(x, y, width, height);
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMLabel.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMLabel.html
new file mode 100644
index 00000000..56693693
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMLabel.html
@@ -0,0 +1 @@
+CMLabel
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMLabel.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMLabel.java.html
new file mode 100644
index 00000000..79e46e55
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMLabel.java.html
@@ -0,0 +1,45 @@
+CMLabel.java
package codemetropolis.toolchain.gui.components;
+
+import java.awt.Font;
+
+import javax.swing.JLabel;
+
+/**
+ * Custom label class for setting custom defaults for the JLabels we use.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class CMLabel extends JLabel {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Font LABEL_FONT = new Font("Source Sans Pro", Font.PLAIN, 16);
+
+ /**
+ * Constructs a {@link CMLabel} instance.
+ *
+ * @param label The text for this label.
+ */
+ public CMLabel(String label) {
+ super(label);
+
+ setFont(LABEL_FONT);
+ }
+
+ /**
+ * Constructs a {@link CMLabel} instance, and sets its position and size.
+ *
+ * @param label The text for this label.
+ * @param x The x position on the ui.
+ * @param y The y position on the ui.
+ * @param width The width of the element.
+ * @param height The height of the element.
+ */
+ public CMLabel(String label, int x, int y, int width, int height) {
+ this(label);
+
+ setBounds(x, y, width, height);
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMMetricPanel.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMMetricPanel.html
new file mode 100644
index 00000000..700099c4
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMMetricPanel.html
@@ -0,0 +1 @@
+CMMetricPanel
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMMetricPanel.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMMetricPanel.java.html
new file mode 100644
index 00000000..cefce852
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMMetricPanel.java.html
@@ -0,0 +1,53 @@
+CMMetricPanel.java
package codemetropolis.toolchain.gui.components;
+
+import javax.swing.JPanel;
+
+import codemetropolis.toolchain.converter.control.ConverterType;
+import codemetropolis.toolchain.gui.beans.ExecutionOptions;
+
+/**
+ * Extension to JPanel, as we need to store to which metric generator (SourceMeter, SonarQube) this panel provides
+ * options for. Can also validate the fields and fill them into a gievn {@link ExecutionOptions} instance.
+ *
+ * @author Abel Szkalisity {@literal <SZAVAET.SZE>}
+ */
+public abstract class CMMetricPanel extends JPanel {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String tabTitle;
+ protected ConverterType converterType;
+
+ /**
+ * Fills the given {@link ExecutionOptions} instance with data from the panel.
+ *
+ * @param executionOptions The target {@link ExecutionOptions} instance.
+ */
+ public abstract void fillFields(ExecutionOptions executionOptions);
+
+ /**
+ * Validates the given {@link ExecutionOptions} instance.
+ *
+ * @param executionOptions The instance to validate.
+ * @return True, if the options related to this panel are existent and valid, false otherwise.
+ */
+ public abstract boolean validateFields(ExecutionOptions executionOptions);
+
+ public String getTabTitle() {
+ return tabTitle;
+ }
+
+ public ConverterType getConverterType() {
+ return converterType;
+ }
+
+ public void setTabTitle(String tabTitle) {
+ this.tabTitle = tabTitle;
+ }
+
+ public void setConverterType(ConverterType converterType) {
+ this.converterType = converterType;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMPasswordField.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMPasswordField.html
new file mode 100644
index 00000000..e1f8d800
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMPasswordField.html
@@ -0,0 +1 @@
+CMPasswordField
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMPasswordField.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMPasswordField.java.html
new file mode 100644
index 00000000..d3c3a0c1
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMPasswordField.java.html
@@ -0,0 +1,41 @@
+CMPasswordField.java
package codemetropolis.toolchain.gui.components;
+
+import java.awt.Font;
+
+import javax.swing.JPasswordField;
+
+/**
+ * Custom passwordField class for setting custom defaults for the JPasswordFields we use.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class CMPasswordField extends JPasswordField {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Font PASSWORD_FIELD_FONT = new Font("Source Sans Pro", Font.PLAIN, 14);
+
+ /**
+ * Constructs a {@link CMPasswordField} instance.
+ */
+ public CMPasswordField() {
+ setEchoChar('*');
+ setFont(PASSWORD_FIELD_FONT);
+ }
+
+ /**
+ * Constructs a {@link CMPasswordField} instance, and sets its position and size.
+ *
+ * @param x The x position on the ui.
+ * @param y The y position on the ui.
+ * @param width The width of the element.
+ * @param height The height of the element.
+ */
+ public CMPasswordField(int x, int y, int width, int height) {
+ this();
+
+ setBounds(x, y, width, height);
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMScrollPane.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMScrollPane.html
new file mode 100644
index 00000000..e83e4766
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMScrollPane.html
@@ -0,0 +1 @@
+CMScrollPane
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMScrollPane.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMScrollPane.java.html
new file mode 100644
index 00000000..b0da7460
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMScrollPane.java.html
@@ -0,0 +1,54 @@
+CMScrollPane.java
package codemetropolis.toolchain.gui.components;
+
+import java.awt.Font;
+
+import javax.swing.JList;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+
+/**
+ * Custom scroll pane class for setting custom defaults for the JComboBoxes we use.
+ * @author Viktor Meszaros {@literal <MEVXAAT.SZE}
+ */
+public class CMScrollPane extends JScrollPane {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Font SCROLL_PANE_FONT = new Font("Source Sans Pro", Font.PLAIN, 14);
+
+ /**
+ * Constructs a {@link CMScrollPane} instance.
+ */
+ public CMScrollPane() {
+ setFont(SCROLL_PANE_FONT);
+ }
+
+ /**
+ * Constructs a {@link CMScrollPane} instance and sets its dimensions and position.
+ * @param list {@link JList} which the scroll pane will contain.
+ * @param x The x position on the UI.
+ * @param y The y position on the UI.
+ * @param width The width of the element.
+ * @param height The height of the element.
+ */
+ public CMScrollPane(JList<String> list, int x, int y, int width, int height) {
+ super(list);
+ setFont(SCROLL_PANE_FONT);
+ setBounds(x, y, width, height);
+ }
+
+ /**
+ * Constructs a {@link CMScrollPane} instance and sets its dimensions and position.
+ * @param table {@link JTable} which the scroll pane will contain.
+ * @param x The x position on the UI.
+ * @param y The y position on the UI.
+ * @param width The width of the element.
+ * @param height The height of the element.
+ */
+ public CMScrollPane(JTable table, int x, int y, int width, int height) {
+ super(table);
+ setFont(SCROLL_PANE_FONT);
+ setBounds(x, y, width, height);
+ }
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMSpinner.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMSpinner.html
new file mode 100644
index 00000000..1440456b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMSpinner.html
@@ -0,0 +1 @@
+CMSpinner
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMSpinner.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMSpinner.java.html
new file mode 100644
index 00000000..ba9a2740
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMSpinner.java.html
@@ -0,0 +1,46 @@
+CMSpinner.java
package codemetropolis.toolchain.gui.components;
+
+import java.awt.Font;
+
+import javax.swing.JSpinner;
+import javax.swing.SpinnerNumberModel;
+
+import codemetropolis.toolchain.mapping.MappingExecutor;
+
+/**
+ * Custom numeric input class for setting custom defaults for the JSpinners we use.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class CMSpinner extends JSpinner {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Font SPINNER_FONT = new Font("Source Sans Pro", Font.PLAIN, 14);
+
+ /**
+ * Constructs a {@link CMSpinner} instance.
+ */
+ public CMSpinner() {
+ super();
+
+ setFont(SPINNER_FONT);
+ setModel(new SpinnerNumberModel(1.0, MappingExecutor.MIN_SCALE, MappingExecutor.MAX_SCALE, 0.01));
+ }
+
+ /**
+ * Constructs a {@link CMSpinner} instance, and sets its position and size.
+ *
+ * @param x The x position on the ui.
+ * @param y The y position on the ui.
+ * @param width The width of the element.
+ * @param height The height of the element.
+ */
+ public CMSpinner(int x, int y, int width, int height) {
+ this();
+
+ setBounds(x, y, width, height);
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMTextArea.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMTextArea.html
new file mode 100644
index 00000000..276026df
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMTextArea.html
@@ -0,0 +1 @@
+CMTextArea
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMTextArea.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMTextArea.java.html
new file mode 100644
index 00000000..1a028057
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMTextArea.java.html
@@ -0,0 +1,40 @@
+CMTextArea.java
package codemetropolis.toolchain.gui.components;
+
+import java.awt.Font;
+
+import javax.swing.JTextArea;
+
+/**
+ * Custom textArea class for setting custom defaults for the JTextAreas we use.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class CMTextArea extends JTextArea {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Font TEXT_AREA_FONT = new Font("Source Sans Pro", Font.PLAIN, 14);
+
+ /**
+ * Constructs a {@link CMTextArea} instance.
+ */
+ public CMTextArea() {
+ setFont(TEXT_AREA_FONT);
+ }
+
+ /**
+ * Constructs a {@link CMTextArea} instance.
+ *
+ * @param x The x position on the ui.
+ * @param y The y position on the ui.
+ * @param width The width of the element.
+ * @param height The height of the element.
+ */
+ public CMTextArea(int x, int y, int width, int height) {
+ this();
+
+ setBounds(x, y, width, height);
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMTextField.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMTextField.html
new file mode 100644
index 00000000..afb5b0c2
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMTextField.html
@@ -0,0 +1 @@
+CMTextField
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMTextField.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMTextField.java.html
new file mode 100644
index 00000000..d2e1ef49
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/CMTextField.java.html
@@ -0,0 +1,40 @@
+CMTextField.java
package codemetropolis.toolchain.gui.components;
+
+import java.awt.Font;
+
+import javax.swing.JTextField;
+
+/**
+ * Custom textField class for setting custom defaults for the JTextFields we use.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class CMTextField extends JTextField {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Font TEXT_FIELD_FONT = new Font("Source Sans Pro", Font.PLAIN, 14);
+
+ /**
+ * Constructs a {@link CMTextField} instance.
+ */
+ public CMTextField() {
+ setFont(TEXT_FIELD_FONT);
+ }
+
+ /**
+ * Constructs a {@link CMTextField} instance.
+ *
+ * @param x The x position on the ui.
+ * @param y The y position on the ui.
+ * @param width The width of the element.
+ * @param height The height of the element.
+ */
+ public CMTextField(int x, int y, int width, int height) {
+ this();
+
+ setBounds(x, y, width, height);
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/index.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/index.html
new file mode 100644
index 00000000..0295b330
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.gui.components
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/index.source.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/index.source.html
new file mode 100644
index 00000000..13bd6344
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.components/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.gui.components
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/Conversion.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/Conversion.html
new file mode 100644
index 00000000..584925e5
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/Conversion.html
@@ -0,0 +1 @@
+Conversion
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/Conversion.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/Conversion.java.html
new file mode 100644
index 00000000..613ccf99
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/Conversion.java.html
@@ -0,0 +1,11 @@
+Conversion.java
package codemetropolis.toolchain.gui.conversions;
+
+/**
+ * Abstract base class for representing the various types of conversions.
+ * @author Viktor Meszaros {@literal <MEVXAAT.SZE>}
+ *
+ */
+public abstract class Conversion {
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/EmptyConversion.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/EmptyConversion.html
new file mode 100644
index 00000000..6e88e5ae
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/EmptyConversion.html
@@ -0,0 +1 @@
+EmptyConversion
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/EmptyConversion.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/EmptyConversion.java.html
new file mode 100644
index 00000000..a76d81e2
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/EmptyConversion.java.html
@@ -0,0 +1,11 @@
+EmptyConversion.java
package codemetropolis.toolchain.gui.conversions;
+
+/**
+ * Class for representing an empty conversion (when there is no conversion needed).
+ * @author Viktor Meszaros {@literal <MEVXAAT.SZE>}
+ *
+ */
+public class EmptyConversion extends Conversion {
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/NormalizeConversion.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/NormalizeConversion.html
new file mode 100644
index 00000000..a7ef1e64
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/NormalizeConversion.html
@@ -0,0 +1 @@
+NormalizeConversion
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/NormalizeConversion.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/NormalizeConversion.java.html
new file mode 100644
index 00000000..af7d4f09
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/NormalizeConversion.java.html
@@ -0,0 +1,11 @@
+NormalizeConversion.java
package codemetropolis.toolchain.gui.conversions;
+
+/**
+ * Class for representing a normalize conversion.
+ * @author Viktor Meszaros {@literal <MEVXAAT.SZE>}
+ *
+ */
+public class NormalizeConversion extends Conversion {
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/QuantizationConversion.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/QuantizationConversion.html
new file mode 100644
index 00000000..761f82ba
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/QuantizationConversion.html
@@ -0,0 +1 @@
+QuantizationConversion
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/QuantizationConversion.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/QuantizationConversion.java.html
new file mode 100644
index 00000000..8e3aa284
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/QuantizationConversion.java.html
@@ -0,0 +1,21 @@
+QuantizationConversion.java
package codemetropolis.toolchain.gui.conversions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Class for representing a quantization conversion.
+ * @author Viktor Meszaros {@literal <MEVXAAT.SZE>}
+ */
+public class QuantizationConversion extends Conversion {
+ private List<String> levels;
+
+ public QuantizationConversion() {
+ levels = new ArrayList<String>();
+ }
+
+ public List<String> getLevels(){
+ return levels;
+ }
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/ToDoubleConversion.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/ToDoubleConversion.html
new file mode 100644
index 00000000..b221d869
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/ToDoubleConversion.html
@@ -0,0 +1 @@
+ToDoubleConversion
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/ToDoubleConversion.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/ToDoubleConversion.java.html
new file mode 100644
index 00000000..d4a362e8
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/ToDoubleConversion.java.html
@@ -0,0 +1,10 @@
+ToDoubleConversion.java
package codemetropolis.toolchain.gui.conversions;
+
+/**
+ * Class for representing a toDouble conversion.
+ * @author Viktor Meszaros {@literal <MEVXAAT.SZE>}
+ */
+public class ToDoubleConversion extends Conversion{
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/ToIntConversion.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/ToIntConversion.html
new file mode 100644
index 00000000..fe1fe203
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/ToIntConversion.html
@@ -0,0 +1 @@
+ToIntConversion
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/ToIntConversion.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/ToIntConversion.java.html
new file mode 100644
index 00000000..8a14ce61
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/ToIntConversion.java.html
@@ -0,0 +1,10 @@
+ToIntConversion.java
package codemetropolis.toolchain.gui.conversions;
+
+/**
+ * Class for representing a toInt conversion.
+ * @author Viktor Meszaros {@literal <MEVXAAT.SZE>}
+ */
+public class ToIntConversion extends Conversion {
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/index.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/index.html
new file mode 100644
index 00000000..835ebdcc
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.gui.conversions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/index.source.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/index.source.html
new file mode 100644
index 00000000..d3276bc0
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.conversions/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.gui.conversions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/ConverterToolExecutor.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/ConverterToolExecutor.html
new file mode 100644
index 00000000..1a5b9b6d
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/ConverterToolExecutor.html
@@ -0,0 +1 @@
+ConverterToolExecutor
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/ConverterToolExecutor.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/ConverterToolExecutor.java.html
new file mode 100644
index 00000000..aeec6c0e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/ConverterToolExecutor.java.html
@@ -0,0 +1,119 @@
+ConverterToolExecutor.java
package codemetropolis.toolchain.gui.executors;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import codemetropolis.toolchain.commons.util.FileLogger;
+import codemetropolis.toolchain.commons.util.Resources;
+import codemetropolis.toolchain.commons.util.Settings;
+import codemetropolis.toolchain.converter.ConverterExecutor;
+import codemetropolis.toolchain.converter.ConverterExecutorArgs;
+import codemetropolis.toolchain.gui.beans.ExecutionException;
+import codemetropolis.toolchain.gui.beans.ExecutionOptions;
+import codemetropolis.toolchain.gui.utils.Translations;
+
+/**
+ * {@link ToolchainExecutor} implementation for the converter tool.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class ConverterToolExecutor implements ToolchainExecutor {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void execute(File cmRoot, ExecutionOptions executionOptions, PrintStream out) throws ExecutionException {
+ FileLogger.load(Settings.get("converter_log_file"));
+
+ ConverterExecutorArgs args = assembleArguments(cmRoot, executionOptions);
+ ConverterExecutor executor = new ConverterExecutor();
+ executor.setPrintStream(out);
+ executor.setErrorStream(out);
+ executor.setPrefix(Resources.get("converter_prefix"));
+ executor.setErrorPrefix(Resources.get("error_prefix"));
+ if (!executor.execute(args)) {
+ throw new ExecutionException("Failed to complete convert step!");
+ }
+ }
+
+ /**
+ * Converts the parameters from UI to match the names and types used by the {@link ConverterExecutor}.
+ *
+ * @param executionOptions The {@link ExecutionOptions} instance.
+ * @return The converted parameter map.
+ */
+ private Map<String, String> convertParams(ExecutionOptions executionOptions) {
+ Map<String, String> params = new HashMap<String, String>();
+ Map<String, Object> executionParams = executionOptions.getMetricGenerationParams();
+
+ switch (executionOptions.getConverterType()) {
+ case SONARQUBE:
+ boolean splitDirs = (boolean) executionParams.get("splitDirs");
+ params.put("username", executionParams.get("username").toString());
+ params.put("password", executionParams.get("password").toString());
+ params.put("projects", executionParams.get("projects").toString());
+ params.put("splitDirs", splitDirs ? "true" : "false");
+ break;
+ default:
+ break;
+ }
+
+ return params;
+ }
+
+ /**
+ * Creates the {@link ConverterExecutorArgs} instance that will be used for the execution of the converter tool.
+ *
+ * @param cmRoot The path of the folder used to store the intermediate files in.
+ * @param executionOptions The {@link ExecutionOptions} instance.
+ * @return The assembled {@link ConverterExecutorArgs} object which will be used for execution.
+ * @throws ExecutionException if the {@link codemetropolis.toolchain.converter.control.ConverterType} in the
+ * {@code executionOptions} is unhandled.
+ */
+ private ConverterExecutorArgs assembleArguments(File cmRoot, ExecutionOptions executionOptions)
+ throws ExecutionException {
+
+ String source = "";
+ switch (executionOptions.getConverterType()) {
+ case SOURCEMETER:
+ source = findSourceMeterGraphPath(cmRoot);
+ break;
+ case SONARQUBE:
+ source = executionOptions.getMetricGenerationParams().get("url").toString();
+ break;
+ default:
+ throw new ExecutionException(Translations.t("gui_err_unhandled_metric_source"));
+ }
+
+ return new ConverterExecutorArgs(
+ executionOptions.getConverterType(),
+ source,
+ cmRoot.getAbsolutePath() + File.separator + "converter-results.xml",
+ convertParams(executionOptions));
+ }
+
+ /**
+ * Attempts to find the graph file in the source-meter folder. Traversed through
+ * source-meter/<project>/<language>/<timestamp>/ folders to find the actual contents.
+ *
+ * @param cmRoot The path of the folder used to store the intermediate files in.
+ * @return The path of the graph file, if found.
+ * @throws ExecutionException if the graph file was not found.
+ */
+ private String findSourceMeterGraphPath(File cmRoot) throws ExecutionException {
+ File project = new File(cmRoot.getAbsolutePath() + File.separator + "source-meter").listFiles()[0];
+ File contents = project.listFiles()[0].listFiles()[0];
+
+ File graph = new File(contents.getAbsolutePath() + File.separator + project.getName() + ".graph");
+ if (graph.exists() && graph.isFile() && graph.canRead()) {
+ return graph.getAbsolutePath();
+ } else {
+ throw new ExecutionException(Translations.t("gui_err_graph_not_found"));
+ }
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/MappingToolExecutor.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/MappingToolExecutor.html
new file mode 100644
index 00000000..3ee937b3
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/MappingToolExecutor.html
@@ -0,0 +1 @@
+MappingToolExecutor
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/MappingToolExecutor.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/MappingToolExecutor.java.html
new file mode 100644
index 00000000..1616818d
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/MappingToolExecutor.java.html
@@ -0,0 +1,56 @@
+MappingToolExecutor.java
package codemetropolis.toolchain.gui.executors;
+
+import java.io.File;
+import java.io.PrintStream;
+
+import codemetropolis.toolchain.commons.util.FileLogger;
+import codemetropolis.toolchain.commons.util.Resources;
+import codemetropolis.toolchain.commons.util.Settings;
+import codemetropolis.toolchain.gui.beans.ExecutionException;
+import codemetropolis.toolchain.gui.beans.ExecutionOptions;
+import codemetropolis.toolchain.mapping.MappingExecutor;
+import codemetropolis.toolchain.mapping.MappingExecutorArgs;
+
+/**
+ * {@link ToolchainExecutor} implementation for the mapping tool.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class MappingToolExecutor implements ToolchainExecutor {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void execute(File cmRoot, ExecutionOptions executionOptions, PrintStream out) throws ExecutionException {
+ FileLogger.load(Settings.get("mapping_log_file"));
+
+ MappingExecutorArgs args = assembleArguments(cmRoot, executionOptions);
+ MappingExecutor executor = new MappingExecutor();
+ executor.setPrintStream(out);
+ executor.setErrorStream(out);
+ executor.setPrefix(Resources.get("mapping_prefix"));
+ executor.setErrorPrefix(Resources.get("error_prefix"));
+ if (!executor.execute(args)) {
+ throw new ExecutionException("Failed to complete mapping step!");
+ }
+ }
+
+ /**
+ * Creates the {@link MappingExecutorArgs} instance that will be used for the execution of the mapping tool.
+ *
+ * @param cmRoot The path of the folder used to store the intermediate files in.
+ * @param executionOptions The {@link ExecutionOptions} instance.
+ * @return The assembled {@link MappingExecutorArgs} object which will be used for execution.
+ */
+ private MappingExecutorArgs assembleArguments(File cmRoot, ExecutionOptions executionOptions) {
+ return new MappingExecutorArgs(
+ cmRoot.getAbsolutePath() + File.separator + "converter-results.xml",
+ cmRoot.getAbsolutePath() + File.separator + "mapping-results.xml",
+ executionOptions.getMappingXml().getAbsolutePath(),
+ executionOptions.getScale(),
+ executionOptions.isValidate());
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/MetricGeneratorExecutor.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/MetricGeneratorExecutor.html
new file mode 100644
index 00000000..269c523d
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/MetricGeneratorExecutor.html
@@ -0,0 +1 @@
+MetricGeneratorExecutor
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/MetricGeneratorExecutor.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/MetricGeneratorExecutor.java.html
new file mode 100644
index 00000000..c6aab8e4
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/MetricGeneratorExecutor.java.html
@@ -0,0 +1,81 @@
+MetricGeneratorExecutor.java
package codemetropolis.toolchain.gui.executors;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.Map;
+
+import codemetropolis.toolchain.gui.beans.ExecutionException;
+import codemetropolis.toolchain.gui.beans.ExecutionOptions;
+import codemetropolis.toolchain.gui.utils.Translations;
+
+/**
+ * {@link ToolchainExecutor} implementation for the metric generation.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class MetricGeneratorExecutor implements ToolchainExecutor {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void execute(File cmRoot, ExecutionOptions executionOptions, PrintStream out) throws ExecutionException {
+ switch (executionOptions.getConverterType()) {
+ case SOURCEMETER:
+ out.println(Translations.t("gui_info_sm_exec_started"));
+ executeSourceMeter(cmRoot, executionOptions);
+ break;
+ case SONARQUBE:
+ // Will be executed by the converter tool
+ break;
+ default:
+ throw new ExecutionException(Translations.t("gui_err_invalid_converter"));
+ }
+ }
+
+ /**
+ * Executes the SourceMeter exe file with the proper parameters.
+ *
+ * @param cmRoot The path of the folder used to store the intermediate files in.
+ * @param executionOptions The {@link ExecutionOptions} instance.
+ * @throws ExecutionException if it fails to run SourceMeter, or if the process returns with an error code.
+ */
+ private void executeSourceMeter(File cmRoot, ExecutionOptions executionOptions) throws ExecutionException {
+ Map<String, Object> params = executionOptions.getMetricGenerationParams();
+ File sourceMeterExe = (File) params.get("sourceMeterExe");
+ File projectRoot = (File) params.get("projectRoot");
+
+ try {
+ File resultsDir = createResultsDir(cmRoot);
+ ProcessBuilder processBuilder = new ProcessBuilder(sourceMeterExe.getAbsolutePath(),
+ "-projectName=\"" + executionOptions.getProjectName() + "\"",
+ "-projectBaseDir=\"" + projectRoot.getAbsolutePath() + "\"",
+ "-resultsDir=\"" + resultsDir.getAbsolutePath() + "\"");
+
+ if (processBuilder.start().waitFor() != 0) {
+ throw new ExecutionException(Translations.t("gui_err_sm_exec_failed"));
+ }
+ } catch (IOException | InterruptedException e) {
+ throw new ExecutionException(Translations.t("gui_err_sm_run_failed"), e);
+ }
+ }
+
+ /**
+ * Creates a directory for the SourceMeter results in the {@code cmRoot} folder.
+ *
+ * @param cmRoot The path of the folder used to store the intermediate files in.
+ * @return The folder for the SourceMeter results.
+ * @throws ExecutionException if it fails to actually create the folder.
+ */
+ private File createResultsDir(File cmRoot) throws ExecutionException {
+ File resultsDir = new File(cmRoot.getAbsolutePath() + File.separator + "source-meter");
+ if (!resultsDir.mkdir()) {
+ throw new ExecutionException(Translations.t("gui_err_mkdir_failed"));
+ }
+
+ return resultsDir;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/PlacingToolExecutor.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/PlacingToolExecutor.html
new file mode 100644
index 00000000..a3c258ee
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/PlacingToolExecutor.html
@@ -0,0 +1 @@
+PlacingToolExecutor
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/PlacingToolExecutor.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/PlacingToolExecutor.java.html
new file mode 100644
index 00000000..15779bba
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/PlacingToolExecutor.java.html
@@ -0,0 +1,55 @@
+PlacingToolExecutor.java
package codemetropolis.toolchain.gui.executors;
+
+import java.io.File;
+import java.io.PrintStream;
+
+import codemetropolis.toolchain.commons.util.FileLogger;
+import codemetropolis.toolchain.commons.util.Resources;
+import codemetropolis.toolchain.commons.util.Settings;
+import codemetropolis.toolchain.gui.beans.ExecutionException;
+import codemetropolis.toolchain.gui.beans.ExecutionOptions;
+import codemetropolis.toolchain.placing.PlacingExecutor;
+import codemetropolis.toolchain.placing.PlacingExecutorArgs;
+
+/**
+ * {@link ToolchainExecutor} implementation for the placing tool.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class PlacingToolExecutor implements ToolchainExecutor {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void execute(File cmRoot, ExecutionOptions executionOptions, PrintStream out) throws ExecutionException {
+ FileLogger.load(Settings.get("placing_log_file"));
+
+ PlacingExecutorArgs args = assembleArguments(cmRoot, executionOptions);
+ PlacingExecutor executor = new PlacingExecutor();
+ executor.setPrintStream(out);
+ executor.setErrorStream(out);
+ executor.setPrefix(Resources.get("placing_prefix"));
+ executor.setErrorPrefix(Resources.get("error_prefix"));
+ if (!executor.execute(args)) {
+ throw new ExecutionException("Failed to complete placing step!");
+ }
+ }
+
+ /**
+ * Creates the {@link PlacingExecutorArgs} instance that will be used for the execution of the placing tool.
+ *
+ * @param cmRoot The path of the folder used to store the intermediate files in.
+ * @param executionOptions The {@link ExecutionOptions} instance.
+ * @return The assembled {@link PlacingExecutorArgs} object which will be used for execution.
+ */
+ private PlacingExecutorArgs assembleArguments(File cmRoot, ExecutionOptions executionOptions) {
+ return new PlacingExecutorArgs(
+ cmRoot.getAbsolutePath() + File.separator + "mapping-results.xml",
+ cmRoot.getAbsolutePath() + File.separator + "placing-results.xml",
+ executionOptions.getLayoutAlgorithm().toString(),
+ executionOptions.isShowMap());
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/RenderingToolExecutor.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/RenderingToolExecutor.html
new file mode 100644
index 00000000..7e6bc4ce
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/RenderingToolExecutor.html
@@ -0,0 +1 @@
+RenderingToolExecutor
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/RenderingToolExecutor.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/RenderingToolExecutor.java.html
new file mode 100644
index 00000000..bbb2268b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/RenderingToolExecutor.java.html
@@ -0,0 +1,55 @@
+RenderingToolExecutor.java
package codemetropolis.toolchain.gui.executors;
+
+import java.io.File;
+import java.io.PrintStream;
+
+import codemetropolis.toolchain.commons.util.FileLogger;
+import codemetropolis.toolchain.commons.util.Resources;
+import codemetropolis.toolchain.commons.util.Settings;
+import codemetropolis.toolchain.gui.beans.ExecutionException;
+import codemetropolis.toolchain.gui.beans.ExecutionOptions;
+import codemetropolis.toolchain.rendering.RenderingExecutor;
+import codemetropolis.toolchain.rendering.RenderingExecutorArgs;
+
+/**
+ * {@link ToolchainExecutor} implementation for the rendering tool.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class RenderingToolExecutor implements ToolchainExecutor {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void execute(File cmRoot, ExecutionOptions executionOptions, PrintStream out) throws ExecutionException {
+ FileLogger.load(Settings.get("rendering_log_file"));
+
+ RenderingExecutorArgs args = assembleArguments(cmRoot, executionOptions);
+ RenderingExecutor executor = new RenderingExecutor();
+ executor.setPrintStream(out);
+ executor.setErrorStream(out);
+ executor.setPrefix(Resources.get("rendering_prefix"));
+ executor.setErrorPrefix(Resources.get("error_prefix"));
+ if (!executor.execute(args)) {
+ throw new ExecutionException("Failed to complete rendering step!");
+ }
+ }
+
+ /**
+ * Creates the {@link RenderingExecutorArgs} instance that will be used for the execution of the rendering tool.
+ *
+ * @param cmRoot The path of the folder used to store the intermediate files in.
+ * @param executionOptions The {@link ExecutionOptions} instance.
+ * @return The assembled {@link RenderingExecutorArgs} object which will be used for execution.
+ */
+ private RenderingExecutorArgs assembleArguments(File cmRoot, ExecutionOptions executionOptions) {
+ return new RenderingExecutorArgs(
+ cmRoot.getAbsolutePath() + File.separator + "placing-results.xml",
+ executionOptions.getMinecraftRoot().getAbsolutePath() + File.separator + "saves" + File.separator
+ + executionOptions.getProjectName().replace(" +;\\/\"?", ""),
+ true);
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/index.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/index.html
new file mode 100644
index 00000000..621b26c7
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.gui.executors
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/index.source.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/index.source.html
new file mode 100644
index 00000000..c9086ef5
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.executors/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.gui.executors
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/SonarQubeGenerator.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/SonarQubeGenerator.html
new file mode 100644
index 00000000..75f6c13e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/SonarQubeGenerator.html
@@ -0,0 +1 @@
+SonarQubeGenerator
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/SonarQubeGenerator.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/SonarQubeGenerator.java.html
new file mode 100644
index 00000000..485839d8
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/SonarQubeGenerator.java.html
@@ -0,0 +1,128 @@
+SonarQubeGenerator.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/SourceMeterGenerator.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/SourceMeterGenerator.html
new file mode 100644
index 00000000..052d8d60
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/SourceMeterGenerator.html
@@ -0,0 +1 @@
+SourceMeterGenerator
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/SourceMeterGenerator.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/SourceMeterGenerator.java.html
new file mode 100644
index 00000000..08f62305
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/SourceMeterGenerator.java.html
@@ -0,0 +1,117 @@
+SourceMeterGenerator.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/index.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/index.html
new file mode 100644
index 00000000..e295fb77
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.gui.metricgenerators
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/index.source.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/index.source.html
new file mode 100644
index 00000000..7862325c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.metricgenerators/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.gui.metricgenerators
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/BuildableSettings.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/BuildableSettings.html
new file mode 100644
index 00000000..50720760
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/BuildableSettings.html
@@ -0,0 +1 @@
+BuildableSettings
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/BuildableSettings.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/BuildableSettings.java.html
new file mode 100644
index 00000000..d347c15b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/BuildableSettings.java.html
@@ -0,0 +1,170 @@
+BuildableSettings.java
package codemetropolis.toolchain.gui.utils;
+
+import java.util.List;
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+import java.net.URL;
+
+import codemetropolis.toolchain.gui.beans.BadConfigFileFomatException;
+
+/**
+ * This class is responsible for providing information which buildable attributes are desired by the user to display on the GUI.
+ * @author Viktor Meszaros {@literal <MEVXAAT.SZE>}
+ */
+public class BuildableSettings {
+ /**
+ * {@link Map}, which contains the default settings of what properties to display to the individual buildable types.
+ */
+ public static final Map<String, String[]> DEFAULT_SETTINGS = new HashMap<>();
+
+ /**
+ * {@Map}, which contains the types (int, float(0 to 1),...) of the possible buildable attributes.
+ */
+ public static final Map<String, String> BUILDABLE_ATTRIBUTE_TYPES = new HashMap<String, String>();
+
+ /**
+ * Stores the possible values, which can be applied to the buildable attributes "character" and "external_character".
+ */
+ public static final List<String> VALID_CHARACTER_TYPES = new ArrayList<String>(Arrays.asList(new String[] {
+ "stone", "cobblestone", "mossy_stone", "sandstone", "obsidian",
+ "wood", "dark_wood", "birch_wood", "planks", "dark_planks", "metal",
+ "dirt", "sand", "red_sand", "brick", "stone_brick", "dark_brick",
+ "glass", "gold", "diamond"
+ }));
+
+ private URL urlToDictionary;
+
+ public BuildableSettings() {
+ urlToDictionary = this.getClass().getResource("/" + "buildableProperties.cmcfg");
+ }
+
+ /**
+ * {@link Map}, serves containing the buildable types(floor, garden, ...) and its assigned properties(height, character, ...).
+ */
+ private static Map<String, String[]> DISPLAYED_PROPERTIES = new HashMap<String, String[]>();
+
+ static {
+ DEFAULT_SETTINGS.put("FLOOR", new String[]{"width", "height", "length", "character", "external_character", "torches"});
+ DEFAULT_SETTINGS.put("CELLAR", new String[]{"width", "height", "length", "character", "external_character", "torches"});
+ DEFAULT_SETTINGS.put("GARDEN", new String[]{"tree-ratio", "mushroom-ratio", "flower-ratio"});
+ DEFAULT_SETTINGS.put("GROUND", new String[]{});
+
+ DISPLAYED_PROPERTIES.put("FLOOR", new String[] {});
+ DISPLAYED_PROPERTIES.put("CELLAR", new String[] {});
+ DISPLAYED_PROPERTIES.put("GARDEN", new String[] {});
+ DISPLAYED_PROPERTIES.put("GROUND", new String[] {});
+
+ BUILDABLE_ATTRIBUTE_TYPES.put("width", "int");
+ BUILDABLE_ATTRIBUTE_TYPES.put("height", "int");
+ BUILDABLE_ATTRIBUTE_TYPES.put("length", "int");
+ BUILDABLE_ATTRIBUTE_TYPES.put("character", "string");
+ BUILDABLE_ATTRIBUTE_TYPES.put("external_character", "string");
+ BUILDABLE_ATTRIBUTE_TYPES.put("torches", "int(0 to 5)");
+ BUILDABLE_ATTRIBUTE_TYPES.put("tree-ratio", "float(0 to 1)");
+ BUILDABLE_ATTRIBUTE_TYPES.put("mushroom-ratio", "float(0 to 1)");
+ BUILDABLE_ATTRIBUTE_TYPES.put("flower-ratio", "float(0 to 1)");
+ }
+
+ /**
+ * Reads the user's display settings from the configuration file.
+ * @return A {@link Map} which contains the possible buildable types as keys and its attributes, which are desired to be displayed.
+ * @throws BadConfigFileFomatException If the format of the configuration file is not appropriate.
+ * @throws FileNotFoundException If the configuration file cannot be found.
+ */
+ public Map<String, String[]> readSettings() throws BadConfigFileFomatException, FileNotFoundException{
+
+ BufferedReader cfgFileReader = null;
+
+ try {
+ if (urlToDictionary != null) {
+ InputStream stream = urlToDictionary.openStream();
+ cfgFileReader = new BufferedReader(new InputStreamReader(stream, "UTF-8"));
+ String actLine;
+ //A regular line: buildable name is followed by an '=' sign, that follows the list of attributes separated by commas.
+ while ((actLine = cfgFileReader.readLine()).split("=").length == 2) {
+ String buildableName = actLine.split("=")[0];
+ String[] buildableProperties = actLine.split("=")[1].split(",");
+ if (DISPLAYED_PROPERTIES.containsKey(buildableName)) {
+ //If there is no assigned attribute given to the actual buildable type...
+ if (buildableProperties.length == 1 && buildableProperties[0].isEmpty()) {
+ DISPLAYED_PROPERTIES.put(buildableName, new String[] {});
+ } else {
+ if (validateProperties(buildableName, buildableProperties)) {
+ DISPLAYED_PROPERTIES.put(buildableName, buildableProperties);
+ } else {
+ throw new BadConfigFileFomatException();
+ }
+ }
+ } else {
+ throw new BadConfigFileFomatException();
+ }
+ }
+ }
+ else {
+ return DEFAULT_SETTINGS;
+ }
+ }
+ catch(IOException e) {
+ e.printStackTrace();
+ }
+ finally {
+ try {
+ if(cfgFileReader != null) {
+ cfgFileReader.close();
+ }
+ }
+ catch(IOException ioe) {
+ ioe.printStackTrace();
+ }
+ }
+ return DISPLAYED_PROPERTIES;
+ }
+
+ /**
+ * Validates, if all assigned attributes of the specified buildable type are valid or not.
+ * @param buildableType The type of the buildable (floor, garden, ...)
+ * @param buildabeAttributes The array of the attributes which are examined if they are valid or not.
+ * @return All of the specified buildable attributes are valid or not.
+ */
+ static boolean validateProperties(String buildableType, String[] buildabeAttributes) {
+ List<String> validProperties = new ArrayList<String>(Arrays.asList(DEFAULT_SETTINGS.get(buildableType)));
+ for(String property : buildabeAttributes) {
+ if(!validProperties.contains(property)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Writes to the console, what display settings will be provided to the Mapping file editor GUI.
+ */
+ public void displaySettings() throws BadConfigFileFomatException, FileNotFoundException {
+
+ Map<String, String[]> returnedSettings = readSettings();
+
+ for(String buildableType : returnedSettings.keySet()) {
+
+ String[] buildableProperties = returnedSettings.get(buildableType);
+
+ System.out.print(buildableType + "=");
+
+ for(int i = 0; i < buildableProperties.length; i++) {
+
+ System.out.print(buildableProperties[i] + ";");
+
+ }
+ System.out.println();
+ }
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/ExeFileFilter.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/ExeFileFilter.html
new file mode 100644
index 00000000..d628779b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/ExeFileFilter.html
@@ -0,0 +1 @@
+ExeFileFilter
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/ExeFileFilter.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/ExeFileFilter.java.html
new file mode 100644
index 00000000..dc950766
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/ExeFileFilter.java.html
@@ -0,0 +1,31 @@
+ExeFileFilter.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/ExecutionWorker.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/ExecutionWorker.html
new file mode 100644
index 00000000..111cb5ee
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/ExecutionWorker.html
@@ -0,0 +1 @@
+ExecutionWorker
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/ExecutionWorker.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/ExecutionWorker.java.html
new file mode 100644
index 00000000..d3e09827
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/ExecutionWorker.java.html
@@ -0,0 +1,68 @@
+ExecutionWorker.java
package codemetropolis.toolchain.gui.utils;
+
+import java.io.IOException;
+import java.io.PipedOutputStream;
+import java.io.PrintStream;
+
+import javax.swing.JButton;
+import javax.swing.JOptionPane;
+import javax.swing.SwingWorker;
+
+import codemetropolis.toolchain.gui.GUIController;
+
+/**
+ * {@link SwingWorker} sublclass for executing the CodeMetropolis toolchain.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class ExecutionWorker extends SwingWorker<Void, Integer> {
+
+ private boolean successful = false;
+
+ private JButton start;
+ private GUIController controller;
+ private PipedOutputStream out;
+
+ /**
+ * Instantiates the {@link ExecutionWorker}.
+ *
+ * @param start The button used to start the execution. This reference is required because at the start and at the end
+ * of the execution it will be disabled and re-enabled, respectively.
+ * @param controller The controller instance that will do the actual execution.
+ * @param out The {@link PipedOutputStream} that will be used by the executors.
+ */
+ public ExecutionWorker(JButton start, GUIController controller, PipedOutputStream out) {
+ this.start = start;
+ this.controller = controller;
+ this.out = out;
+ }
+
+ @Override
+ protected Void doInBackground() throws Exception {
+ start.setEnabled(false);
+ controller.execute(new PrintStream(out));
+ successful = true;
+ return null;
+ }
+
+ @Override
+ protected void done() {
+ try {
+ out.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ start.setEnabled(true);
+ if (successful) {
+ JOptionPane.showMessageDialog(null, Translations.t("gui_info_world_gen_successful"),
+ Translations.t("gui_info_finished"), JOptionPane.INFORMATION_MESSAGE);
+ } else {
+ JOptionPane.showMessageDialog(null, Translations.t("gui_err_world_gen_failed"),
+ Translations.t("gui_err_title"), JOptionPane.ERROR_MESSAGE);
+ }
+ super.done();
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/GuiUtils.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/GuiUtils.html
new file mode 100644
index 00000000..5ce61799
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/GuiUtils.html
@@ -0,0 +1 @@
+GuiUtils
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/GuiUtils.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/GuiUtils.java.html
new file mode 100644
index 00000000..4bef6e85
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/GuiUtils.java.html
@@ -0,0 +1,89 @@
+GuiUtils.java
package codemetropolis.toolchain.gui.utils;
+
+import java.io.File;
+
+import javax.swing.JOptionPane;
+
+import codemetropolis.toolchain.gui.beans.ExecutionOptions;
+
+/**
+ * Utility class for globally used functions.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class GuiUtils {
+
+ /**
+ * Attempts to find the location for the root folder of Minecraft, if it is installed.
+ *
+ * @return The path for the root folder, if found.
+ */
+ public static String findMinecraftRoot() {
+ String expectedLocation = getMinecraftExpectedLocation();
+
+ File minecraftRoot = new File(expectedLocation);
+ if (minecraftRoot.exists() && minecraftRoot.isDirectory()) {
+ return minecraftRoot.getAbsolutePath();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Assembles a path based on the host operating system, which is expected to be the root folder for Minecraft if it is
+ * installed.
+ *
+ * @return The path to the expected location.
+ */
+ private static String getMinecraftExpectedLocation() {
+ String os = System.getProperty("os.name").toLowerCase();
+
+ String location = "";
+ if (os.indexOf("win") > -1) {
+ location = System.getenv("appdata") + File.separator + ".minecraft";
+ } else if (os.indexOf("nix") > -1 || os.indexOf("nux") > -1 || os.indexOf("aix") > -1) {
+ location = '~' + File.separator + ".minecraft";
+ } else if (os.indexOf("mac") > -1) {
+ location = '~' + File.separator + "Library" + File.separator + "Application Support" + File.separator
+ + "minecraft";
+ }
+
+ return location;
+ }
+
+ /**
+ * Validates the options set in the {@code executionOptions}. Most importantly checks if the files and directories
+ * selected are readable/writable.
+ *
+ * @param executionOptions The {@link ExecutionOptions} instance to validate.
+ * @return True, if the options are valid, false otherwise.
+ */
+ public static boolean validateOptions(ExecutionOptions executionOptions) {
+ File mappingXml = executionOptions.getMappingXml();
+ File minecraftRoot = executionOptions.getMinecraftRoot();
+
+ if (executionOptions.getProjectName() == null || executionOptions.getProjectName().isEmpty()) {
+ showError(Translations.t("gui_err_invalid_project_name"));
+ } else if (mappingXml == null || !mappingXml.exists() || !mappingXml.isFile() || !mappingXml.canRead()) {
+ showError(Translations.t("gui_err_invalid_mapping_xml"));
+ } else if (minecraftRoot == null || !minecraftRoot.exists() || !minecraftRoot.isDirectory()
+ || !minecraftRoot.canRead() || !minecraftRoot.canWrite()) {
+ showError(Translations.t("gui_err_invalid_mc_root"));
+ } else {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Shows an error dialog with the specified {@code message}.
+ *
+ * @param message The error message to show.
+ */
+ public static void showError(String message) {
+ JOptionPane.showMessageDialog(null, message, Translations.t("gui_err_title"), JOptionPane.ERROR_MESSAGE);
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/Property.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/Property.html
new file mode 100644
index 00000000..a52f2f0a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/Property.html
@@ -0,0 +1 @@
+Property
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/Property.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/Property.java.html
new file mode 100644
index 00000000..65ceb20e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/Property.java.html
@@ -0,0 +1,17 @@
+Property.java
package codemetropolis.toolchain.gui.utils;
+
+/**
+ * This class serves for storing the information of a property belongs to a source code element type.
+ * @author Viktor Meszaros {@literal <MEVXAAT.SZE>}
+ */
+public class Property{
+ /**
+ * Name of the property.
+ */
+ public String name;
+ /**
+ * Type of the property.
+ */
+ public String type;
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/PropertyCollector.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/PropertyCollector.html
new file mode 100644
index 00000000..8ab5428b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/PropertyCollector.html
@@ -0,0 +1 @@
+PropertyCollector
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/PropertyCollector.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/PropertyCollector.java.html
new file mode 100644
index 00000000..4863353c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/PropertyCollector.java.html
@@ -0,0 +1,165 @@
+PropertyCollector.java
package codemetropolis.toolchain.gui.utils;
+
+import java.io.*;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * This class is responsible for providing information what properties/metrics belong to the individual source code element types.
+ * @author Viktor Meszaros {@literal <MEVXAAT.SZE>}
+ */
+public class PropertyCollector {
+ /**
+ * Those source code element types, whose properties wanted to be collected.
+ */
+ public static final Set<String> acceptedTypes = new HashSet<String>(Arrays.asList(
+ new String[] {"package","class","attribute","method"}
+ ));
+
+ /**
+ * The String key contains the name of the source code element type. The value assigned to the key is a list with the properties (<name, type> pairs).
+ */
+ private Map<String, List<Property>> propertyMap;
+
+ /**
+ * Class initialization.
+ */
+ public PropertyCollector() {
+ initializePropertyMap();
+ }
+
+ /**
+ * Initialize the property map.
+ */
+ private void initializePropertyMap() {
+ Map<String, List<Property>> tmpPropertyMap = new HashMap<String, List<Property>>();
+ for(String type : acceptedTypes) {
+ tmpPropertyMap.put(type, null);
+ }
+ propertyMap = tmpPropertyMap;
+ }
+
+ /**
+ * Gets the {@link Map} which contains the individual source code element types as keys and their metrics/properties as values.
+ * @param cdfFilePath The path from the cdf file from which the information will be read.
+ * @return The {@link Map} which contains the individual source code element types as keys and their metrics/properties as values.
+ */
+ public Map<String, List<Property>> getFromCdf(String cdfFilePath) throws FileNotFoundException {
+ try {
+
+ initializePropertyMap();
+
+ File file = new File(cdfFilePath);
+
+ DocumentBuilder dBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ Document doc = dBuilder.parse(file);
+
+ Element rootElement = doc.getDocumentElement();
+ rootElement.normalize();
+
+ //This NodeList 'elementTags' below doesn't contains the root element.
+ //The root element is also an 'element' tag (a package), that's why we need to try collecting its properties as well.
+ if(isValidElement(rootElement)) {
+ tryCollectProperties(rootElement);
+ }
+
+ NodeList elementTags = rootElement.getElementsByTagName("element");
+
+ //Iteration through all of the rest 'element' tags (they represent source code element types). Trying to collect their properties.
+ for(int i = 0; i < elementTags.getLength(); i++) {
+ Element currentTag = (Element) elementTags.item(i);
+ if(isValidElement(currentTag)) {
+ tryCollectProperties(currentTag);
+ }
+ };
+
+ } catch (ParserConfigurationException | SAXException | IOException e) {
+ e.printStackTrace();
+ }
+
+ return propertyMap;
+ }
+
+ /**
+ * Checks if the tag is a valid 'element' tag or not.
+ * @param element The {@link Element} which will be examined.
+ * @return The examined element is a valid 'element' tag or not.
+ */
+ public boolean isValidElement(Element element) {
+ return element.getTagName().equals("element") &&
+ element.hasAttribute("type") &&
+ acceptedTypes.contains(element.getAttribute("type"));
+ }
+
+ /**
+ * Checks if the properties/metrics of the element have been ever gathered or not. If not, calls the {@code getPropertyList} method to collect them.
+ * @param element The 'element' tag which will be examined.
+ */
+ private void tryCollectProperties(Element element) {
+ List<Property> propertyList = null;
+ //We will collect the properties of the source code element types only in that way, when we have never collected them before.
+ //The element tag must have child nodes. (E.g. the 'properties' tag also a child element.)
+ if(propertyList == null && element.hasChildNodes()) {
+ NodeList children = element.getChildNodes();
+ for(int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ //When we found the 'properties' tag, we collect the list of properties contained by it.
+ if(child.getNodeType() == Node.ELEMENT_NODE && child.getNodeName().equals("properties")) {
+ propertyList = getPropertyList((Element)child);
+ propertyMap.put(element.getAttribute("type"), propertyList);
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Collects the properties contained by the 'properties' tag.
+ * @param element The 'properties' tag of the 'element' tag.
+ * @return The list of the gathered properties/metrics.
+ */
+ public List<Property> getPropertyList(Element element) {
+ List<Property> result = new ArrayList<Property>();
+
+ NodeList properties = element.getElementsByTagName("property");
+
+ for(int i = 0; i < properties.getLength(); i++) {
+ Element property = (Element) properties.item(i);
+ if(property.hasAttribute("name") && property.hasAttribute("type")) {
+ Property p = new Property();
+ p.name = property.getAttribute("name");
+ p.type = property.getAttribute("type");
+ result.add(p);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Displays the various properties (<name, type> pairs) of the source code elements.
+ */
+ public void displayProperties() {
+ for(String srcCodeElement : acceptedTypes) {
+ System.out.println("Properties of source code element '" + srcCodeElement + "':");
+ for(Property p : propertyMap.get(srcCodeElement)) {
+ System.out.println(p.name + ": " + p.type);
+ }
+ }
+ }
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/StreamReaderWorker.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/StreamReaderWorker.html
new file mode 100644
index 00000000..58467451
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/StreamReaderWorker.html
@@ -0,0 +1 @@
+StreamReaderWorker
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/StreamReaderWorker.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/StreamReaderWorker.java.html
new file mode 100644
index 00000000..76e76eca
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/StreamReaderWorker.java.html
@@ -0,0 +1,59 @@
+StreamReaderWorker.java
package codemetropolis.toolchain.gui.utils;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PipedInputStream;
+import java.io.PipedOutputStream;
+
+import javax.swing.JButton;
+import javax.swing.JTextArea;
+import javax.swing.SwingWorker;
+
+/**
+ * {@link SwingWorker} subclass that reads from a specified {@link PipedOutputStream} and feeds it into a
+ * {@link JTextArea}.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class StreamReaderWorker extends SwingWorker<Void, Integer> {
+
+ private JButton close;
+ private JTextArea textArea;
+ private PipedInputStream in;
+
+ /**
+ * Instantiates the worker.
+ *
+ * @param close A {@link JButton} that will be enabled when the stream closes.
+ * @param textArea The {@link JTextArea} the stream will be fed into.
+ * @param out The {@link PipedOutputStream} the data will be read from by piping it into a {@link PipedInputStream}.
+ * @throws IOException if any I/O error occurs.
+ */
+ public StreamReaderWorker(JButton close, JTextArea textArea, PipedOutputStream out) throws IOException {
+ this.close = close;
+ this.textArea = textArea;
+ this.in = new PipedInputStream(out);
+ }
+
+ @Override
+ protected Void doInBackground() throws Exception {
+ String line;
+ BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+ while ((line = reader.readLine()) != null) {
+ textArea.append(line);
+ textArea.append("\n");
+ }
+
+ reader.close();
+ in.close();
+ return null;
+ }
+
+ @Override
+ protected void done() {
+ close.setEnabled(true);
+ };
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/TransferHelper.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/TransferHelper.html
new file mode 100644
index 00000000..c399068d
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/TransferHelper.html
@@ -0,0 +1 @@
+TransferHelper
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/TransferHelper.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/TransferHelper.java.html
new file mode 100644
index 00000000..3175b30a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/TransferHelper.java.html
@@ -0,0 +1,177 @@
+TransferHelper.java
package codemetropolis.toolchain.gui.utils;
+
+import java.awt.Component;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.Point;
+import java.io.IOException;
+import java.util.List;
+
+import javax.swing.JComponent;
+import javax.swing.JTable;
+import javax.swing.TransferHandler;
+
+import codemetropolis.toolchain.gui.MappingFileEditorDialog;
+import codemetropolis.toolchain.gui.MappingFileEditorDialog.AssignResult;
+import codemetropolis.toolchain.gui.conversions.*;
+
+/**
+ * This class is used to handle the transfer of
+ * a Transferable to and from Swing components.
+ *
+ * @author Tamas Keri {@literal <KETWAAT.SZE>}
+ * @author Viktor Meszaros {@literal <MEVXAAT.SZE>}
+ */
+public class TransferHelper extends TransferHandler {
+
+ private static final long serialVersionUID = 1L;
+
+ public TransferHelper() {
+ }
+
+ /**
+ * Checking dropping available
+ *
+ * @param obj dragged object
+ * @param target the target table
+ * @param row row of target table
+ * @param col column of target table
+ * @return boolean available dropping
+ */
+ public boolean typeChecker (Object obj, JTable target, int row, int col) {
+ int currCol = col -1;
+
+ if (col == 0) { return false; }
+
+ Object value = target.getModel().getValueAt(row, currCol);
+ String dragValue = obj.toString();
+ String dropValue = value.toString();
+
+ JTable currGardenTable = MappingFileEditorDialog.getGardenTable();
+ JTable currFloorTable = MappingFileEditorDialog.getFloorTable();
+ JTable currCellarTable = MappingFileEditorDialog.getCellarTable();
+
+ List<Conversion> conversionList = MappingFileEditorDialog.gardenConversion;
+
+ if (target == currGardenTable) {
+ conversionList = MappingFileEditorDialog.gardenConversion;
+ }
+
+ if (target == currFloorTable) {
+ conversionList = MappingFileEditorDialog.floorConversion;
+ }
+
+ if (target == currCellarTable) {
+ conversionList = MappingFileEditorDialog.cellarConversion;
+ }
+
+ dragValue = dragValue.split(": ")[1];
+ dropValue = dropValue.split(": ")[1];
+
+ AssignResult cell = MappingFileEditorDialog.ASSIGN_RESULT_MATRIX.get(dropValue).get(dragValue);
+ if(cell == null) {
+ //We are trying to drag a resource... specify its type.
+ if(dragValue.matches("[0-9]+")) dragValue = "int";
+ else if(dragValue.matches("[0-9]+.[0-9]+")) dragValue = "float";
+ else{
+ dragValue = "string";
+ }
+ cell = MappingFileEditorDialog.ASSIGN_RESULT_MATRIX.get(dropValue).get(dragValue);
+ }
+
+ switch (cell) {
+ case CANNOT_ASSIGN:
+ return false;
+
+ case NO_CONVERSION:
+ conversionList.add(row, new EmptyConversion());
+ return true;
+
+ case TO_INT:
+ conversionList.add(row, new ToIntConversion());
+ return true;
+
+ case TO_DOUBLE:
+ conversionList.add(row, new ToDoubleConversion());
+ return true;
+
+ case NORMALIZE:
+ conversionList.add(row, new NormalizeConversion());
+ return true;
+
+ case QUANTIZATON:
+ conversionList.add(row, new QuantizationConversion());
+ return true;
+
+ default:
+ return true;
+ }
+ }
+
+ @Override
+ public int getSourceActions(JComponent c) {
+ return MOVE;
+ }
+
+ @Override
+ protected void exportDone(JComponent source, Transferable data, int action) {
+ }
+
+ @Override
+ public boolean canImport(TransferSupport support) {
+ // Reject the import by default...
+ boolean canImport = false;
+ // Can only import into another JTable
+ Component comp = support.getComponent();
+ if (comp instanceof JTable) {
+ JTable target = (JTable) comp;
+ DropLocation dl = support.getDropLocation();
+ Point dp = dl.getDropPoint();
+ int dropCol = target.columnAtPoint(dp);
+ int dropRow = target.rowAtPoint(dp);
+
+ try {
+ // Get the Transferable, we need to check
+ // the constraints
+ Transferable t = support.getTransferable();
+ Object obj = t.getTransferData(DataFlavor.stringFlavor);
+ if (obj != null) {
+ canImport = typeChecker(obj, target, dropRow, dropCol);
+ }
+ } catch (UnsupportedFlavorException | IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+ return canImport;
+ }
+
+ @Override
+ public boolean importData(TransferSupport support) {
+ // Import failed for some reason...
+ boolean imported = false;
+ // Only import into JTables...
+ Component comp = support.getComponent();
+ if (comp instanceof JTable) {
+ JTable target = (JTable) comp;
+ // Need to know where we are importing to...
+ DropLocation dl = support.getDropLocation();
+ Point dp = dl.getDropPoint();
+ int dropCol = target.columnAtPoint(dp);
+ int dropRow = target.rowAtPoint(dp);
+ try {
+ // Get the Transferable at the heart of it all
+ Transferable t = support.getTransferable();
+ Object obj = t.getTransferData(DataFlavor.stringFlavor);
+
+ target.setValueAt(obj, dropRow, dropCol);
+
+ imported = true;
+ } catch (UnsupportedFlavorException | IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+ return imported;
+ }
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/Translations.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/Translations.html
new file mode 100644
index 00000000..fb0f495a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/Translations.html
@@ -0,0 +1 @@
+Translations
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/Translations.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/Translations.java.html
new file mode 100644
index 00000000..e815f86b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/Translations.java.html
@@ -0,0 +1,34 @@
+Translations.java
package codemetropolis.toolchain.gui.utils;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * Translation service utility for the GUI translations. We use this instead of the
+ * {@link codemetropolis.toolchain.commons.util.Resources} class so we didn't need to modify the
+ * {@code resources.properties}, and could use a separate file for the GUI related labels.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class Translations {
+
+ private static ResourceBundle translations = ResourceBundle.getBundle("translations");
+
+ private Translations() { }
+
+ /**
+ * Attempts to find the translation for the given {@code key}.
+ *
+ * @param key The translation key.
+ * @return The translation, if found, otherwise the {@code key} itself.
+ */
+ public static String t(String key) {
+ try {
+ return translations.getString(key);
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/XmlFileFilter.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/XmlFileFilter.html
new file mode 100644
index 00000000..ed45c391
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/XmlFileFilter.html
@@ -0,0 +1 @@
+XmlFileFilter
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/XmlFileFilter.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/XmlFileFilter.java.html
new file mode 100644
index 00000000..0347b61f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/XmlFileFilter.java.html
@@ -0,0 +1,31 @@
+XmlFileFilter.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/index.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/index.html
new file mode 100644
index 00000000..cd87ae4d
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.gui.utils
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/index.source.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/index.source.html
new file mode 100644
index 00000000..26ef0c3a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui.utils/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.gui.utils
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/CodeMetropolisGUI$1.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/CodeMetropolisGUI$1.html
new file mode 100644
index 00000000..45f94154
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/CodeMetropolisGUI$1.html
@@ -0,0 +1 @@
+CodeMetropolisGUI.new ActionListener() {...}
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/CodeMetropolisGUI$2.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/CodeMetropolisGUI$2.html
new file mode 100644
index 00000000..8a19738a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/CodeMetropolisGUI$2.html
@@ -0,0 +1 @@
+CodeMetropolisGUI.new ActionListener() {...}
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/CodeMetropolisGUI.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/CodeMetropolisGUI.html
new file mode 100644
index 00000000..74eaab6f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/CodeMetropolisGUI.html
@@ -0,0 +1 @@
+CodeMetropolisGUI
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/CodeMetropolisGUI.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/CodeMetropolisGUI.java.html
new file mode 100644
index 00000000..f7b4dfb6
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/CodeMetropolisGUI.java.html
@@ -0,0 +1,366 @@
+CodeMetropolisGUI.java
package codemetropolis.toolchain.gui;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Image;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.io.PipedOutputStream;
+import java.util.Random;
+
+import javax.swing.ImageIcon;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
+import javax.swing.SwingConstants;
+import javax.swing.filechooser.FileFilter;
+
+import codemetropolis.toolchain.gui.beans.ExecutionOptions;
+import codemetropolis.toolchain.gui.components.CMButton;
+import codemetropolis.toolchain.gui.components.CMCheckBox;
+import codemetropolis.toolchain.gui.components.CMComboBox;
+import codemetropolis.toolchain.gui.components.CMLabel;
+import codemetropolis.toolchain.gui.components.CMMetricPanel;
+import codemetropolis.toolchain.gui.components.CMSpinner;
+import codemetropolis.toolchain.gui.components.CMTextField;
+import codemetropolis.toolchain.gui.components.listeners.BrowseListener;
+import codemetropolis.toolchain.gui.utils.ExecutionWorker;
+import codemetropolis.toolchain.gui.utils.GuiUtils;
+import codemetropolis.toolchain.gui.utils.Translations;
+import codemetropolis.toolchain.gui.utils.XmlFileFilter;
+import codemetropolis.toolchain.placing.layout.LayoutAlgorithm;
+
+/**
+ * GUI window for the CodeMetropolis toolchain.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class CodeMetropolisGUI extends JFrame {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final FileFilter XML_FILTER = new XmlFileFilter();
+ private static final int COVER_IMAGE_COUNT = 4;
+ private static final Random rng = new Random();
+
+ private GUIController controller;
+
+ private CMTextField projectName;
+ private JTabbedPane metricTabbedPane;
+ private CMTextField mappingPath;
+ private CMTextField mappingEditorCdfPath;
+ private CMTextField mcRootPath;
+ private CMCheckBox showMap;
+ private CMCheckBox validateStructure;
+ private CMSpinner scaleSpinner;
+ private CMComboBox<LayoutAlgorithm> layoutSelector;
+
+ /**
+ * Instantiates the CodeMetropolis GUI.
+ *
+ * @param controller The {@link GUIController} instance.
+ */
+ public CodeMetropolisGUI(GUIController controller) {
+ super(Translations.t("gui_title"));
+ this.controller = controller;
+
+ JPanel panel = createBasePanel();
+ addHeaderImages(panel);
+ addTitle(panel);
+ addProjectNameField(panel);
+ addMetricTabs(panel);
+ addMappingOptions(panel);
+ addPlacingOptions(panel);
+ addMinecraftRootBrowser(panel);
+ addStartButton(panel);
+
+ initFields();
+
+ this.setResizable(false);
+ this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ this.setContentPane(panel);
+ this.pack();
+ this.setLocationRelativeTo(null);
+ }
+
+ /**
+ * Does automatic initialization for some of the fields. Search for Minecraft folder if exists.
+ */
+ public void initFields() {
+ String minecraftRoot = GuiUtils.findMinecraftRoot();
+ if (minecraftRoot != null) {
+ mcRootPath.setText(minecraftRoot);
+ }
+ }
+
+ /**
+ * Creates the base panel for the CodeMetropolis GUI.
+ *
+ * @return The generated {@link JPanel}.
+ */
+ private static final JPanel createBasePanel() {
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBackground(Color.WHITE);
+ panel.setBounds(0, 0, 500, 700);
+
+ Dimension size = new Dimension(500, 800);
+ panel.setMinimumSize(size);
+ panel.setPreferredSize(size);
+ panel.setMaximumSize(size);
+
+ return panel;
+ }
+
+ /**
+ * Adds the cover image and the logo to the top of the {@code panel}.
+ *
+ * @param panel The {@link JPanel} to add the components to.
+ */
+ private final void addHeaderImages(JPanel panel) {
+ JPanel headerPanel = new JPanel();
+ headerPanel.setLayout(null);
+
+ // Load the cover and logo images
+ Image coverImage = new ImageIcon(ClassLoader.getSystemResource("images/cm-background-"
+ + (rng.nextInt(COVER_IMAGE_COUNT) + 1) + ".png")).getImage().getScaledInstance(500, 200, Image.SCALE_SMOOTH);
+ ImageIcon logoIcon = new ImageIcon(ClassLoader.getSystemResource("images/cm-logo-border.png"));
+ Image logoImage = logoIcon.getImage().getScaledInstance(150, 150, Image.SCALE_SMOOTH);
+
+ JLabel coverImageContainer = new JLabel(new ImageIcon(coverImage));
+ coverImageContainer.setBounds(0, 0, 500, 200);
+ JLabel logoImageContainer = new JLabel(new ImageIcon(logoImage));
+ logoImageContainer.setBounds(175, 125, 150, 150);
+
+ // Add the icon to the window title bar as well
+ setIconImage(logoIcon.getImage().getScaledInstance(32, 32, Image.SCALE_SMOOTH));
+
+ headerPanel.setBackground(Color.WHITE);
+ headerPanel.setBounds(0, 0, 500, 275);
+
+ headerPanel.add(coverImageContainer);
+ headerPanel.add(logoImageContainer);
+ headerPanel.setComponentZOrder(coverImageContainer, 1);
+ headerPanel.setComponentZOrder(logoImageContainer, 0);
+ panel.add(headerPanel);
+ }
+
+ /**
+ * Adds the CodeMetropolis title to the {@code panel}
+ *
+ * @param panel The {@link JPanel} to add the components to.
+ */
+ private final void addTitle(JPanel panel) {
+ JLabel title = new JLabel(Translations.t("gui_title"));
+ title.setFont(new Font("Source Sans Pro", Font.BOLD, 26));
+ title.setHorizontalAlignment(SwingConstants.CENTER);
+ title.setBounds(0, 280, 500, 30);
+
+ panel.add(title);
+ }
+
+ /**
+ * Adds the project name field to the {@code panel}.
+ *
+ * @param panel The {@link JPanel} to add the components to.
+ */
+ private final void addProjectNameField(JPanel panel) {
+ CMLabel label = new CMLabel(Translations.t("gui_l_project_name"), 15, 325, 120, 30);
+ projectName = new CMTextField(145, 325, 340, 30);
+
+ panel.add(label);
+ panel.add(projectName);
+ }
+
+ /**
+ * Adds the metric generation tabbed pane to the {@code panel}
+ *
+ * @param panel The {@link JPanel} to add the components to.
+ */
+ private final void addMetricTabs(JPanel panel) {
+ metricTabbedPane = new JTabbedPane();
+
+ for (CMMetricPanel metricPanel : controller.getMetricGeneratorPanels()) {
+ metricTabbedPane.add(metricPanel.getTabTitle(), metricPanel);
+ }
+
+ metricTabbedPane.setBounds(15, 365, 472, 180);
+ metricTabbedPane.setFont(new Font("Source Sans Pro", Font.PLAIN, 16));
+ panel.add(metricTabbedPane);
+ }
+
+ /**
+ * Adds the options for the mapping tool to the {@code panel}.
+ *
+ * @param panel The {@link JPanel} to add the components to.
+ */
+ private final void addMappingOptions(JPanel panel) {
+ CodeMetropolisGUI self = this;
+
+ CMLabel mappingLabel = new CMLabel(Translations.t("gui_l_mapping"), 15, 555, 120, 30);
+ mappingPath = new CMTextField(145, 555, 235, 30);
+ CMButton mappingBrowse = new CMButton(Translations.t("gui_b_browse"), 385, 555, 100, 30);
+ mappingBrowse.addActionListener(new BrowseListener(mappingPath, JFileChooser.FILES_ONLY, XML_FILTER));
+
+ //Mapping file editor GUI components
+ CMLabel mappingEditorLabel = new CMLabel(Translations.t("gui_l_source_cdf"), 15, 590, 120, 30);
+ mappingEditorCdfPath = new CMTextField(145, 590, 235, 30);
+ CMButton mappingEditorBrowse = new CMButton(Translations.t("gui_b_browse"), 385, 590, 100, 30);
+ mappingEditorBrowse.addActionListener(new BrowseListener(mappingEditorCdfPath, JFileChooser.FILES_ONLY, XML_FILTER));
+ CMButton mappingEditorButton = new CMButton(Translations.t("gui_b_mapping_file_editor"), 300, 625, 185, 30);
+ mappingEditorButton.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent event) {
+ if(!checkInputCdfFile(mappingEditorCdfPath.getText())) {
+ JOptionPane.showMessageDialog(
+ self,
+ Translations.t("gui_err_missing_cdf_file"),
+ Translations.t("gui_err_title"),
+ JOptionPane.ERROR_MESSAGE);
+ }
+ else {
+ MappingFileEditorDialog dialog = new MappingFileEditorDialog(mappingEditorCdfPath.getText(), self);
+ dialog.setVisible(true);
+ }
+ }
+ });
+
+ CMLabel scaleLabel = new CMLabel(Translations.t("gui_l_scale"), 15, 660, 120, 30);
+ scaleSpinner = new CMSpinner(145, 660, 120, 30);
+
+ validateStructure = new CMCheckBox(275, 660, 20, 30);
+ CMLabel validateStructureLabel = new CMLabel(Translations.t("gui_l_validate_structure"), 300, 660, 185, 30);
+
+ panel.add(mappingLabel);
+ panel.add(mappingPath);
+ panel.add(mappingBrowse);
+ panel.add(mappingEditorLabel);
+ panel.add(mappingEditorCdfPath);
+ panel.add(mappingEditorBrowse);
+ panel.add(mappingEditorButton);
+ panel.add(scaleLabel);
+ panel.add(scaleSpinner);
+ panel.add(validateStructure);
+ panel.add(validateStructureLabel);
+ }
+
+ /**
+ * Adds the options for the placing tool to the {@code panel}.
+ *
+ * @param panel The {@link JPanel} to add the components to.
+ */
+ private final void addPlacingOptions(JPanel panel) {
+ CMLabel layoutLabel = new CMLabel(Translations.t("gui_l_layout"), 15, 695, 120, 30);
+ layoutSelector = new CMComboBox<LayoutAlgorithm>(LayoutAlgorithm.values());
+ layoutSelector.setBounds(145, 695, 120, 30);
+
+ showMap = new CMCheckBox(275, 695, 20, 30);
+ CMLabel showMapLabel = new CMLabel(Translations.t("gui_l_show_map"), 300, 695, 185, 30);
+
+ panel.add(layoutLabel);
+ panel.add(layoutSelector);
+ panel.add(showMap);
+ panel.add(showMapLabel);
+ }
+
+ /**
+ * Adds the minecraft root folder browser. This should actually be automatically filled, but in case it is not found
+ * or the user wishes to save the results to a different location, it enables them to do so.
+ *
+ * @param panel The {@link JPanel} to add the components to.
+ */
+ private final void addMinecraftRootBrowser(JPanel panel) {
+ CMLabel mcRootLabel = new CMLabel(Translations.t("gui_l_mcroot"), 15, 730, 120, 30);
+ mcRootPath = new CMTextField(145, 730, 235, 30);
+ CMButton mcRootBrowse = new CMButton(Translations.t("gui_b_browse"), 385, 730, 100, 30);
+ mcRootBrowse.addActionListener(new BrowseListener(mcRootPath, JFileChooser.DIRECTORIES_ONLY, null));
+
+ panel.add(mcRootLabel);
+ panel.add(mcRootPath);
+ panel.add(mcRootBrowse);
+ }
+
+ /**
+ * Adds the start button to the bottom of panel.
+ *
+ * @param panel The {@link JPanel} to add the components to.
+ */
+ private final void addStartButton(JPanel panel) {
+ CodeMetropolisGUI self = this;
+ CMButton start = new CMButton(Translations.t("gui_b_generate"), 190, 765, 120, 30);
+ start.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent event) {
+ ExecutionOptions executionOptions = controller.getExecutionOptions();
+ fillOptions(executionOptions);
+ if (!fillAndValidateMetricOptions(executionOptions)) {
+ return;
+ }
+
+ if (GuiUtils.validateOptions(controller.getExecutionOptions())) {
+ PipedOutputStream out = new PipedOutputStream();
+ ExecutionDialog dialog = new ExecutionDialog(self, out);
+ dialog.setVisible(true);
+ ExecutionWorker worker = new ExecutionWorker(start, controller, out);
+ worker.execute();
+ }
+ }
+ });
+
+ panel.add(start);
+ }
+
+ /**
+ * Chacks if the input cdf file does exist or not.
+ * @param cdfPath The path of the cdf file.
+ * @return The cdf file exists or not.
+ */
+ public static boolean checkInputCdfFile(String cdfPath) {
+ File cdfXmlFile = new File(cdfPath);
+ if(!cdfXmlFile.exists()) {
+ return false;
+ }
+ else {
+ return true;
+ }
+ }
+
+ /**
+ * Fills the data required for the metric generation tools.
+ *
+ * @param executionOptions The target {@link ExecutionOptions} instance.
+ * @return True if the options are valid, false otherwise.
+ */
+ private final boolean fillAndValidateMetricOptions(ExecutionOptions executionOptions) {
+ executionOptions.getMetricGenerationParams().clear();
+
+ CMMetricPanel currentTab = (CMMetricPanel) metricTabbedPane.getSelectedComponent();
+ currentTab.fillFields(executionOptions);
+ return currentTab.validateFields(executionOptions);
+ }
+
+ /**
+ * Fills the data from the UI fields to the given {@link ExecutionOptions} instance.
+ *
+ * @param executionOptions The target instance.
+ */
+ private final void fillOptions(ExecutionOptions executionOptions) {
+ Double scale = (Double) scaleSpinner.getValue();
+ executionOptions.setProjectName(projectName.getText());
+ executionOptions.setMappingXml(new File(mappingPath.getText()));
+ executionOptions.setScale(scale.floatValue());
+ executionOptions.setValidate(validateStructure.isSelected());
+ executionOptions.setLayoutAlgorithm((LayoutAlgorithm) layoutSelector.getSelectedItem());
+ executionOptions.setShowMap(showMap.isSelected());
+ executionOptions.setMinecraftRoot(new File(mcRootPath.getText()));
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/ExecutionDialog$1.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/ExecutionDialog$1.html
new file mode 100644
index 00000000..bb0eaade
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/ExecutionDialog$1.html
@@ -0,0 +1 @@
+ExecutionDialog.new ActionListener() {...}
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/ExecutionDialog.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/ExecutionDialog.html
new file mode 100644
index 00000000..75a9ec7d
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/ExecutionDialog.html
@@ -0,0 +1 @@
+ExecutionDialog
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/ExecutionDialog.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/ExecutionDialog.java.html
new file mode 100644
index 00000000..9f02b234
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/ExecutionDialog.java.html
@@ -0,0 +1,126 @@
+ExecutionDialog.java
package codemetropolis.toolchain.gui;
+
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.IOException;
+import java.io.PipedOutputStream;
+
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.text.DefaultCaret;
+
+import codemetropolis.toolchain.gui.components.CMButton;
+import codemetropolis.toolchain.gui.components.CMTextArea;
+import codemetropolis.toolchain.gui.utils.StreamReaderWorker;
+import codemetropolis.toolchain.gui.utils.Translations;
+
+/**
+ * A dialog window for showing displaying the standard output of the executors.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class ExecutionDialog extends JDialog {
+
+ private static final long serialVersionUID = 1L;
+
+ private CMTextArea textArea;
+ private CMButton close;
+
+ /**
+ * Creates the dialog window and starts the reader process.
+ *
+ * @param parent The parent frame. Useful in case we might want to turn this into a modal window.
+ * @param out The {@link PipedOutputStream} used for the executors that we need to read.
+ */
+ public ExecutionDialog(JFrame parent, PipedOutputStream out) {
+ super(parent, Translations.t("gui_exec_title"));
+
+ JPanel panel = createDialogPanel();
+ addTextArea(panel);
+ addCloseButton(panel);
+
+ this.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
+ this.setContentPane(panel);
+ this.pack();
+ this.setLocationRelativeTo(null);
+
+ startReaderThread(out);
+ }
+
+ /**
+ * Creates the base panel for this dialog.
+ *
+ * @return The assembled panel.
+ */
+ private JPanel createDialogPanel() {
+ JPanel panel = new JPanel(null);
+ panel.setLayout(null);
+ panel.setBounds(0, 0, 400, 300);
+
+ Dimension size = new Dimension(400, 300);
+ panel.setMinimumSize(size);
+ panel.setPreferredSize(size);
+ panel.setMaximumSize(size);
+
+ return panel;
+ }
+
+ /**
+ * Creates and adds an uneditable {@link CMTextArea} into which the executors' outputs will be fed.
+ *
+ * @param panel The dialog panel.
+ */
+ private void addTextArea(JPanel panel) {
+ textArea = new CMTextArea();
+ textArea.setEditable(false);
+
+ // Automatically scroll to the bottom
+ DefaultCaret caret = (DefaultCaret) textArea.getCaret();
+ caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
+
+ JScrollPane pane = new JScrollPane(textArea);
+ pane.setBounds(10, 10, 380, 240);
+
+ panel.add(pane);
+ }
+
+ /**
+ * Creates and adds a close button for this dialog that is disabled by default. It will be enabled when the world
+ * generation is finished.
+ *
+ * @param panel The dialog panel.
+ */
+ private void addCloseButton(JPanel panel) {
+ close = new CMButton(Translations.t("gui_b_close"), 140, 260, 120, 30);
+ close.setEnabled(false);
+ close.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ setVisible(false);
+ }
+ });
+
+ panel.add(close);
+ }
+
+ /**
+ * Starts a {@link javax.swing.SwingWorker} that will read from the specified {@link PipedOutputStream} by feeding it
+ * into a {@link java.io.PipedInputStream}. It appends the lines it reads to the textArea on the dialog frame.
+ *
+ * @param out The {@link PipedOutputStream} used by the executors.
+ */
+ private void startReaderThread(PipedOutputStream out) {
+ try {
+ StreamReaderWorker worker = new StreamReaderWorker(close, textArea, out);
+ worker.execute();
+ } catch (IOException e) {
+ // Can't really do anything about this
+ e.printStackTrace();
+ }
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/GUIController.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/GUIController.html
new file mode 100644
index 00000000..9fbeb90b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/GUIController.html
@@ -0,0 +1 @@
+GUIController
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/GUIController.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/GUIController.java.html
new file mode 100644
index 00000000..d18c2b30
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/GUIController.java.html
@@ -0,0 +1,103 @@
+GUIController.java
package codemetropolis.toolchain.gui;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import codemetropolis.toolchain.gui.beans.ExecutionException;
+import codemetropolis.toolchain.gui.beans.ExecutionOptions;
+import codemetropolis.toolchain.gui.components.CMMetricPanel;
+import codemetropolis.toolchain.gui.executors.ConverterToolExecutor;
+import codemetropolis.toolchain.gui.executors.MappingToolExecutor;
+import codemetropolis.toolchain.gui.executors.MetricGeneratorExecutor;
+import codemetropolis.toolchain.gui.executors.PlacingToolExecutor;
+import codemetropolis.toolchain.gui.executors.RenderingToolExecutor;
+import codemetropolis.toolchain.gui.metricgenerators.SonarQubeGenerator;
+import codemetropolis.toolchain.gui.metricgenerators.SourceMeterGenerator;
+import codemetropolis.toolchain.gui.utils.Translations;
+
+/**
+ * Controller class for the GUI that handles tasks like managing the toolchain execution.
+ *
+ * @author Abel Szkalisity {@literal <SZAVAET.SZE>}
+ */
+public class GUIController {
+
+ private static final SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat("yyyyMMdd-hhmmss-SSS");
+
+ private ExecutionOptions executionOptions;
+ private List<CMMetricPanel> metricGeneratorPanels = new ArrayList<CMMetricPanel>();
+
+ /**
+ * Instantiates a {@link GUIController} and adds the available metricGeneration options.
+ */
+ public GUIController() {
+ executionOptions = new ExecutionOptions();
+
+ metricGeneratorPanels.add(new SourceMeterGenerator());
+ metricGeneratorPanels.add(new SonarQubeGenerator());
+ }
+
+ /**
+ * Handles toolchain execution. Creates the folder that stores the intermediate project files, then it runs each part
+ * of the toolchain in sequence.
+ *
+ * @param out The {@link PrintStream} instance that will be set for each executor, so we can read their outputs and
+ * display them for the user.
+ * @throws ExecutionException if any exception occurs during execution.
+ */
+ public void execute(PrintStream out) throws ExecutionException {
+ try {
+ File projectRoot = createTargetFolder();
+
+ new MetricGeneratorExecutor().execute(projectRoot, executionOptions, out);
+ new ConverterToolExecutor().execute(projectRoot, executionOptions, out);
+ new MappingToolExecutor().execute(projectRoot, executionOptions, out);
+ new PlacingToolExecutor().execute(projectRoot, executionOptions, out);
+ new RenderingToolExecutor().execute(projectRoot, executionOptions, out);
+ } catch (Exception e) {
+ throw new ExecutionException("Toolchain execution failed!", e);
+ }
+ }
+
+ /**
+ * Creates the folder that will be used to store the intermediate project files.
+ *
+ * @return The {@link File} object for the generated directory.
+ * @throws ExecutionException if creating the directory failed.
+ */
+ private File createTargetFolder() throws ExecutionException {
+ File cmRoot = new File(executionOptions.getMinecraftRoot().getAbsolutePath() + File.separator + ".code-metropolis");
+ if (!cmRoot.exists()) {
+ cmRoot.mkdir();
+ }
+
+ File projectRoot = new File(cmRoot.getAbsolutePath() + File.separator + getCurrentDateString());
+ if (!projectRoot.mkdir()) {
+ throw new ExecutionException(Translations.t("gui_err_mkdir_project_failed"));
+ }
+ return projectRoot;
+ }
+
+ /**
+ * Gets the current date and time, then returns a formatted version of it, that can act as a valid directory name.
+ *
+ * @return The formatted date and time.
+ */
+ private String getCurrentDateString() {
+ return DATE_FORMATTER.format(new Date());
+ }
+
+ public ExecutionOptions getExecutionOptions() {
+ return executionOptions;
+ }
+
+ public List<CMMetricPanel> getMetricGeneratorPanels() {
+ return metricGeneratorPanels;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/Main.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/Main.html
new file mode 100644
index 00000000..48daffc8
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/Main.html
@@ -0,0 +1 @@
+Main
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/Main.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/Main.java.html
new file mode 100644
index 00000000..821bd39b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/Main.java.html
@@ -0,0 +1,65 @@
+Main.java
package codemetropolis.toolchain.gui;
+
+import java.awt.Font;
+import java.awt.FontFormatException;
+import java.awt.GraphicsEnvironment;
+import java.io.IOException;
+
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+
+/**
+ * Main class for the CodeMetropolis' GUI module. Initializes some globals, like fonts and look-and-feel, and
+ * instaniates the main gui window.
+ *
+ * @author Adam Bankeszi {@literal <BAAVAGT.SZE>}
+ */
+public class Main {
+
+ private static final int TTF = Font.TRUETYPE_FONT;
+ private static final String SOURCE_SANS = "fonts/SourceSansPro-";
+ private static final String[] FONT_VARIATIONS = { "Black", "BlackItalic", "Bold", "BoldItalic", "ExtraLight",
+ "ExtraLightItalic", "Italic", "Light", "LightItalic", "Regular", "Semibold", "SemiboldItalic" };
+
+ /**
+ * The CodeMetropolis GUI application entry point.
+ *
+ * @param args The command line arguments. Since this a GUI application, it is currently unused.
+ */
+ public static void main(String[] args) {
+ setSystemLookAndFeel();
+ loadSourceSansProFonts();
+
+ // Instantiate the GUI
+ GUIController controller = new GUIController();
+ CodeMetropolisGUI gui = new CodeMetropolisGUI(controller);
+ gui.setVisible(true);
+ }
+
+ /**
+ * Attempts to set the lookAndFeel used by the Swing components to be the system's lookAndFeel.
+ */
+ private static final void setSystemLookAndFeel() {
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // Failed to set system look and feel. Continue regardless.
+ }
+ }
+
+ /**
+ * Attempts to load the SourceSans ttf font files from the classpath.
+ */
+ private static final void loadSourceSansProFonts() {
+ try {
+ GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+ for (String variation : FONT_VARIATIONS) {
+ ge.registerFont(Font.createFont(TTF, ClassLoader.getSystemResourceAsStream(SOURCE_SANS + variation + ".ttf")));
+ }
+ } catch (FontFormatException | IOException e) {
+ // Failed to load font files. Using defaults instead.
+ }
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog$1.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog$1.html
new file mode 100644
index 00000000..c6d3ac2a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog$1.html
@@ -0,0 +1 @@
+MappingFileEditorDialog.new ActionListener() {...}
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog$2.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog$2.html
new file mode 100644
index 00000000..278beda4
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog$2.html
@@ -0,0 +1 @@
+MappingFileEditorDialog.new ActionListener() {...}
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog$3.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog$3.html
new file mode 100644
index 00000000..3e0a5483
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog$3.html
@@ -0,0 +1 @@
+MappingFileEditorDialog.new ActionListener() {...}
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog$AssignResult.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog$AssignResult.html
new file mode 100644
index 00000000..294c3ecf
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog$AssignResult.html
@@ -0,0 +1 @@
+MappingFileEditorDialog.AssignResult
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog.html
new file mode 100644
index 00000000..f8074d33
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog.html
@@ -0,0 +1 @@
+MappingFileEditorDialog
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog.java.html
new file mode 100644
index 00000000..63dd3ced
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/MappingFileEditorDialog.java.html
@@ -0,0 +1,629 @@
+MappingFileEditorDialog.java
package codemetropolis.toolchain.gui;
+
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.Rectangle;
+import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.swing.DefaultListModel;
+import javax.swing.DropMode;
+import javax.swing.JDialog;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.ListModel;
+import javax.swing.ListSelectionModel;
+import javax.swing.filechooser.FileFilter;
+
+import codemetropolis.toolchain.gui.beans.BadConfigFileFomatException;
+import codemetropolis.toolchain.gui.beans.QuantizationInformation;
+import codemetropolis.toolchain.gui.components.CMButton;
+import codemetropolis.toolchain.gui.components.CMCheckBox;
+import codemetropolis.toolchain.gui.components.CMLabel;
+import codemetropolis.toolchain.gui.components.CMScrollPane;
+import codemetropolis.toolchain.gui.components.CMTextField;
+import codemetropolis.toolchain.gui.components.listeners.BrowseListener;
+import codemetropolis.toolchain.gui.conversions.Conversion;
+import codemetropolis.toolchain.gui.conversions.QuantizationConversion;
+import codemetropolis.toolchain.gui.utils.BuildableSettings;
+import codemetropolis.toolchain.gui.utils.Property;
+import codemetropolis.toolchain.gui.utils.PropertyCollector;
+import codemetropolis.toolchain.gui.utils.TransferHelper;
+import codemetropolis.toolchain.gui.utils.Translations;
+import codemetropolis.toolchain.gui.utils.XmlFileFilter;
+
+/**
+ * Dialog for the mapping file editor.
+ * @author Viktor Meszaros {@literal <MEVXAAT.SZE>}
+ */
+public class MappingFileEditorDialog extends JDialog {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final FileFilter XML_FILTER;
+
+ static public List<Conversion> cellarConversion;
+ static public List<Conversion> gardenConversion;
+ static public List<Conversion> floorConversion;
+
+ static public Map<QuantizationInformation, QuantizationConversion> cellarQuant;
+ static public Map<QuantizationInformation, QuantizationConversion> gardenQuant;
+ static public Map<QuantizationInformation, QuantizationConversion> floorQuant;
+
+ /**
+ * Contains the possible results of assigning a metric to a property of a buildable type.
+ */
+ public enum AssignResult {CANNOT_ASSIGN, NO_CONVERSION, TO_INT, TO_DOUBLE, NORMALIZE, QUANTIZATON};
+
+ public static final Map<String, Map<String, AssignResult>> ASSIGN_RESULT_MATRIX;
+
+ static {
+ XML_FILTER = new XmlFileFilter();
+
+ cellarConversion = new ArrayList<Conversion>();
+ gardenConversion = new ArrayList<Conversion>();
+ floorConversion = new ArrayList<Conversion>();
+
+ cellarQuant = new HashMap<QuantizationInformation, QuantizationConversion>();
+ gardenQuant = new HashMap<QuantizationInformation, QuantizationConversion>();
+ floorQuant = new HashMap<QuantizationInformation, QuantizationConversion>();
+
+ ASSIGN_RESULT_MATRIX = new HashMap<String, Map<String, AssignResult>>();
+
+ ASSIGN_RESULT_MATRIX.put("int", new HashMap<String, AssignResult>());
+ ASSIGN_RESULT_MATRIX.put("int(0 to 5)", new HashMap<String, AssignResult>());
+ ASSIGN_RESULT_MATRIX.put("string", new HashMap<String, AssignResult>());
+ ASSIGN_RESULT_MATRIX.put("float(0 to 1)", new HashMap<String, AssignResult>());
+ //First row of the "matrix"
+ ASSIGN_RESULT_MATRIX.get("int").put("int", AssignResult.NO_CONVERSION);
+ ASSIGN_RESULT_MATRIX.get("int").put("float", AssignResult.TO_INT);
+ ASSIGN_RESULT_MATRIX.get("int").put("string", AssignResult.CANNOT_ASSIGN);
+ //Second row of the "matrix"
+ ASSIGN_RESULT_MATRIX.get("int(0 to 5)").put("int", AssignResult.QUANTIZATON);
+ ASSIGN_RESULT_MATRIX.get("int(0 to 5)").put("float", AssignResult.QUANTIZATON);
+ ASSIGN_RESULT_MATRIX.get("int(0 to 5)").put("string", AssignResult.CANNOT_ASSIGN);
+ //Third row of the "matrix"
+ ASSIGN_RESULT_MATRIX.get("string").put("int", AssignResult.QUANTIZATON);
+ ASSIGN_RESULT_MATRIX.get("string").put("float", AssignResult.QUANTIZATON);
+ ASSIGN_RESULT_MATRIX.get("string").put("string", AssignResult.NO_CONVERSION);
+ //Fourth row of the "matrix"
+ ASSIGN_RESULT_MATRIX.get("float(0 to 1)").put("int", AssignResult.NORMALIZE);
+ ASSIGN_RESULT_MATRIX.get("float(0 to 1)").put("float", AssignResult.NORMALIZE);
+ ASSIGN_RESULT_MATRIX.get("float(0 to 1)").put("string", AssignResult.CANNOT_ASSIGN);
+ }
+
+ private Map<String, String[]> displayedBuildableAttributes;
+ private Map<String, List<Property>> sourceCodeElementProperties;
+
+ private JTabbedPane buildableTabbedPane;
+ private JPanel cellarPanel;
+ private JPanel floorPanel;
+ private JPanel gardenPanel;
+ private JPanel groundPanel;
+ private static JTable cellarTable;
+ private static JTable floorTable;
+ private static JTable gardenTable;
+
+ //ListModel and JList for the buildables: cellar, floor, garden
+ private ListModel<String> cellarListmodel;
+ private JList<String> cellarList;
+ private ListModel<String> floorListmodel;
+ private JList<String> floorList;
+ private ListModel<String> gardenListmodel;
+ private JList<String> gardenList;
+
+ //ListModel and JList for the resources
+ private ListModel<String> resourcesListmodel;
+ private JList<String> resourcesList;
+
+ private CMCheckBox useMappingCheckBox;
+ private CMTextField pathField;
+
+ /**
+ * Loads the list of the buildable attributes which are desired to display on the GUI from the configuration file.
+ * Loads the list of the source code element from the given input cdf xml file.
+ * @param cdfFilePath The path of the input cdf xml file.
+ */
+ private void loadDisplayedInfo(String cdfFilePath) {
+ try {
+ BuildableSettings settings = new BuildableSettings();
+ displayedBuildableAttributes = settings.readSettings();
+
+ }
+ catch(BadConfigFileFomatException e) {
+ JOptionPane.showMessageDialog(
+ null,
+ Translations.t("gui_err_invaild_config_file_format"),
+ Translations.t("gui_err_title"),
+ JOptionPane.ERROR_MESSAGE);
+
+ displayedBuildableAttributes = BuildableSettings.DEFAULT_SETTINGS;
+ }
+ catch(FileNotFoundException e) {
+ JOptionPane.showMessageDialog(
+ null,
+ Translations.t("gui_err_config_file_not_found"),
+ Translations.t("gui_err_title"),
+ JOptionPane.ERROR_MESSAGE);
+
+ displayedBuildableAttributes = BuildableSettings.DEFAULT_SETTINGS;
+ }
+ try {
+ PropertyCollector pc = new PropertyCollector();
+ sourceCodeElementProperties = pc.getFromCdf(cdfFilePath);
+ }
+ catch(FileNotFoundException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ /**
+ * Instantiates the Mapping file editor dialog.
+ *
+ * @param cdfFilePath The path of the input cdf xml file.
+ * @param cmGui The parent window of the dialog.
+ */
+ public MappingFileEditorDialog(String cdfFilePath, CodeMetropolisGUI cmGui) {
+ super(cmGui, Translations.t("gui_mapping_editor_title") ,true);
+ loadDisplayedInfo(cdfFilePath);
+
+ JPanel panel = createBasePanel();
+ addResourceOptions(panel);
+ addSaveOptions(panel);
+ addBuildableTabs(panel);
+ addConversionOptions(panel);
+
+ this.setResizable(false);
+ this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
+ this.setContentPane(panel);
+ this.pack();
+ this.setLocationRelativeTo(cmGui);
+ }
+
+ /**
+ * Creates the base panel for the Mapping file editor dialog.
+ *
+ * @return The created {@link JPanel}.
+ */
+ private JPanel createBasePanel() {
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBounds(0, 0, 800, 550);
+
+ Dimension size = new Dimension(800, 550);
+ panel.setMinimumSize(size);
+ panel.setPreferredSize(size);
+ panel.setMaximumSize(size);
+
+ return panel;
+ }
+
+ /**
+ * Adds the resource options to the {@code panel}.
+ * @param panel The {@link JPanel} to which the components will be added to.
+ */
+ private void addResourceOptions(JPanel panel) {
+ CMLabel resourcesLabel = new CMLabel(Translations.t("gui_l_resources"), 10, 0, 120, 30);
+
+ resourcesListmodel = new DefaultListModel<String>();
+ resourcesList = new JList<String>(resourcesListmodel);
+ resourcesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ resourcesList.setLayoutOrientation(JList.VERTICAL);
+ resourcesList.setVisibleRowCount(-1);
+ CMScrollPane resourcesScrollPane = new CMScrollPane(resourcesList, 10, 35, 240, 120);
+
+ CMButton resourcesAddButton = new CMButton(Translations.t("gui_b_add"), 265, 35, 120, 30);
+ resourcesAddButton.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ JTextField nameField = new JTextField();
+ JTextField valueField = new JTextField();
+
+ JPanel addResourcePanel = new JPanel();
+ addResourcePanel.setLayout(new GridLayout(4, 2));
+ addResourcePanel.add(new JLabel("Resource name:"));
+ addResourcePanel.add(nameField);
+ addResourcePanel.add(new JLabel("Resource value:"));
+ addResourcePanel.add(valueField);
+
+ int result = JOptionPane.showConfirmDialog(null, addResourcePanel, Translations.t("gui_add_resource_title"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);
+ if(result == JOptionPane.OK_OPTION) {
+ if (nameField.getText().matches("[a-zA-Z0-9]+") &&
+ (valueField.getText().matches("[0-9]+(.[0-9]+)?")) || BuildableSettings.VALID_CHARACTER_TYPES.contains(valueField.getText())) {
+ //Produce the resource string from the text fields...
+ String resourceToAdd = nameField.getText() + ": " + valueField.getText();
+ //Add the newly defined resource to the property lists of the buildables and to the resource list (on top left of the window).
+ List<JList<String>> lists = Arrays.asList(resourcesList, cellarList, floorList, gardenList);
+ for (JList<String> list : lists) {
+ DefaultListModel<String> listModel = (DefaultListModel<String>) list.getModel();
+ listModel.addElement(resourceToAdd);
+ }
+ }
+ else {
+ JOptionPane.showMessageDialog(
+ null,
+ Translations.t("gui_err_name_value_not_valid"),
+ Translations.t("gui_err_title"),
+ JOptionPane.ERROR_MESSAGE);
+ }
+ }
+ }
+ });
+ CMButton resourcesRemoveButton = new CMButton(Translations.t("gui_b_remove"), 265, 80, 120, 30);
+ resourcesRemoveButton.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ int indexToRemove = resourcesList.getSelectedIndex();
+ if(indexToRemove == -1) {
+ JOptionPane.showMessageDialog(
+ null,
+ Translations.t("gui_err_resources_empty_no_selected"),
+ Translations.t("gui_err_title"),
+ JOptionPane.ERROR_MESSAGE);
+ }
+ else {
+ String resourceToRemove = resourcesList.getModel().getElementAt(indexToRemove);
+ List<JList<String>> lists = Arrays.asList(resourcesList, cellarList, floorList, gardenList);
+ List<JTable> tables = Arrays.asList(cellarTable, floorTable, gardenTable);
+ for(JList<String> list : lists) {
+ DefaultListModel<String> listModel = (DefaultListModel<String>) list.getModel();
+ listModel.removeElement(resourceToRemove);
+ }
+ for(JTable table : tables) {
+ int rows = table.getRowCount();
+ int columns = table.getColumnCount();
+ for(int i = 0; i < rows; i++)
+ for(int j = 0; j < columns; j++) {
+ String cellValue = (String) table.getValueAt(i, j);
+ if(resourceToRemove.equals(cellValue)) {
+ table.setValueAt(null, i, j);
+ }
+ }
+ }
+ }
+ }
+ });
+
+ panel.add(resourcesLabel);
+ panel.add(resourcesScrollPane);
+ panel.add(resourcesAddButton);
+ panel.add(resourcesRemoveButton);
+ }
+
+ /**
+ * Adds the saving options to the {@code panel}.
+ * @param panel The {@link JPanel} to which the components will be added to.
+ */
+ private void addSaveOptions(JPanel panel) {
+ CMLabel saveSettingsLabel = new CMLabel(Translations.t("gui_l_save_settings"), 415, 0, 120, 30);
+ CMLabel pathLabel = new CMLabel(Translations.t("gui_l_path"), 415, 35, 60, 30);
+ pathField = new CMTextField(475, 35, 270, 30);
+ CMButton specifyPathButton = new CMButton(Translations.t("gui_b_specify_path"), 415, 80, 120, 30);
+ useMappingCheckBox = new CMCheckBox(550, 80, 30, 30);
+ CMLabel useMappingLabel = new CMLabel(Translations.t("gui_l_use_mapping_file"),575, 80, 180, 30);
+ CMButton saveMappingFileButton = new CMButton(Translations.t("gui_b_save_mapping_file"), 415, 120, 165, 30);
+ specifyPathButton.addActionListener(new BrowseListener(pathField, JFileChooser.FILES_ONLY, XML_FILTER));
+
+ panel.add(saveSettingsLabel);
+ panel.add(pathLabel);
+ panel.add(pathField);
+ panel.add(specifyPathButton);
+ panel.add(useMappingCheckBox);
+ panel.add(useMappingLabel);
+ panel.add(saveMappingFileButton);
+ }
+
+ /**
+ * Adds the the tabs of the buildables to the {@code buildableTabbedPane} {@link JTabbedPane}.
+ * @param panel The {@link JPanel} to which the {@code buildableTabbedPane} will be added to.
+ */
+ private void addBuildableTabs(JPanel panel) {
+ buildableTabbedPane = new JTabbedPane();
+
+ createCellarTab();
+ createFloorTab();
+ createGardenTab();
+ createGroundTab();
+
+ buildableTabbedPane.add(Translations.t("gui_tab_cellar"), cellarPanel);
+ buildableTabbedPane.add(Translations.t("gui_tab_floor"), floorPanel);
+ buildableTabbedPane.add(Translations.t("gui_tab_garden"), gardenPanel);
+ buildableTabbedPane.add(Translations.t("gui_tab_ground"), groundPanel);
+
+ buildableTabbedPane.setFont(new Font("Source Sans Pro", Font.PLAIN, 16));
+ buildableTabbedPane.setBounds(10, 175, 780, 300);
+
+ panel.add(buildableTabbedPane);
+
+ }
+
+ /**
+ * Creates the tab to the buildable type cellar, where the buildable attributes and their desired values can be paired.
+ */
+ private void createCellarTab() {
+ cellarPanel = new JPanel();
+ cellarPanel.setLayout(null);
+ cellarPanel.setBounds(0, 0, 780, 285);
+
+ Dimension size = new Dimension(780, 285);
+ cellarPanel.setMinimumSize(size);
+ cellarPanel.setPreferredSize(size);
+ cellarPanel.setMaximumSize(size);
+
+ CMLabel assignedLabel = new CMLabel(Translations.t("gui_l_assigned_to"), 15, 15, 270, 30);
+ CMLabel attributeLabel = new CMLabel(Translations.t("gui_l_attribute"), 270, 15, 60, 30);
+ CMLabel propertiesLabel = new CMLabel(Translations.t("gui_l_properties"), 525, 15, 120, 30);
+
+ cellarTable = setUpBuildableTable("CELLAR");
+ Rectangle bounds = cellarTable.getBounds();
+ CMScrollPane scrollPane = new CMScrollPane(cellarTable, bounds.x, bounds.y, bounds.width, bounds.height + 30);
+
+ cellarListmodel = initializeListModel("attribute");
+ cellarList = new JList<String>();
+ cellarList.setModel(cellarListmodel);
+ cellarList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ cellarList.setLayoutOrientation(JList.VERTICAL);
+ cellarList.setVisibleRowCount(-1);
+ cellarList.setDragEnabled(true);
+ cellarList.setDropMode(DropMode.INSERT);
+
+ CMScrollPane cellarScrollPane = new CMScrollPane(cellarList, 525, 50, 240, 180);
+
+ cellarPanel.add(assignedLabel);
+ cellarPanel.add(attributeLabel);
+ cellarPanel.add(propertiesLabel);
+ cellarPanel.add(scrollPane);
+ cellarPanel.add(cellarScrollPane);
+ }
+
+ /**
+ * Creates the tab to the buildable type floor, where the buildable attributes and their desired values can be paired.
+ */
+ private void createFloorTab() {
+ floorPanel = new JPanel();
+ floorPanel.setLayout(null);
+ floorPanel.setBounds(0, 0, 780, 285);
+
+ Dimension size = new Dimension(780, 285);
+ floorPanel.setMinimumSize(size);
+ floorPanel.setPreferredSize(size);
+ floorPanel.setMaximumSize(size);
+
+ CMLabel assignedLabel = new CMLabel(Translations.t("gui_l_assigned_to"), 15, 15, 270, 30);
+ CMLabel methodLabel = new CMLabel(Translations.t("gui_l_method"), 270, 15, 60, 30);
+ CMLabel propertiesLabel = new CMLabel(Translations.t("gui_l_properties"), 525, 15, 120, 30);
+
+ floorTable = setUpBuildableTable("FLOOR");
+ Rectangle bounds = floorTable.getBounds();
+ CMScrollPane scrollPane = new CMScrollPane(floorTable, bounds.x, bounds.y, bounds.width, bounds.height + 30);
+
+ floorListmodel = initializeListModel("method");
+ floorList = new JList<String>();
+ floorList.setModel(floorListmodel);
+ floorList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ floorList.setLayoutOrientation(JList.VERTICAL);
+ floorList.setVisibleRowCount(-1);
+ floorList.setDragEnabled(true);
+ floorList.setDropMode(DropMode.INSERT);
+
+ CMScrollPane floorScrollPane = new CMScrollPane(floorList, 525, 50, 240, 180);
+
+ floorPanel.add(assignedLabel);
+ floorPanel.add(methodLabel);
+ floorPanel.add(propertiesLabel);
+ floorPanel.add(scrollPane);
+ floorPanel.add(floorScrollPane);
+ }
+
+ /**
+ * Creates the tab to the buildable type garden, where the buildable attributes and their desired values can be paired.
+ */
+ private void createGardenTab() {
+ gardenPanel = new JPanel();
+ gardenPanel.setLayout(null);
+ gardenPanel.setBounds(0, 0, 780, 285);
+
+ Dimension size = new Dimension(780, 285);
+ gardenPanel.setMinimumSize(size);
+ gardenPanel.setPreferredSize(size);
+ gardenPanel.setMaximumSize(size);
+
+ CMLabel assignedLabel = new CMLabel(Translations.t("gui_l_assigned_to"), 15, 15, 270, 30);
+ CMLabel classLabel = new CMLabel(Translations.t("gui_l_class"), 270, 15, 60, 30);
+ CMLabel propertiesLabel = new CMLabel(Translations.t("gui_l_properties"), 525, 15, 120, 30);
+
+ gardenTable = setUpBuildableTable("GARDEN");
+ Rectangle bounds = gardenTable.getBounds();
+ CMScrollPane scrollPane = new CMScrollPane(gardenTable, bounds.x, bounds.y, bounds.width, bounds.height + 30);
+
+ gardenListmodel = initializeListModel("class");
+ gardenList = new JList<String>();
+ gardenList.setModel(gardenListmodel);
+ gardenList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ gardenList.setLayoutOrientation(JList.VERTICAL);
+ gardenList.setVisibleRowCount(-1);
+ gardenList.setDragEnabled(true);
+ gardenList.setDropMode(DropMode.INSERT);
+
+ CMScrollPane gardenScrollPane = new CMScrollPane(gardenList, 525, 50, 240, 180);
+
+ gardenPanel.add(assignedLabel);
+ gardenPanel.add(classLabel);
+ gardenPanel.add(propertiesLabel);
+ gardenPanel.add(scrollPane);
+ gardenPanel.add(gardenScrollPane);
+ }
+
+ /**
+ * Creates the tab to the buildable type ground.
+ */
+ private void createGroundTab() {
+ groundPanel = new JPanel();
+ groundPanel.setLayout(null);
+ groundPanel.setBounds(0, 0, 780, 285);
+
+ Dimension size = new Dimension(780, 285);
+ groundPanel.setMinimumSize(size);
+ groundPanel.setPreferredSize(size);
+ groundPanel.setMaximumSize(size);
+
+ CMLabel assignedLabel = new CMLabel(Translations.t("gui_l_assigned_to"), 15, 15, 270, 30);
+ CMLabel packageLabel = new CMLabel(Translations.t("gui_l_package"), 270, 15, 60, 30);
+ CMLabel noAttrsLabel = new CMLabel(Translations.t("gui_l_no_attributes"), 15, 60, 300, 30);
+
+ groundPanel.add(assignedLabel);
+ groundPanel.add(packageLabel);
+ groundPanel.add(noAttrsLabel);
+ }
+
+ /**
+ * Sets up the table of a buildable type which contains the attributes of the buildable (height, character, etc.) and provides a second column for their values.
+ * @param buildableType The type of the buildable (method, attribute, etc.).
+ * @return The JTable contains the buildable attributes.
+ */
+ private JTable setUpBuildableTable(String buildableType) {
+ String[] displayedProperties = displayedBuildableAttributes.get(buildableType);
+
+ Object[] columnNames = new String[] {Translations.t("gui_t_attribute"), Translations.t("gui_t_assigned_propery")};
+ Object[][] initData = new Object[displayedProperties.length][2];
+
+ for(int i = 0; i < displayedProperties.length; i++) {
+ initData[i][0] = displayedProperties[i] + ": " + BuildableSettings.BUILDABLE_ATTRIBUTE_TYPES.get(displayedProperties[i]);
+ initData[i][1] = null;
+ }
+
+ JTable table = new JTable(initData, columnNames);
+ table.setFont(new Font("Source Sans Pro", Font.PLAIN, 14));
+ table.setRowHeight(30);
+ table.setBounds(15, 50, 480, displayedProperties.length * 30);
+ table.setDragEnabled(true);
+ table.setDropMode(DropMode.USE_SELECTION);
+ table.setTransferHandler(new TransferHelper());
+ table.setRowSelectionAllowed(false);
+ table.setCellSelectionEnabled(true);
+
+ return table;
+ }
+
+ /**
+ * Fills up the list model of the given source code element type with its own properties/metrics.
+ * @param sourceCodeElementType Type of the source code element (method, attribute, etc.).
+ * @return The {@link ListModel} contains all of the properties/metrics.
+ */
+ public ListModel<String> initializeListModel(String sourceCodeElementType) {
+ List<Property> propertyList = sourceCodeElementProperties.get(sourceCodeElementType);
+
+ DefaultListModel<String> model = new DefaultListModel<String>();
+
+ for(Property p : propertyList) {
+ model.addElement(p.name + ": " + p.type);
+ }
+
+ return model;
+ }
+
+ /**
+ * Adds the conversion options to the {@code panel}.
+ * @param panel The {@link JPanel} to which the options will be added to.
+ */
+ private void addConversionOptions(JPanel panel) {
+ CMButton conversionButton = new CMButton(Translations.t("gui_b_conversions"), 10, 490, 150, 30);
+ panel.add(conversionButton);
+
+ MappingFileEditorDialog self = this;
+ conversionButton.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent arg0) {
+ int index;
+ String buildableAttribute;
+ String metric;
+
+ for (Conversion element : cellarConversion) {
+ if ( element instanceof QuantizationConversion ) {
+ QuantizationInformation cellar = new QuantizationInformation();
+
+ index = cellarConversion.indexOf(element);
+ buildableAttribute = (String) cellarTable.getModel().getValueAt(index, 0);
+ metric = (String) cellarTable.getModel().getValueAt(index, 1);
+
+ cellar.setIndex(index);
+ cellar.setBuildableAttribute(buildableAttribute);
+ cellar.setMetric(metric);
+
+ cellarQuant.put(cellar, new QuantizationConversion());
+ }
+ }
+ for (Conversion element : gardenConversion) {
+ if ( element instanceof QuantizationConversion ) {
+ QuantizationInformation garden = new QuantizationInformation();
+
+ index = gardenConversion.indexOf(element);
+ buildableAttribute = (String) gardenTable.getModel().getValueAt(index, 0);
+ metric = (String) gardenTable.getModel().getValueAt(index, 1);
+
+ garden.setIndex(index);
+ garden.setBuildableAttribute(buildableAttribute);
+ garden.setMetric(metric);
+
+ gardenQuant.put(garden, new QuantizationConversion());
+ }
+ }
+ for (Conversion element : floorConversion) {
+ if ( element instanceof QuantizationConversion ) {
+ QuantizationInformation floor = new QuantizationInformation();
+
+ index = floorConversion.indexOf(element);
+ buildableAttribute = (String) floorTable.getModel().getValueAt(index, 0);
+ metric = (String) floorTable.getModel().getValueAt(index, 1);
+
+ floor.setIndex(index);
+ floor.setBuildableAttribute(buildableAttribute);
+ floor.setMetric(metric);
+
+ floorQuant.put(floor, new QuantizationConversion());
+ }
+ }
+ QuantizationSetterDialog dialog = new QuantizationSetterDialog(self);
+ dialog.setVisible(true);
+
+ }
+ });
+ }
+
+ /**
+ * @return floorTable
+ */
+ public static JTable getFloorTable() {
+ return floorTable;
+ }
+
+ /**
+ * @return gardenTable
+ */
+ public static JTable getGardenTable() {
+ return gardenTable;
+ }
+
+ /**
+ * @return cellarTable
+ */
+ public static JTable getCellarTable() {
+ return cellarTable;
+ }
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/QuantizationSetterDialog.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/QuantizationSetterDialog.html
new file mode 100644
index 00000000..efd6e03f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/QuantizationSetterDialog.html
@@ -0,0 +1 @@
+QuantizationSetterDialog
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/QuantizationSetterDialog.java.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/QuantizationSetterDialog.java.html
new file mode 100644
index 00000000..3cb8b9b7
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/QuantizationSetterDialog.java.html
@@ -0,0 +1,129 @@
+QuantizationSetterDialog.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/index.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/index.html
new file mode 100644
index 00000000..deab5fd5
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.gui
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/index.source.html b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/index.source.html
new file mode 100644
index 00000000..42078f38
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/codemetropolis.toolchain.gui/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.gui
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_java/index.html b/doc/codemetropolis-toolchain-gui/src_main_java/index.html
new file mode 100644
index 00000000..51eea92a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_java/index.html
@@ -0,0 +1 @@
+src/main/java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-gui/src_main_resources/index.html b/doc/codemetropolis-toolchain-gui/src_main_resources/index.html
new file mode 100644
index 00000000..e4675829
--- /dev/null
+++ b/doc/codemetropolis-toolchain-gui/src_main_resources/index.html
@@ -0,0 +1 @@
+src/main/resources
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/index.html b/doc/codemetropolis-toolchain-mapping/index.html
new file mode 100644
index 00000000..66fb0985
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/index.html
@@ -0,0 +1 @@
+codemetropolis-toolchain-mapping
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/LimitController.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/LimitController.html
new file mode 100644
index 00000000..df3e05cb
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/LimitController.html
@@ -0,0 +1 @@
+LimitController
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/LimitController.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/LimitController.java.html
new file mode 100644
index 00000000..41b942d0
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/LimitController.java.html
@@ -0,0 +1,24 @@
+LimitController.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/MappingController.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/MappingController.html
new file mode 100644
index 00000000..77cde922
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/MappingController.html
@@ -0,0 +1 @@
+MappingController
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/MappingController.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/MappingController.java.html
new file mode 100644
index 00000000..51f1ef09
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/MappingController.java.html
@@ -0,0 +1,305 @@
+MappingController.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/index.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/index.html
new file mode 100644
index 00000000..f44b4a38
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.mapping.control
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/index.source.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/index.source.html
new file mode 100644
index 00000000..71bca629
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.control/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.mapping.control
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/Conversion.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/Conversion.html
new file mode 100644
index 00000000..be8b1593
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/Conversion.html
@@ -0,0 +1 @@
+Conversion
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/Conversion.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/Conversion.java.html
new file mode 100644
index 00000000..c6c289e5
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/Conversion.java.html
@@ -0,0 +1,73 @@
+Conversion.java
package codemetropolis.toolchain.mapping.conversions;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import codemetropolis.toolchain.mapping.model.Limit;
+import codemetropolis.toolchain.mapping.model.Parameter;
+
+@XmlJavaTypeAdapter(ConversionAdapter.class)
+public abstract class Conversion {
+
+ protected List<Parameter> parameters = new ArrayList<Parameter>();
+
+ public abstract Object apply(Object value, Limit limit);
+
+ public void clearParameters() {
+ parameters.clear();
+ }
+
+ public void addParameter(Parameter p) {
+ parameters.add(p);
+ }
+
+ public void addParameters(Parameter... parameters) {
+ for(Parameter p : parameters) {
+ this.parameters.add(p);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<Parameter> getParameters() {
+ if(parameters == null) {
+ parameters = Collections.EMPTY_LIST;
+ }
+ return Collections.unmodifiableList(parameters);
+ }
+
+ public static Conversion createFromName(String name) {
+ switch(name.toLowerCase()) {
+ case ToIntConversion.NAME:
+ return new ToIntConversion();
+ case ToDoubleConversion.NAME:
+ return new ToDoubleConversion();
+ case MultiplyConversion.NAME:
+ return new MultiplyConversion();
+ case QuantizationConversion.NAME:
+ return new QuantizationConversion();
+ case NormalizeConversion.NAME:
+ return new NormalizeConversion();
+ case SwitchConversion.NAME:
+ return new SwitchConversion();
+ }
+ return null;
+ }
+
+ //region conversion helpers
+ public static double toDouble(Object value) {
+ if(value instanceof String) {
+ return Double.parseDouble((String)value);
+ }
+ return (double)value;
+ }
+
+ public static int toInt(Object value) {
+ return (int)toDouble(value);
+ }
+ //endregion
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ConversionAdapter$AdaptedConversion.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ConversionAdapter$AdaptedConversion.html
new file mode 100644
index 00000000..27b1526c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ConversionAdapter$AdaptedConversion.html
@@ -0,0 +1 @@
+ConversionAdapter.AdaptedConversion
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ConversionAdapter.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ConversionAdapter.html
new file mode 100644
index 00000000..e515edf6
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ConversionAdapter.html
@@ -0,0 +1 @@
+ConversionAdapter
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ConversionAdapter.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ConversionAdapter.java.html
new file mode 100644
index 00000000..5f9fc7d1
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ConversionAdapter.java.html
@@ -0,0 +1,40 @@
+ConversionAdapter.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/MultiplyConversion.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/MultiplyConversion.html
new file mode 100644
index 00000000..6751c4b6
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/MultiplyConversion.html
@@ -0,0 +1 @@
+MultiplyConversion
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/MultiplyConversion.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/MultiplyConversion.java.html
new file mode 100644
index 00000000..e98ea1e1
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/MultiplyConversion.java.html
@@ -0,0 +1,22 @@
+MultiplyConversion.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/NormalizeConversion.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/NormalizeConversion.html
new file mode 100644
index 00000000..80cbd6bd
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/NormalizeConversion.html
@@ -0,0 +1 @@
+NormalizeConversion
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/NormalizeConversion.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/NormalizeConversion.java.html
new file mode 100644
index 00000000..707e4c37
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/NormalizeConversion.java.html
@@ -0,0 +1,18 @@
+NormalizeConversion.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/QuantizationConversion.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/QuantizationConversion.html
new file mode 100644
index 00000000..885bcde0
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/QuantizationConversion.html
@@ -0,0 +1 @@
+QuantizationConversion
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/QuantizationConversion.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/QuantizationConversion.java.html
new file mode 100644
index 00000000..ffb104e9
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/QuantizationConversion.java.html
@@ -0,0 +1,42 @@
+QuantizationConversion.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/SwitchConversion.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/SwitchConversion.html
new file mode 100644
index 00000000..ab3df342
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/SwitchConversion.html
@@ -0,0 +1 @@
+SwitchConversion
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/SwitchConversion.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/SwitchConversion.java.html
new file mode 100644
index 00000000..590d5c31
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/SwitchConversion.java.html
@@ -0,0 +1,29 @@
+SwitchConversion.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ToDoubleConversion.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ToDoubleConversion.html
new file mode 100644
index 00000000..c38fde12
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ToDoubleConversion.html
@@ -0,0 +1 @@
+ToDoubleConversion
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ToDoubleConversion.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ToDoubleConversion.java.html
new file mode 100644
index 00000000..dad851a4
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ToDoubleConversion.java.html
@@ -0,0 +1,15 @@
+ToDoubleConversion.java
package codemetropolis.toolchain.mapping.conversions;
+
+import codemetropolis.toolchain.mapping.model.Limit;
+
+public class ToDoubleConversion extends Conversion {
+
+ public static final String NAME = "to_double";
+
+ @Override
+ public Object apply(Object value, Limit limit) {
+ return toDouble(value);
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ToIntConversion.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ToIntConversion.html
new file mode 100644
index 00000000..5eb998fa
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ToIntConversion.html
@@ -0,0 +1 @@
+ToIntConversion
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ToIntConversion.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ToIntConversion.java.html
new file mode 100644
index 00000000..4d5cb41d
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/ToIntConversion.java.html
@@ -0,0 +1,15 @@
+ToIntConversion.java
package codemetropolis.toolchain.mapping.conversions;
+
+import codemetropolis.toolchain.mapping.model.Limit;
+
+public class ToIntConversion extends Conversion {
+
+ public static final String NAME = "to_int";
+
+ @Override
+ public Object apply(Object value, Limit limit) {
+ return toInt(value);
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/index.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/index.html
new file mode 100644
index 00000000..6ba87e32
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.mapping.conversions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/index.source.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/index.source.html
new file mode 100644
index 00000000..819412eb
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.conversions/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.mapping.conversions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingException.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingException.html
new file mode 100644
index 00000000..79157598
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingException.html
@@ -0,0 +1 @@
+MappingException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingException.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingException.java.html
new file mode 100644
index 00000000..087825b2
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingException.java.html
@@ -0,0 +1,30 @@
+MappingException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingReaderException.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingReaderException.html
new file mode 100644
index 00000000..915aaef8
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingReaderException.html
@@ -0,0 +1 @@
+MappingReaderException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingReaderException.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingReaderException.java.html
new file mode 100644
index 00000000..685e9abf
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingReaderException.java.html
@@ -0,0 +1,28 @@
+MappingReaderException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingWriterException.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingWriterException.html
new file mode 100644
index 00000000..d76bd0c6
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingWriterException.html
@@ -0,0 +1 @@
+MappingWriterException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingWriterException.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingWriterException.java.html
new file mode 100644
index 00000000..c3fe43a5
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MappingWriterException.java.html
@@ -0,0 +1,28 @@
+MappingWriterException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MissingResourceException.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MissingResourceException.html
new file mode 100644
index 00000000..d1388ad3
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MissingResourceException.html
@@ -0,0 +1 @@
+MissingResourceException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MissingResourceException.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MissingResourceException.java.html
new file mode 100644
index 00000000..d5804043
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/MissingResourceException.java.html
@@ -0,0 +1,28 @@
+MissingResourceException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/NotSupportedLinkingException.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/NotSupportedLinkingException.html
new file mode 100644
index 00000000..c1cd209e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/NotSupportedLinkingException.html
@@ -0,0 +1 @@
+NotSupportedLinkingException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/NotSupportedLinkingException.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/NotSupportedLinkingException.java.html
new file mode 100644
index 00000000..8268fcf9
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/NotSupportedLinkingException.java.html
@@ -0,0 +1,28 @@
+NotSupportedLinkingException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/NotValidBuildableStructure.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/NotValidBuildableStructure.html
new file mode 100644
index 00000000..3465b8f0
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/NotValidBuildableStructure.html
@@ -0,0 +1 @@
+NotValidBuildableStructure
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/NotValidBuildableStructure.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/NotValidBuildableStructure.java.html
new file mode 100644
index 00000000..50689c8f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/NotValidBuildableStructure.java.html
@@ -0,0 +1,16 @@
+NotValidBuildableStructure.java
package codemetropolis.toolchain.mapping.exceptions;
+
+public class NotValidBuildableStructure extends Exception {
+
+ private static final long serialVersionUID = -2553006687770284206L;
+
+ public NotValidBuildableStructure() {
+ super();
+ }
+
+ public NotValidBuildableStructure(String message) {
+ super(message);
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/index.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/index.html
new file mode 100644
index 00000000..e9a649a9
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.mapping.exceptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/index.source.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/index.source.html
new file mode 100644
index 00000000..b6d718f6
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.exceptions/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.mapping.exceptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Binding.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Binding.html
new file mode 100644
index 00000000..716b61c6
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Binding.html
@@ -0,0 +1 @@
+Binding
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Binding.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Binding.java.html
new file mode 100644
index 00000000..e39f1678
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Binding.java.html
@@ -0,0 +1,83 @@
+Binding.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Constant.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Constant.html
new file mode 100644
index 00000000..7dd62205
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Constant.html
@@ -0,0 +1 @@
+Constant
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Constant.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Constant.java.html
new file mode 100644
index 00000000..dbee1980
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Constant.java.html
@@ -0,0 +1,42 @@
+Constant.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Limit.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Limit.html
new file mode 100644
index 00000000..b905b172
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Limit.html
@@ -0,0 +1 @@
+Limit
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Limit.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Limit.java.html
new file mode 100644
index 00000000..eb722e52
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Limit.java.html
@@ -0,0 +1,34 @@
+Limit.java
package codemetropolis.toolchain.mapping.model;
+
+public class Limit {
+
+ private double min;
+ private double max;
+ private int valueSetSize;
+
+ public Limit() {
+ this.min = Double.POSITIVE_INFINITY;
+ this.max = Double.NEGATIVE_INFINITY;
+ this.valueSetSize = 0;
+ }
+
+ public double getMax() {
+ return max;
+ }
+
+ public double getMin() {
+ return min;
+ }
+
+ public int getValueSetSize() {
+ return valueSetSize;
+ }
+
+ public void add(double value) {
+ if(value < min) min = value;
+ if(value > max) max = value;
+ ++valueSetSize;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Linking.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Linking.html
new file mode 100644
index 00000000..80e25300
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Linking.html
@@ -0,0 +1 @@
+Linking
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Linking.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Linking.java.html
new file mode 100644
index 00000000..fd612827
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Linking.java.html
@@ -0,0 +1,119 @@
+Linking.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Mapping.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Mapping.html
new file mode 100644
index 00000000..1a5373e5
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Mapping.html
@@ -0,0 +1 @@
+Mapping
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Mapping.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Mapping.java.html
new file mode 100644
index 00000000..91ae595a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Mapping.java.html
@@ -0,0 +1,143 @@
+Mapping.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Parameter.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Parameter.html
new file mode 100644
index 00000000..43432448
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Parameter.html
@@ -0,0 +1 @@
+Parameter
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Parameter.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Parameter.java.html
new file mode 100644
index 00000000..eef1699b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/Parameter.java.html
@@ -0,0 +1,42 @@
+Parameter.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/index.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/index.html
new file mode 100644
index 00000000..adff1dab
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.mapping.model
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/index.source.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/index.source.html
new file mode 100644
index 00000000..b8846e7c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.model/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.mapping.model
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.test/MappingModelTests.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.test/MappingModelTests.html
new file mode 100644
index 00000000..0d6f48b1
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.test/MappingModelTests.html
@@ -0,0 +1 @@
+MappingModelTests
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.test/MappingModelTests.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.test/MappingModelTests.java.html
new file mode 100644
index 00000000..d63e7aa4
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.test/MappingModelTests.java.html
@@ -0,0 +1,111 @@
+MappingModelTests.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.test/index.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.test/index.html
new file mode 100644
index 00000000..845e4bc4
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.test/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.mapping.test
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.test/index.source.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.test/index.source.html
new file mode 100644
index 00000000..32880fd6
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping.test/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.mapping.test
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/CommandLineOptions.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/CommandLineOptions.html
new file mode 100644
index 00000000..cb5aa489
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/CommandLineOptions.html
@@ -0,0 +1 @@
+CommandLineOptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/CommandLineOptions.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/CommandLineOptions.java.html
new file mode 100644
index 00000000..8490fb47
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/CommandLineOptions.java.html
@@ -0,0 +1,50 @@
+CommandLineOptions.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/Main.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/Main.html
new file mode 100644
index 00000000..047e4822
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/Main.html
@@ -0,0 +1 @@
+Main
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/Main.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/Main.java.html
new file mode 100644
index 00000000..5657a64c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/Main.java.html
@@ -0,0 +1,52 @@
+Main.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/MappingExecutor.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/MappingExecutor.html
new file mode 100644
index 00000000..1731e429
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/MappingExecutor.html
@@ -0,0 +1 @@
+MappingExecutor
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/MappingExecutor.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/MappingExecutor.java.html
new file mode 100644
index 00000000..136bc20b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/MappingExecutor.java.html
@@ -0,0 +1,93 @@
+MappingExecutor.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/MappingExecutorArgs.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/MappingExecutorArgs.html
new file mode 100644
index 00000000..4fa0818b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/MappingExecutorArgs.html
@@ -0,0 +1 @@
+MappingExecutorArgs
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/MappingExecutorArgs.java.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/MappingExecutorArgs.java.html
new file mode 100644
index 00000000..6881d538
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/MappingExecutorArgs.java.html
@@ -0,0 +1,43 @@
+MappingExecutorArgs.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/index.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/index.html
new file mode 100644
index 00000000..d5b351a4
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.mapping
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/index.source.html b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/index.source.html
new file mode 100644
index 00000000..33d5da81
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/codemetropolis.toolchain.mapping/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.mapping
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-mapping/src_main_java/index.html b/doc/codemetropolis-toolchain-mapping/src_main_java/index.html
new file mode 100644
index 00000000..cf1c94d2
--- /dev/null
+++ b/doc/codemetropolis-toolchain-mapping/src_main_java/index.html
@@ -0,0 +1 @@
+src/main/java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/index.html b/doc/codemetropolis-toolchain-placing/index.html
new file mode 100644
index 00000000..13eec2e8
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/index.html
@@ -0,0 +1 @@
+codemetropolis-toolchain-placing
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/LayoutException.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/LayoutException.html
new file mode 100644
index 00000000..daabf84f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/LayoutException.html
@@ -0,0 +1 @@
+LayoutException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/LayoutException.java.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/LayoutException.java.html
new file mode 100644
index 00000000..07684e21
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/LayoutException.java.html
@@ -0,0 +1,28 @@
+LayoutException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/NonExistentLayoutException.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/NonExistentLayoutException.html
new file mode 100644
index 00000000..0968713a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/NonExistentLayoutException.html
@@ -0,0 +1 @@
+NonExistentLayoutException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/NonExistentLayoutException.java.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/NonExistentLayoutException.java.html
new file mode 100644
index 00000000..e81dfcd9
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/NonExistentLayoutException.java.html
@@ -0,0 +1,28 @@
+NonExistentLayoutException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/PlacingException.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/PlacingException.html
new file mode 100644
index 00000000..8cdd3191
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/PlacingException.html
@@ -0,0 +1 @@
+PlacingException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/PlacingException.java.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/PlacingException.java.html
new file mode 100644
index 00000000..86af3788
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/PlacingException.java.html
@@ -0,0 +1,30 @@
+PlacingException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/index.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/index.html
new file mode 100644
index 00000000..f1035875
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.placing.exceptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/index.source.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/index.source.html
new file mode 100644
index 00000000..fbe43d3f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.exceptions/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.placing.exceptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/BuildableWrapper.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/BuildableWrapper.html
new file mode 100644
index 00000000..5c26245e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/BuildableWrapper.html
@@ -0,0 +1 @@
+BuildableWrapper
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/BuildableWrapper.java.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/BuildableWrapper.java.html
new file mode 100644
index 00000000..70c7a5e2
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/BuildableWrapper.java.html
@@ -0,0 +1,113 @@
+BuildableWrapper.java
package codemetropolis.toolchain.placing.layout.pack;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import codemetropolis.toolchain.commons.cmxml.Buildable;
+
+public class BuildableWrapper implements Comparable<BuildableWrapper> {
+
+ Object buildable;
+
+ public BuildableWrapper(Buildable buildable) {
+ this.buildable = buildable;
+ }
+
+ public BuildableWrapper(House buildable) {
+ this.buildable = buildable;
+ }
+
+ public Object getInnerBuildable() {
+ return buildable;
+ }
+
+ public int getPositionX() {
+ if(buildable instanceof Buildable) return ((Buildable)buildable).getPositionX();
+ if(buildable instanceof House) return ((House)buildable).getPositionX();
+ return 0;
+ }
+
+ public int getPositionZ() {
+ if(buildable instanceof Buildable) return ((Buildable)buildable).getPositionZ();
+ if(buildable instanceof House) return ((House)buildable).getPositionZ();
+ return 0;
+ }
+
+ public int getSizeX() {
+ if(buildable instanceof Buildable) return ((Buildable)buildable).getSizeX();
+ if(buildable instanceof House) return ((House)buildable).getSizeX();
+ return 0;
+ }
+
+ public int getSizeZ() {
+ if(buildable instanceof Buildable) return ((Buildable)buildable).getSizeZ();
+ if(buildable instanceof House) return ((House)buildable).getSizeZ();
+ return 0;
+ }
+
+ public void setPositionX(int x) {
+ if(buildable instanceof Buildable) ((Buildable)buildable).setPositionXR(x);
+ if(buildable instanceof House) ((House)buildable).setPositionXR(x);
+ }
+
+ public void setPositionZ(int z) {
+ if(buildable instanceof Buildable) ((Buildable)buildable).setPositionZR(z);
+ if(buildable instanceof House) ((House)buildable).setPositionZR(z);
+ }
+
+ public Buildable getParent() {
+ if(buildable instanceof Buildable) return ((Buildable)buildable).getParent();
+ if(buildable instanceof House) return ((House)buildable).getParent();
+ return null;
+ }
+
+ public List<BuildableWrapper> getChildren(Map<Buildable, List<House>> houses) {
+ List<BuildableWrapper> result = new ArrayList<BuildableWrapper>();
+ if(buildable instanceof House) return result;
+ for(Buildable c : ((Buildable)buildable).getChildren()) {
+ if(c.getType() == Buildable.Type.FLOOR || c.getType() == Buildable.Type.CELLAR) continue;
+ result.add(new BuildableWrapper(c));
+ }
+ if(houses.get((Buildable)buildable) != null) {
+ for(House h : houses.get((Buildable)buildable)) {
+ result.add(new BuildableWrapper(h));
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((buildable == null) ? 0 : buildable.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ BuildableWrapper other = (BuildableWrapper) obj;
+ if (buildable == null) {
+ if (other.buildable != null)
+ return false;
+ } else if (!buildable.equals(other.buildable))
+ return false;
+ return true;
+ }
+
+ @Override
+ public int compareTo(BuildableWrapper o) {
+ int result = this.getSizeX() - o.getSizeX();
+ return result == 0 ? this.getSizeZ() - o.getSizeZ() : result;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/House.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/House.html
new file mode 100644
index 00000000..db3ac486
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/House.html
@@ -0,0 +1 @@
+House
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/House.java.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/House.java.html
new file mode 100644
index 00000000..86d4ac79
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/House.java.html
@@ -0,0 +1,156 @@
+House.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/PackLayout.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/PackLayout.html
new file mode 100644
index 00000000..15ca1910
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/PackLayout.html
@@ -0,0 +1 @@
+PackLayout
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/PackLayout.java.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/PackLayout.java.html
new file mode 100644
index 00000000..039c5f6f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/PackLayout.java.html
@@ -0,0 +1,157 @@
+PackLayout.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/RectanglePacker$Fit.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/RectanglePacker$Fit.html
new file mode 100644
index 00000000..6baf8214
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/RectanglePacker$Fit.html
@@ -0,0 +1 @@
+RectanglePacker.Fit
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/RectanglePacker$Node.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/RectanglePacker$Node.html
new file mode 100644
index 00000000..c8d5e7e0
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/RectanglePacker$Node.html
@@ -0,0 +1 @@
+RectanglePacker.Node
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/RectanglePacker$Rectangle.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/RectanglePacker$Rectangle.html
new file mode 100644
index 00000000..25135429
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/RectanglePacker$Rectangle.html
@@ -0,0 +1 @@
+RectanglePacker.Rectangle
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/RectanglePacker.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/RectanglePacker.html
new file mode 100644
index 00000000..828b921d
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/RectanglePacker.html
@@ -0,0 +1 @@
+RectanglePacker
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/RectanglePacker.java.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/RectanglePacker.java.html
new file mode 100644
index 00000000..84299b4e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/RectanglePacker.java.html
@@ -0,0 +1,370 @@
+RectanglePacker.java
/*
+ * Copyright (c) 2007, Ryan McNally 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 name of the <ORGANIZATION> 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 COPYRIGHT OWNER 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.
+ */
+
+package codemetropolis.toolchain.placing.layout.pack;
+
+import java.util.List;
+
+/**
+ * Tries to pack rectangles as tightly as possible. An implementation of the
+ * algorithm described at http://www.blackpawn.com/texts/lightmaps/default.html
+ *
+ * @author ryanm
+ * @param <P>
+ * The type of items to be held
+ */
+public class RectanglePacker<P> {
+
+ /**
+ * Determines the outcome of a rectangle-fitting test
+ *
+ * @author ryanm
+ */
+ private static enum Fit {
+ /**
+ * Indicates that the rectangle did not fit
+ */
+ FAIL,
+ /**
+ * Indicates that the rectangle fitted perfectly
+ */
+ PERFECT,
+ /**
+ * Indicates that the rectangle fitted with room to spare
+ */
+ FIT
+ };
+
+ private Node root;
+
+ /**
+ * The border to leave around rectangles
+ */
+ private int border = 0;
+
+ /**
+ * Builds a new {@link RectanglePacker}
+ *
+ * @param width
+ * The width of the space available to pack into
+ * @param height
+ * The height of the space available to pack into
+ * @param border
+ * The border to preserve between packed items
+ */
+ public RectanglePacker(int width, int height, int border) {
+ root = new Node(new Rectangle(0, 0, width, height));
+ this.border = border;
+ }
+
+ /**
+ * Builds a list of all {@link Rectangle}s in the tree, for debugging
+ * purposes
+ *
+ * @param rectangles
+ * The list to add the tree's {@link Rectangle}s to
+ */
+ public void inspectRectangles(List<Rectangle> rectangles) {
+ root.getRectangles(rectangles);
+ }
+
+ /**
+ * Finds the {@link Rectangle} where an item is stored
+ *
+ * @param item
+ * The item to search for
+ * @return The {@link Rectangle} where that item resides, or null if not
+ * found
+ */
+ public Rectangle findRectangle(P item) {
+ return root.findRectange(item);
+ }
+
+ /**
+ * Clears the packer of all items
+ */
+ public void clear() {
+ root = new Node(root.rect);
+ }
+
+ /**
+ * Attempts to pack an item of the supplied dimensions
+ *
+ * @param width
+ * The width of the item
+ * @param height
+ * The height of the item
+ * @param o
+ * The item to pack
+ * @return The packed location, or null if it will not fit.
+ */
+ public Rectangle insert(int width, int height, P o) {
+ Node n = root.insert(width + 2 * border, height + 2 * border, o);
+
+ if (n != null) {
+ Rectangle r = new Rectangle(n.rect.x + border, n.rect.y + border,
+ n.rect.width - 2 * border, n.rect.height - 2 * border);
+ return r;
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Removes an item from the tree, consolidating the space if possible. The
+ * space can easily become fragmented, so don't rely on this to work as
+ * cleverly as you would like.
+ *
+ * @param o
+ * the item to remove
+ * @return <code>true</code> if the item was found, false otherwise
+ */
+ public boolean remove(P o) {
+ return root.remove(o);
+ }
+
+ /**
+ * Gets the width of this packer
+ *
+ * @return the width of this packer
+ */
+ public int getWidth() {
+ return root.rect.width;
+ }
+
+ /**
+ * Gets the height of this packer
+ *
+ * @return The height of this packer
+ */
+ public int getHeight() {
+ return root.rect.height;
+ }
+
+ private class Node {
+ private Rectangle rect;
+
+ private P occupier = null;
+
+ private Node left = null;
+
+ private Node right = null;
+
+ private Node(Rectangle r) {
+ this.rect = r;
+ }
+
+ private Rectangle findRectange(P item) {
+ if (isLeaf()) {
+ if (item == occupier) {
+ return rect;
+ } else {
+ return null;
+ }
+ } else {
+ Rectangle l = left.findRectange(item);
+
+ if (l != null) {
+ return l;
+ } else {
+ return right.findRectange(item);
+ }
+ }
+ }
+
+ private Node insert(int width, int height, P o) {
+ if (!isLeaf()) {
+ Node r = left.insert(width, height, o);
+
+ if (r == null) {
+ r = right.insert(width, height, o);
+ }
+
+ return r;
+ } else {
+ if (occupier != null) {
+ return null;
+ }
+
+ Fit fit = fits(width, height);
+
+ switch (fit) {
+ case FAIL:
+ return null;
+ case PERFECT:
+ occupier = o;
+ return this;
+ case FIT:
+ split(width, height);
+ break;
+ }
+
+ return left.insert(width, height, o);
+ }
+ }
+
+ private boolean isLeaf() {
+ return left == null;
+ }
+
+ /**
+ * Determines if this node contains an item, even many levels below
+ *
+ * @return <code>true</code> if this node or any of it's descendants
+ * holds an item
+ */
+ private boolean isOccupied() {
+ return occupier != null || !isLeaf();
+ }
+
+ /**
+ * Removes an item, and consolidates the tree if possible
+ *
+ * @param o
+ * the item to remove
+ * @return <code>true</code> if the item was found, <code>false</code>
+ * otherwise
+ */
+ private boolean remove(P o) {
+ if (isLeaf()) {
+ if (occupier == o) {
+ occupier = null;
+
+ return true;
+ }
+ return false;
+ } else {
+ boolean found = left.remove(o);
+ if (!found) {
+ found = right.remove(o);
+ }
+
+ if (found) {
+ if (!left.isOccupied() && !right.isOccupied()) {
+ left = null;
+ right = null;
+ }
+ }
+
+ return found;
+ }
+ }
+
+ private void split(int width, int height) {
+ int dw = rect.width - width;
+ int dh = rect.height - height;
+
+ assert dw >= 0;
+ assert dh >= 0;
+
+ Rectangle r, l;
+ if (dw > dh) {
+ l = new Rectangle(rect.x, rect.y, width, rect.height);
+
+ r = new Rectangle(l.x + width, rect.y, rect.width - width,
+ rect.height);
+ } else {
+ l = new Rectangle(rect.x, rect.y, rect.width, height);
+
+ r = new Rectangle(rect.x, l.y + height, rect.width, rect.height
+ - height);
+ }
+
+ left = new Node(l);
+ right = new Node(r);
+ }
+
+ private Fit fits(int width, int height) {
+ if (width <= rect.width && height <= rect.height) {
+ if (width == rect.width && height == rect.height) {
+ return Fit.PERFECT;
+ } else {
+ return Fit.FIT;
+ }
+ }
+
+ return Fit.FAIL;
+ }
+
+ private void getRectangles(List<Rectangle> rectangles) {
+ rectangles.add(rect);
+
+ if (!isLeaf()) {
+ left.getRectangles(rectangles);
+ right.getRectangles(rectangles);
+ }
+ }
+ }
+
+ /**
+ * Yet another Rectangle class. Only here to remove dependencies on
+ * awt/lwjgl/etc
+ *
+ * @author ryanm
+ */
+ public static class Rectangle {
+ /**
+ *
+ */
+ public final int x;
+
+ /**
+ *
+ */
+ public final int y;
+
+ /**
+ *
+ */
+ public final int width;
+
+ /**
+ *
+ */
+ public final int height;
+
+ private Rectangle(int x, int y, int width, int height) {
+ this.x = x;
+ this.y = y;
+ this.width = width;
+ this.height = height;
+ }
+
+ private Rectangle(Rectangle r) {
+ this.x = r.x;
+ this.y = r.y;
+ this.width = r.width;
+ this.height = r.height;
+ }
+
+ @Override
+ public String toString() {
+ return "[ " + x + ", " + y + ", " + width + ", " + height + " ]";
+ }
+ }
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/index.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/index.html
new file mode 100644
index 00000000..ef37c2ae
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.placing.layout.pack
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/index.source.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/index.source.html
new file mode 100644
index 00000000..20eeb11a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.pack/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.placing.layout.pack
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/House.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/House.html
new file mode 100644
index 00000000..0495a3c0
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/House.html
@@ -0,0 +1 @@
+House
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/House.java.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/House.java.html
new file mode 100644
index 00000000..1ff9c906
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/House.java.html
@@ -0,0 +1,116 @@
+House.java
package codemetropolis.toolchain.placing.layout.tetris;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import codemetropolis.toolchain.commons.cmxml.Buildable;
+import codemetropolis.toolchain.commons.cmxml.Buildable.Type;
+
+public class House {
+
+ private final int maxHeight;
+ private final int minHeight;
+
+ private List<Buildable> floorsAndCellars = new ArrayList<>();
+ private Buildable top = null;
+ private Buildable bottom = null;
+
+ public House(int minHeight, int maxHeight) {
+ this.minHeight = minHeight;
+ this.maxHeight = maxHeight;
+ }
+
+ public boolean addFloor(Buildable b) {
+ if(b.getType() != Type.FLOOR)
+ return false;
+ if(top != null) {
+ if(
+ getHeight() + b.getSizeY() > maxHeight ||
+ b.getSizeX() > getSizeX() ||
+ b.getSizeZ() > getSizeZ())
+ return false;
+
+ b.setPositionY(getHeight());
+ } else {
+ bottom = b;
+ b.setPositionY(b.getParent().getPositionY() + 1);
+ }
+ top = b;
+ floorsAndCellars.add(b);
+ setSizeOfContainingBuildables(b);
+ return true;
+ }
+
+ private void setSizeOfContainingBuildables(Buildable b) {
+ Buildable parent = b.getParent();
+ while(parent != null) {
+ if(getHeight() - parent.getPositionY() + 1 > parent.getSizeY()) {
+ parent.setSizeY(getHeight() - parent.getPositionY() + 1);
+ parent = parent.getParent();
+ } else {
+ break;
+ }
+ }
+ }
+
+ public boolean addCellar(Buildable b) {
+ if(b.getType() != Type.CELLAR)
+ return false;
+ if(bottom != null) {
+ if(
+ getDepth() - b.getSizeY() < minHeight ||
+ b.getSizeX() > getSizeX() ||
+ b.getSizeZ() > getSizeZ())
+ return false;
+
+ b.setPositionY(getDepth() - b.getSizeY());
+ } else {
+ top = b;
+ b.setPositionY(b.getParent().getPositionY() - b.getSizeY());
+ }
+ bottom = b;
+ floorsAndCellars.add(b);
+
+ return true;
+ }
+
+ public List<Buildable> getFloorsAndCellars() {
+ return new ArrayList<>(floorsAndCellars);
+ }
+
+ public Buildable getTop() {
+ return top;
+ }
+
+ public Buildable getBottom() {
+ return bottom;
+ }
+
+ public int getSizeX() {
+ int max = 0;
+ for(Buildable b : floorsAndCellars)
+ if(b.getSizeX() > max) max = b.getSizeX();
+ return max;
+ }
+
+ public int getSizeY() {
+ return top.getPositionY() + top.getSizeY();
+ }
+
+ public int getSizeZ() {
+ int max = 0;
+ for(Buildable b : floorsAndCellars)
+ if(b.getSizeZ() > max) max = b.getSizeZ();
+ return max;
+ }
+
+ public int getHeight() {
+ return getSizeY();
+ }
+
+ public int getDepth() {
+ return bottom.getPositionY();
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/TetrisLayout.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/TetrisLayout.html
new file mode 100644
index 00000000..b8a4de33
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/TetrisLayout.html
@@ -0,0 +1 @@
+TetrisLayout
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/TetrisLayout.java.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/TetrisLayout.java.html
new file mode 100644
index 00000000..a0a5790e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/TetrisLayout.java.html
@@ -0,0 +1,312 @@
+TetrisLayout.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/index.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/index.html
new file mode 100644
index 00000000..787191e9
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.placing.layout.tetris
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/index.source.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/index.source.html
new file mode 100644
index 00000000..29ca1f1c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout.tetris/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.placing.layout.tetris
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/Layout.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/Layout.html
new file mode 100644
index 00000000..1c6cd972
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/Layout.html
@@ -0,0 +1 @@
+Layout
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/Layout.java.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/Layout.java.html
new file mode 100644
index 00000000..5f6582c3
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/Layout.java.html
@@ -0,0 +1,33 @@
+Layout.java
package codemetropolis.toolchain.placing.layout;
+
+import codemetropolis.toolchain.commons.cmxml.BuildableTree;
+import codemetropolis.toolchain.placing.exceptions.LayoutException;
+import codemetropolis.toolchain.placing.exceptions.NonExistentLayoutException;
+import codemetropolis.toolchain.placing.layout.pack.PackLayout;
+//import codemetropolis.toolchain.placing.layout.tetris.TetrisLayout;
+
+public abstract class Layout {
+
+ protected static final int GROUND_LEVEL = 60;
+ protected static final int MIN_HEIGHT = 10;
+ protected static final int MAX_HEIGHT = 200;
+
+ public static Layout parse(String algorithm) throws NonExistentLayoutException {
+ try{
+ switch(LayoutAlgorithm.valueOf(algorithm.toUpperCase())) {
+ case PACK:
+ return new PackLayout();
+ //TODO tetris layout is out of date and needs to be updated
+ //case TETRIS:
+ // return new TetrisLayout();
+ }
+ } catch (IllegalArgumentException e) {
+ throw new NonExistentLayoutException(algorithm);
+ }
+ return null;
+ }
+
+ public abstract void apply(BuildableTree buildables) throws LayoutException;
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/LayoutAlgorithm.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/LayoutAlgorithm.html
new file mode 100644
index 00000000..7bca420a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/LayoutAlgorithm.html
@@ -0,0 +1 @@
+LayoutAlgorithm
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/LayoutAlgorithm.java.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/LayoutAlgorithm.java.html
new file mode 100644
index 00000000..cf396051
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/LayoutAlgorithm.java.html
@@ -0,0 +1,7 @@
+LayoutAlgorithm.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/index.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/index.html
new file mode 100644
index 00000000..c5e57f1e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.placing.layout
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/index.source.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/index.source.html
new file mode 100644
index 00000000..4ee04b70
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing.layout/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.placing.layout
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CityMapGUI$1.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CityMapGUI$1.html
new file mode 100644
index 00000000..06e66744
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CityMapGUI$1.html
@@ -0,0 +1 @@
+CityMapGUI.new WindowAdapter() {...}
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CityMapGUI$CityMapCanvas.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CityMapGUI$CityMapCanvas.html
new file mode 100644
index 00000000..4b5d5746
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CityMapGUI$CityMapCanvas.html
@@ -0,0 +1 @@
+CityMapGUI.CityMapCanvas
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CityMapGUI.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CityMapGUI.html
new file mode 100644
index 00000000..aea4d6b6
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CityMapGUI.html
@@ -0,0 +1 @@
+CityMapGUI
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CityMapGUI.java.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CityMapGUI.java.html
new file mode 100644
index 00000000..4156eef2
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CityMapGUI.java.html
@@ -0,0 +1,105 @@
+CityMapGUI.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CommandLineOptions.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CommandLineOptions.html
new file mode 100644
index 00000000..b2bc8366
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CommandLineOptions.html
@@ -0,0 +1 @@
+CommandLineOptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CommandLineOptions.java.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CommandLineOptions.java.html
new file mode 100644
index 00000000..d5d5227e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/CommandLineOptions.java.html
@@ -0,0 +1,43 @@
+CommandLineOptions.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/Main.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/Main.html
new file mode 100644
index 00000000..dc9362cb
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/Main.html
@@ -0,0 +1 @@
+Main
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/Main.java.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/Main.java.html
new file mode 100644
index 00000000..d3117e61
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/Main.java.html
@@ -0,0 +1,51 @@
+Main.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/PlacingExecutor$1.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/PlacingExecutor$1.html
new file mode 100644
index 00000000..0d5ccfe7
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/PlacingExecutor$1.html
@@ -0,0 +1 @@
+PlacingExecutor.new Runnable() {...}
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/PlacingExecutor.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/PlacingExecutor.html
new file mode 100644
index 00000000..edab0635
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/PlacingExecutor.html
@@ -0,0 +1 @@
+PlacingExecutor
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/PlacingExecutor.java.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/PlacingExecutor.java.html
new file mode 100644
index 00000000..fc5dba4b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/PlacingExecutor.java.html
@@ -0,0 +1,83 @@
+PlacingExecutor.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/PlacingExecutorArgs.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/PlacingExecutorArgs.html
new file mode 100644
index 00000000..463c9575
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/PlacingExecutorArgs.html
@@ -0,0 +1 @@
+PlacingExecutorArgs
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/PlacingExecutorArgs.java.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/PlacingExecutorArgs.java.html
new file mode 100644
index 00000000..a55ab30a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/PlacingExecutorArgs.java.html
@@ -0,0 +1,41 @@
+PlacingExecutorArgs.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/index.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/index.html
new file mode 100644
index 00000000..f97be684
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.placing
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/index.source.html b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/index.source.html
new file mode 100644
index 00000000..af325008
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/codemetropolis.toolchain.placing/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.placing
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-placing/src_main_java/index.html b/doc/codemetropolis-toolchain-placing/src_main_java/index.html
new file mode 100644
index 00000000..27b097e0
--- /dev/null
+++ b/doc/codemetropolis-toolchain-placing/src_main_java/index.html
@@ -0,0 +1 @@
+src/main/java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/index.html b/doc/codemetropolis-toolchain-rendering/index.html
new file mode 100644
index 00000000..b6691a4e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/index.html
@@ -0,0 +1 @@
+codemetropolis-toolchain-rendering
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/BuildPhase.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/BuildPhase.html
new file mode 100644
index 00000000..66c7c2bc
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/BuildPhase.html
@@ -0,0 +1 @@
+BuildPhase
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/BuildPhase.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/BuildPhase.java.html
new file mode 100644
index 00000000..c85e9b35
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/BuildPhase.java.html
@@ -0,0 +1,8 @@
+BuildPhase.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/WorldBuilder.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/WorldBuilder.html
new file mode 100644
index 00000000..12bdc926
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/WorldBuilder.html
@@ -0,0 +1 @@
+WorldBuilder
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/WorldBuilder.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/WorldBuilder.java.html
new file mode 100644
index 00000000..e88f5b1a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/WorldBuilder.java.html
@@ -0,0 +1,170 @@
+WorldBuilder.java
package codemetropolis.toolchain.rendering.control;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.EventListener;
+import java.util.List;
+
+import org.apache.commons.lang3.time.StopWatch;
+
+import codemetropolis.blockmodifier.World;
+import codemetropolis.toolchain.commons.cmxml.Buildable;
+import codemetropolis.toolchain.commons.cmxml.BuildableTree;
+import codemetropolis.toolchain.commons.cmxml.exceptions.CmxmlReaderException;
+import codemetropolis.toolchain.rendering.events.ProgressEvent;
+import codemetropolis.toolchain.rendering.events.ProgressEventListener;
+import codemetropolis.toolchain.rendering.exceptions.BuildingTypeMismatchException;
+import codemetropolis.toolchain.rendering.exceptions.RenderingException;
+import codemetropolis.toolchain.rendering.exceptions.TooLongRenderDurationException;
+import codemetropolis.toolchain.rendering.model.building.*;
+import codemetropolis.toolchain.rendering.model.primitive.Boxel;
+
+public class WorldBuilder {
+
+ private static final int GROUND_LEVEL = 60;
+
+ private World world;
+ private List<Building> buildings = new ArrayList<Building>();
+ private StopWatch stopWatch = new StopWatch();
+
+ private int count = 0;
+ private int total = 0;
+
+ public WorldBuilder(String worldPath) {
+ world = new World(worldPath, GROUND_LEVEL);
+ }
+
+ public void createBuildings(String inputPath) throws BuildingTypeMismatchException{
+ BuildableTree buildables = new BuildableTree();
+ try {
+ buildables.loadFromFile(inputPath);
+ } catch (CmxmlReaderException e) {
+ e.printStackTrace();
+ return;
+ }
+
+ List<Floor> floors = new ArrayList<Floor>();
+ List<Cellar> cellars = new ArrayList<Cellar>();
+ List<Garden> gardens = new ArrayList<Garden>();
+ List<Ground> grounds = new ArrayList<Ground>();
+
+ for(Buildable b : buildables.getBuildables()) {
+ switch(b.getType()) {
+ case FLOOR:
+ Floor floor = new Floor(b);
+ floors.add(floor);
+ total += floor.getNumberOfBlocks();
+ break;
+ case CELLAR:
+ Cellar cellar = new Cellar(b);
+ cellars.add(cellar);
+ total += cellar.getNumberOfBlocks();
+ break;
+ case GARDEN:
+ Garden garden = new Garden(b);
+ gardens.add(garden);
+ total += garden.getNumberOfBlocks();
+ break;
+ case GROUND:
+ Ground ground = new Ground(b);
+ grounds.add(ground);
+ total += ground.getNumberOfBlocks();
+ break;
+ case CONTAINER:
+ break;
+ }
+ }
+
+ buildings.addAll(grounds);
+ buildings.addAll(gardens);
+ buildings.addAll(cellars);
+ buildings.addAll(floors);
+
+ raiseProgressEvent(BuildPhase.READING_INPUT_FILE, 1, 1, -1);
+ }
+
+ public void createBlocks(File directory, int maxTime) throws TooLongRenderDurationException {
+ raiseProgressEvent(BuildPhase.GENERATING_BLOCKS, 0, total, 0);
+ stopWatch.reset();
+ stopWatch.start();
+ for(Building b : buildings) {
+ count += b.toCSVFile(directory);
+ long timeElapsed = stopWatch.getTime();
+ int timeLeftInMinutes = (int) ((double)timeElapsed / count * (total - count)) / (1000 * 60);
+ if(timeLeftInMinutes > maxTime) throw new TooLongRenderDurationException(timeLeftInMinutes, maxTime);
+ raiseProgressEvent(BuildPhase.GENERATING_BLOCKS, count, total, timeElapsed);
+ }
+ stopWatch.stop();
+ }
+
+ public void build(File sourceDirectory) throws RenderingException {
+
+ if(!sourceDirectory.exists()) {
+ return;
+ }
+
+ raiseProgressEvent(BuildPhase.PLACING_BLOCKS, 0, total, 0);
+ count = 0;
+ stopWatch.reset();
+ stopWatch.start();
+
+ for(File f : sourceDirectory.listFiles()) {
+ if(f.getName().matches("blocks\\.-?[0-9]*\\.-?[0-9]*.csv")) {
+ try(BufferedReader reader = new BufferedReader(new FileReader(f))) {
+ String blockString = reader.readLine();
+ while(blockString != null) {
+ Boxel boxel = Boxel.parseCSV(blockString);
+ boxel.render(world);
+ count++;
+ blockString = reader.readLine();
+ }
+ } catch (IOException e) {
+ throw new RenderingException(e);
+ }
+ }
+ long timeSpent = stopWatch.getTime();
+ raiseProgressEvent(BuildPhase.PLACING_BLOCKS, count, total, timeSpent);
+ }
+
+ world.finish();
+ stopWatch.stop();
+ raiseProgressEvent(BuildPhase.PLACING_BLOCKS, total, total, stopWatch.getTime());
+ }
+
+ public int getNumberOfBuildings() {
+ return buildings.size();
+ }
+
+ public int getNumberOfBlocks() {
+ return total;
+ }
+
+ public long getTimeElapsedDuringLastPhase() {
+ return stopWatch.getTime();
+ }
+
+ //region PROGRESS EVENT
+ private List<EventListener> listeners = new ArrayList<EventListener>();
+
+ public synchronized void addEventListener(ProgressEventListener listener) {
+ listeners.add(listener);
+ }
+
+ public synchronized void removeEventListener(ProgressEventListener listener) {
+ listeners.remove(listener);
+ }
+
+ private synchronized void raiseProgressEvent(BuildPhase phase, long count, long total, long timeElapsedInMillis) {
+ ProgressEvent event = new ProgressEvent(this, phase, count, total, timeElapsedInMillis);
+
+ for(EventListener listener : listeners) {
+ ((ProgressEventListener) listener).onNextState(event);
+ }
+ }
+ //endregion
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/index.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/index.html
new file mode 100644
index 00000000..525ded01
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering.control
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/index.source.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/index.source.html
new file mode 100644
index 00000000..3af72270
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.control/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering.control
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.events/ProgressEvent.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.events/ProgressEvent.html
new file mode 100644
index 00000000..b944533a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.events/ProgressEvent.html
@@ -0,0 +1 @@
+ProgressEvent
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.events/ProgressEvent.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.events/ProgressEvent.java.html
new file mode 100644
index 00000000..b3aa21e5
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.events/ProgressEvent.java.html
@@ -0,0 +1,38 @@
+ProgressEvent.java
package codemetropolis.toolchain.rendering.events;
+
+import java.util.EventObject;
+
+import codemetropolis.toolchain.commons.util.Time;
+import codemetropolis.toolchain.rendering.control.BuildPhase;
+
+public class ProgressEvent extends EventObject {
+
+ private static final long serialVersionUID = 1L;
+
+ public final BuildPhase PHASE;
+ public final long COUNT;
+ public final long TOTAL;
+ public final long TIME_ELAPSED_IN_MILLIS;
+
+ public ProgressEvent(Object source, BuildPhase phase, long count, long total, long timeElapsedInMillis) {
+ super(source);
+ this.PHASE = phase;
+ this.COUNT = count;
+ this.TOTAL = total;
+ this.TIME_ELAPSED_IN_MILLIS = timeElapsedInMillis;
+ }
+
+ public double getPercent() {
+ return (double)COUNT / TOTAL * 100;
+ }
+
+ public long getTimeLeftInMillis() {
+ return (long) ((double)TIME_ELAPSED_IN_MILLIS / COUNT * (TOTAL - COUNT));
+ }
+
+ public Time getTimeLeft() {
+ return new Time(getTimeLeftInMillis());
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.events/index.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.events/index.html
new file mode 100644
index 00000000..599c0a83
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.events/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering.events
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.events/index.source.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.events/index.source.html
new file mode 100644
index 00000000..fa2c802c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.events/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering.events
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/BuildingTypeMismatchException.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/BuildingTypeMismatchException.html
new file mode 100644
index 00000000..86b0ea71
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/BuildingTypeMismatchException.html
@@ -0,0 +1 @@
+BuildingTypeMismatchException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/BuildingTypeMismatchException.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/BuildingTypeMismatchException.java.html
new file mode 100644
index 00000000..f7094104
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/BuildingTypeMismatchException.java.html
@@ -0,0 +1,35 @@
+BuildingTypeMismatchException.java
package codemetropolis.toolchain.rendering.exceptions;
+
+import codemetropolis.toolchain.commons.cmxml.Buildable.Type;
+import codemetropolis.toolchain.rendering.model.building.Building;
+
+public class BuildingTypeMismatchException extends RenderingException {
+
+ private static final long serialVersionUID = 3337855398912743115L;
+
+ public BuildingTypeMismatchException() {
+ super();
+ }
+
+ public BuildingTypeMismatchException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+ super(message, cause, enableSuppression, writableStackTrace);
+ }
+
+ public BuildingTypeMismatchException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public BuildingTypeMismatchException(String message) {
+ super(message);
+ }
+
+ public BuildingTypeMismatchException(Throwable cause) {
+ super(cause);
+ }
+
+ public BuildingTypeMismatchException(Type buildableType, Class<? extends Building> buildingType) {
+ this(String.format("Buildable of type '%s' cannot be converted to '%s'", buildableType.name(), buildingType.getName()));
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/RenderingException.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/RenderingException.html
new file mode 100644
index 00000000..10445e1a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/RenderingException.html
@@ -0,0 +1 @@
+RenderingException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/RenderingException.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/RenderingException.java.html
new file mode 100644
index 00000000..e7cbfc31
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/RenderingException.java.html
@@ -0,0 +1,30 @@
+RenderingException.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/TooLongRenderDurationException.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/TooLongRenderDurationException.html
new file mode 100644
index 00000000..5727e01c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/TooLongRenderDurationException.html
@@ -0,0 +1 @@
+TooLongRenderDurationException
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/TooLongRenderDurationException.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/TooLongRenderDurationException.java.html
new file mode 100644
index 00000000..1026dc09
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/TooLongRenderDurationException.java.html
@@ -0,0 +1,25 @@
+TooLongRenderDurationException.java
package codemetropolis.toolchain.rendering.exceptions;
+
+public class TooLongRenderDurationException extends RenderingException {
+
+ private static final long serialVersionUID = -7647174616882103244L;
+
+ private int estimatedTime;
+ private int maxTime;
+
+ public TooLongRenderDurationException(int estimatedTime, int maxTime) {
+ super();
+ this.estimatedTime = estimatedTime;
+ this.maxTime = maxTime;
+ }
+
+ public int getEstimatedTime() {
+ return estimatedTime;
+ }
+
+ public int getMaxTime() {
+ return maxTime;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/index.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/index.html
new file mode 100644
index 00000000..a7577762
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering.exceptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/index.source.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/index.source.html
new file mode 100644
index 00000000..53dbde16
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.exceptions/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering.exceptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Building.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Building.html
new file mode 100644
index 00000000..5c5dc272
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Building.html
@@ -0,0 +1 @@
+Building
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Building.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Building.java.html
new file mode 100644
index 00000000..922fa25a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Building.java.html
@@ -0,0 +1,85 @@
+Building.java
package codemetropolis.toolchain.rendering.model.building;
+
+import java.io.File;
+import java.util.LinkedList;
+
+import codemetropolis.toolchain.commons.cmxml.Buildable;
+import codemetropolis.toolchain.commons.cmxml.Point;
+import codemetropolis.toolchain.rendering.model.primitive.Primitive;
+import codemetropolis.toolchain.rendering.model.primitive.SignPost;
+
+public class Building {
+
+ private static final int MIN_SIZE = 9;
+
+ protected LinkedList<Primitive> primitives = new LinkedList<Primitive>();
+ protected LinkedList<SignPost> signs = new LinkedList<SignPost>();
+ protected Buildable innerBuildable;
+
+ protected Point position;
+ protected Point center;
+ protected Point size;
+
+ public Building( Buildable innerBuildable )
+ {
+ this.innerBuildable = innerBuildable;
+
+ size = new Point(
+ adjustSize(innerBuildable.getSizeX()),
+ adjustSize(innerBuildable.getSizeY()),
+ adjustSize(innerBuildable.getSizeZ())
+ );
+
+ position = new Point(
+ innerBuildable.getPositionX(),
+ innerBuildable.getPositionY(),
+ innerBuildable.getPositionZ()
+ );
+
+ center = new Point(
+ (int)(size.getX() * 0.5),
+ (int)(size.getY() * 0.5),
+ (int)(size.getZ() * 0.5)
+ );
+ }
+
+ private static int adjustSize( int x ) {
+ if(x < MIN_SIZE) return MIN_SIZE;
+ if(x % 2 == 0) return x + 1;
+ return x;
+ }
+
+ public int toCSVFile(File directory) {
+ int count = 0;
+ for(Primitive primitive : primitives) {
+ primitive.toCSVFile(directory);
+ count += primitive.getNumberOfBlocks();
+ }
+ return count;
+ }
+
+ public Buildable getInnerBuildable() {
+ return innerBuildable;
+ }
+
+ public Point getPosition() {
+ return position;
+ }
+
+ public Point getCenter() {
+ return center;
+ }
+
+ public Point getSize() {
+ return size;
+ }
+
+ public int getNumberOfBlocks() {
+ int result = 0;
+ for(Primitive p : primitives)
+ result += p.getNumberOfBlocks();
+ return result;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Cellar.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Cellar.html
new file mode 100644
index 00000000..5aea0536
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Cellar.html
@@ -0,0 +1 @@
+Cellar
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Cellar.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Cellar.java.html
new file mode 100644
index 00000000..48ec7220
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Cellar.java.html
@@ -0,0 +1,39 @@
+Cellar.java
package codemetropolis.toolchain.rendering.model.building;
+
+import codemetropolis.toolchain.commons.cmxml.Buildable;
+import codemetropolis.toolchain.commons.cmxml.Buildable.Type;
+import codemetropolis.toolchain.commons.cmxml.Point;
+import codemetropolis.toolchain.rendering.exceptions.BuildingTypeMismatchException;
+import codemetropolis.toolchain.rendering.model.BasicBlock;
+import codemetropolis.toolchain.rendering.model.pattern.RepeationPattern;
+import codemetropolis.toolchain.rendering.model.primitive.SolidBox;
+import codemetropolis.toolchain.rendering.util.Orientation;
+
+public class Cellar extends Floor {
+
+ public Cellar(Buildable innerBuildable) throws BuildingTypeMismatchException {
+ super(innerBuildable);
+
+ if ( innerBuildable.getType() != Type.CELLAR )
+ throw new BuildingTypeMismatchException(innerBuildable.getType(), getClass());
+
+ primitives.add(
+ 0,
+ new SolidBox(
+ position.translate( new Point( 1, 1, 1 ) ),
+ size.translate( new Point( -2, -2, -2 ) ),
+ new RepeationPattern( new BasicBlock[][][] { { { new BasicBlock( "minecraft:air" ) } } } ),
+ new RepeationPattern( new BasicBlock[][][] { { { new BasicBlock( "minecraft:air" ) } } } ),
+ Orientation.NearX ) );
+
+ primitives.add(
+ new SolidBox(
+ position.translate( new Point( center.getX() - 3, size.getY() + 1, center.getZ() - 3 ) ),
+ new Point( 7, 1, 7 ),
+ new RepeationPattern( new BasicBlock[][][] { { { new BasicBlock( "minecraft:air" ) } } } ),
+ new RepeationPattern( new BasicBlock[][][] { { { new BasicBlock( "minecraft:air" ) } } } ),
+ Orientation.NearX ) );
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Floor.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Floor.html
new file mode 100644
index 00000000..3195b4f6
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Floor.html
@@ -0,0 +1 @@
+Floor
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Floor.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Floor.java.html
new file mode 100644
index 00000000..badb188f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Floor.java.html
@@ -0,0 +1,347 @@
+Floor.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Garden.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Garden.html
new file mode 100644
index 00000000..b13d7ed9
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Garden.html
@@ -0,0 +1 @@
+Garden
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Garden.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Garden.java.html
new file mode 100644
index 00000000..a1cdefb0
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Garden.java.html
@@ -0,0 +1,149 @@
+Garden.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Ground.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Ground.html
new file mode 100644
index 00000000..31c52879
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Ground.html
@@ -0,0 +1 @@
+Ground
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Ground.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Ground.java.html
new file mode 100644
index 00000000..8a6f3e76
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/Ground.java.html
@@ -0,0 +1,43 @@
+Ground.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/index.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/index.html
new file mode 100644
index 00000000..e4355cf8
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering.model.building
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/index.source.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/index.source.html
new file mode 100644
index 00000000..f201c61d
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.building/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering.model.building
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/RandomPattern.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/RandomPattern.html
new file mode 100644
index 00000000..497d68aa
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/RandomPattern.html
@@ -0,0 +1 @@
+RandomPattern
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/RandomPattern.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/RandomPattern.java.html
new file mode 100644
index 00000000..5b6f9bfc
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/RandomPattern.java.html
@@ -0,0 +1,44 @@
+RandomPattern.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/RepeationPattern.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/RepeationPattern.html
new file mode 100644
index 00000000..c3b5639b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/RepeationPattern.html
@@ -0,0 +1 @@
+RepeationPattern
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/RepeationPattern.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/RepeationPattern.java.html
new file mode 100644
index 00000000..011a9583
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/RepeationPattern.java.html
@@ -0,0 +1,30 @@
+RepeationPattern.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/SplitPattern.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/SplitPattern.html
new file mode 100644
index 00000000..abacdca6
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/SplitPattern.html
@@ -0,0 +1 @@
+SplitPattern
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/SplitPattern.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/SplitPattern.java.html
new file mode 100644
index 00000000..db35a85a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/SplitPattern.java.html
@@ -0,0 +1,35 @@
+SplitPattern.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/XSplitPattern.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/XSplitPattern.html
new file mode 100644
index 00000000..54baaa4e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/XSplitPattern.html
@@ -0,0 +1 @@
+XSplitPattern
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/XSplitPattern.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/XSplitPattern.java.html
new file mode 100644
index 00000000..e3d384ca
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/XSplitPattern.java.html
@@ -0,0 +1,22 @@
+XSplitPattern.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/YSplitPattern.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/YSplitPattern.html
new file mode 100644
index 00000000..3c379441
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/YSplitPattern.html
@@ -0,0 +1 @@
+YSplitPattern
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/YSplitPattern.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/YSplitPattern.java.html
new file mode 100644
index 00000000..e98d00aa
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/YSplitPattern.java.html
@@ -0,0 +1,22 @@
+YSplitPattern.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/ZSplitPattern.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/ZSplitPattern.html
new file mode 100644
index 00000000..d1b9caf8
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/ZSplitPattern.html
@@ -0,0 +1 @@
+ZSplitPattern
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/ZSplitPattern.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/ZSplitPattern.java.html
new file mode 100644
index 00000000..4c93a682
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/ZSplitPattern.java.html
@@ -0,0 +1,22 @@
+ZSplitPattern.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/index.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/index.html
new file mode 100644
index 00000000..53f236f1
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering.model.pattern
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/index.source.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/index.source.html
new file mode 100644
index 00000000..470a363f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.pattern/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering.model.pattern
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Banner$Orientation.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Banner$Orientation.html
new file mode 100644
index 00000000..4984c0ce
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Banner$Orientation.html
@@ -0,0 +1 @@
+Banner.Orientation
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Banner.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Banner.html
new file mode 100644
index 00000000..6535c82e
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Banner.html
@@ -0,0 +1 @@
+Banner
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Banner.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Banner.java.html
new file mode 100644
index 00000000..efcfc9fa
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Banner.java.html
@@ -0,0 +1,53 @@
+Banner.java
package codemetropolis.toolchain.rendering.model.primitive;
+
+import java.io.File;
+
+import codemetropolis.toolchain.commons.cmxml.Point;
+import codemetropolis.toolchain.rendering.model.BasicBlock;
+
+public class Banner implements Primitive {
+
+ public enum Orientation {
+ SOUTH(0),
+ SOUTHWEST(2),
+ WEST(4),
+ NORTHWEST(6),
+ NORTH(8),
+ NORTHEAST(10),
+ EAST(12),
+ SOUTHEAST(14);
+
+ private final int value;
+
+ Orientation(int v) {
+ value = v;
+ }
+
+ public int getValue() {
+ return value;
+ }
+ }
+
+ private Point position;
+ private Orientation orientation;
+ private String color;
+
+ public Banner(int x, int y, int z, Orientation orientation, String color) {
+ super();
+ this.position = new Point(x, y, z);
+ this.orientation = orientation;
+ this.color = color;
+ }
+
+ @Override
+ public int toCSVFile(File directory) {
+ new Boxel(new BasicBlock((short) 176, orientation.getValue()), position, color).toCSVFile(directory);
+ return 1;
+ }
+ @Override
+ public int getNumberOfBlocks() {
+ return 1;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Boxel.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Boxel.html
new file mode 100644
index 00000000..b12c806f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Boxel.html
@@ -0,0 +1 @@
+Boxel
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Boxel.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Boxel.java.html
new file mode 100644
index 00000000..e8272fee
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Boxel.java.html
@@ -0,0 +1,95 @@
+Boxel.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Door$Orientation.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Door$Orientation.html
new file mode 100644
index 00000000..fde311ce
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Door$Orientation.html
@@ -0,0 +1 @@
+Door.Orientation
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Door.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Door.html
new file mode 100644
index 00000000..2156d101
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Door.html
@@ -0,0 +1 @@
+Door
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Door.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Door.java.html
new file mode 100644
index 00000000..a5761d7f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Door.java.html
@@ -0,0 +1,48 @@
+Door.java
package codemetropolis.toolchain.rendering.model.primitive;
+
+import java.io.File;
+
+import codemetropolis.toolchain.commons.cmxml.Point;
+import codemetropolis.toolchain.rendering.model.BasicBlock;
+
+public class Door implements Primitive {
+
+ public enum Orientation {
+ NORTH(1),
+ SOUTH(3),
+ WEST(0),
+ EAST(2);
+
+ private final int value;
+
+ Orientation(int v) {
+ value = v;
+ }
+
+ public int getValue() {
+ return value;
+ }
+ }
+
+ private Point position;
+ private Orientation orientation;
+
+ public Door(int x, int y, int z, Orientation orientation) {
+ super();
+ this.position = new Point(x, y, z);
+ this.orientation = orientation;
+ }
+
+ @Override
+ public int toCSVFile(File directory) {
+ new Boxel(new BasicBlock((short) 64, orientation.getValue()), position).toCSVFile(directory);
+ new Boxel(new BasicBlock((short) 64, 8), new Point(position.getX(), position.getY() + 1, position.getZ())).toCSVFile(directory);
+ return 2;
+ }
+ @Override
+ public int getNumberOfBlocks() {
+ return 2;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/EmptyBox.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/EmptyBox.html
new file mode 100644
index 00000000..5f72ab06
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/EmptyBox.html
@@ -0,0 +1 @@
+EmptyBox
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/EmptyBox.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/EmptyBox.java.html
new file mode 100644
index 00000000..1476c312
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/EmptyBox.java.html
@@ -0,0 +1,107 @@
+EmptyBox.java
package codemetropolis.toolchain.rendering.model.primitive;
+
+import java.io.File;
+import java.util.LinkedList;
+
+import codemetropolis.toolchain.commons.cmxml.Point;
+import codemetropolis.toolchain.rendering.model.pattern.Pattern;
+import codemetropolis.toolchain.rendering.util.Orientation;
+
+public class EmptyBox implements Primitive {
+
+ private LinkedList<SolidBox> sides = new LinkedList<SolidBox>( );
+
+ private Point nearSideWitdth;
+ private Point farSideWitdth;
+ private Point basePoint;
+ private Point size;
+
+ public EmptyBox(Point basePoint, Point size, Pattern bottomFill, Pattern topFill, Pattern sideFill, Pattern stroke, Point nearSideWitdth, Point farSideWitdth ) {
+ super();
+ this.nearSideWitdth = nearSideWitdth;
+ this.farSideWitdth = farSideWitdth;
+ this.basePoint = basePoint;
+ this.size = size;
+
+ sides.add(
+ new SolidBox(
+ new Point( basePoint.getX(), basePoint.getY(), basePoint.getZ() ),
+ new Point( nearSideWitdth.getX(), size.getY(), size.getZ() ),
+ sideFill,
+ stroke,
+ Orientation.NearX )
+ );
+ sides.add(
+ new SolidBox(
+ new Point( basePoint.getX() + size.getX()-1, basePoint.getY(), basePoint.getZ() ),
+ new Point( farSideWitdth.getX(), size.getY(), size.getZ() ),
+ sideFill,
+ stroke,
+ Orientation.FarX )
+ );
+
+ sides.add(
+ new SolidBox(
+ new Point( basePoint.getX(), basePoint.getY(), basePoint.getZ() ),
+ new Point( size.getX(), size.getY(), nearSideWitdth.getZ() ),
+ sideFill,
+ stroke,
+ Orientation.NearZ )
+ );
+ sides.add(
+ new SolidBox(
+ new Point( basePoint.getX(), basePoint.getY(), basePoint.getZ() + size.getZ() - 1 ),
+ new Point( size.getX(), size.getY(), farSideWitdth.getZ() ),
+ sideFill,
+ stroke,
+ Orientation.FarZ )
+ );
+
+ sides.add(
+ new SolidBox(
+ new Point( basePoint.getX(), basePoint.getY(), basePoint.getZ() ),
+ new Point( size.getX(), nearSideWitdth.getY(), size.getZ() ),
+ bottomFill,
+ stroke,
+ Orientation.NearY )
+ );
+ sides.add(
+ new SolidBox(
+ new Point( basePoint.getX(), basePoint.getY() + size.getY() - 1, basePoint.getZ() ),
+ new Point( size.getX(), farSideWitdth.getY(), size.getZ() ),
+ topFill,
+ stroke,
+ Orientation.FarY )
+ );
+ }
+
+ public int toCSVFile(File directory) {
+ int count = 0;
+ for(SolidBox s : sides) {
+ count += s.toCSVFile(directory);
+ }
+ return count;
+ }
+
+ public Point getNearSideWitdth() {
+ return nearSideWitdth;
+ }
+ public Point getFarSideWitdth() {
+ return farSideWitdth;
+ }
+ public Point getBasePoint() {
+ return basePoint;
+ }
+ public Point getSize() {
+ return size;
+ }
+
+ public int getNumberOfBlocks() {
+ int result = 0;
+ for(SolidBox s : sides)
+ result += s.getNumberOfBlocks();
+ return result;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Row$Direction.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Row$Direction.html
new file mode 100644
index 00000000..16a6b920
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Row$Direction.html
@@ -0,0 +1 @@
+Row.Direction
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Row.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Row.html
new file mode 100644
index 00000000..751eadff
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Row.html
@@ -0,0 +1 @@
+Row
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Row.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Row.java.html
new file mode 100644
index 00000000..1f62bb35
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/Row.java.html
@@ -0,0 +1,70 @@
+Row.java
package codemetropolis.toolchain.rendering.model.primitive;
+
+import java.io.File;
+
+import codemetropolis.toolchain.commons.cmxml.Point;
+import codemetropolis.toolchain.rendering.model.BasicBlock;
+
+public class Row implements Primitive {
+
+ public enum Direction {
+ UP,
+ DOWN,
+ NORTH,
+ SOUTH,
+ WEST,
+ EAST;
+ }
+
+ private Point position;
+ private int length;
+ private Direction orientation;
+ private BasicBlock[] pattern;
+
+ public Row(Point position, int length, Direction orientation, BasicBlock[] pattern) {
+ super();
+ this.position = position;
+ this.length = length;
+ this.orientation = orientation;
+ this.pattern = pattern;
+ }
+
+ @Override
+ public int toCSVFile(File directory) {
+ int c = 0;
+ for(int i = 0; i < length; i++) {
+ Point blockPos = null;
+ switch(orientation) {
+ case UP:
+ blockPos = new Point(position.getX(), position.getY() + i, position.getZ());
+ break;
+ case DOWN:
+ blockPos = new Point(position.getX(), position.getY() - i, position.getZ());
+ break;
+ case NORTH:
+ blockPos = new Point(position.getX(), position.getY(), position.getZ() + i);
+ break;
+ case SOUTH:
+ blockPos = new Point(position.getX(), position.getY(), position.getZ() - i);
+ break;
+ case WEST:
+ blockPos = new Point(position.getX() + i, position.getY(), position.getZ());
+ break;
+ case EAST:
+ blockPos = new Point(position.getX() - i, position.getY(), position.getZ());
+ break;
+ }
+
+ new Boxel(pattern[c], blockPos).toCSVFile(directory);
+ if(++c > pattern.length - 1) c = 0;
+ }
+ return length;
+ }
+
+ @Override
+ public int getNumberOfBlocks() {
+ return length;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/SignPost$Orientation.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/SignPost$Orientation.html
new file mode 100644
index 00000000..d9c0e84b
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/SignPost$Orientation.html
@@ -0,0 +1 @@
+SignPost.Orientation
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/SignPost.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/SignPost.html
new file mode 100644
index 00000000..cd71314f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/SignPost.html
@@ -0,0 +1 @@
+SignPost
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/SignPost.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/SignPost.java.html
new file mode 100644
index 00000000..f29221af
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/SignPost.java.html
@@ -0,0 +1,53 @@
+SignPost.java
package codemetropolis.toolchain.rendering.model.primitive;
+
+import java.io.File;
+
+import codemetropolis.toolchain.commons.cmxml.Point;
+import codemetropolis.toolchain.rendering.model.BasicBlock;
+
+public class SignPost implements Primitive {
+
+ public enum Orientation {
+ SOUTH(0),
+ SOUTHWEST(2),
+ WEST(4),
+ NORTHWEST(6),
+ NORTH(8),
+ NORTHEAST(10),
+ EAST(12),
+ SOUTHEAST(14);
+
+ private final int value;
+
+ Orientation(int v) {
+ value = v;
+ }
+
+ public int getValue() {
+ return value;
+ }
+ }
+
+ private Point position;
+ private Orientation orientation;
+ private String text;
+
+ public SignPost(int x, int y, int z, Orientation orientation, String text) {
+ super();
+ this.position = new Point(x, y, z);
+ this.orientation = orientation;
+ this.text = text;
+ }
+
+ @Override
+ public int toCSVFile(File directory) {
+ new Boxel(new BasicBlock((short) 63, orientation.getValue()), position, text).toCSVFile(directory);
+ return 1;
+ }
+ @Override
+ public int getNumberOfBlocks() {
+ return 1;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/SolidBox.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/SolidBox.html
new file mode 100644
index 00000000..0f8a37e3
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/SolidBox.html
@@ -0,0 +1 @@
+SolidBox
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/SolidBox.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/SolidBox.java.html
new file mode 100644
index 00000000..cdfb88bf
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/SolidBox.java.html
@@ -0,0 +1,84 @@
+SolidBox.java
package codemetropolis.toolchain.rendering.model.primitive;
+
+import java.io.File;
+
+import codemetropolis.toolchain.commons.cmxml.Point;
+import codemetropolis.toolchain.rendering.model.BasicBlock;
+import codemetropolis.toolchain.rendering.model.Paintable;
+import codemetropolis.toolchain.rendering.model.pattern.Pattern;
+import codemetropolis.toolchain.rendering.util.Orientation;
+
+public class SolidBox extends Paintable implements Primitive {
+
+ public Point basePoint;
+ public Point size;
+ public Orientation orientation;
+
+ public SolidBox(Point basePoint, Point size, Pattern fill, Pattern stroke, Orientation orientation) {
+ super(fill, stroke);
+ this.basePoint = basePoint;
+ this.size = size;
+ this.orientation = orientation;
+ }
+
+ private Point flipPattern(Point original, Point size) {
+ switch ( orientation ) {
+ case NearX:
+ return original;
+ case NearY:
+ return new Point( original.getY(), original.getX(), original.getZ() );
+ case NearZ:
+ return new Point( original.getZ(), original.getY(), original.getX() );
+ case FarX:
+ return new Point( ( size.getX() - 1 ) - ( original.getX() % size.getX() ), original.getY(), original.getZ() );
+ case FarY:
+ return new Point( ( size.getY() - 1 ) - ( original.getY() % size.getY() ), original.getX(), original.getZ() );
+ case FarZ:
+ return new Point( ( size.getZ() - 1 ) - ( original.getZ() % size.getZ() ), original.getY(), original.getX() );
+ default:
+ return null;
+ }
+ }
+
+ public int toCSVFile(File directory) {
+ for ( int x = 0; x < size.getX(); x++ ) {
+ for ( int y = 0; y < size.getY(); y++ ) {
+ for ( int z = 0; z < size.getZ(); z++ ) {
+ if ( (( x == 0 || x == size.getX() - 1 ) && ( y == 0 || y == size.getY() - 1 )) ||
+ (( x == 0 || x == size.getX() - 1 ) && ( z == 0 || z == size.getZ() - 1 )) ||
+ (( y == 0 || y == size.getY() - 1 ) && ( z == 0 || z == size.getZ() - 1 )) )
+ {
+ new Boxel(
+ new BasicBlock( stroke.applyTo( new Point( x, y, z ), this::flipPattern ) ),
+ new Point( basePoint.getX() + x, basePoint.getY() + y, basePoint.getZ() + z ))
+ .toCSVFile(directory);
+ } else {
+ new Boxel(
+ new BasicBlock( fill.applyTo( new Point( x, y, z ), this::flipPattern ) ),
+ new Point( basePoint.getX() + x, basePoint.getY() + y, basePoint.getZ() + z ))
+ .toCSVFile(directory);
+ }
+ }
+ }
+ }
+ return getNumberOfBlocks();
+ }
+
+ public Point getBasePoint() {
+ return basePoint;
+ }
+
+ public Point getSize() {
+ return size;
+ }
+
+ public Orientation getOrientation() {
+ return orientation;
+ }
+
+ public int getNumberOfBlocks() {
+ return size.getX() * size.getY() * size.getZ();
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/WallSign$Orientation.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/WallSign$Orientation.html
new file mode 100644
index 00000000..e297b45c
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/WallSign$Orientation.html
@@ -0,0 +1 @@
+WallSign.Orientation
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/WallSign.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/WallSign.html
new file mode 100644
index 00000000..95915e2a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/WallSign.html
@@ -0,0 +1 @@
+WallSign
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/WallSign.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/WallSign.java.html
new file mode 100644
index 00000000..5ed69cad
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/WallSign.java.html
@@ -0,0 +1,53 @@
+WallSign.java
package codemetropolis.toolchain.rendering.model.primitive;
+
+import java.io.File;
+
+import codemetropolis.toolchain.commons.cmxml.Point;
+import codemetropolis.toolchain.rendering.model.BasicBlock;
+
+public class WallSign implements Primitive {
+
+ public enum Orientation {
+ NORTH(2),
+ SOUTH(3),
+ WEST(4),
+ EAST(5);
+
+ private final int value;
+
+ Orientation(int v) {
+ value = v;
+ }
+
+ public int getValue() {
+ return value;
+ }
+ }
+
+ private Point position;
+ private Orientation orientation;
+ private String text;
+
+ public WallSign(int x, int y, int z, Orientation orientation, String text) {
+ this(new Point(x,y,z), orientation, text);
+ }
+
+ public WallSign(Point position, Orientation orientation, String text) {
+ super();
+ this.position = position;
+ this.orientation = orientation;
+ this.text = text;
+ }
+
+ @Override
+ public int toCSVFile(File directory) {
+ new Boxel(new BasicBlock((short) 68, orientation.getValue()), position, text).toCSVFile(directory);
+ return 1;
+ }
+ @Override
+ public int getNumberOfBlocks() {
+ return 1;
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/index.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/index.html
new file mode 100644
index 00000000..35332dc3
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering.model.primitive
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/index.source.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/index.source.html
new file mode 100644
index 00000000..b745bc48
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model.primitive/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering.model.primitive
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/BasicBlock.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/BasicBlock.html
new file mode 100644
index 00000000..b4c23527
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/BasicBlock.html
@@ -0,0 +1 @@
+BasicBlock
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/BasicBlock.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/BasicBlock.java.html
new file mode 100644
index 00000000..10806270
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/BasicBlock.java.html
@@ -0,0 +1,113 @@
+BasicBlock.java
package codemetropolis.toolchain.rendering.model;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+import java.util.Map;
+
+import codemetropolis.toolchain.rendering.RenderingExecutor;
+
+public class BasicBlock {
+
+ public static final BasicBlock NonBlock;
+ public static final Map<Short, String> idToName;
+ public static final Map<Short, String> idToHumanReadableName;
+ public static final Map<String, Short> nameToId;
+ public static final Map<String, Short> humanReadableNameToId;
+
+ static {
+ NonBlock = new BasicBlock((short)-1 );
+ idToName = new HashMap<Short,String>();
+ idToHumanReadableName = new HashMap<Short,String>();
+ nameToId = new HashMap<String,Short>();
+ humanReadableNameToId = new HashMap<String,Short>();
+
+ InputStream csvStream = RenderingExecutor.class.getClassLoader().getResourceAsStream("blocks.csv");
+ try(BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(csvStream, "UTF-8"))) {
+ String line;
+ while ((line = bufferedReader.readLine()) != null) {
+ String[] blockInfo = line.split(",");
+ idToName.put(Short.parseShort(blockInfo[0]), blockInfo[1]);
+ idToHumanReadableName.put(Short.parseShort(blockInfo[0]), blockInfo[2]);
+ nameToId.put(blockInfo[1], Short.parseShort(blockInfo[0]));
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private short id;
+ private int data;
+
+ public BasicBlock(short id) {
+ this(id, 0);
+ }
+
+ public BasicBlock(short id, int data) {
+ this.id = id;
+ this.data = data;
+ }
+
+ public BasicBlock(String name) {
+ this(nameToId.get(name), 0);
+ }
+
+ public BasicBlock(String name, int data) {
+ this(nameToId.get(name), data);
+ }
+
+ public BasicBlock(BasicBlock original) {
+ this.id = original.id;
+ this.data = original.data;
+ }
+
+ public String getName() {
+ return idToName.get(id);
+ }
+
+ public String getHumanReadableName() {
+ return idToHumanReadableName.get(id);
+ }
+
+ public short getId() {
+ return id;
+ }
+
+ public int getData() {
+ return data;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + data;
+ result = prime * result + id;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ BasicBlock other = (BasicBlock) obj;
+ if (data != other.data)
+ return false;
+ if (id != other.id)
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return getHumanReadableName() + (data != 0 ? data : "");
+ }
+
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/Paintable.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/Paintable.html
new file mode 100644
index 00000000..637a6b17
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/Paintable.html
@@ -0,0 +1 @@
+Paintable
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/Paintable.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/Paintable.java.html
new file mode 100644
index 00000000..d97a679d
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/Paintable.java.html
@@ -0,0 +1,24 @@
+Paintable.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/index.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/index.html
new file mode 100644
index 00000000..08565e4a
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering.model
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/index.source.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/index.source.html
new file mode 100644
index 00000000..4f6d7e51
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.model/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering.model
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/Character.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/Character.html
new file mode 100644
index 00000000..3a514761
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/Character.html
@@ -0,0 +1 @@
+Character
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/Character.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/Character.java.html
new file mode 100644
index 00000000..9b854a58
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/Character.java.html
@@ -0,0 +1,75 @@
+Character.java
package codemetropolis.toolchain.rendering.util;
+
+import codemetropolis.toolchain.rendering.model.BasicBlock;
+
+public enum Character {
+
+ STONE,
+ COBBLESTONE,
+ MOSSY_STONE,
+ SANDSTONE,
+ OBSIDIAN,
+ WOOD,
+ DARK_WOOD,
+ BIRCH_WOOD,
+ PLANKS,
+ DARK_PLANKS,
+ METAL,
+ DIRT,
+ SAND,
+ RED_SAND,
+ BRICK,
+ STONE_BRICK,
+ DARK_BRICK,
+ GLASS,
+ GOLD,
+ DIAMOND,
+ UNDEFINED;
+
+ public static Character parse(String str) {
+ for(Character c : Character.values()) {
+ if(c.toString().equalsIgnoreCase(str)) return c;
+ }
+ return Character.UNDEFINED;
+ }
+
+ public BasicBlock getBlock() {
+ switch(this) {
+ case STONE: return new BasicBlock( "minecraft:stone" );
+ case COBBLESTONE: return new BasicBlock( "minecraft:cobblestone" );
+ case MOSSY_STONE: return new BasicBlock( "minecraft:mossy_cobblestone" );
+ case SANDSTONE: return new BasicBlock( "minecraft:sandstone" );
+ case OBSIDIAN: return new BasicBlock( "minecraft:obsidian" );
+ case WOOD: return new BasicBlock( "minecraft:log" );
+ case DARK_WOOD: return new BasicBlock( "minecraft:log", 1 );
+ case BIRCH_WOOD: return new BasicBlock( "minecraft:log", 2 );
+ case PLANKS: return new BasicBlock( "minecraft:planks" );
+ case DARK_PLANKS: return new BasicBlock( "minecraft:planks", 5 );
+ case METAL: return new BasicBlock( "minecraft:iron_block" );
+ case DIRT: return new BasicBlock( "minecraft:dirt" );
+ case SAND: return new BasicBlock( "minecraft:sandstone" , 2 );
+ case RED_SAND: return new BasicBlock( "minecraft:sand" );
+ case BRICK: return new BasicBlock( "minecraft:double_stone_slab", 4 );
+ case STONE_BRICK: return new BasicBlock( "minecraft:double_stone_slab", 5 );
+ case DARK_BRICK: return new BasicBlock( "minecraft:double_stone_slab", 6 );
+ case GLASS: return new BasicBlock( "minecraft:glass" );
+ case GOLD: return new BasicBlock( "minecraft:gold_block" );
+ case DIAMOND: return new BasicBlock( "minecraft:diamond_block" );
+ case UNDEFINED: return new BasicBlock( "minecraft:wool", 2 );
+ default: return null;
+ }
+ }
+
+ public BasicBlock getTopBlock() {
+ switch(this) {
+ case WOOD:
+ case DARK_WOOD:
+ case BIRCH_WOOD:
+ case PLANKS:
+ case DARK_PLANKS:
+ return new BasicBlock( "minecraft:fence" );
+ default: return getBlock();
+ }
+ }
+}
+
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/Orientation.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/Orientation.html
new file mode 100644
index 00000000..c9de5921
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/Orientation.html
@@ -0,0 +1 @@
+Orientation
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/Orientation.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/Orientation.java.html
new file mode 100644
index 00000000..92dc9a0f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/Orientation.java.html
@@ -0,0 +1,11 @@
+Orientation.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/index.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/index.html
new file mode 100644
index 00000000..a6f153be
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering.util
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/index.source.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/index.source.html
new file mode 100644
index 00000000..06c2e7c3
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering.util/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering.util
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/CommandLineOptions.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/CommandLineOptions.html
new file mode 100644
index 00000000..dd815e89
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/CommandLineOptions.html
@@ -0,0 +1 @@
+CommandLineOptions
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/CommandLineOptions.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/CommandLineOptions.java.html
new file mode 100644
index 00000000..2df78ee8
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/CommandLineOptions.java.html
@@ -0,0 +1,36 @@
+CommandLineOptions.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/Main$1.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/Main$1.html
new file mode 100644
index 00000000..427de671
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/Main$1.html
@@ -0,0 +1 @@
+Main.new ProgressEventListener() {...}
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/Main.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/Main.html
new file mode 100644
index 00000000..c06e01a4
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/Main.html
@@ -0,0 +1 @@
+Main
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/Main.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/Main.java.html
new file mode 100644
index 00000000..8d749da9
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/Main.java.html
@@ -0,0 +1,83 @@
+Main.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/RenderingExecutor.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/RenderingExecutor.html
new file mode 100644
index 00000000..a0c0debb
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/RenderingExecutor.html
@@ -0,0 +1 @@
+RenderingExecutor
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/RenderingExecutor.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/RenderingExecutor.java.html
new file mode 100644
index 00000000..f6e68c49
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/RenderingExecutor.java.html
@@ -0,0 +1,122 @@
+RenderingExecutor.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/RenderingExecutorArgs.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/RenderingExecutorArgs.html
new file mode 100644
index 00000000..5e337c87
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/RenderingExecutorArgs.html
@@ -0,0 +1 @@
+RenderingExecutorArgs
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/RenderingExecutorArgs.java.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/RenderingExecutorArgs.java.html
new file mode 100644
index 00000000..6e0123b7
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/RenderingExecutorArgs.java.html
@@ -0,0 +1,45 @@
+RenderingExecutorArgs.java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/index.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/index.html
new file mode 100644
index 00000000..54a3c33d
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/index.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/index.source.html b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/index.source.html
new file mode 100644
index 00000000..6e9398de
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/codemetropolis.toolchain.rendering/index.source.html
@@ -0,0 +1 @@
+codemetropolis.toolchain.rendering
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_java/index.html b/doc/codemetropolis-toolchain-rendering/src_main_java/index.html
new file mode 100644
index 00000000..958f2a5f
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_java/index.html
@@ -0,0 +1 @@
+src/main/java
\ No newline at end of file
diff --git a/doc/codemetropolis-toolchain-rendering/src_main_resources/index.html b/doc/codemetropolis-toolchain-rendering/src_main_resources/index.html
new file mode 100644
index 00000000..985d0bc8
--- /dev/null
+++ b/doc/codemetropolis-toolchain-rendering/src_main_resources/index.html
@@ -0,0 +1 @@
+src/main/resources
\ No newline at end of file
diff --git a/doc/jacoco-resources/branchfc.gif b/doc/jacoco-resources/branchfc.gif
new file mode 100644
index 00000000..989b46d3
Binary files /dev/null and b/doc/jacoco-resources/branchfc.gif differ
diff --git a/doc/jacoco-resources/branchnc.gif b/doc/jacoco-resources/branchnc.gif
new file mode 100644
index 00000000..1933e07c
Binary files /dev/null and b/doc/jacoco-resources/branchnc.gif differ
diff --git a/doc/jacoco-resources/branchpc.gif b/doc/jacoco-resources/branchpc.gif
new file mode 100644
index 00000000..cbf711b7
Binary files /dev/null and b/doc/jacoco-resources/branchpc.gif differ
diff --git a/doc/jacoco-resources/bundle.gif b/doc/jacoco-resources/bundle.gif
new file mode 100644
index 00000000..fca9c53e
Binary files /dev/null and b/doc/jacoco-resources/bundle.gif differ
diff --git a/doc/jacoco-resources/class.gif b/doc/jacoco-resources/class.gif
new file mode 100644
index 00000000..eb348fb0
Binary files /dev/null and b/doc/jacoco-resources/class.gif differ
diff --git a/doc/jacoco-resources/down.gif b/doc/jacoco-resources/down.gif
new file mode 100644
index 00000000..440a14db
Binary files /dev/null and b/doc/jacoco-resources/down.gif differ
diff --git a/doc/jacoco-resources/greenbar.gif b/doc/jacoco-resources/greenbar.gif
new file mode 100644
index 00000000..0ba65672
Binary files /dev/null and b/doc/jacoco-resources/greenbar.gif differ
diff --git a/doc/jacoco-resources/group.gif b/doc/jacoco-resources/group.gif
new file mode 100644
index 00000000..a4ea580d
Binary files /dev/null and b/doc/jacoco-resources/group.gif differ
diff --git a/doc/jacoco-resources/method.gif b/doc/jacoco-resources/method.gif
new file mode 100644
index 00000000..7d24707e
Binary files /dev/null and b/doc/jacoco-resources/method.gif differ
diff --git a/doc/jacoco-resources/package.gif b/doc/jacoco-resources/package.gif
new file mode 100644
index 00000000..131c28da
Binary files /dev/null and b/doc/jacoco-resources/package.gif differ
diff --git a/doc/jacoco-resources/prettify.css b/doc/jacoco-resources/prettify.css
new file mode 100644
index 00000000..be5166e0
--- /dev/null
+++ b/doc/jacoco-resources/prettify.css
@@ -0,0 +1,13 @@
+/* Pretty printing styles. Used with prettify.js. */
+
+.str { color: #2A00FF; }
+.kwd { color: #7F0055; font-weight:bold; }
+.com { color: #3F5FBF; }
+.typ { color: #606; }
+.lit { color: #066; }
+.pun { color: #660; }
+.pln { color: #000; }
+.tag { color: #008; }
+.atn { color: #606; }
+.atv { color: #080; }
+.dec { color: #606; }
diff --git a/doc/jacoco-resources/prettify.js b/doc/jacoco-resources/prettify.js
new file mode 100644
index 00000000..ab278821
--- /dev/null
+++ b/doc/jacoco-resources/prettify.js
@@ -0,0 +1,1510 @@
+// Copyright (C) 2006 Google Inc.
+//
+// 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.
+
+
+/**
+ * @fileoverview
+ * some functions for browser-side pretty printing of code contained in html.
+ *
+ *
+ * For a fairly comprehensive set of languages see the
+ * README
+ * file that came with this source. At a minimum, the lexer should work on a
+ * number of languages including C and friends, Java, Python, Bash, SQL, HTML,
+ * XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP and Awk
+ * and a subset of Perl, but, because of commenting conventions, doesn't work on
+ * Smalltalk, Lisp-like, or CAML-like languages without an explicit lang class.
+ *
+ * Usage:
+ *
include this source file in an html page via
+ * {@code }
+ *
define style rules. See the example page for examples.
+ *
mark the {@code
} and {@code } tags in your source with
+ * {@code class=prettyprint.}
+ * You can also use the (html deprecated) {@code } tag, but the pretty
+ * printer needs to do more substantial DOM manipulations to support that, so
+ * some css styles may not be preserved.
+ *
+ * That's it. I wanted to keep the API as simple as possible, so there's no
+ * need to specify which language the code is in, but if you wish, you can add
+ * another class to the {@code
} or {@code } element to specify the
+ * language, as in {@code
}. Any class that
+ * starts with "lang-" followed by a file extension, specifies the file type.
+ * See the "lang-*.js" files in this directory for code that implements
+ * per-language file handlers.
+ *
+ * Change log:
+ * cbeust, 2006/08/22
+ *
+ * Java annotations (start with "@") are now captured as literals ("lit")
+ *
+ * @requires console
+ */
+
+// JSLint declarations
+/*global console, document, navigator, setTimeout, window */
+
+/**
+ * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
+ * UI events.
+ * If set to {@code false}, {@code prettyPrint()} is synchronous.
+ */
+window['PR_SHOULD_USE_CONTINUATION'] = true;
+
+/** the number of characters between tab columns */
+window['PR_TAB_WIDTH'] = 8;
+
+/** Walks the DOM returning a properly escaped version of innerHTML.
+ * @param {Node} node
+ * @param {Array.} out output buffer that receives chunks of HTML.
+ */
+window['PR_normalizedHtml']
+
+/** Contains functions for creating and registering new language handlers.
+ * @type {Object}
+ */
+ = window['PR']
+
+/** Pretty print a chunk of code.
+ *
+ * @param {string} sourceCodeHtml code as html
+ * @return {string} code as html, but prettier
+ */
+ = window['prettyPrintOne']
+/** Find all the {@code
} and {@code } tags in the DOM with
+ * {@code class=prettyprint} and prettify them.
+ * @param {Function?} opt_whenDone if specified, called when the last entry
+ * has been finished.
+ */
+ = window['prettyPrint'] = void 0;
+
+/** browser detection. @extern @returns false if not IE, otherwise the major version. */
+window['_pr_isIE6'] = function () {
+ var ieVersion = navigator && navigator.userAgent &&
+ navigator.userAgent.match(/\bMSIE ([678])\./);
+ ieVersion = ieVersion ? +ieVersion[1] : false;
+ window['_pr_isIE6'] = function () { return ieVersion; };
+ return ieVersion;
+};
+
+
+(function () {
+ // Keyword lists for various languages.
+ var FLOW_CONTROL_KEYWORDS =
+ "break continue do else for if return while ";
+ var C_KEYWORDS = FLOW_CONTROL_KEYWORDS + "auto case char const default " +
+ "double enum extern float goto int long register short signed sizeof " +
+ "static struct switch typedef union unsigned void volatile ";
+ var COMMON_KEYWORDS = C_KEYWORDS + "catch class delete false import " +
+ "new operator private protected public this throw true try typeof ";
+ var CPP_KEYWORDS = COMMON_KEYWORDS + "alignof align_union asm axiom bool " +
+ "concept concept_map const_cast constexpr decltype " +
+ "dynamic_cast explicit export friend inline late_check " +
+ "mutable namespace nullptr reinterpret_cast static_assert static_cast " +
+ "template typeid typename using virtual wchar_t where ";
+ var JAVA_KEYWORDS = COMMON_KEYWORDS +
+ "abstract boolean byte extends final finally implements import " +
+ "instanceof null native package strictfp super synchronized throws " +
+ "transient ";
+ var CSHARP_KEYWORDS = JAVA_KEYWORDS +
+ "as base by checked decimal delegate descending event " +
+ "fixed foreach from group implicit in interface internal into is lock " +
+ "object out override orderby params partial readonly ref sbyte sealed " +
+ "stackalloc string select uint ulong unchecked unsafe ushort var ";
+ var JSCRIPT_KEYWORDS = COMMON_KEYWORDS +
+ "debugger eval export function get null set undefined var with " +
+ "Infinity NaN ";
+ var PERL_KEYWORDS = "caller delete die do dump elsif eval exit foreach for " +
+ "goto if import last local my next no our print package redo require " +
+ "sub undef unless until use wantarray while BEGIN END ";
+ var PYTHON_KEYWORDS = FLOW_CONTROL_KEYWORDS + "and as assert class def del " +
+ "elif except exec finally from global import in is lambda " +
+ "nonlocal not or pass print raise try with yield " +
+ "False True None ";
+ var RUBY_KEYWORDS = FLOW_CONTROL_KEYWORDS + "alias and begin case class def" +
+ " defined elsif end ensure false in module next nil not or redo rescue " +
+ "retry self super then true undef unless until when yield BEGIN END ";
+ var SH_KEYWORDS = FLOW_CONTROL_KEYWORDS + "case done elif esac eval fi " +
+ "function in local set then until ";
+ var ALL_KEYWORDS = (
+ CPP_KEYWORDS + CSHARP_KEYWORDS + JSCRIPT_KEYWORDS + PERL_KEYWORDS +
+ PYTHON_KEYWORDS + RUBY_KEYWORDS + SH_KEYWORDS);
+
+ // token style names. correspond to css classes
+ /** token style for a string literal */
+ var PR_STRING = 'str';
+ /** token style for a keyword */
+ var PR_KEYWORD = 'kwd';
+ /** token style for a comment */
+ var PR_COMMENT = 'com';
+ /** token style for a type */
+ var PR_TYPE = 'typ';
+ /** token style for a literal value. e.g. 1, null, true. */
+ var PR_LITERAL = 'lit';
+ /** token style for a punctuation string. */
+ var PR_PUNCTUATION = 'pun';
+ /** token style for a punctuation string. */
+ var PR_PLAIN = 'pln';
+
+ /** token style for an sgml tag. */
+ var PR_TAG = 'tag';
+ /** token style for a markup declaration such as a DOCTYPE. */
+ var PR_DECLARATION = 'dec';
+ /** token style for embedded source. */
+ var PR_SOURCE = 'src';
+ /** token style for an sgml attribute name. */
+ var PR_ATTRIB_NAME = 'atn';
+ /** token style for an sgml attribute value. */
+ var PR_ATTRIB_VALUE = 'atv';
+
+ /**
+ * A class that indicates a section of markup that is not code, e.g. to allow
+ * embedding of line numbers within code listings.
+ */
+ var PR_NOCODE = 'nocode';
+
+ /** A set of tokens that can precede a regular expression literal in
+ * javascript.
+ * http://www.mozilla.org/js/language/js20/rationale/syntax.html has the full
+ * list, but I've removed ones that might be problematic when seen in
+ * languages that don't support regular expression literals.
+ *
+ *
Specifically, I've removed any keywords that can't precede a regexp
+ * literal in a syntactically legal javascript program, and I've removed the
+ * "in" keyword since it's not a keyword in many languages, and might be used
+ * as a count of inches.
+ *
+ *
The link a above does not accurately describe EcmaScript rules since
+ * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
+ * very well in practice.
+ *
+ * @private
+ */
+ var REGEXP_PRECEDER_PATTERN = function () {
+ var preceders = [
+ "!", "!=", "!==", "#", "%", "%=", "&", "&&", "&&=",
+ "&=", "(", "*", "*=", /* "+", */ "+=", ",", /* "-", */ "-=",
+ "->", /*".", "..", "...", handled below */ "/", "/=", ":", "::", ";",
+ "<", "<<", "<<=", "<=", "=", "==", "===", ">",
+ ">=", ">>", ">>=", ">>>", ">>>=", "?", "@", "[",
+ "^", "^=", "^^", "^^=", "{", "|", "|=", "||",
+ "||=", "~" /* handles =~ and !~ */,
+ "break", "case", "continue", "delete",
+ "do", "else", "finally", "instanceof",
+ "return", "throw", "try", "typeof"
+ ];
+ var pattern = '(?:^^|[+-]';
+ for (var i = 0; i < preceders.length; ++i) {
+ pattern += '|' + preceders[i].replace(/([^=<>:&a-z])/g, '\\$1');
+ }
+ pattern += ')\\s*'; // matches at end, and matches empty string
+ return pattern;
+ // CAVEAT: this does not properly handle the case where a regular
+ // expression immediately follows another since a regular expression may
+ // have flags for case-sensitivity and the like. Having regexp tokens
+ // adjacent is not valid in any language I'm aware of, so I'm punting.
+ // TODO: maybe style special characters inside a regexp as punctuation.
+ }();
+
+ // Define regexps here so that the interpreter doesn't have to create an
+ // object each time the function containing them is called.
+ // The language spec requires a new object created even if you don't access
+ // the $1 members.
+ var pr_amp = /&/g;
+ var pr_lt = //g;
+ var pr_quot = /\"/g;
+ /** like textToHtml but escapes double quotes to be attribute safe. */
+ function attribToHtml(str) {
+ return str.replace(pr_amp, '&')
+ .replace(pr_lt, '<')
+ .replace(pr_gt, '>')
+ .replace(pr_quot, '"');
+ }
+
+ /** escapest html special characters to html. */
+ function textToHtml(str) {
+ return str.replace(pr_amp, '&')
+ .replace(pr_lt, '<')
+ .replace(pr_gt, '>');
+ }
+
+
+ var pr_ltEnt = /</g;
+ var pr_gtEnt = />/g;
+ var pr_aposEnt = /'/g;
+ var pr_quotEnt = /"/g;
+ var pr_ampEnt = /&/g;
+ var pr_nbspEnt = / /g;
+ /** unescapes html to plain text. */
+ function htmlToText(html) {
+ var pos = html.indexOf('&');
+ if (pos < 0) { return html; }
+ // Handle numeric entities specially. We can't use functional substitution
+ // since that doesn't work in older versions of Safari.
+ // These should be rare since most browsers convert them to normal chars.
+ for (--pos; (pos = html.indexOf('', pos + 1)) >= 0;) {
+ var end = html.indexOf(';', pos);
+ if (end >= 0) {
+ var num = html.substring(pos + 3, end);
+ var radix = 10;
+ if (num && num.charAt(0) === 'x') {
+ num = num.substring(1);
+ radix = 16;
+ }
+ var codePoint = parseInt(num, radix);
+ if (!isNaN(codePoint)) {
+ html = (html.substring(0, pos) + String.fromCharCode(codePoint) +
+ html.substring(end + 1));
+ }
+ }
+ }
+
+ return html.replace(pr_ltEnt, '<')
+ .replace(pr_gtEnt, '>')
+ .replace(pr_aposEnt, "'")
+ .replace(pr_quotEnt, '"')
+ .replace(pr_nbspEnt, ' ')
+ .replace(pr_ampEnt, '&');
+ }
+
+ /** is the given node's innerHTML normally unescaped? */
+ function isRawContent(node) {
+ return 'XMP' === node.tagName;
+ }
+
+ var newlineRe = /[\r\n]/g;
+ /**
+ * Are newlines and adjacent spaces significant in the given node's innerHTML?
+ */
+ function isPreformatted(node, content) {
+ // PRE means preformatted, and is a very common case, so don't create
+ // unnecessary computed style objects.
+ if ('PRE' === node.tagName) { return true; }
+ if (!newlineRe.test(content)) { return true; } // Don't care
+ var whitespace = '';
+ // For disconnected nodes, IE has no currentStyle.
+ if (node.currentStyle) {
+ whitespace = node.currentStyle.whiteSpace;
+ } else if (window.getComputedStyle) {
+ // Firefox makes a best guess if node is disconnected whereas Safari
+ // returns the empty string.
+ whitespace = window.getComputedStyle(node, null).whiteSpace;
+ }
+ return !whitespace || whitespace === 'pre';
+ }
+
+ function normalizedHtml(node, out, opt_sortAttrs) {
+ switch (node.nodeType) {
+ case 1: // an element
+ var name = node.tagName.toLowerCase();
+
+ out.push('<', name);
+ var attrs = node.attributes;
+ var n = attrs.length;
+ if (n) {
+ if (opt_sortAttrs) {
+ var sortedAttrs = [];
+ for (var i = n; --i >= 0;) { sortedAttrs[i] = attrs[i]; }
+ sortedAttrs.sort(function (a, b) {
+ return (a.name < b.name) ? -1 : a.name === b.name ? 0 : 1;
+ });
+ attrs = sortedAttrs;
+ }
+ for (var i = 0; i < n; ++i) {
+ var attr = attrs[i];
+ if (!attr.specified) { continue; }
+ out.push(' ', attr.name.toLowerCase(),
+ '="', attribToHtml(attr.value), '"');
+ }
+ }
+ out.push('>');
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ normalizedHtml(child, out, opt_sortAttrs);
+ }
+ if (node.firstChild || !/^(?:br|link|img)$/.test(name)) {
+ out.push('<\/', name, '>');
+ }
+ break;
+ case 3: case 4: // text
+ out.push(textToHtml(node.nodeValue));
+ break;
+ }
+ }
+
+ /**
+ * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
+ * matches the union o the sets o strings matched d by the input RegExp.
+ * Since it matches globally, if the input strings have a start-of-input
+ * anchor (/^.../), it is ignored for the purposes of unioning.
+ * @param {Array.} regexs non multiline, non-global regexs.
+ * @return {RegExp} a global regex.
+ */
+ function combinePrefixPatterns(regexs) {
+ var capturedGroupIndex = 0;
+
+ var needToFoldCase = false;
+ var ignoreCase = false;
+ for (var i = 0, n = regexs.length; i < n; ++i) {
+ var regex = regexs[i];
+ if (regex.ignoreCase) {
+ ignoreCase = true;
+ } else if (/[a-z]/i.test(regex.source.replace(
+ /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
+ needToFoldCase = true;
+ ignoreCase = false;
+ break;
+ }
+ }
+
+ function decodeEscape(charsetPart) {
+ if (charsetPart.charAt(0) !== '\\') { return charsetPart.charCodeAt(0); }
+ switch (charsetPart.charAt(1)) {
+ case 'b': return 8;
+ case 't': return 9;
+ case 'n': return 0xa;
+ case 'v': return 0xb;
+ case 'f': return 0xc;
+ case 'r': return 0xd;
+ case 'u': case 'x':
+ return parseInt(charsetPart.substring(2), 16)
+ || charsetPart.charCodeAt(1);
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7':
+ return parseInt(charsetPart.substring(1), 8);
+ default: return charsetPart.charCodeAt(1);
+ }
+ }
+
+ function encodeEscape(charCode) {
+ if (charCode < 0x20) {
+ return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
+ }
+ var ch = String.fromCharCode(charCode);
+ if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') {
+ ch = '\\' + ch;
+ }
+ return ch;
+ }
+
+ function caseFoldCharset(charSet) {
+ var charsetParts = charSet.substring(1, charSet.length - 1).match(
+ new RegExp(
+ '\\\\u[0-9A-Fa-f]{4}'
+ + '|\\\\x[0-9A-Fa-f]{2}'
+ + '|\\\\[0-3][0-7]{0,2}'
+ + '|\\\\[0-7]{1,2}'
+ + '|\\\\[\\s\\S]'
+ + '|-'
+ + '|[^-\\\\]',
+ 'g'));
+ var groups = [];
+ var ranges = [];
+ var inverse = charsetParts[0] === '^';
+ for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
+ var p = charsetParts[i];
+ switch (p) {
+ case '\\B': case '\\b':
+ case '\\D': case '\\d':
+ case '\\S': case '\\s':
+ case '\\W': case '\\w':
+ groups.push(p);
+ continue;
+ }
+ var start = decodeEscape(p);
+ var end;
+ if (i + 2 < n && '-' === charsetParts[i + 1]) {
+ end = decodeEscape(charsetParts[i + 2]);
+ i += 2;
+ } else {
+ end = start;
+ }
+ ranges.push([start, end]);
+ // If the range might intersect letters, then expand it.
+ if (!(end < 65 || start > 122)) {
+ if (!(end < 65 || start > 90)) {
+ ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
+ }
+ if (!(end < 97 || start > 122)) {
+ ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
+ }
+ }
+ }
+
+ // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
+ // -> [[1, 12], [14, 14], [16, 17]]
+ ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1] - a[1]); });
+ var consolidatedRanges = [];
+ var lastRange = [NaN, NaN];
+ for (var i = 0; i < ranges.length; ++i) {
+ var range = ranges[i];
+ if (range[0] <= lastRange[1] + 1) {
+ lastRange[1] = Math.max(lastRange[1], range[1]);
+ } else {
+ consolidatedRanges.push(lastRange = range);
+ }
+ }
+
+ var out = ['['];
+ if (inverse) { out.push('^'); }
+ out.push.apply(out, groups);
+ for (var i = 0; i < consolidatedRanges.length; ++i) {
+ var range = consolidatedRanges[i];
+ out.push(encodeEscape(range[0]));
+ if (range[1] > range[0]) {
+ if (range[1] + 1 > range[0]) { out.push('-'); }
+ out.push(encodeEscape(range[1]));
+ }
+ }
+ out.push(']');
+ return out.join('');
+ }
+
+ function allowAnywhereFoldCaseAndRenumberGroups(regex) {
+ // Split into character sets, escape sequences, punctuation strings
+ // like ('(', '(?:', ')', '^'), and runs of characters that do not
+ // include any of the above.
+ var parts = regex.source.match(
+ new RegExp(
+ '(?:'
+ + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]' // a character set
+ + '|\\\\u[A-Fa-f0-9]{4}' // a unicode escape
+ + '|\\\\x[A-Fa-f0-9]{2}' // a hex escape
+ + '|\\\\[0-9]+' // a back-reference or octal escape
+ + '|\\\\[^ux0-9]' // other escape sequence
+ + '|\\(\\?[:!=]' // start of a non-capturing group
+ + '|[\\(\\)\\^]' // start/emd of a group, or line start
+ + '|[^\\x5B\\x5C\\(\\)\\^]+' // run of other characters
+ + ')',
+ 'g'));
+ var n = parts.length;
+
+ // Maps captured group numbers to the number they will occupy in
+ // the output or to -1 if that has not been determined, or to
+ // undefined if they need not be capturing in the output.
+ var capturedGroups = [];
+
+ // Walk over and identify back references to build the capturedGroups
+ // mapping.
+ for (var i = 0, groupIndex = 0; i < n; ++i) {
+ var p = parts[i];
+ if (p === '(') {
+ // groups are 1-indexed, so max group index is count of '('
+ ++groupIndex;
+ } else if ('\\' === p.charAt(0)) {
+ var decimalValue = +p.substring(1);
+ if (decimalValue && decimalValue <= groupIndex) {
+ capturedGroups[decimalValue] = -1;
+ }
+ }
+ }
+
+ // Renumber groups and reduce capturing groups to non-capturing groups
+ // where possible.
+ for (var i = 1; i < capturedGroups.length; ++i) {
+ if (-1 === capturedGroups[i]) {
+ capturedGroups[i] = ++capturedGroupIndex;
+ }
+ }
+ for (var i = 0, groupIndex = 0; i < n; ++i) {
+ var p = parts[i];
+ if (p === '(') {
+ ++groupIndex;
+ if (capturedGroups[groupIndex] === undefined) {
+ parts[i] = '(?:';
+ }
+ } else if ('\\' === p.charAt(0)) {
+ var decimalValue = +p.substring(1);
+ if (decimalValue && decimalValue <= groupIndex) {
+ parts[i] = '\\' + capturedGroups[groupIndex];
+ }
+ }
+ }
+
+ // Remove any prefix anchors so that the output will match anywhere.
+ // ^^ really does mean an anchored match though.
+ for (var i = 0, groupIndex = 0; i < n; ++i) {
+ if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
+ }
+
+ // Expand letters to groupts to handle mixing of case-sensitive and
+ // case-insensitive patterns if necessary.
+ if (regex.ignoreCase && needToFoldCase) {
+ for (var i = 0; i < n; ++i) {
+ var p = parts[i];
+ var ch0 = p.charAt(0);
+ if (p.length >= 2 && ch0 === '[') {
+ parts[i] = caseFoldCharset(p);
+ } else if (ch0 !== '\\') {
+ // TODO: handle letters in numeric escapes.
+ parts[i] = p.replace(
+ /[a-zA-Z]/g,
+ function (ch) {
+ var cc = ch.charCodeAt(0);
+ return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
+ });
+ }
+ }
+ }
+
+ return parts.join('');
+ }
+
+ var rewritten = [];
+ for (var i = 0, n = regexs.length; i < n; ++i) {
+ var regex = regexs[i];
+ if (regex.global || regex.multiline) { throw new Error('' + regex); }
+ rewritten.push(
+ '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
+ }
+
+ return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
+ }
+
+ var PR_innerHtmlWorks = null;
+ function getInnerHtml(node) {
+ // inner html is hopelessly broken in Safari 2.0.4 when the content is
+ // an html description of well formed XML and the containing tag is a PRE
+ // tag, so we detect that case and emulate innerHTML.
+ if (null === PR_innerHtmlWorks) {
+ var testNode = document.createElement('PRE');
+ testNode.appendChild(
+ document.createTextNode('\n'));
+ PR_innerHtmlWorks = !/)[\r\n]+/g, '$1')
+ .replace(/(?:[\r\n]+[ \t]*)+/g, ' ');
+ }
+ return content;
+ }
+
+ var out = [];
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ normalizedHtml(child, out);
+ }
+ return out.join('');
+ }
+
+ /** returns a function that expand tabs to spaces. This function can be fed
+ * successive chunks of text, and will maintain its own internal state to
+ * keep track of how tabs are expanded.
+ * @return {function (string) : string} a function that takes
+ * plain text and return the text with tabs expanded.
+ * @private
+ */
+ function makeTabExpander(tabWidth) {
+ var SPACES = ' ';
+ var charInLine = 0;
+
+ return function (plainText) {
+ // walk over each character looking for tabs and newlines.
+ // On tabs, expand them. On newlines, reset charInLine.
+ // Otherwise increment charInLine
+ var out = null;
+ var pos = 0;
+ for (var i = 0, n = plainText.length; i < n; ++i) {
+ var ch = plainText.charAt(i);
+
+ switch (ch) {
+ case '\t':
+ if (!out) { out = []; }
+ out.push(plainText.substring(pos, i));
+ // calculate how much space we need in front of this part
+ // nSpaces is the amount of padding -- the number of spaces needed
+ // to move us to the next column, where columns occur at factors of
+ // tabWidth.
+ var nSpaces = tabWidth - (charInLine % tabWidth);
+ charInLine += nSpaces;
+ for (; nSpaces >= 0; nSpaces -= SPACES.length) {
+ out.push(SPACES.substring(0, nSpaces));
+ }
+ pos = i + 1;
+ break;
+ case '\n':
+ charInLine = 0;
+ break;
+ default:
+ ++charInLine;
+ }
+ }
+ if (!out) { return plainText; }
+ out.push(plainText.substring(pos));
+ return out.join('');
+ };
+ }
+
+ var pr_chunkPattern = new RegExp(
+ '[^<]+' // A run of characters other than '<'
+ + '|<\!--[\\s\\S]*?--\>' // an HTML comment
+ + '|' // a CDATA section
+ // a probable tag that should not be highlighted
+ + '|<\/?[a-zA-Z](?:[^>\"\']|\'[^\']*\'|\"[^\"]*\")*>'
+ + '|<', // A '<' that does not begin a larger chunk
+ 'g');
+ var pr_commentPrefix = /^<\!--/;
+ var pr_cdataPrefix = /^) into their textual equivalent.
+ *
+ * @param {string} s html where whitespace is considered significant.
+ * @return {Object} source code and extracted tags.
+ * @private
+ */
+ function extractTags(s) {
+ // since the pattern has the 'g' modifier and defines no capturing groups,
+ // this will return a list of all chunks which we then classify and wrap as
+ // PR_Tokens
+ var matches = s.match(pr_chunkPattern);
+ var sourceBuf = [];
+ var sourceBufLen = 0;
+ var extractedTags = [];
+ if (matches) {
+ for (var i = 0, n = matches.length; i < n; ++i) {
+ var match = matches[i];
+ if (match.length > 1 && match.charAt(0) === '<') {
+ if (pr_commentPrefix.test(match)) { continue; }
+ if (pr_cdataPrefix.test(match)) {
+ // strip CDATA prefix and suffix. Don't unescape since it's CDATA
+ sourceBuf.push(match.substring(9, match.length - 3));
+ sourceBufLen += match.length - 12;
+ } else if (pr_brPrefix.test(match)) {
+ // tags are lexically significant so convert them to text.
+ // This is undone later.
+ sourceBuf.push('\n');
+ ++sourceBufLen;
+ } else {
+ if (match.indexOf(PR_NOCODE) >= 0 && isNoCodeTag(match)) {
+ // A will start a section that should be
+ // ignored. Continue walking the list until we see a matching end
+ // tag.
+ var name = match.match(pr_tagNameRe)[2];
+ var depth = 1;
+ var j;
+ end_tag_loop:
+ for (j = i + 1; j < n; ++j) {
+ var name2 = matches[j].match(pr_tagNameRe);
+ if (name2 && name2[2] === name) {
+ if (name2[1] === '/') {
+ if (--depth === 0) { break end_tag_loop; }
+ } else {
+ ++depth;
+ }
+ }
+ }
+ if (j < n) {
+ extractedTags.push(
+ sourceBufLen, matches.slice(i, j + 1).join(''));
+ i = j;
+ } else { // Ignore unclosed sections.
+ extractedTags.push(sourceBufLen, match);
+ }
+ } else {
+ extractedTags.push(sourceBufLen, match);
+ }
+ }
+ } else {
+ var literalText = htmlToText(match);
+ sourceBuf.push(literalText);
+ sourceBufLen += literalText.length;
+ }
+ }
+ }
+ return { source: sourceBuf.join(''), tags: extractedTags };
+ }
+
+ /** True if the given tag contains a class attribute with the nocode class. */
+ function isNoCodeTag(tag) {
+ return !!tag
+ // First canonicalize the representation of attributes
+ .replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,
+ ' $1="$2$3$4"')
+ // Then look for the attribute we want.
+ .match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/);
+ }
+
+ /**
+ * Apply the given language handler to sourceCode and add the resulting
+ * decorations to out.
+ * @param {number} basePos the index of sourceCode within the chunk of source
+ * whose decorations are already present on out.
+ */
+ function appendDecorations(basePos, sourceCode, langHandler, out) {
+ if (!sourceCode) { return; }
+ var job = {
+ source: sourceCode,
+ basePos: basePos
+ };
+ langHandler(job);
+ out.push.apply(out, job.decorations);
+ }
+
+ /** Given triples of [style, pattern, context] returns a lexing function,
+ * The lexing function interprets the patterns to find token boundaries and
+ * returns a decoration list of the form
+ * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
+ * where index_n is an index into the sourceCode, and style_n is a style
+ * constant like PR_PLAIN. index_n-1 <= index_n, and style_n-1 applies to
+ * all characters in sourceCode[index_n-1:index_n].
+ *
+ * The stylePatterns is a list whose elements have the form
+ * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
+ *
+ * Style is a style constant like PR_PLAIN, or can be a string of the
+ * form 'lang-FOO', where FOO is a language extension describing the
+ * language of the portion of the token in $1 after pattern executes.
+ * E.g., if style is 'lang-lisp', and group 1 contains the text
+ * '(hello (world))', then that portion of the token will be passed to the
+ * registered lisp handler for formatting.
+ * The text before and after group 1 will be restyled using this decorator
+ * so decorators should take care that this doesn't result in infinite
+ * recursion. For example, the HTML lexer rule for SCRIPT elements looks
+ * something like ['lang-js', /<[s]cript>(.+?)<\/script>/]. This may match
+ * '