Commit a1e80c61 authored by Florian Grabowski's avatar Florian Grabowski
Browse files

Language Changes

parent b7e294e8
......@@ -20,6 +20,10 @@
<excludeFolder url="file://$MODULE_DIR$/src/server/logs" />
<excludeFolder url="file://$MODULE_DIR$/.idea/dataSources" />
<excludeFolder url="file://$MODULE_DIR$/target" />
<excludeFolder url="file://$MODULE_DIR$/src/server/plugins" />
<excludeFolder url="file://$MODULE_DIR$/src/server/world" />
<excludeFolder url="file://$MODULE_DIR$/src/server/world_nether" />
<excludeFolder url="file://$MODULE_DIR$/src/server/world_the_end" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
......
......@@ -82,7 +82,7 @@ public class GenerateLayout implements CommandExecutor {
return true;
} else {
Bukkit.getLogger().log(Level.SEVERE, "Kein Spieler gefunden.");
Bukkit.getLogger().log(Level.SEVERE, "no player found.");
return false;
}
}
......
......@@ -42,7 +42,7 @@ public class SetPreset implements CommandExecutor {
t.run();
}
} else {
Bukkit.getLogger().log(Level.SEVERE, "Kein Spieler gefunden.");
Bukkit.getLogger().log(Level.SEVERE, "no player found.");
return false;
}
return true;
......
......@@ -32,15 +32,15 @@ public class Klasse {
public static int variablesMin= Integer.MAX_VALUE;
public static int variablesMax;
public Duration bearbeiteteZeit;
public static Duration bearbeiteteZeitMin;
public static Duration bearbeiteteZeitMax;
public Duration zeitSeitLetzterBearbeitung;
public static Duration zeitSeitLetzterBearbeitungMin;
public static Duration zeitSeitLetzterBearbeitungMax;
public Duration zeitSeitErstemCommit;
public static Duration zeitSeitErstemCommitMin;
public static Duration zeitSeitErstemCommitMax;
public Duration existingTime;
public static Duration existingTimeMin;
public static Duration existingTimeMax;
public Duration lastEditingTime;
public static Duration lastEditingTimeMin;
public static Duration lastEditingTimeMax;
public Duration firstCommitTime;
public static Duration firstCommitTimeMin;
public static Duration firstCommitTimeMax;
ArrayList<LocalDateTime> commitTimes;
public Klasse(int id, String name, String path, int qloc, int loc, int commits, int functions, int variables,int complexity, ArrayList<LocalDateTime> commitTimes){
......@@ -68,26 +68,26 @@ public class Klasse {
this.name = name;
this.path = path;
this.commitTimes = commitTimes;
this.bearbeiteteZeit = (commitTimes.isEmpty()) ? null:Duration.between(commitTimes.get(commitTimes.size()-1), commitTimes.get(0));
if (bearbeiteteZeit != null) {
if(bearbeiteteZeitMax == null)bearbeiteteZeitMax = Duration.ofMillis(Long.MIN_VALUE);
if(bearbeiteteZeitMin == null)bearbeiteteZeitMin = Duration.ofMillis((Long.MAX_VALUE));
bearbeiteteZeitMax = (bearbeiteteZeitMax.toMillis() >= bearbeiteteZeit.toMillis()) ? bearbeiteteZeitMax:bearbeiteteZeit;
bearbeiteteZeitMin = (bearbeiteteZeitMin.toMillis() <= bearbeiteteZeit.toMillis()) ? bearbeiteteZeitMin:bearbeiteteZeit;
this.existingTime = (commitTimes.isEmpty()) ? null:Duration.between(commitTimes.get(commitTimes.size()-1), commitTimes.get(0));
if (existingTime != null) {
if(existingTimeMax == null) existingTimeMax = Duration.ofMillis(Long.MIN_VALUE);
if(existingTimeMin == null) existingTimeMin = Duration.ofMillis((Long.MAX_VALUE));
existingTimeMax = (existingTimeMax.toMillis() >= existingTime.toMillis()) ? existingTimeMax : existingTime;
existingTimeMin = (existingTimeMin.toMillis() <= existingTime.toMillis()) ? existingTimeMin : existingTime;
}
this.zeitSeitLetzterBearbeitung = (commitTimes.isEmpty()) ? null:Duration.between(commitTimes.get(0),LocalDateTime.now());
if (zeitSeitLetzterBearbeitung != null) {
if(zeitSeitLetzterBearbeitungMax == null)zeitSeitLetzterBearbeitungMax = Duration.ofMillis(Long.MIN_VALUE);
if(zeitSeitLetzterBearbeitungMin == null)zeitSeitLetzterBearbeitungMin = Duration.ofMillis(Long.MAX_VALUE);
zeitSeitLetzterBearbeitungMax = (zeitSeitLetzterBearbeitungMax.toMillis() >= zeitSeitLetzterBearbeitung.toMillis()) ? zeitSeitLetzterBearbeitungMax:zeitSeitLetzterBearbeitung;
zeitSeitLetzterBearbeitungMin = (zeitSeitLetzterBearbeitungMin.toMillis() <= zeitSeitLetzterBearbeitung.toMillis()) ? zeitSeitLetzterBearbeitungMin:zeitSeitLetzterBearbeitung;
this.lastEditingTime = (commitTimes.isEmpty()) ? null:Duration.between(commitTimes.get(0),LocalDateTime.now());
if (lastEditingTime != null) {
if(lastEditingTimeMax == null) lastEditingTimeMax = Duration.ofMillis(Long.MIN_VALUE);
if(lastEditingTimeMin == null) lastEditingTimeMin = Duration.ofMillis(Long.MAX_VALUE);
lastEditingTimeMax = (lastEditingTimeMax.toMillis() >= lastEditingTime.toMillis()) ? lastEditingTimeMax : lastEditingTime;
lastEditingTimeMin = (lastEditingTimeMin.toMillis() <= lastEditingTime.toMillis()) ? lastEditingTimeMin : lastEditingTime;
}
this.zeitSeitErstemCommit = (commitTimes.isEmpty()) ? null:Duration.between(commitTimes.get(commitTimes.size()-1),LocalDateTime.now());
if (zeitSeitErstemCommit != null) {
if(zeitSeitErstemCommitMax == null)zeitSeitErstemCommitMax = Duration.ofMillis(Long.MIN_VALUE);
if(zeitSeitErstemCommitMin == null)zeitSeitErstemCommitMin = Duration.ofMillis(Long.MAX_VALUE);
zeitSeitErstemCommitMax = (zeitSeitErstemCommitMax.toMillis() >= zeitSeitErstemCommit.toMillis()) ? zeitSeitErstemCommitMax:zeitSeitErstemCommit;
zeitSeitErstemCommitMin = (zeitSeitErstemCommitMin.toMillis() <= zeitSeitErstemCommit.toMillis()) ? zeitSeitErstemCommitMin:zeitSeitErstemCommit;
this.firstCommitTime = (commitTimes.isEmpty()) ? null:Duration.between(commitTimes.get(commitTimes.size()-1),LocalDateTime.now());
if (firstCommitTime != null) {
if(firstCommitTimeMax == null) firstCommitTimeMax = Duration.ofMillis(Long.MIN_VALUE);
if(firstCommitTimeMin == null) firstCommitTimeMin = Duration.ofMillis(Long.MAX_VALUE);
firstCommitTimeMax = (firstCommitTimeMax.toMillis() >= firstCommitTime.toMillis()) ? firstCommitTimeMax : firstCommitTime;
firstCommitTimeMin = (firstCommitTimeMin.toMillis() <= firstCommitTime.toMillis()) ? firstCommitTimeMin : firstCommitTime;
}
}
......
......@@ -7,7 +7,7 @@ import java.util.ArrayList;
public class Quadrat extends Shape {
private Boolean belegt;
private Boolean filled;
public Structure getStructure() {
return structure;
......@@ -19,9 +19,9 @@ public class Quadrat extends Shape {
this.bottomLeftCorner = bottomLeftCorner;
this.topRightCorner = topRightCorner;
this.xEdgeLength = topRightCorner.x-bottomLeftCorner.x;
this.belegt=false;
this.filled =false;
if(topRightCorner.y-bottomLeftCorner.y < 3 || topRightCorner.x-bottomLeftCorner.x <3){
throw new IllegalArgumentException("keine Quadrate < 3 erlaubt");
throw new IllegalArgumentException("no Quadrate < 3 permitted");
}
}
......@@ -29,14 +29,14 @@ public class Quadrat extends Shape {
this.xEdgeLength = xEdgeLength;
this.bottomLeftCorner = bottomLeftCorner;
this.topRightCorner = new Point(bottomLeftCorner.x+xEdgeLength,bottomLeftCorner.y+xEdgeLength);
this.belegt = false;
this.filled = false;
if(xEdgeLength < 3 || topRightCorner.x-bottomLeftCorner.x <3){
throw new IllegalArgumentException("keine Quadrate < 3 erlaubt " + xEdgeLength);
throw new IllegalArgumentException("no Quadrate < 3 permitted " + xEdgeLength);
}
}
public ArrayList<Quadrat> setBelegt(Structure structure) {
this.belegt = true;
public ArrayList<Quadrat> setFilled(Structure structure) {
this.filled = true;
this.structure = structure;
ArrayList<Quadrat> result = new ArrayList<>();
if(this.xEdgeLength > structure.getWidth().x+3){//if you can split rest into more quads
......@@ -54,8 +54,8 @@ public class Quadrat extends Shape {
return result;
}
public Boolean getBelegt() {
return belegt;
public Boolean getFilled() {
return filled;
}
public Point getWidth(){
......
......@@ -49,16 +49,16 @@ public class SimpleSquareLayout {
first = false;
this.size = s.getWidth().x;
layout.add(new Quadrat(new Point(0,0),s.getWidth().x));
layout.addAll(layout.get(0).setBelegt(s));
layout.addAll(layout.get(0).setFilled(s));
}else{
layout.sort(new CoordinateYComparator());
layout.sort(new CoordinateXComparator());
layout.sort(new WidthComparator());
boolean noneFoundFlag = true;
for (int i = 0;i < layout.size();i++) {
if((s.getWidth().x <= layout.get(i).getWidth().x)&&(!layout.get(i).getBelegt())&&(noneFoundFlag)){
if((s.getWidth().x <= layout.get(i).getWidth().x)&&(!layout.get(i).getFilled())&&(noneFoundFlag)){
noneFoundFlag = false;
layout.addAll(layout.get(i).setBelegt(s));
layout.addAll(layout.get(i).setFilled(s));
}
}
if (noneFoundFlag){
......@@ -70,12 +70,12 @@ public class SimpleSquareLayout {
private void appendQuad(Structure structure){
Quadrat q = new Quadrat(new Point(this.size,0),structure.getWidth().x);
q.setBelegt(structure);
q.setFilled(structure);
this.size += structure.getWidth().x;
layout.add(q);
layout.add(new Quadrat(new Point(q.bottomLeftCorner.y,q.bottomLeftCorner.x),new Point(q.topRightCorner.y,q.topRightCorner.x))); // gespiegeltes Quadrat
layout.add(new Quadrat(new Point(q.bottomLeftCorner.x,q.bottomLeftCorner.x),structure.getWidth().x)); // Oberes rechtes Quadrat
if((this.size-(2*structure.getWidth().x)) > 0){ //falls Abstand zwischen den Quadraten ist.
if((this.size-(2*structure.getWidth().x)) > 0){ //in case there is space between those quads.
de._82grfl1bif.kpiVisualizer.layouts.simpleSquare.Rectangle rTop = new de._82grfl1bif.kpiVisualizer.layouts.simpleSquare.Rectangle(structure.getWidth().x,(this.size-2*structure.getWidth().x),new Point(q .topRightCorner.y,q.bottomLeftCorner.x));
layout.addAll(rTop.splitToQuads(rTop));
de._82grfl1bif.kpiVisualizer.layouts.simpleSquare.Rectangle rRight = new Rectangle((this.size-2*structure.getWidth().x),structure.getWidth().x,new Point(q.bottomLeftCorner.x,q.topRightCorner.y));
......@@ -85,12 +85,12 @@ public class SimpleSquareLayout {
public Point getCoordinateOf(Structure structure) throws AttributeNotFoundException {
for (Quadrat q:this.layout) {
if(q.getBelegt()){
if(q.getFilled()){
if(q.getStructure().equals(structure)){
return q.bottomLeftCorner;
}
}
}
throw new AttributeNotFoundException("Diese Structure ist nicht in der Ebene.");
throw new AttributeNotFoundException("This structure couldn't found in the hierarchy.");
}
}
......@@ -25,7 +25,7 @@ public class SquarifiedTreemapLayout {
ArrayList<Row> tempRows = new ArrayList<>();
rows.stream().filter(r -> r.rectangles.containsValue(foundations.get(foundations.size()-1))).forEach(row ->
tempRows.addAll(generateSubLayout(foundations.get(foundations.size()-1), new Rectangle(foundations.get(foundations.size()-1).getArea(), row.getWidth(), row.space.getOrigin()))));
rows.addAll(tempRows);//letztes element bearbeitet und ein subLayout dafür angelegt.
rows.addAll(tempRows);//last element processed and created a sublayout.
ArrayList<Foundation> tempFoundations = new ArrayList<>();
for (Structure s : foundations.get(foundations.size() - 1).getChildren()) {
......@@ -34,7 +34,7 @@ public class SquarifiedTreemapLayout {
}
}
foundations.remove(foundations.size()-1);
foundations.addAll(tempFoundations);//alle Kinder(nur Foundations) des letzten Elements in die Liste geschrieben und das Element entfernt.
foundations.addAll(tempFoundations);//all children(just Foundations) added and removed the Foundation.
} while (!foundations.isEmpty());
}
......@@ -43,11 +43,11 @@ public class SquarifiedTreemapLayout {
ArrayList<Row> result = new ArrayList<>();
result.add(new Row(rectangle));
for (Structure s : foundation.getChildren()) {
if (!result.get(result.size() - 1).checkInsert(s.getArea())) {//wenn einfügen in die bestehende Reihe das Seitenverhältnis verschlechtern würde.
Row tempRow = new Row(result.get(result.size() - 1).getLeftover());//erzeige neue Reihe mit dem Rest des alten spaces als space.
result.add(tempRow);//füge die neue Reihe ans Ende der Sammlung ein.
if (!result.get(result.size() - 1).checkInsert(s.getArea())) {//in case an insertion would make the ratio worse.
Row tempRow = new Row(result.get(result.size() - 1).getLeftover());//create new Row with the remaining space of the old Row.
result.add(tempRow);//put the new Row at the end of the list.
}
result.get(result.size() - 1).addRectangle(s.getArea(), s);//füge das Kind in die letzte Reihe ein, die in der Liste ist.
result.get(result.size() - 1).addRectangle(s.getArea(), s);//put the child in the last Row of the list.
}
return result;
}
......
......@@ -14,7 +14,7 @@ import java.util.Objects;
import java.util.Random;
import java.util.logging.Level;
@SuppressWarnings("ALL")
public class Builder {
Server server;
......@@ -115,43 +115,41 @@ public class Builder {
addDescription(s.getLocation().clone().add(0, s.getDepth(), 0), s);
setAllChildren((Foundation) s);
} else {//TODO must be revisited to draw rectangular Buildings
float ersterCommit = ((Building) s).klasse.zeitSeitErstemCommit.toDays();
float scaleErsterCommit;
if((float)Klasse.zeitSeitErstemCommitMin.toDays() == (float)Klasse.zeitSeitErstemCommitMax.toDays()){
scaleErsterCommit = 0f;
float firstCommit = ((Building) s).klasse.firstCommitTime.toDays();
float scaleFirstCommit;
if((float)Klasse.firstCommitTimeMin.toDays() == (float)Klasse.firstCommitTimeMax.toDays()){
scaleFirstCommit = 0f;
}else {
scaleErsterCommit = ((ersterCommit - (float)Klasse.zeitSeitErstemCommitMin.toDays()) / ((float) Klasse.zeitSeitErstemCommitMax.toDays() - (float)Klasse.zeitSeitErstemCommitMin.toDays()));
scaleFirstCommit = ((firstCommit - (float)Klasse.firstCommitTimeMin.toDays()) / ((float) Klasse.firstCommitTimeMax.toDays() - (float)Klasse.firstCommitTimeMin.toDays()));
}
Duration d = ((Building) s).klasse.zeitSeitLetzterBearbeitung;
float letzterBearbeitung = d.toDays();
float scaleLetzterBearbeitung;
if((float)Klasse.zeitSeitLetzterBearbeitungMin.toDays() == (float)Klasse.zeitSeitLetzterBearbeitungMax.toDays()){
scaleLetzterBearbeitung = 0f;
Duration d = ((Building) s).klasse.lastEditingTime;
float lastCommit = d.toDays();
float scaleLastCommit;
if((float)Klasse.lastEditingTimeMin.toDays() == (float)Klasse.lastEditingTimeMax.toDays()){
scaleLastCommit = 0f;
}else {
scaleLetzterBearbeitung = ((letzterBearbeitung - (float)Klasse.zeitSeitLetzterBearbeitungMin.toDays()) / ((float)Klasse.zeitSeitLetzterBearbeitungMax.toDays() - (float)Klasse.zeitSeitLetzterBearbeitungMin.toDays()));
scaleLastCommit = ((lastCommit - (float)Klasse.lastEditingTimeMin.toDays()) / ((float)Klasse.lastEditingTimeMax.toDays() - (float)Klasse.lastEditingTimeMin.toDays()));
}
Material facadeMaterial;
if(scaleErsterCommit < 0.10){
if(scaleFirstCommit < 0.10){
facadeMaterial = Material.WAXED_COPPER_BLOCK;
}else if(scaleErsterCommit < 0.5){
}else if(scaleFirstCommit < 0.5){
facadeMaterial = Material.WAXED_EXPOSED_COPPER;
}else if(scaleErsterCommit < 0.90){
}else if(scaleFirstCommit < 0.90){
facadeMaterial = Material.WAXED_WEATHERED_COPPER;
}else {
facadeMaterial = Material.WAXED_OXIDIZED_COPPER;
}
Material facadeInnerMaterial;
if(scaleLetzterBearbeitung< 0.10){
if(scaleLastCommit< 0.10){
facadeInnerMaterial = Material.WHITE_STAINED_GLASS;
}else if(scaleLetzterBearbeitung < 0.5){
}else if(scaleLastCommit < 0.5){
facadeInnerMaterial = Material.GLASS;
}else if(scaleLetzterBearbeitung < 0.90){
}else if(scaleLastCommit < 0.90){
facadeInnerMaterial = Material.BLUE_STAINED_GLASS;
}else {
facadeInnerMaterial = Material.IRON_BARS;
}
//System.out.println(letzterBearbeitung);
//System.out.println(scaleLetzterBearbeitung);
this.buildBuilding(s.getLocation().clone().add(1, s.getDepth() + 1,1),
s.getWidth().x - 2,
((Building) s).getHeight()+1,
......@@ -208,9 +206,7 @@ public class Builder {
private void addDescription(Location startLocation, Structure structure) {
if (structure.getClass() == Foundation.class) {
//if (!((Foundation) structure).getChildren().stream().anyMatch(s -> s.getClass() == Foundation.class)) {//no foundation in Children
setFoundationSing(startLocation,(Foundation) structure);
//}
} else {
setWallSing(startLocation, (Building) structure, BlockFace.NORTH);
setWallSing(startLocation, (Building) structure, BlockFace.EAST);
......
......@@ -16,7 +16,7 @@ public class Building extends Structure{
this.height = height;
this.material = material;
if(this.width.x < 5){
throw new IllegalArgumentException("keine Gebäude kleiner 5 wegen 2 Gehweg");
throw new IllegalArgumentException("no buildings smaller than 5");
}
}
......@@ -28,7 +28,7 @@ public class Building extends Structure{
this.name = name;
this.height = klasse.functions;
if(this.width.x < 5 || this.width.y < 5){
throw new IllegalArgumentException("keine Gebäude kleiner 5 wegen 2 Gehweg");
throw new IllegalArgumentException("no buildings smaller than 5");
}
}
......
......@@ -220,7 +220,6 @@ public class Foundation extends Structure {
allFoundations.sort(new DepthComparator());
Collections.reverse(allFoundations); //higher Depths first
for (Foundation f : allFoundations) {
//if(!this.equals(f))
f.organizeFoundation();
}
} else { //normal Call and recursion
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment