Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions examples/mapping/sourcemeter_mapping_example_2_0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
</conversions>
</binding>
</linking>
<linking source="interface" target="garden">
<binding from="CBO" to="flower-ratio">
<conversions>
<conversion type="normalize"/>
</conversions>
</binding>
</linking>
<linking source="method" target="floor">
<binding from="LLOC" to="height"/>
<binding from="NII" to="width"/>
Expand Down
6 changes: 0 additions & 6 deletions sources/codemetropolis-toolchain-commons/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
Expand Down
8 changes: 8 additions & 0 deletions sources/codemetropolis-toolchain-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,13 @@
<artifactId>gson</artifactId>
<version>2.6.1</version>
</dependency>

<!-- JUnit 4 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public enum Type {
GROUND,
GARDEN,
FLOOR,
DECORATION_FLOOR,
CELLAR,
CONTAINER;
}
Expand Down Expand Up @@ -101,6 +102,10 @@ public String getAttributeValue(String name) {
return null;
}

public void setAttributes(List<Attribute> attributes) {
this.attributes = attributes;
}

public Buildable[] getAncestors() {
List<Buildable> result = new ArrayList<Buildable>();
Buildable temp = this;
Expand Down Expand Up @@ -178,6 +183,12 @@ public void clearAttributes() {
attributes.clear();
}

public void addFirstChild(Buildable b) {
if(!b.isRoot()) b.parent.children.remove(b);
children.add(0, b);
b.parent = this;
}

public void addChild(Buildable b) {
if(!b.isRoot()) b.parent.children.remove(b);
children.add(b);
Expand Down Expand Up @@ -317,10 +328,18 @@ public Attribute[] getAttributes() {
public Buildable[] getChildren() {
return children.toArray(new Buildable[children.size()]);
}

public List<Buildable> getChildrenList() {
return children;
}

public Buildable getParent() {
return parent;
}

public void setParent(Buildable parent) {
this.parent = parent;
}

public boolean isRoot() {
return parent == null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ public void loadFromFile(String path) throws CmxmlReaderException {
break;
case "floor": type = Type.FLOOR;
break;
case "decoration_floor": type = Type.DECORATION_FLOOR;
break;
case "cellar": type = Type.CELLAR;
break;
case "container": type = Type.CONTAINER;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,16 @@ protected void setZ(int z) {
this.z = z;
}

@Override
public boolean equals(Object obj) {
if (obj instanceof Point) {
Point point = (Point) obj;
return (this.x == point.getX() &&
this.y == point.getY() &&
this.z == point.getZ());
} else {
return false;
}
}

}
Original file line number Diff line number Diff line change
@@ -1,91 +1,96 @@
# Message prefixes
error_prefix = Error:
converter_prefix = Converter:
mapping_prefix = Mapping:
placing_prefix = Placing:
rendering_prefix = Rendering:

# Converter info
converter_introduction = CodeMetropolis CDF Converter (c) University of Szeged, Department of Software Engineering
converter_usage = Usage: java -jar converter.jar -t <type> -s <source> [-o <outputFile>] [-p <parameters>]

# Converter notifications
converting_to_cdf = Converting input to CDF format...
converting_to_cdf_done = Converting input to CDF format done.
printing_cdf = Printing CDF document...
printing_cdf_done = Printing CDF document done.

#SonarQube converter
sonar_downloading_project = Downloading data of project %s.

# Mapping info
mapping_introduction = CodeMetropolis Toolchain Mapping (c) University of Szeged, Department of Software Engineering
mapping_usage = Usage: java -jar mapping.jar -i <cdfFile> -m <mappingFile> [-o <outputFile>]

# Mapping notifications
reading_mapping = Reading map file...
reading_mapping_done = Reading map file done.
validating_mapping = Validating mapping...
validating_mapping_done = Validating mapping done.
reading_graph = Reading CDF file...
reading_graph_done = Reading CDF file done.
linking_metrics = Linking metrics to buildables...
linking_metrics_done = Linking metrics to buildables done.
mapping_printing_output = Generating input for placing...
mapping_printing_output_done = Generating input for placing done.

# Placing info
placing_introduction = CodeMetropolis Toolchain Placing (c) University of Szeged, Department of Software Engineering
placing_usage = Usage: java -jar placing.jar -i <inputFile> [-o <outputFile>] [-m]

# Placing notifications
placing_reading_input = Reading input file...
placing_reading_input_done = Reading input file done.
calculating_size_and_pos = Calculating building sizes and positions...
calculating_size_and_pos_done = Calculating building sizes and positions done.
placing_printing_output = Generating input for rendering...
placing_printing_output_done = Generating input for rendering done.

# Rendering info
rendering_introduction = CodeMetropolis Toolchain Rendering (c) University of Szeged, Department of Software Engineering
rendering_usage = Usage: java -jar rendering.jar -i <inputFile> -world <worldPath>

# Rendering notifications
world_already_exists = Another world with the same name might exist or being built right now. Do you want to overwrite? [Y/N]
render_interrupted = Interrupted. End of program.
rendering_reading_input = Reading input file...
rendering_reading_input_done = Reading input file done.
buildables_found = %d buildables were found.
creating_blocks = Generating blocks...
creating_blocks_progress = Generating blocks... %.2f%% (Remaining: %2d hours, %2d minutes)
creating_blocks_done = Generating blocks done. %d blocks were generated in %d hours and %d minutes.
placing_blocks = Placing blocks...
placing_blocks_progress = Placing blocks... %.2f%% (Remaining: %2d hours, %2d minutes)
placing_blocks_done = Placing blocks done in %d hours and %d minutes.

# Errors
command_line_error = Incorrect command line arguments.
invalid_linking_error = Linking ( %s, %s -> %s, %s ) is not supported.
invalid_linking_target_error = '%s' is not a valid linking target.
missing_resource_error = Mapping resource '%s' is not declared.
invalid_input_xml_error = Input XML is not in CMXML format.
missing_input_xml_error = The given input XML does not exits.
missing_layout_error = Layout with the given identifier does not exist.
mapping_reader_error = An error has occurred while reading the mapping file. For more information please check the log file.
cmxml_writer_error = An error has occurred while writing the output file. For more information please check the log file.
cmxml_reader_error = An error has occurred while reading the input file. For more information please check the log file.
layout_error = An error has occurred during layout creation. For more information please check the log file.
cdf_error = An error has occurred while processing CDF. For more information please check the log file.
cdf_writer_error = An error has occurred while writing CDF to file. For more information please check the log file.
cdf_not_found_error = No CDF file was found on the given path.
mapping_not_found_error = No mapping file was found on the given path.
building_creation_failed_error = An error has occurred while processing building data. Please make sure you are using a valid input file.
too_long_render_duration_error = Generating world would take more time then the maximum allowed (%d minutes)
placing_blocks_failed_error = An error has occurred while placing blocks. For more information please check the log file.
converter_error = An error has occurred while converting to CDF format. For more information please check the log file.
invalid_hierarchy_error = Invalid structure has been found in buildable hierarchy.
invalid_scale_error = Scale value must be between %.2f and %.2f.
invalid_converter_type = Converter with the given identifier does not exist.
invalid_params = Invalid parameter format.
sonar_connect_error = Could not connect to SonarQube server.
sonar_unauthorized_error = Unauthorized server access. Please provide your username and password in converter parameters if you are accessing a non-public SonarQube resource.
# Message prefixes
error_prefix = Error:
converter_prefix = Converter:
mapping_prefix = Mapping:
placing_prefix = Placing: metrics_prefix = Metrics processing:
rendering_prefix = Rendering:

# Converter info
converter_introduction = CodeMetropolis CDF Converter (c) University of Szeged, Department of Software Engineering
converter_usage = Usage: java -jar converter.jar -t <type> -s <source> [-o <outputFile>] [-p <parameters>]

# Converter notifications
converting_to_cdf = Converting input to CDF format...
converting_to_cdf_done = Converting input to CDF format done.
printing_cdf = Printing CDF document...
printing_cdf_done = Printing CDF document done.

#SonarQube converter
sonar_downloading_project = Downloading data of project %s.

# Mapping info
mapping_introduction = CodeMetropolis Toolchain Mapping (c) University of Szeged, Department of Software Engineering
mapping_usage = Usage: java -jar mapping.jar -i <cdfFile> -m <mappingFile> [-o <outputFile>]

# Mapping notifications
reading_mapping = Reading map file...
reading_mapping_done = Reading map file done.
validating_mapping = Validating mapping...
validating_mapping_done = Validating mapping done.
reading_graph = Reading CDF file...
reading_graph_done = Reading CDF file done.
linking_metrics = Linking metrics to buildables...
linking_metrics_done = Linking metrics to buildables done.
mapping_printing_output = Generating input for placing...
mapping_printing_output_done = Generating input for placing done.

# Placing info
placing_introduction = CodeMetropolis Toolchain Placing (c) University of Szeged, Department of Software Engineering
placing_usage = Usage: java -jar placing.jar -i <inputFile> [-o <outputFile>] [-m]

# Placing notifications
placing_reading_input = Reading input file...
placing_reading_input_done = Reading input file done.
calculating_size_and_pos = Calculating building sizes and positions...
calculating_size_and_pos_done = Calculating building sizes and positions done.
placing_printing_output = Generating input for rendering...
placing_printing_output_done = Generating input for rendering done.

# Metrics processing notifications
metrics_generating_began = Generating metrics for display...
metrics_generating_done = Metrics created.

# Rendering info
rendering_introduction = CodeMetropolis Toolchain Rendering (c) University of Szeged, Department of Software Engineering
rendering_usage = Usage: java -jar rendering.jar -i <inputFile> -world <worldPath> [-t <theme>]

# Rendering notifications
world_already_exists = Another world with the same name might exist or being built right now. Do you want to overwrite? [Y/N]
render_interrupted = Interrupted. End of program.
rendering_reading_input = Reading input file...
rendering_reading_input_done = Reading input file done.
buildables_found = %d buildables were found.
creating_blocks = Generating blocks...
creating_blocks_progress = Generating blocks... %.2f%% (Remaining: %2d hours, %2d minutes)
creating_blocks_done = Generating blocks done. %d blocks were generated in %d hours and %d minutes.
placing_blocks = Placing blocks...
placing_blocks_progress = Placing blocks... %.2f%% (Remaining: %2d hours, %2d minutes)
placing_blocks_done = Placing blocks done in %d hours and %d minutes.

# Errors
command_line_error = Incorrect command line arguments.
invalid_linking_error = Linking ( %s, %s -> %s, %s ) is not supported.
invalid_linking_target_error = '%s' is not a valid linking target.
missing_resource_error = Mapping resource '%s' is not declared.
invalid_input_xml_error = Input XML is not in CMXML format.
missing_input_xml_error = The given input XML does not exits.
missing_layout_error = Layout with the given identifier does not exist.
mapping_reader_error = An error has occurred while reading the mapping file. For more information please check the log file.
cmxml_writer_error = An error has occurred while writing the output file. For more information please check the log file.
cmxml_reader_error = An error has occurred while reading the input file. For more information please check the log file.
layout_error = An error has occurred during layout creation. For more information please check the log file.
cdf_error = An error has occurred while processing CDF. For more information please check the log file.
cdf_writer_error = An error has occurred while writing CDF to file. For more information please check the log file.
cdf_not_found_error = No CDF file was found on the given path.
mapping_not_found_error = No mapping file was found on the given path.
building_creation_failed_error = An error has occurred while processing building data. Please make sure you are using a valid input file.
too_long_render_duration_error = Generating world would take more time then the maximum allowed (%d minutes)
placing_blocks_failed_error = An error has occurred while placing blocks. For more information please check the log file.
converter_error = An error has occurred while converting to CDF format. For more information please check the log file.
invalid_hierarchy_error = Invalid structure has been found in buildable hierarchy.
invalid_scale_error = Scale value must be between %.2f and %.2f.
invalid_converter_type = Converter with the given identifier does not exist.
invalid_params = Invalid parameter format.
sonar_connect_error = Could not connect to SonarQube server.
sonar_unauthorized_error = Unauthorized server access. Please provide your username and password in converter parameters if you are accessing a non-public SonarQube resource.sourcemeter_only_error = Only SourceMeter metrics are allowed for the in-game display.
xml_not_found = XML not found, expected location:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
converter_log_file = CodeMetropolis_toolchain.log
mapping_log_file = CodeMetropolis_toolchain.log
placing_log_file = CodeMetropolis_toolchain.log
converter_log_file = CodeMetropolis_toolchain.log
mapping_log_file = CodeMetropolis_toolchain.log
placing_log_file = CodeMetropolis_toolchain.logmetrics_log_file = CodeMetropolis_toolchain.log
rendering_log_file = CodeMetropolis_toolchain.log
Expand Down
Loading