Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/CodeMetropolis-k18.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ http://codemetropolis.github.io/CodeMetropolis/
1. navigate to `sources` folder
1. `mvn clean package`
1. The current distribution will be aviable under `source/distro`.

## Demo
1 change: 1 addition & 0 deletions sources/commons/src/main/resources/resources.properties
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ 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.
invalid_xml_input_type_error = Input XML is not in correct XML 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.
Expand Down
15,695 changes: 15,695 additions & 0 deletions sources/distro/converterToMapping.xml

Large diffs are not rendered by default.

Binary file added sources/distro/log4j-1.2.17.graph
Binary file not shown.
2,994 changes: 2,994 additions & 0 deletions sources/distro/mappingToPlacing.xml

Large diffs are not rendered by default.

2,994 changes: 2,994 additions & 0 deletions sources/distro/placingToRendering.xml

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions sources/distro/sourcemeter_mapping_example_2_0.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<mapping version="2.0">
<resources>
<constant id="cellar_character" value="planks"/>
<constant id="cellar_external_character" value="wood"/>
</resources>
<linking source="package" target="ground"/>
<linking source="class" 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"/>
<binding from="NOI" to="length"/>
<binding from="McCC" to="character">
<conversions>
<conversion type="quantization">
<parameter name="level0" value="glass"/>
<parameter name="level1" value="sand"/>
<parameter name="level2" value="planks"/>
<parameter name="level3" value="stone"/>
<parameter name="level4" value="obsidian"/>
</conversion>
</conversions>
</binding>
<binding from="McCC" to="external_character">
<conversions>
<conversion type="quantization">
<parameter name="level0" value="metal"/>
<parameter name="level1" value="sandstone"/>
<parameter name="level2" value="wood"/>
<parameter name="level3" value="cobblestone"/>
<parameter name="level4" value="obsidian"/>
</conversion>
</conversions>
</binding>
<binding from="NUMPAR" to="torches">
<conversions>
<conversion type="quantization">
<parameter name="level0" value="1"/>
<parameter name="level1" value="2"/>
<parameter name="level2" value="3"/>
</conversion>
</conversions>
</binding>
</linking>
<linking source="attribute" target="cellar">
<binding from="WarningP0" to="torches">
<conversions>
<conversion type="quantization">
<parameter name="level0" value="1"/>
<parameter name="level1" value="2"/>
</conversion>
</conversions>
</binding>
<binding from="${cellar_character}" to="character"/>
<binding from="${cellar_external_character}" to="external_character"/>
</linking>
</mapping>
9 changes: 9 additions & 0 deletions sources/distro/vizualize.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SET PATH=D:\jdk1.8.0_311\bin;%PATH%

java -jar .\converter-1.4.0.jar -t sourcemeter -s .\log4j-1.2.17.graph
java -jar .\mapping-1.4.0.jar -i .\converterToMapping.xml -m ..\..\examples\mapping\sourcemeter_mapping_example_2_0.xml
java -jar .\placing-1.4.0.jar -i .\mappingToPlacing.xml
java -jar .\rendering-1.4.0.jar -i .\placingToRendering.xml -world .\world\

:: This is a comment
:: Comment out any step you would like to skip
Empty file added sources/gui/.idea/.gitignore
Empty file.
13 changes: 13 additions & 0 deletions sources/gui/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions sources/gui/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions sources/gui/.idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions sources/gui/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions sources/gui/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions sources/gui/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*package codemetropolis.toolchain.rendering;

import org.junit.jupiter.api.Test;

public class MainTest {

private static final String TEST_ONE = "Invalid input file";

private static final String SUCCESSFUL = " was successful";
private static final String FAILED = " has failed";

public static void main(String[] args) {
testValidFile();
}

@TEST
private static void testValidFile() {
if(Validator.validateFile("")) testLogger(TEST_ONE, SUCCESSFUL);
else testLogger(TEST_ONE, FAILED);
}

private static void testLogger(String testName, String result) {
System.out.println("Test " + testName + result);
}
}
*/
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import codemetropolis.toolchain.commons.cmxml.CmxmlValidator;
import codemetropolis.toolchain.commons.cmxml.exceptions.CmxmlValidationFailedException;
import codemetropolis.toolchain.commons.exceptions.SchemeNotSetException;
import codemetropolis.toolchain.commons.executor.AbstractExecutor;
import codemetropolis.toolchain.commons.executor.ExecutorArgs;
import codemetropolis.toolchain.commons.util.FileUtils;
Expand All @@ -19,6 +20,8 @@
import codemetropolis.toolchain.rendering.exceptions.RenderingException;
import codemetropolis.toolchain.rendering.exceptions.TooLongRenderDurationException;

import javax.xml.parsers.ParserConfigurationException;

public class RenderingExecutor extends AbstractExecutor {

@Override
Expand Down Expand Up @@ -60,7 +63,7 @@ public boolean execute(ExecutorArgs args) {
printError(e, Resources.get("missing_input_xml_error"));
return false;
} catch (CmxmlValidationFailedException e) {
printError(e, Resources.get("invalid_input_xml_error"));
print(Resources.get("invalid_xml_input_type_error")); // 2022.04.24. Tajti S�ndor
return false;
}

Expand Down