Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
4d3972b
Added a new maven module for the gui application.
h361758 Apr 10, 2016
844e411
Base UI layout and desing.
h361758 Apr 13, 2016
f363a68
Browse windows, modularized metric generators, start of execution pip…
szkabel Apr 15, 2016
1b6e182
First working version with SourceMeter
szkabel Apr 15, 2016
e6ddbc8
Massive refactor, clean, documentation and code style improvements.
h361758 Apr 16, 2016
8219155
Randomized the cover image.
h361758 Apr 16, 2016
0183690
Corrected misspelled package name.
h361758 Apr 16, 2016
72cae42
Added JUnit tests for the custom FileFilter implementations used by t…
h361758 Apr 16, 2016
064b739
One more new Unit test to GuiUtils findMineCraftRoot
szkabel Apr 18, 2016
daf94ce
Fixed an issue that caused world generation to start even if the metr…
h361758 Apr 18, 2016
87ff165
Minor code refactor.
h361758 Apr 18, 2016
58cfa63
Added a dialog to indicate that the world generation has finished.
h361758 Apr 18, 2016
8b6eaf1
Merge remote-tracking branch 'origin/feature/gui-convert' into featur…
h361758 Apr 18, 2016
992c5ea
CodeMetropolis API fixed.
blip24 Apr 20, 2016
5f4a37e
Finalizing commit before creating the pull request.
h361758 Apr 27, 2016
dcae45b
Added a new dialog window for displaying the output of the toolchain …
h361758 May 1, 2016
33e7384
Merge remote-tracking branch 'upstream/develop' into feature/gui-convert
h361758 May 1, 2016
02ef432
Updated the version numbers to 1.4.0.
h361758 May 1, 2016
3d02d86
Extracted the anonymous worker subclasses to their own files to make …
h361758 May 1, 2016
87cbb95
Added missing JavaDoc comments and tags.
h361758 May 1, 2016
e973e69
Corrected some formatting mistakes that were caused by an indentation…
h361758 May 1, 2016
76c1c81
Mapping model updated to provide support for creating mapping files p…
blip24 May 4, 2016
68fefcc
Merge pull request #87 from szkabel/feature/gui-convert
geryxyz May 6, 2016
d1d2583
Implemented basic class relationship with tunnels (also with basic re…
Apr 8, 2018
c306a7f
Now tunnels are underground and added stairs to them.
Apr 12, 2018
20b6f8c
Changes in placing
Apr 13, 2018
7949d31
Simplified and corrected placing
Apr 13, 2018
832f1f8
Buildings now cant contain two stairs to a tunnel, stairs are present…
Apr 13, 2018
f1c05f9
Made more complex example for mapping.
Apr 13, 2018
3535544
Added unit test classes bounded to tunnel implementation.
Apr 16, 2018
499f30a
added basic lighting to tunnels (glowstone floor)
wyvick Apr 17, 2018
1c02c78
replaced tunnel lighting to single redstone lamp line
wyvick Apr 17, 2018
639e480
Merge branch 'lighting' into develop
wyvick Apr 17, 2018
592bc66
Fixed stair placing, added bridge class and test class for bridge.
Apr 19, 2018
e615696
Repaired unit tests
Apr 21, 2018
dc1dfa9
refactored prepareLightning
Apr 21, 2018
289b6d2
added tests for prepareLightning
Apr 21, 2018
72e5444
Repaired stairs at bridge
Apr 21, 2018
b617cf9
Update README.md
geryxyz Feb 16, 2017
dd67533
Update README.md
geryxyz Feb 16, 2017
f701665
Added: '.idea' to .gitingore file
redLeR1st Mar 25, 2018
42f3e6d
Implemented: inheritence in converter and mapping
redLeR1st Apr 19, 2018
faf5dbd
WIP added support for attribute member relations
wyvick Apr 19, 2018
a681ac6
added working attributes support
Apr 20, 2018
5409091
Check if relation file is exist
redLeR1st Apr 21, 2018
69263a3
Removed: -r alias --relationFile as an option
redLeR1st Apr 21, 2018
8061617
Added: tunnel and bridge to garden's properties. Code clean up. Unexp…
redLeR1st Apr 21, 2018
b5f2993
Removed: 'TODO:' labe
redLeR1st Apr 21, 2018
2a79094
Merge pull request #4 from wyvick/converter-mapping-to-handle-inherit…
redLeR1st Apr 21, 2018
796a67e
added unit tests for mapping
Apr 21, 2018
dc6c698
Tests for Relations class
redLeR1st Apr 21, 2018
b0077c6
Merge pull request #5 from wyvick/converter-test
redLeR1st Apr 21, 2018
5dfac8f
Tested: mapping methods
redLeR1st Apr 21, 2018
61ef65f
Merge pull request #6 from wyvick/mapping-test
redLeR1st Apr 21, 2018
d75f377
added partial SolidBlockTest
Apr 21, 2018
04ac2e6
Merge branch 'rendering-test' into develop
Apr 21, 2018
984acbe
added test for LimitController
Apr 21, 2018
daee3ee
added test for QuantizationConversionTest
Apr 21, 2018
6ffd043
updated pom.xml and .classpath
Apr 21, 2018
d5b00f2
corrected typo
Apr 21, 2018
1129799
corrected typo
Apr 21, 2018
0418589
corrected tests
Apr 21, 2018
a2fc458
Modified step height.
Apr 21, 2018
436c12d
basic refactoring (variable names)
wyvick May 17, 2018
cdcfd4d
refactoring: separate methods
wyvick May 17, 2018
892760c
renamed parser class file
wyvick May 17, 2018
f09e81b
Merge branch 'hotfix' into develop
wyvick May 17, 2018
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
**/bin/**
**/target/**
**/tmp/**
**/.idea/**
**/.metadata/**
**/.settings/**
**/.recommenders/**
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ CodeMetropolis
See your software as never before.

Official community page: https://plus.google.com/communities/110235162339639686953

BlockModifier-API aviable at: https://github.com/blip24/BlockModifier-API
471 changes: 471 additions & 0 deletions examples/placing/mapping_out-with-tunnel.xml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions sources/codemetropolis-toolchain-commons/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="test"/>
<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.4</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public enum Type {
GARDEN,
FLOOR,
CELLAR,
CONTAINER;
CONTAINER,
TUNNEL,
BRIDGE;
}

private String id;
Expand All @@ -28,6 +30,8 @@ public enum Type {
private List<Buildable> children;
private Buildable parent;
private String cdfNames;
private boolean hasLowerStairs;
private boolean hasUpperStairs;

public Buildable(String id, String name, Type type) {
this(id, name, type, new Point(), new Point());
Expand All @@ -41,6 +45,8 @@ public Buildable(String id, String name, Type type, Point position, Point size)
this.size = size;
this.attributes = new ArrayList<Attribute>();
this.children = new ArrayList<Buildable>();
this.setHasLowerStairs(false);
this.setHasUpperStairs(false);
}

public boolean isOverlapping(Buildable b) {
Expand Down Expand Up @@ -459,5 +465,22 @@ public Element toXmlElement(Document doc, boolean recursive) {

return buildable;
}

public boolean hasLowerStairs() {
return hasLowerStairs;
}

public void setHasLowerStairs(boolean hasLowerStairs) {
this.hasLowerStairs = hasLowerStairs;
}

public boolean hasUpperStairs() {
return hasUpperStairs;
}

public void setHasUpperStairs(boolean hasUpperStairs) {
this.hasUpperStairs = hasUpperStairs;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ public void loadFromFile(String path) throws CmxmlReaderException {
Document doc = dBuilder.parse(xmlFile);
doc.getDocumentElement().normalize();
NodeList nList = doc.getElementsByTagName("buildable");




for (int temp = 0; temp < nList.getLength(); temp++) {
Node nNode = nList.item(temp);
if (nNode.getNodeType() == Node.ELEMENT_NODE) {
Expand All @@ -132,6 +134,10 @@ public void loadFromFile(String path) throws CmxmlReaderException {
break;
case "container": type = Type.CONTAINER;
break;
case "tunnel": type = Type.TUNNEL;
break;
case "bridge": type = Type.BRIDGE;
break;
}

Point position;
Expand Down Expand Up @@ -165,7 +171,6 @@ public void loadFromFile(String path) throws CmxmlReaderException {
);

NodeList attributeNodes = eElement.getElementsByTagName("attributes").item(0).getChildNodes();

for(int i = 1; attributeNodes.item(i) != null; i += 2) {
b.addAttribute(
((Element)attributeNodes.item(i)).getAttribute("name"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@ public static void load(String filePath) {
}

public static void logInfo(String message) {
if(logger == null) return;
logger.log(Level.INFO, message);
}

public static void logWarning(String message, Exception exception) {
if(logger == null) return;
logger.log(Level.WARNING, message, exception);
}

public static void logError(String message, Exception exception) {
if(logger == null) return;
logger.log(Level.SEVERE, message, exception);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
package codemetropolis.toolchain.commons.cmxml;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.util.ArrayList;
import java.util.List;

import org.junit.BeforeClass;
import org.junit.Test;

import codemetropolis.toolchain.commons.cmxml.Buildable.Type;

/** Test class for {@link Tunnel} to test basic functions.
*
* @author Csuvik Viktor {@literal D1YZL5}
* @version %I%
*
*/

public class BuildableTest {

private static Buildable b1;
private static Buildable b2;

@BeforeClass
public static void setUpBeforeClass() {
b1 = new Buildable("UNIQUE_ID_1", "SAMPLE_TUNNEL_1", Type.TUNNEL, new Point(0, 0, 0), new Point(10, 5, 2));
b2 = new Buildable("UNIQUE_ID_2", "SAMPLE_TUNNEL_2", Type.TUNNEL, new Point(0, 0, 0), new Point(2, 5, 10));

b1.addChild(b2);
}


@Test
public void testIsOverlapping() {

assertTrue(b1.isOverlapping(b2));
assertTrue(b1.isOverlapping(b2.getPositionX(), b2.getPositionZ()));

b2.setPositionX(11);
assertFalse(b1.isOverlapping(b2));
assertFalse(b1.isOverlapping(b2.getPositionX(), b2.getPositionZ()));
}

@Test
public void testGetDescendants() {
List<Buildable> buildables1 = b1.getDescendants();

List<Buildable> buildables2 = new ArrayList<Buildable>();
buildables2.add(b2);

assertArrayEquals(buildables1.toArray(), buildables2.toArray());
}

@Test
public void testGetAncestors() {
List<Buildable> buildables = new ArrayList<Buildable>();
buildables.add(b1);

assertArrayEquals(buildables.toArray(), b2.getAncestors());
}

@Test
public void testEquals() {
assertTrue(b1.equals(b1));
assertTrue(b2.equals(b2));

assertFalse(b1.equals(b2));
assertFalse(b2.equals(b1));

assertFalse(b1.equals(null));


Buildable b3 = new Buildable("UNIQUE_ID_1", "SAMPLE_TUNNEL_1", Type.TUNNEL, new Point(0, 0, 0), new Point(10, 5, 2));
assertTrue(b1.equals(b3));

b3.setName("SOMETHING_ELSE");
assertFalse(b1.equals(b3));

b3.setName("SAMPLE_TUNNEL_1");
b3.setType(Type.GARDEN);
assertFalse(b3.equals(b1));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package codemetropolis.toolchain.commons.cmxml.comparators;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

import codemetropolis.toolchain.commons.cmxml.Buildable;
import codemetropolis.toolchain.commons.cmxml.Buildable.Type;
import codemetropolis.toolchain.commons.cmxml.Point;

/** Test class for {@link Tunnel}, to test depth comparator.
*
* @author Csuvik Viktor {@literal D1YZL5}
* @version %I%
*
*/

public class BuildableDepthComparatorTest {

@Test
public void testCompare() {
BuildableDepthComparator c = new BuildableDepthComparator();
Buildable b1 = new Buildable("UNIQUE_ID_1", "SAMPLE_TUNNEL_1", Type.TUNNEL, new Point(0, 0, 0), new Point(10, 10, 10));
Buildable b2 = new Buildable("UNIQUE_ID_2", "SAMPLE_TUNNEL_2", Type.TUNNEL, new Point(0, 0, 0), new Point(10, 10, 10));
assertTrue(c.compare(b1, b2) == 0);

Buildable b3 = new Buildable("UNIQUE_ID_3", "SAMPLE_TUNNEL_3", Type.TUNNEL, new Point(0, 0, 0), new Point(15, 15, 15));
assertTrue(c.compare(b1, b3) != 0);

Buildable b4 = new Buildable("UNIQUE_ID_4", "SAMPLE_GARDEN_1", Type.GARDEN, new Point(0, 0, 0), new Point(10, 10, 10));
assertTrue(c.compare(b1, b4) == 0);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package codemetropolis.toolchain.commons.cmxml.comparators;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

import codemetropolis.toolchain.commons.cmxml.Buildable;
import codemetropolis.toolchain.commons.cmxml.Point;
import codemetropolis.toolchain.commons.cmxml.Buildable.Type;

/** Test class for {@link Tunnel}, to test size comparator.
*
* @author Csuvik Viktor {@literal D1YZL5}
* @version %I%
*
*/


public class BuildableSizeComparatorTest {

@Test
public void testCompare() {
BuildableSizeComparator c = new BuildableSizeComparator();
Buildable b1 = new Buildable("UNIQUE_ID_1", "SAMPLE_TUNNEL_1", Type.TUNNEL, new Point(0, 0, 0), new Point(10, 10, 10));
Buildable b2 = new Buildable("UNIQUE_ID_2", "SAMPLE_TUNNEL_2", Type.TUNNEL, new Point(0, 0, 0), new Point(10, 10, 10));
assertTrue(c.compare(b1, b2) == 0);

Buildable b3 = new Buildable("UNIQUE_ID_3", "SAMPLE_TUNNEL_3", Type.TUNNEL, new Point(0, 0, 0), new Point(15, 15, 15));
assertTrue(c.compare(b1, b3) != 0);

Buildable b4 = new Buildable("UNIQUE_ID_4", "SAMPLE_GARDEN_1", Type.GARDEN, new Point(0, 0, 0), new Point(10, 10, 10));
assertTrue(c.compare(b1, b4) == 0);
}

}
6 changes: 6 additions & 0 deletions sources/codemetropolis-toolchain-converter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>codemetropolis.toolchain</groupId>
<artifactId>codemetropolis-toolchain-commons</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class CommandLineOptions {

@Option(name="-p", handler = StringArrayOptionHandler.class, aliases = {"--params"})
private String[] params = null;

public String getOutputFile(){
return outputFile;
}
Expand All @@ -39,5 +39,4 @@ public boolean showHelp() {
public String[] getParams() {
return params;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import codemetropolis.toolchain.commons.executor.ExecutorArgs;
import codemetropolis.toolchain.commons.util.Resources;
import codemetropolis.toolchain.converter.control.ConverterLoader;
import codemetropolis.toolchain.converter.relations.Relations;

public class ConverterExecutor extends AbstractExecutor {

Expand All @@ -26,7 +27,7 @@ public void onConverterEvent(ConverterEvent event) {
}

});

print(Resources.get("converting_to_cdf"));
CdfTree cdfTree = null;
try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package codemetropolis.toolchain.converter;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

Expand All @@ -12,7 +13,7 @@ public class ConverterExecutorArgs extends ExecutorArgs {
private String source;
private String outputFile;
private Map<String, String> params;

public ConverterExecutorArgs(ConverterType type, String source, String outputFile) {
this(type, source, outputFile, null);
}
Expand All @@ -38,7 +39,7 @@ public String getOutputFile(){
}

public Map<String, String> getParams() {
return new HashMap<>(params);
return Collections.unmodifiableMap(params);
}

public String getParameter(String key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.HashMap;
import java.util.Map;

import codemetropolis.toolchain.converter.relations.Relations;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;

Expand All @@ -11,6 +12,8 @@
import codemetropolis.toolchain.commons.util.Settings;
import codemetropolis.toolchain.converter.control.ConverterType;

import javax.management.relation.RelationService;

public class Main {

public static void main(String[] args) {
Expand Down
Loading