TomTroppmann 2 rokov pred
rodič
commit
d794508f1f
48 zmenil súbory, kde vykonal 396 pridanie a 331 odobranie
  1. 52 0
      res/images/logo/holeg.svg
  2. 6 6
      src/holeg/adapter/PositionAdapter.java
  3. 4 4
      src/holeg/addon/Randomizer.java
  4. 2 2
      src/holeg/addon/helper/EmailNotification.java
  5. 1 1
      src/holeg/addon/helper/HolonElementSketch.java
  6. 6 6
      src/holeg/algorithm/binary/AcoAlgorithm.java
  7. 2 2
      src/holeg/algorithm/objective_function/TopologieObjectiveFunction.java
  8. 1 1
      src/holeg/algorithm/topologie/AcoAlgorithm.java
  9. 1 1
      src/holeg/algorithm/topologie/GaAlgorithm.java
  10. 4 4
      src/holeg/algorithm/topologie/PsoAlgorithm.java
  11. 15 15
      src/holeg/api/AlgorithmFrameworkFlex.java
  12. 2 2
      src/holeg/interfaces/GraphEditable.java
  13. 5 5
      src/holeg/model/AbstractCanvasObject.java
  14. 17 17
      src/holeg/model/HolonElement.java
  15. 14 14
      src/holeg/model/HolonSwitch.java
  16. 2 2
      src/holeg/ui/controller/CanvasController.java
  17. 8 8
      src/holeg/ui/controller/ClipboardController.java
  18. 3 3
      src/holeg/ui/controller/LoadController.java
  19. 6 6
      src/holeg/ui/controller/NodeController.java
  20. 3 3
      src/holeg/ui/controller/SaveController.java
  21. 3 3
      src/holeg/ui/model/GuiSettings.java
  22. 6 6
      src/holeg/ui/view/canvas/AbstractCanvas.java
  23. 29 29
      src/holeg/ui/view/canvas/Canvas.java
  24. 4 4
      src/holeg/ui/view/component/Console.java
  25. 2 2
      src/holeg/ui/view/dialog/AboutUsPopUp.java
  26. 2 2
      src/holeg/ui/view/dialog/AddElementPopUp.java
  27. 4 4
      src/holeg/ui/view/dialog/AddObjectPopUp.java
  28. 5 5
      src/holeg/ui/view/dialog/CanvasResizePopUp.java
  29. 4 4
      src/holeg/ui/view/dialog/CreateTemplatePopUp.java
  30. 2 2
      src/holeg/ui/view/information/HolonInformationPanel.java
  31. 9 9
      src/holeg/ui/view/inspector/Inspector.java
  32. 7 7
      src/holeg/ui/view/inspector/InspectorTable.java
  33. 56 56
      src/holeg/ui/view/inspector/UnitGraph.java
  34. 8 8
      src/holeg/ui/view/inspector/UnitGraphPoint.java
  35. 10 10
      src/holeg/ui/view/main/GUI.java
  36. 8 8
      src/holeg/ui/view/main/TimePanel.java
  37. 2 2
      src/holeg/ui/view/window/AddOnWindow.java
  38. 2 2
      src/holeg/ui/view/window/FlexWindow.java
  39. 5 5
      src/holeg/ui/view/window/Outliner.java
  40. 0 14
      src/holeg/utility/Maths.java
  41. 4 4
      src/holeg/utility/image/Import.java
  42. 27 0
      src/holeg/utility/math/Maths.java
  43. 1 1
      src/holeg/utility/math/Random.java
  44. 2 2
      src/holeg/utility/math/decimal/Format.java
  45. 6 6
      src/holeg/utility/math/decimal/Sampler.java
  46. 17 17
      src/holeg/utility/math/vector/Vec2f.java
  47. 16 16
      src/holeg/utility/math/vector/Vec2i.java
  48. 1 1
      src/holeg/utility/pooling/Pool.java

+ 52 - 0
res/images/logo/holeg.svg

@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
+<path style="fill:#507C5C;" d="M196.594,512c-1.716,0-3.45-0.313-5.119-0.96c-5.85-2.273-9.504-8.13-8.971-14.384l14.522-170.571
+	H48.049c-4.648,0-8.999-2.283-11.64-6.108c-2.641-3.825-3.235-8.702-1.588-13.049L147.627,9.135C149.71,3.637,154.976,0,160.854,0
+	h232.583c4.743,0,9.167,2.376,11.788,6.328c2.621,3.952,3.088,8.955,1.242,13.321l-49.4,116.91h106.884
+	c5.391,0,10.311,3.064,12.692,7.9s1.803,10.606-1.485,14.876l-48.819,63.388c-4.767,6.191-13.648,7.341-19.837,2.576
+	c-6.19-4.767-7.343-13.648-2.576-19.837l31.278-40.612h-99.471c-4.743,0-9.167-2.376-11.788-6.328s-3.088-8.955-1.242-13.321
+	l49.402-116.912H170.623L68.532,297.794h143.894c3.961,0,7.739,1.661,10.418,4.576c2.679,2.917,4.013,6.822,3.676,10.768
+	l-11.743,137.929l121.963-158.363c4.768-6.19,13.648-7.341,19.837-2.576c6.19,4.767,7.342,13.648,2.576,19.837L207.803,506.485
+	C205.066,510.04,200.889,512,196.594,512z"/>
+<polygon style="fill:#CFF09E;" points="274.026,255.36 129.983,255.36 199.925,70.724 307.059,70.724 249.356,207.284 
+	346.772,207.284 259.542,338.02 "/>
+<path style="fill:#507C5C;" d="M259.538,352.166c-1.76,0-3.54-0.328-5.255-1.016c-6.21-2.487-9.828-8.983-8.674-15.572
+	l11.579-66.073H129.985c-4.648,0-8.999-2.283-11.64-6.108c-2.641-3.825-3.235-8.702-1.588-13.048l69.94-184.636
+	c2.082-5.498,7.348-9.135,13.228-9.135H307.06c4.743,0,9.167,2.376,11.788,6.328c2.621,3.952,3.088,8.955,1.241,13.321l-49.4,116.91
+	h76.084c5.217,0,10.012,2.873,12.471,7.473c2.461,4.6,2.19,10.183-0.706,14.522l-87.232,130.737
+	C268.618,349.899,264.153,352.166,259.538,352.166z M150.466,241.215h123.56c4.178,0,8.143,1.847,10.831,5.047
+	c2.686,3.2,3.822,7.425,3.101,11.539l-2.886,16.47l35.259-52.843h-70.974c-4.743,0-9.169-2.376-11.788-6.328
+	c-2.62-3.952-3.086-8.955-1.24-13.321l49.399-116.91h-76.035L150.466,241.215z"/>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+</svg>

+ 6 - 6
src/holeg/adapter/PositionAdapter.java

@@ -9,28 +9,28 @@ import com.google.gson.JsonPrimitive;
 import com.google.gson.JsonSerializationContext;
 import com.google.gson.JsonSerializer;
 
-import holeg.utility.Vector2Int;
+import holeg.utility.math.vector.Vec2i;
 
-public class PositionAdapter implements JsonSerializer<Vector2Int>, JsonDeserializer<Vector2Int> {
+public class PositionAdapter implements JsonSerializer<Vec2i>, JsonDeserializer<Vec2i> {
 
 	@Override
-	public JsonElement serialize(Vector2Int arg0, Type arg1, JsonSerializationContext arg2) {
+	public JsonElement serialize(Vec2i arg0, Type arg1, JsonSerializationContext arg2) {
 		return new JsonPrimitive(arg0.getX() + ":" + arg0.getY());
 	}
 
 	@Override
-	public Vector2Int deserialize(JsonElement arg0, Type arg1, JsonDeserializationContext arg2) {
+	public Vec2i deserialize(JsonElement arg0, Type arg1, JsonDeserializationContext arg2) {
 		try {
 			String arg = arg0.getAsString();
 			int mid = arg.indexOf(':');
 			int x = Integer.parseInt(arg.substring(0, mid));
 			int y = Integer.parseInt(arg.substring(mid + 1, arg.length()));
-			return new Vector2Int(x, y);
+			return new Vec2i(x, y);
 
 		} catch (NumberFormatException e) {
 			System.err.println(e);
 		}
-		return new Vector2Int(-1, -1);
+		return new Vec2i(-1, -1);
 	}
 
 }

+ 4 - 4
src/holeg/addon/Randomizer.java

@@ -43,8 +43,8 @@ import holeg.api.AddOn;
 import holeg.model.HolonElement;
 import holeg.model.HolonObject;
 import holeg.ui.controller.Control;
-import holeg.utility.ImageImport;
-import holeg.utility.Random;
+import holeg.utility.image.Import;
+import holeg.utility.math.Random;
 
 public class Randomizer implements AddOn {
 	private Control  control;
@@ -115,7 +115,7 @@ public class Randomizer implements AddOn {
 		headPanel.setLayout(new BoxLayout(headPanel, BoxLayout.LINE_AXIS));
 		headPanel.add(new JLabel("FILTER"));
 		JButton updateButton = new JButton();
-		updateButton.setIcon(new ImageIcon(ImageImport.loadImage("images/canvas/replace.png", 15, 15)));
+		updateButton.setIcon(new ImageIcon(Import.loadImage("images/canvas/replace.png", 15, 15)));
 		updateButton.addActionListener(action -> {
 			this.updateFilterList();
 			content.updateUI();
@@ -136,7 +136,7 @@ public class Randomizer implements AddOn {
 			//Entry
 			JPanel entryPanel = new JPanel();
 			entryPanel.setLayout(new BoxLayout(entryPanel, BoxLayout.LINE_AXIS));
-			JLabel label = new JLabel(hObject.getName() + "[" + hObject.getId() + "]", new ImageIcon(ImageImport.loadImage(hObject.getImage(), lineSpace, lineSpace)), JLabel.LEFT);
+			JLabel label = new JLabel(hObject.getName() + "[" + hObject.getId() + "]", new ImageIcon(Import.loadImage(hObject.getImage(), lineSpace, lineSpace)), JLabel.LEFT);
 			entryPanel.add(label);
 			entryPanel.add(Box.createHorizontalGlue());
 			JCheckBox checkbox = new JCheckBox();

+ 2 - 2
src/holeg/addon/helper/EmailNotification.java

@@ -16,7 +16,7 @@ import javax.swing.JTextField;
 
 import org.apache.commons.mail.*;
 
-import holeg.utility.ImageImport;
+import holeg.utility.image.Import;
 
 
 public class EmailNotification {
@@ -48,7 +48,7 @@ public class EmailNotification {
 		loadPreferences();
 		JFrame frame = new JFrame();
 		frame.setTitle("Email Settings");
-		frame.setIconImage(ImageImport.loadImage("/images/logo/holeg.png",30,30));
+		frame.setIconImage(Import.loadImage("/images/logo/holeg.png",30,30));
 		frame.setContentPane(createEditFormular(frame));
 		frame.pack();
 		frame.setPreferredSize(new Dimension(400,frame.getHeight()));

+ 1 - 1
src/holeg/addon/helper/HolonElementSketch.java

@@ -5,7 +5,7 @@ import holeg.model.Flexibility;
 import holeg.model.HolonElement;
 import holeg.model.HolonObject;
 import holeg.model.HolonElement.Priority;
-import holeg.utility.Random;
+import holeg.utility.math.Random;
 
 public class HolonElementSketch {
 	//HolonElement

+ 6 - 6
src/holeg/algorithm/binary/AcoAlgorithm.java

@@ -7,7 +7,7 @@ import java.util.ListIterator;
 import javax.swing.JFrame;
 
 import holeg.api.AlgorithmFrameworkFlex;
-import holeg.utility.FormatFloat;
+import holeg.utility.math.decimal.Format;
 
 public class AcoAlgorithm extends AlgorithmFrameworkFlex{
 	
@@ -79,7 +79,7 @@ public class AcoAlgorithm extends AlgorithmFrameworkFlex{
 		best.fitness = evaluatePosition(best.position);
 		List<Double> runList = new ArrayList<Double>();
 		runList.add(best.fitness);
-		console.print("Start with: " + FormatFloat.doubleFixedPlaces(2, best.fitness));
+		console.print("Start with: " + Format.doubleFixedPlaces(2, best.fitness));
 		if(moreInformation)console.println("");
 		if(best.position.isEmpty()) return best;
 		int problemSize = best.position.size();
@@ -92,7 +92,7 @@ public class AcoAlgorithm extends AlgorithmFrameworkFlex{
 			if(moreInformation)console.println("Generation" + generation + " start with Fitness: " + best.fitness);
 			for(Individual i : population) {
 				i.fitness = evaluatePosition(i.position);
-				if(moreInformation)console.println("Fitness" + FormatFloat.doubleFixedPlaces(2, i.fitness));
+				if(moreInformation)console.println("Fitness" + Format.doubleFixedPlaces(2, i.fitness));
 				if(i.fitness < best.fitness) best = i;	
 			}
 			runList.add(best.fitness);
@@ -107,7 +107,7 @@ public class AcoAlgorithm extends AlgorithmFrameworkFlex{
 		}
 		
 		
-		console.println("   End With:" + FormatFloat.doubleFixedPlaces(2, best.fitness));
+		console.println("   End With:" + Format.doubleFixedPlaces(2, best.fitness));
 		this.runList = runList;
 		return best;
 		
@@ -196,8 +196,8 @@ public class AcoAlgorithm extends AlgorithmFrameworkFlex{
 				+ " Rounds: " + rounds 
 				+ " Iterations: " + maxGenerations 
 				+ " Individuals: " +  popsize
-				+ " vaporization: " +  FormatFloat.doubleAllPlaces(p)
-				+ " convergenceFactorReset: " +  FormatFloat.doubleAllPlaces(convergenceFactorReset);
+				+ " vaporization: " +  Format.doubleAllPlaces(p)
+				+ " convergenceFactorReset: " +  Format.doubleAllPlaces(convergenceFactorReset);
 	}
 
 

+ 2 - 2
src/holeg/algorithm/objective_function/TopologieObjectiveFunction.java

@@ -8,7 +8,7 @@ import holeg.algorithm.objective_function.GraphMetrics.Graph;
 import holeg.ui.model.DecoratedHolonObject;
 import holeg.ui.model.DecoratedNetwork;
 import holeg.ui.model.DecoratedState;
-import holeg.utility.FloatLog;
+import holeg.utility.math.decimal.Sampler;
 
 public class TopologieObjectiveFunction {
 	private static final Logger log = Logger.getLogger(TopologieObjectiveFunction.class.getName());
@@ -70,7 +70,7 @@ public class TopologieObjectiveFunction {
 	static double range_for_k_avg_shortest_path = range(k_avg_shortest_path);
 	static double range_for_k_disjoint_path = range(k_disjoint_path - centerValue_disjoint_path);
 
-	public static FloatLog averageLog = new FloatLog();
+	public static Sampler averageLog = new Sampler();
 	static boolean useLog = false;
 	static {
         //init

+ 1 - 1
src/holeg/algorithm/topologie/AcoAlgorithm.java

@@ -8,7 +8,7 @@ import java.util.ListIterator;
 import holeg.algorithm.objective_function.TopologieObjectiveFunction;
 import holeg.api.TopologieAlgorithmFramework;
 import holeg.ui.model.DecoratedState;
-import holeg.utility.Random;
+import holeg.utility.math.Random;
 
 public class AcoAlgorithm extends TopologieAlgorithmFramework {
 

+ 1 - 1
src/holeg/algorithm/topologie/GaAlgorithm.java

@@ -10,7 +10,7 @@ import java.util.TreeSet;
 import holeg.algorithm.objective_function.TopologieObjectiveFunction;
 import holeg.api.TopologieAlgorithmFramework;
 import holeg.ui.model.DecoratedState;
-import holeg.utility.Random;
+import holeg.utility.math.Random;
 
 public class GaAlgorithm extends TopologieAlgorithmFramework {
 

+ 4 - 4
src/holeg/algorithm/topologie/PsoAlgorithm.java

@@ -10,8 +10,8 @@ import java.util.stream.Collectors;
 import holeg.algorithm.objective_function.TopologieObjectiveFunction;
 import holeg.api.TopologieAlgorithmFramework;
 import holeg.ui.model.DecoratedState;
-import holeg.utility.Maths;
-import holeg.utility.Random;
+import holeg.utility.math.Maths;
+import holeg.utility.math.Random;
 
 public class PsoAlgorithm extends TopologieAlgorithmFramework {
 
@@ -246,8 +246,8 @@ public class PsoAlgorithm extends TopologieAlgorithmFramework {
 	 */
 	private void decode(Particle particle, int index) {
 		double value = clamp(Random.nextGaussian(particle.xGenotype.get(index), deviation));
-		double alpha = Maths.inverseLinearInterpolation(-maxVelocity, +maxVelocity, value);
-		double result = Maths.linearInterpolate(0, this.getMaximumIndexObjects(index), alpha);
+		double alpha = Maths.invLerp(-maxVelocity, +maxVelocity, value);
+		double result = Maths.lerp(0, this.getMaximumIndexObjects(index), alpha);
 		particle.xPhenotype.set(index, (int)Math.round(result));
 	}
 

+ 15 - 15
src/holeg/api/AlgorithmFrameworkFlex.java

@@ -60,8 +60,8 @@ import holeg.ui.model.Model;
 import holeg.ui.model.DecoratedHolonObject.HolonObjectState;
 import holeg.ui.model.DecoratedSwitch.SwitchState;
 import holeg.ui.view.component.Console;
-import holeg.utility.FormatFloat;
-import holeg.utility.ImageImport;
+import holeg.utility.image.Import;
+import holeg.utility.math.decimal.Format;
 
 public abstract class AlgorithmFrameworkFlex implements AddOn{
 	//Algo
@@ -215,7 +215,7 @@ public abstract class AlgorithmFrameworkFlex implements AddOn{
 		emailNotificationCheckbox.addActionListener(actionEvent -> useEmailNotification = emailNotificationCheckbox.isSelected());
 		parameterPanel.add(emailNotificationCheckbox);
 		
-		JButton emailSettingsButton = new JButton("", new ImageIcon(ImageImport.loadImage("/images/buttons/settings.png", 16,16)));
+		JButton emailSettingsButton = new JButton("", new ImageIcon(Import.loadImage("/images/buttons/settings.png", 16,16)));
 		emailSettingsButton.setBounds(1030, 200, 20, 20);
 		emailSettingsButton.addActionListener(event -> {
 			EmailNotification.OpenEmailSettings(content);
@@ -614,12 +614,12 @@ public abstract class AlgorithmFrameworkFlex implements AddOn{
 			long executionTime = printElapsedTime();
 			setState(roundBest.position);
 			runPrinter.openStream();
-			runPrinter.println(runList.stream().map(value -> FormatFloat.doubleFixedPlaces(2,value)).collect(Collectors.joining(", ")));
+			runPrinter.println(runList.stream().map(value -> Format.doubleFixedPlaces(2,value)).collect(Collectors.joining(", ")));
 			RunValues val = getRunValuesFromActualState();
 			val.result = roundBest.fitness;
 			val.executionTime = executionTime;
 			avg.addRun(val);
-			runPrinter.println("Result: " + FormatFloat.doubleFixedPlaces(2,roundBest.fitness) + " ExecutionTime:" + executionTime + " " + stringStatFromRunValues(val));
+			runPrinter.println("Result: " + Format.doubleFixedPlaces(2,roundBest.fitness) + " ExecutionTime:" + executionTime + " " + stringStatFromRunValues(val));
 			runPrinter.closeStream();
 			resetState();
 			if(roundBest.fitness < runBest.fitness) runBest = roundBest;
@@ -628,14 +628,14 @@ public abstract class AlgorithmFrameworkFlex implements AddOn{
 		this.extractPositionAndAccess();
 		setState(runBest.position);
 		updateVisual();
-		console.println("Start: " + FormatFloat.doubleFixedPlaces(2,startFitness));
-		console.println("AlgoResult: " + FormatFloat.doubleFixedPlaces(2,runBest.fitness));
+		console.println("Start: " + Format.doubleFixedPlaces(2,startFitness));
+		console.println("AlgoResult: " + Format.doubleFixedPlaces(2,runBest.fitness));
 		if(this.algoUseFlexes)calculateAndPrintFlexInfos(control.getSimManager().getActualDecorState().get());
 		runPrinter.openStream();
 		if(rounds > 1) {
 			RunValues avgRun = avg.getAverage();
 			
-			runPrinter.println("Average.Result: " + FormatFloat.doubleFixedPlaces(2, avgRun.result) + " Average.ExecutionTime:" + avgRun.executionTime + " "  + this.stringStatFromRunValues(avg.getAverage(), "Average."));
+			runPrinter.println("Average.Result: " + Format.doubleFixedPlaces(2, avgRun.result) + " Average.ExecutionTime:" + avgRun.executionTime + " "  + this.stringStatFromRunValues(avg.getAverage(), "Average."));
 		}
 		runPrinter.println("");
 		runPrinter.closeStream();
@@ -923,12 +923,12 @@ public abstract class AlgorithmFrameworkFlex implements AddOn{
 			+ " " +	prefix +"Partially: " + percentage(val.partiallySupplied, val.objects)
 			+ " " +	prefix +"Over: " + percentage(val.overSupplied, val.objects)
 			+ " " +	prefix +"Supplied: " + percentage(val.supplied, val.objects)
-			+ " " +	prefix +"Partially.SupplyPercentage.Min: " + FormatFloat.doubleFixedPlaces(2, val.partiallyMin) 
-			+ " " +	prefix +"Partially.SupplyPercentage.Max: "+ FormatFloat.doubleFixedPlaces(2, val.partiallyMax) 
-			+ " " +	prefix +"Partially.SupplyPercentage.Average: " + FormatFloat.doubleFixedPlaces(2, val.partiallyAverage)
-			+ " " + prefix +"Over.SupplyPercentage.Min: " + FormatFloat.doubleFixedPlaces(2, val.overMin) 
-			+ " " +	prefix +"Over.SupplyPercentage.Max: "+ FormatFloat.doubleFixedPlaces(2, val.overMax) 
-			+ " " +	prefix +"Over.SupplyPercentage.Average: " + FormatFloat.doubleFixedPlaces(2, val.overAverage)
+			+ " " +	prefix +"Partially.SupplyPercentage.Min: " + Format.doubleFixedPlaces(2, val.partiallyMin) 
+			+ " " +	prefix +"Partially.SupplyPercentage.Max: "+ Format.doubleFixedPlaces(2, val.partiallyMax) 
+			+ " " +	prefix +"Partially.SupplyPercentage.Average: " + Format.doubleFixedPlaces(2, val.partiallyAverage)
+			+ " " + prefix +"Over.SupplyPercentage.Min: " + Format.doubleFixedPlaces(2, val.overMin) 
+			+ " " +	prefix +"Over.SupplyPercentage.Max: "+ Format.doubleFixedPlaces(2, val.overMax) 
+			+ " " +	prefix +"Over.SupplyPercentage.Average: " + Format.doubleFixedPlaces(2, val.overAverage)
 			+ " " +	prefix +"HolonElemnts.Active:" + percentage(val.activeElements, val.elements)
 			+ " " +	prefix +"Flexibilities.Essential: " + percentage(val.essentialFlex, val.flexebilities)
 			+ " " + prefix +"Flexibilities.High: " + percentage(val.highFlex, val.flexebilities)
@@ -947,7 +947,7 @@ public abstract class AlgorithmFrameworkFlex implements AddOn{
 		if((int)denominator == 0) {
 			return "-%";
 		}
-		return  FormatFloat.doubleTwoPlaces(numerator)   + "/" + FormatFloat.doubleTwoPlaces(denominator) + " "+ FormatFloat.doubleFixedPlaces(2,(float)numerator /(float)denominator * 100) + "%";
+		return  Format.doubleTwoPlaces(numerator)   + "/" + Format.doubleTwoPlaces(denominator) + " "+ Format.doubleFixedPlaces(2,(float)numerator /(float)denominator * 100) + "%";
 	}
 	
 

+ 2 - 2
src/holeg/interfaces/GraphEditable.java

@@ -2,7 +2,7 @@ package holeg.interfaces;
 
 import java.util.LinkedList;
 
-import holeg.utility.Vector2Float;
+import holeg.utility.math.vector.Vec2f;
 
 /**
  * Interface for all Elements that have a Graph to edit it state over time.
@@ -28,7 +28,7 @@ public interface GraphEditable {
 	 * Getter for the graph.
 	 * @return The list of all graph points.
 	 */
-	LinkedList<Vector2Float> getStateGraph();
+	LinkedList<Vec2f> getStateGraph();
 	
 	/**
 	 * Sample the Graph on the object.

+ 5 - 5
src/holeg/model/AbstractCanvasObject.java

@@ -4,7 +4,7 @@ import com.google.gson.annotations.Expose;
 
 import holeg.ui.model.IdCounter;
 import holeg.ui.model.IdCounter.CounterType;
-import holeg.utility.Vector2Int;
+import holeg.utility.math.vector.Vec2i;
 
 /**
  * The abstract class "CpsObject" represents any possible object in the system
@@ -29,7 +29,7 @@ public abstract class AbstractCanvasObject {
 	String image;
 	/* Position with a X and Y value */
 	@Expose
-	Vector2Int position = new Vector2Int(0,0);
+	Vec2i position = new Vec2i(0,0);
 	//TODO(Tom2022-01-11): Saving should be removed
 	@Expose
 	String sav;
@@ -132,7 +132,7 @@ public abstract class AbstractCanvasObject {
 	 *            Y-Coord
 	 */
 	public void setPosition(int x, int y) {
-		setPosition(new Vector2Int(x, y));
+		setPosition(new Vec2i(x, y));
 	}
 
 	/**
@@ -140,7 +140,7 @@ public abstract class AbstractCanvasObject {
 	 *
 	 * @return Position Position of this Object
 	 */
-	public Vector2Int getPosition() {
+	public Vec2i getPosition() {
 		return position;
 	}
 
@@ -149,7 +149,7 @@ public abstract class AbstractCanvasObject {
 	 *
 	 * @param pos Coordinates
 	 */
-	public void setPosition(Vector2Int pos) {
+	public void setPosition(Vec2i pos) {
 		this.position = pos;
 	}
 

+ 17 - 17
src/holeg/model/HolonElement.java

@@ -8,7 +8,7 @@ import holeg.model.Flexibility.FlexState;
 import holeg.ui.controller.IndexTranslator;
 import holeg.ui.model.IdCounter;
 import holeg.ui.model.IdCounter.CounterType;
-import holeg.utility.Vector2Float;
+import holeg.utility.math.vector.Vec2f;
 
 import java.util.ArrayList;
 import java.util.LinkedList;
@@ -33,7 +33,7 @@ public class HolonElement implements TimelineDependent{
      * the X component from a Point is period from 0..1
      * the Y component from a Point is the percentage from 0..1
      * */
-    private LinkedList<Vector2Float> graphPoints;
+    private LinkedList<Vec2f> graphPoints;
     /** Name of the gadget, e.g. TV */
     @Expose
     @SerializedName(value = "name", alternate = "eleName")
@@ -127,8 +127,8 @@ public class HolonElement implements TimelineDependent{
         setEnergy(element.getEnergy());
         this.active = element.active;
         setGraphPoints(new LinkedList<>());
-        for (Vector2Float p : element.getGraphPoints()) {
-            this.graphPoints.add(new Vector2Float(p));
+        for (Vec2f p : element.getGraphPoints()) {
+            this.graphPoints.add(new Vec2f(p));
         }
         sampleGraph();
         setSaving(null);
@@ -245,14 +245,14 @@ public class HolonElement implements TimelineDependent{
 	private void initGraphPoints()
 	{
 		graphPoints.clear();
-		graphPoints.add(new Vector2Float(0f,1.0f));
-		graphPoints.add(new Vector2Float(1f,1.0f));
+		graphPoints.add(new Vec2f(0f,1.0f));
+		graphPoints.add(new Vec2f(1f,1.0f));
 	}
 	/**
 	 * Getter for the graphPoint List.
 	 * @return {@link HolonElement#graphPoints}
 	 */
-	public LinkedList<Vector2Float> getGraphPoints() {
+	public LinkedList<Vec2f> getGraphPoints() {
 		return graphPoints;
 	}
 
@@ -260,7 +260,7 @@ public class HolonElement implements TimelineDependent{
 	 * Setter for the graphPoint List.
 	 * @param testGraphPoints is new  {@link HolonElement#graphPoints}
 	 */
-	public void setGraphPoints(LinkedList<Vector2Float> graphPoints) {
+	public void setGraphPoints(LinkedList<Vec2f> graphPoints) {
 		this.graphPoints = graphPoints;
 	}
 
@@ -275,7 +275,7 @@ public class HolonElement implements TimelineDependent{
 
 
 	@Override
-	public LinkedList<Vector2Float> getStateGraph() {
+	public LinkedList<Vec2f> getStateGraph() {
 		return getGraphPoints();
 	}
 
@@ -298,9 +298,9 @@ public class HolonElement implements TimelineDependent{
 	 */
 	private float[] sampleGraph(int sampleLength)
 	{		
-		ListIterator<Vector2Float> iter = this.graphPoints.listIterator();
-		Vector2Float before = iter.next();
-		Vector2Float after = iter.next();
+		ListIterator<Vec2f> iter = this.graphPoints.listIterator();
+		Vec2f before = iter.next();
+		Vec2f after = iter.next();
 		float [] sampleCurve = new float[sampleLength];	
 		for(int i = 0; i<sampleLength ; i++)
 		{
@@ -329,14 +329,14 @@ public class HolonElement implements TimelineDependent{
 	 * @param end is the end Point of the Curve.
 	 * @return the percentage from the Curve at the X Value based on t.
 	 */
-	private double getYBetweenTwoPoints(double t, Vector2Float start, Vector2Float end) {
+	private double getYBetweenTwoPoints(double t, Vec2f start, Vec2f end) {
 		
 		float mitte = (start.x + end.x)* 0.5f;
-		Vector2Float bezier = getBezierPoint(t, start, new Vector2Float(mitte, start.y), new Vector2Float(mitte, end.y), end);
+		Vec2f bezier = getBezierPoint(t, start, new Vec2f(mitte, start.y), new Vec2f(mitte, end.y), end);
 		return bezier.y;
 	}
 	/**
-	 * Helper method for {@link HolonElement#getYBetweenTwoPoints(double, Vector2Float, Vector2Float)}.
+	 * Helper method for {@link HolonElement#getYBetweenTwoPoints(double, Vec2f, Vec2f)}.
 	 * <p>
 	 * A Method for a normal Cubic Bezier Curve. A Cubic Bezier curve has four control points.
 	 * @param t is in Range [0,1] how much it traverse along the curve.
@@ -346,14 +346,14 @@ public class HolonElement implements TimelineDependent{
 	 * @param p3 EndPoint
 	 * @return the BezierPosition at t.
 	 */
-	private Vector2Float getBezierPoint(double t, Vector2Float p0, Vector2Float p1,Vector2Float p2,Vector2Float p3) {
+	private Vec2f getBezierPoint(double t, Vec2f p0, Vec2f p1,Vec2f p2,Vec2f p3) {
 		/*
 		 * Calculate Bezi�r:
 		 * B(t) = (1-t)^3 * P0 + 3*(1-t)^2 * t * P1 + 3*(1-t)*t^2 * P2 + t^3 * P3 , 0 < t < 1
 		 * 
 		 * Source: //http://www.theappguruz.com/blog/bezier-curve-in-games
 		 */
-		Vector2Float bezier = new Vector2Float();
+		Vec2f bezier = new Vec2f();
 		double OneSubT =  1-t;
 		double OneSubT2 = Math.pow(OneSubT, 2);
 		double OneSubT3 = Math.pow(OneSubT, 3);

+ 14 - 14
src/holeg/model/HolonSwitch.java

@@ -8,7 +8,7 @@ import com.google.gson.annotations.Expose;
 import holeg.interfaces.LocalMode;
 import holeg.interfaces.TimelineDependent;
 import holeg.ui.controller.IndexTranslator;
-import holeg.utility.Vector2Float;
+import holeg.utility.math.vector.Vec2f;
 
 /**
  * The class HolonSwitch represents a Switch, which can be turned on and off.
@@ -56,7 +56,7 @@ public class HolonSwitch extends AbstractCanvasObject implements TimelineDepende
 	 */
 	boolean[] activeAt;
 	// Points on the UnitGraph
-	LinkedList<Vector2Float> graphPoints = new LinkedList<>();
+	LinkedList<Vec2f> graphPoints = new LinkedList<>();
 
 	/**
 	 * Create a new HolonSwitch with the default name ("Switch"), a default value of
@@ -71,7 +71,7 @@ public class HolonSwitch extends AbstractCanvasObject implements TimelineDepende
 		setManualState(true);
 		setAutoState(true);
 		setManualMode(false);
-		setGraphPoints(new LinkedList<Vector2Float>());
+		setGraphPoints(new LinkedList<Vec2f>());
 		initGraphPoints();
 		sampleGraph();
 	}
@@ -89,9 +89,9 @@ public class HolonSwitch extends AbstractCanvasObject implements TimelineDepende
 		super.setName(other.getName());
 		setManualState(other.getManualState());
 		setAutoState(true);
-		setGraphPoints(new LinkedList<Vector2Float>());
-		for (Vector2Float p : other.getGraphPoints()) {
-			this.graphPoints.add(new Vector2Float(p.getX(), p.getY()));
+		setGraphPoints(new LinkedList<Vec2f>());
+		for (Vec2f p : other.getGraphPoints()) {
+			this.graphPoints.add(new Vec2f(p.getX(), p.getY()));
 		}
 		sampleGraph();
 		setManualMode(other.getManualMode());
@@ -186,7 +186,7 @@ public class HolonSwitch extends AbstractCanvasObject implements TimelineDepende
 	 * 
 	 * @return the Graph Points
 	 */
-	public LinkedList<Vector2Float> getGraphPoints() {
+	public LinkedList<Vec2f> getGraphPoints() {
 		return graphPoints;
 	}
 
@@ -195,7 +195,7 @@ public class HolonSwitch extends AbstractCanvasObject implements TimelineDepende
 	 * 
 	 * @param linkedList the Graph points
 	 */
-	public void setGraphPoints(LinkedList<Vector2Float> linkedList) {
+	public void setGraphPoints(LinkedList<Vec2f> linkedList) {
 		this.graphPoints = linkedList;
 	}
 
@@ -204,8 +204,8 @@ public class HolonSwitch extends AbstractCanvasObject implements TimelineDepende
 	 */
 	private void initGraphPoints() {
 		graphPoints.clear();
-		graphPoints.add(new Vector2Float(0, 1));
-		graphPoints.add(new Vector2Float(1, 1));
+		graphPoints.add(new Vec2f(0, 1));
+		graphPoints.add(new Vec2f(1, 1));
 	}
 
 	/**
@@ -251,7 +251,7 @@ public class HolonSwitch extends AbstractCanvasObject implements TimelineDepende
 	}
 
 	@Override
-	public LinkedList<Vector2Float> getStateGraph() {
+	public LinkedList<Vec2f> getStateGraph() {
 		return graphPoints;
 	}
 
@@ -276,9 +276,9 @@ public class HolonSwitch extends AbstractCanvasObject implements TimelineDepende
 	 * @return the boolean array of samplepoints.
 	 */
 	private boolean[] sampleGraph(int sampleLength) {
-		ListIterator<Vector2Float> iter = this.graphPoints.listIterator();
-		Vector2Float before = iter.next();
-		Vector2Float after = iter.next();
+		ListIterator<Vec2f> iter = this.graphPoints.listIterator();
+		Vec2f before = iter.next();
+		Vec2f after = iter.next();
 		boolean[] activeTriggerPos = new boolean[sampleLength];
 		for (int i = 0; i < sampleLength; i++) {
 			double graphX = (double) i / (double) (sampleLength - 1); // from 0.0 to 1.0

+ 2 - 2
src/holeg/ui/controller/CanvasController.java

@@ -15,7 +15,7 @@ import holeg.model.Node;
 import holeg.ui.model.GuiSettings;
 import holeg.ui.model.Model;
 import holeg.ui.view.main.GUI;
-import holeg.utility.Vector2Int;
+import holeg.utility.math.vector.Vec2i;
 
 /**
  * Controller for the Canvas.
@@ -198,7 +198,7 @@ public class CanvasController {
 			} else {
 				tCps = new Node("Node");
 			}
-			tCps.setPosition(new Vector2Int(p.x + (cps.getPosition().getX() - x), p.y + (cps.getPosition().getY() - y)));
+			tCps.setPosition(new Vec2i(p.x + (cps.getPosition().getX() - x), p.y + (cps.getPosition().getY() - y)));
 			tCps.setSav(cps.getSav());
 			addObject(tCps, false);
 		}

+ 8 - 8
src/holeg/ui/controller/ClipboardController.java

@@ -9,8 +9,8 @@ import holeg.ui.controller.SaveController.NUMTYPE;
 import holeg.ui.controller.SaveController.TYPE;
 import holeg.ui.model.GuiSettings;
 import holeg.ui.model.Model;
-import holeg.utility.Vector2Float;
-import holeg.utility.Vector2Int;
+import holeg.utility.math.vector.Vec2f;
+import holeg.utility.math.vector.Vec2i;
 
 import java.awt.*;
 import java.awt.datatransfer.*;
@@ -56,8 +56,8 @@ public class ClipboardController {
         store.initNumeration();
 
         file.add("SAV", new JsonPrimitive((upperNode == null ? "CVS" : "" + upperNode.getId())));
-        Vector2Int pos = uppC.calculatePos(GuiSettings.getSelectedObjects());
-        file.add("CENTER", GuiSettings.gson.toJsonTree(pos, Vector2Int.class));
+        Vec2i pos = uppC.calculatePos(GuiSettings.getSelectedObjects());
+        file.add("CENTER", GuiSettings.gson.toJsonTree(pos, Vec2i.class));
 
         for (AbstractCanvasObject abs : GuiSettings.getSelectedObjects()) {
             queue.add(abs);
@@ -128,7 +128,7 @@ public class ClipboardController {
         eleIDMap = new HashMap<>();
         sav = json.get("SAV").getAsString();
 
-        Vector2Int old = GuiSettings.gson.getAdapter(Vector2Int.class).fromJsonTree(json.get("CENTER"));
+        Vec2i old = GuiSettings.gson.getAdapter(Vec2i.class).fromJsonTree(json.get("CENTER"));
         point = new Point(old.getX() - p.x, old.getY() - p.y);
 
         forwardObjects(keys, json, objDispatch, eleDispatch, upperNode);
@@ -254,14 +254,14 @@ public class ClipboardController {
         String p;
         int mid;
         int sav = 0;
-     	LinkedList<Vector2Float> graphpointTEST = new LinkedList<>();
+     	LinkedList<Vec2f> graphpointTEST = new LinkedList<>();
         for (String k : keys) {
             if (!k.equals("ID")) {
                 p = object.get(k).getAsString();
                 mid = p.indexOf(':');
                 float x1 = Float.parseFloat(p.substring(0, mid));
                 float y1 = Float.parseFloat(p.substring(mid + 1, p.length()));
-                graphpointTEST.add(new Vector2Float(x1, y1));
+                graphpointTEST.add(new Vec2f(x1, y1));
             } else
                 // else its an ID
                 sav = object.get(k).getAsInt();
@@ -407,7 +407,7 @@ public class ClipboardController {
         if (y > GuiSettings.canvasSize.getY())
             y = GuiSettings.canvasSize.getY() - GuiSettings.getPictureScaleDiv2() - 1;
 
-        temp.setPosition(new Vector2Int(x, y));
+        temp.setPosition(new Vec2i(x, y));
     }
 
 }

+ 3 - 3
src/holeg/ui/controller/LoadController.java

@@ -11,7 +11,7 @@ import holeg.ui.model.GuiSettings;
 import holeg.ui.model.IdCounter;
 import holeg.ui.model.Model;
 import holeg.ui.model.IdCounter.CounterType;
-import holeg.utility.Vector2Float;
+import holeg.utility.math.vector.Vec2f;
 
 import org.apache.commons.compress.archivers.ArchiveEntry;
 import org.apache.commons.compress.archivers.ArchiveException;
@@ -367,14 +367,14 @@ public class LoadController {
         String p;
         int mid;
         int sav = 0;
-     	LinkedList<Vector2Float> graphpointTEST = new LinkedList<>();
+     	LinkedList<Vec2f> graphpointTEST = new LinkedList<>();
         for (String k : keys) {
             if (!k.equals("ID")) {
                 p = object.get(k).getAsString();
                 mid = p.indexOf(':');
                 float x1 = Float.parseFloat(p.substring(0, mid));
                 float y1 = Float.parseFloat(p.substring(mid + 1, p.length()));
-                graphpointTEST.add(new Vector2Float(x1, y1));
+                graphpointTEST.add(new Vec2f(x1, y1));
             } else
                 // else its an ID
                 sav = object.get(k).getAsInt();

+ 6 - 6
src/holeg/ui/controller/NodeController.java

@@ -11,7 +11,7 @@ import holeg.model.GroupNode;
 import holeg.model.Node;
 import holeg.ui.model.GuiSettings;
 import holeg.ui.model.Model;
-import holeg.utility.Vector2Int;
+import holeg.utility.math.vector.Vec2i;
 
 
 class NodeController {
@@ -49,8 +49,8 @@ class NodeController {
     		cvs.deleteObjectOnCanvas(node);
     		return;
     	}
-		Vector2Int old = calculatePos(node.getObjectsInThisLayer().toList());
-		Vector2Int p = node.getPosition();
+		Vec2i old = calculatePos(node.getObjectsInThisLayer().toList());
+		Vec2i p = node.getPosition();
 		point = new Point(old.getX() - p.getX(), old.getY() - p.getY());
 
 		unmakeNodesOfNodes(node, groupNode);
@@ -107,8 +107,8 @@ class NodeController {
 	/**
 	 * Calculate new Position of the Upper Node
 	 */
-    Vector2Int calculatePos(Collection<AbstractCanvasObject> toGroup) {
-		Vector2Int pos = new Vector2Int(0, 0);
+    Vec2i calculatePos(Collection<AbstractCanvasObject> toGroup) {
+		Vec2i pos = new Vec2i(0, 0);
 		for (AbstractCanvasObject abs : toGroup) {
 			pos = pos.add(abs.getPosition());
 		}
@@ -238,6 +238,6 @@ class NodeController {
         if (y > GuiSettings.canvasSize.getY())
             y = GuiSettings.canvasSize.getY() - GuiSettings.getPictureScaleDiv2() - 1;
 
-        temp.setPosition(new Vector2Int(x, y));
+        temp.setPosition(new Vec2i(x, y));
     }
 }

+ 3 - 3
src/holeg/ui/controller/SaveController.java

@@ -10,7 +10,7 @@ import holeg.ui.model.IdCounter;
 import holeg.ui.model.Model;
 import holeg.ui.model.IdCounter.CounterType;
 import holeg.ui.view.main.Category;
-import holeg.utility.Vector2Float;
+import holeg.utility.math.vector.Vec2f;
 
 import org.apache.commons.compress.archivers.ArchiveException;
 import org.apache.commons.compress.archivers.ArchiveOutputStream;
@@ -274,7 +274,7 @@ public class SaveController {
     /**
      * Put the UnitGraphs of Switches or Elements into Json
      */
-    void unitgraphToJson(GRAPHTYPE type, JsonObject file, int id, LinkedList<Vector2Float> graph) {
+    void unitgraphToJson(GRAPHTYPE type, JsonObject file, int id, LinkedList<Vec2f> graph) {
 
         JsonObject temp = new JsonObject();
         String key = null;
@@ -304,7 +304,7 @@ public class SaveController {
     /**
      * Put the UnitGraphs of Switches or Elements into Json
      */
-    void unitgraphTESTToJson(JsonObject file, int id, LinkedList<Vector2Float> graph) {
+    void unitgraphTESTToJson(JsonObject file, int id, LinkedList<Vec2f> graph) {
 
         JsonObject temp = new JsonObject();
         String key = null;

+ 3 - 3
src/holeg/ui/model/GuiSettings.java

@@ -13,13 +13,13 @@ import holeg.adapter.PositionAdapter;
 import holeg.model.AbstractCanvasObject;
 import holeg.model.Edge;
 import holeg.ui.view.main.Category;
-import holeg.utility.Vector2Int;
+import holeg.utility.math.vector.Vec2i;
 
 public class GuiSettings {
 
     private static int pictureScale = 50; // Picture Scale
     private static int halfPictureScale = pictureScale / 2;
-    public static Vector2Int canvasSize = new Vector2Int(3000,3000);
+    public static Vec2i canvasSize = new Vec2i(3000,3000);
     
     
     public static int timerSpeed = 1000;
@@ -79,7 +79,7 @@ public class GuiSettings {
         builder.excludeFieldsWithoutExposeAnnotation();
         builder.setPrettyPrinting();
         builder.registerTypeAdapter(AbstractCanvasObject.class, new AbstractCpsObjectAdapter());
-        builder.registerTypeAdapter(Vector2Int.class, new PositionAdapter());
+        builder.registerTypeAdapter(Vec2i.class, new PositionAdapter());
         builder.registerTypeAdapter(SimpleEntry.class, new PairAdapter());
         return builder.create();
     }

+ 6 - 6
src/holeg/ui/view/canvas/AbstractCanvas.java

@@ -28,7 +28,7 @@ import holeg.model.Node;
 import holeg.ui.controller.Control;
 import holeg.ui.model.GuiSettings;
 import holeg.ui.model.Model;
-import holeg.utility.Vector2Int;
+import holeg.utility.math.vector.Vec2i;
 
 /**
  * Collection of methods and values needed in both <code>MyCanvas</code> and
@@ -75,7 +75,7 @@ public abstract class AbstractCanvas extends JPanel {
 	JPopupMenu popmenu = new JPopupMenu();
 	// Tooltip
 	boolean toolTip; // Tooltip on or off
-	Vector2Int toolTipPos = new Vector2Int(); // Tooltip Position
+	Vec2i toolTipPos = new Vec2i(); // Tooltip Position
 	String toolTipText = "";
 	List<HolonElement> dataSelected = new ArrayList<>();
 	protected Set<AbstractCanvasObject> tempSelected = new HashSet<>();
@@ -86,11 +86,11 @@ public abstract class AbstractCanvas extends JPanel {
 	boolean doMark = false; // for double click
 	public Edge edgeHighlight = null;
 	Point mousePosition = new Point(); // Mouse Position when
-	ArrayList<Vector2Int> savePos;
+	ArrayList<Vec2i> savePos;
 	// edge Object Start Point
 	int cx, cy;
 	int sx, sy; // Mark Coords
-	Vector2Int unPos;
+	Vec2i unPos;
 	// Animation
 	Timer animT; // animation Timer
 	int animDuration = ANIMTIME; // animation Duration
@@ -289,7 +289,7 @@ public abstract class AbstractCanvas extends JPanel {
 		AbstractCanvasObject toBeReplaced = null;
 
 		/** Position of object that might be replaced */
-		Vector2Int p;
+		Vec2i p;
 
 		/** for each cps on Canvas */
 		if (draggedCps == null || !(draggedCps instanceof Node) && !(draggedCps instanceof Node)) {
@@ -367,7 +367,7 @@ public abstract class AbstractCanvas extends JPanel {
 	 */
 	protected void align(AbstractCanvasObject cps, int distance) {
 		/** Position of the AbstractCpsObject which should be aligned */
-		Vector2Int p = cps.getPosition();
+		Vec2i p = cps.getPosition();
 
 		// calculate how many pixels the cps should be decreased to align
 		/** x offset relative to a grid with lines every distance pixels */

+ 29 - 29
src/holeg/ui/view/canvas/Canvas.java

@@ -48,8 +48,8 @@ import holeg.ui.model.Passiv;
 import holeg.ui.model.Supplier;
 import holeg.ui.model.VisualRepresentationalState;
 import holeg.ui.view.inspector.UnitGraph;
-import holeg.utility.ImageImport;
-import holeg.utility.Vector2Int;
+import holeg.utility.image.Import;
+import holeg.utility.math.vector.Vec2i;
 
 /**
  * This Class is the Canvas. All Objects will be visualized here
@@ -105,7 +105,7 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 
 		itemGroup.addActionListener(actionEvent -> {
 			// calculate uppernode pos (taken from the controller)
-			unPos = new Vector2Int(0, 0);
+			unPos = new Vec2i(0, 0);
 			animCps = new ArrayList<>();
 			for (AbstractCanvasObject cps : GuiSettings.getSelectedObjects()) {
 				animCps.add(cps); // add to animation Cps ArrayList
@@ -116,15 +116,15 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 			// save old Position
 			savePos = new ArrayList<>();
 			for (int i = 0; i < animCps.size(); i++) {
-				savePos.add(new Vector2Int(animCps.get(i).getPosition()));
+				savePos.add(new Vec2i(animCps.get(i).getPosition()));
 			}
 
 			animT = new javax.swing.Timer(animDelay, actionEvent1 -> {
 				if (animDuration - animDelay > 0 && animCps.size() > 1) {
 					for (AbstractCanvasObject animCpObject : animCps) {
-						Vector2Int pos = animCpObject.getPosition();
-						Vector2Int difference = pos.subtract(unPos);
-						Vector2Int result = pos.subtract(difference.divide(animSteps));
+						Vec2i pos = animCpObject.getPosition();
+						Vec2i difference = pos.subtract(unPos);
+						Vec2i result = pos.subtract(difference.divide(animSteps));
 						pos.set(result);
 					}
 					repaint();
@@ -157,22 +157,22 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 			control.undoGroupNode((GroupNode) tempCps, groupNode);
 
 			for (int i = 0; i < animCps.size(); i++) {
-				savePos.add(new Vector2Int(animCps.get(i).getPosition()));
+				savePos.add(new Vec2i(animCps.get(i).getPosition()));
 			}
 			for (AbstractCanvasObject cps : animCps) {
 				int x = tempCps.getPosition().getX();
 				int y = tempCps.getPosition().getY();
 
-				cps.setPosition(new Vector2Int(x, y));
+				cps.setPosition(new Vec2i(x, y));
 			}
 
 			animT = new javax.swing.Timer(animDelay, actionEvent1 -> {
 				control.clearSelection();
 				if (animDuration - animDelay >= 0) {
 					for (int i = 0; i < animCps.size(); i++) {
-						Vector2Int pos = animCps.get(i).getPosition();
-						Vector2Int difference = pos.subtract(savePos.get(i));
-						Vector2Int result = pos.subtract(difference.divide(animSteps));
+						Vec2i pos = animCps.get(i).getPosition();
+						Vec2i difference = pos.subtract(savePos.get(i));
+						Vec2i result = pos.subtract(difference.divide(animSteps));
 						pos.set(result);
 					}
 					repaint();
@@ -268,7 +268,7 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 
 
 	protected void paintCanvasObject(Graphics2D g, DecoratedHolonObject decoratedHolonObject) {
-		Vector2Int pos = decoratedHolonObject.getModel().getPosition();
+		Vec2i pos = decoratedHolonObject.getModel().getPosition();
 		Color statecolor = ColorPreference.HolonObject.getStateColor(decoratedHolonObject.getState());
 		g.setColor(statecolor);
 		g.fillRect(pos.getX() - GuiSettings.getPictureScaleDiv2(), pos.getY() - GuiSettings.getPictureScaleDiv2(),
@@ -276,7 +276,7 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 		drawCanvasObject(g, decoratedHolonObject.getModel().getImage(), pos);
 	}
 
-	protected void drawCanvasObjectString(Graphics2D g, Vector2Int posOfCanvasObject, float energy) {
+	protected void drawCanvasObjectString(Graphics2D g, Vec2i posOfCanvasObject, float energy) {
 		g.setColor(Color.BLACK);
 		g.setFont(new Font("TimesNewRoman", Font.PLAIN, (int) (GuiSettings.getPictureScale() / 4f)));
 		g.drawString((energy > 0) ? "+" + Float.toString(energy) : Float.toString(energy),
@@ -298,15 +298,15 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 		drawCanvasObjectString(g, sup.getModel().getPosition(), sup.getEnergyToSupplyNetwork());
 	}
 
-	protected void drawCanvasObject(Graphics2D g, String Image, Vector2Int pos) {
-		g.drawImage(ImageImport.loadImage(Image, GuiSettings.getPictureScale(), GuiSettings.getPictureScale()),
+	protected void drawCanvasObject(Graphics2D g, String Image, Vec2i pos) {
+		g.drawImage(Import.loadImage(Image, GuiSettings.getPictureScale(), GuiSettings.getPictureScale()),
 				pos.getX() - GuiSettings.getPictureScaleDiv2(), pos.getY() - GuiSettings.getPictureScaleDiv2(), GuiSettings.getPictureScale(),
 				GuiSettings.getPictureScale(), null);
 	}
 
 	protected void paintCable(Graphics2D g, Edge cable, boolean isSelected) {
-		Vector2Int start = cable.getA().getPosition();
-		Vector2Int end = cable.getB().getPosition();
+		Vec2i start = cable.getA().getPosition();
+		Vec2i end = cable.getB().getPosition();
 		float currentEnergy = cable.getActualFlow();
 		float capacity = cable.maxCapacity;
 		boolean unlimited = cable.isUnlimitedCapacity();
@@ -325,7 +325,7 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 		}
 		g.drawLine(start.getX(), start.getY(), end.getX(), end.getY());
 		if (showConnectionInformation) {
-			Vector2Int middle = new Vector2Int((start.getX() + end.getX()) / 2, (start.getY() + end.getY()) / 2);
+			Vec2i middle = new Vec2i((start.getX() + end.getX()) / 2, (start.getY() + end.getY()) / 2);
 			g.setFont(new Font("TimesRoman", Font.PLAIN, Math.max((int) (GuiSettings.getPictureScale() / 3.5f), 10)));
 			g.drawString(currentEnergy + "/" + (unlimited ? "\u221E" : capacity), middle.getX(), middle.getY());
 		}
@@ -337,8 +337,8 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 	}
 
 	protected void paintExitCable(Graphics2D g, ExitCable eCable) {
-		Vector2Int start = eCable.getStart().getPosition();
-		Vector2Int end = eCable.getFinish().getPosition();
+		Vec2i start = eCable.getStart().getPosition();
+		Vec2i end = eCable.getFinish().getPosition();
 		float currentEnergy;
 		float capacity = eCable.getEdge().maxCapacity;
 		boolean unlimited = eCable.getEdge().isUnlimitedCapacity();
@@ -359,13 +359,13 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 			break;
 		}
 		g.drawLine(start.getX(), start.getY(), end.getX(), end.getY());
-		Vector2Int middle = new Vector2Int((start.getX() + end.getX()) / 2, (start.getY() + end.getY()) / 2);
+		Vec2i middle = new Vec2i((start.getX() + end.getX()) / 2, (start.getY() + end.getY()) / 2);
 		g.setFont(new Font("TimesRoman", Font.PLAIN, Math.max((int) (GuiSettings.getPictureScale() / 3.5f), 10)));
 		g.drawString(currentEnergy + "/" + (unlimited ? "\u221E" : capacity), middle.getX(), middle.getY());
 	}
 
 	protected void paintGroupNode(Graphics2D g, DecoratedGroupNode dGroupNode) {
-		Vector2Int pos = dGroupNode.getModel().getPosition();
+		Vec2i pos = dGroupNode.getModel().getPosition();
 		g.setColor(Color.lightGray);
 		g.fillRect(pos.getX() - GuiSettings.getPictureScaleDiv2(), pos.getY() - GuiSettings.getPictureScaleDiv2(),
 				GuiSettings.getPictureScale(), GuiSettings.getPictureScale());
@@ -373,7 +373,7 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 		paintGroupNodeBar(g, dGroupNode, pos);
 	}
 
-	private void paintGroupNodeBar(Graphics2D g, DecoratedGroupNode dGroupNode, Vector2Int pos) {
+	private void paintGroupNodeBar(Graphics2D g, DecoratedGroupNode dGroupNode, Vec2i pos) {
 		// +1, -2, -1 little Adjustment for pixel perfect alignment
 		int barWidth = (int) (GuiSettings.getPictureScale());
 		int barHeight = (int) (GuiSettings.getPictureScale() / 5);
@@ -420,7 +420,7 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 		return percentages;
 	}
 
-	private void paintSupplyBar(Graphics2D g, float percentage, Color color, Vector2Int pos) {
+	private void paintSupplyBar(Graphics2D g, float percentage, Color color, Vec2i pos) {
 		// +1, -2, -1 little Adjustment for pixel perfect alignment
 		int barWidth = (int) (GuiSettings.getPictureScale());
 		int barHeight = (int) (GuiSettings.getPictureScale() / 5);
@@ -528,7 +528,7 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 		Color transparentGrey = ColorPreference.Panel.ObjectSelection;
 		for (AbstractCanvasObject aCps : GuiSettings.getSelectedObjects()) {
 			if (aCps instanceof Node) {
-				Vector2Int pos = aCps.getPosition();
+				Vec2i pos = aCps.getPosition();
 				g2d.setColor(transparentGrey);
 				g2d.fillOval(pos.getX() - (int) (GuiSettings.getPictureScaleDiv2()),
 						pos.getY() - (int) (GuiSettings.getPictureScaleDiv2()), GuiSettings.getPictureScale(), GuiSettings.getPictureScale());
@@ -537,7 +537,7 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 				g2d.drawOval(pos.getX() - (int) (GuiSettings.getPictureScaleDiv2()),
 						pos.getY() - (int) (GuiSettings.getPictureScaleDiv2()), GuiSettings.getPictureScale(), GuiSettings.getPictureScale());
 			} else {
-				Vector2Int pos = aCps.getPosition();
+				Vec2i pos = aCps.getPosition();
 				g2d.setColor(transparentGrey);
 				g2d.fillRect(pos.getX() - (int) (GuiSettings.getPictureScaleDiv2() * 1.5f),
 						pos.getY() - (int) (GuiSettings.getPictureScaleDiv2() * 1.5f), (int) (GuiSettings.getPictureScale() * 1.5f),
@@ -553,8 +553,8 @@ public class Canvas extends AbstractCanvas implements MouseListener, MouseMotion
 		// maybeReplace:
 		if (mayBeReplaced != null) {
 			g2d.setColor(Color.RED);
-			Vector2Int pos = mayBeReplaced.getPosition();
-			g2d.drawImage(ImageImport.loadImage("/images/canvas/replace.png"), pos.getX() + GuiSettings.getPictureScaleDiv2(),
+			Vec2i pos = mayBeReplaced.getPosition();
+			g2d.drawImage(Import.loadImage("/images/canvas/replace.png"), pos.getX() + GuiSettings.getPictureScaleDiv2(),
 					pos.getY() - GuiSettings.getPictureScale(), GuiSettings.getPictureScaleDiv2(), GuiSettings.getPictureScaleDiv2(), null);
 		}
 		// <-- OldCode

+ 4 - 4
src/holeg/ui/view/component/Console.java

@@ -11,7 +11,7 @@ import javax.swing.JTextArea;
 import javax.swing.JToolBar;
 import javax.swing.text.DefaultCaret;
 
-import holeg.utility.ImageImport;
+import holeg.utility.image.Import;
 /**
  * Little new swing object to print data to a console.
  * @author tom
@@ -31,16 +31,16 @@ public class Console extends JPanel {
 		this.add(scrollPane, BorderLayout.CENTER);
 		JToolBar toolBar = new JToolBar();
 		toolBar.setFloatable(false);
-		JButton clearButton  = new JButton("", new ImageIcon(ImageImport.loadImage("/images/buttons/clear.png", 24, 24)));
+		JButton clearButton  = new JButton("", new ImageIcon(Import.loadImage("/images/buttons/clear.png", 24, 24)));
 		clearButton.setToolTipText("Clear Console");
 		clearButton.addActionListener(actionEvent -> clear());
 		toolBar.add(clearButton);
 		toolBar.add(Box.createHorizontalGlue());
-		JButton topButton = new JButton("", new ImageIcon(ImageImport.loadImage("/images/buttons/top.png", 24, 24)));
+		JButton topButton = new JButton("", new ImageIcon(Import.loadImage("/images/buttons/top.png", 24, 24)));
 		topButton.setToolTipText("Scroll to top");
 		topButton.addActionListener(actionEvent -> scrollToTop());
 		toolBar.add(topButton);
-		JButton botButton = new JButton("", new ImageIcon(ImageImport.loadImage("/images/buttons/bottom.png", 24, 24)));
+		JButton botButton = new JButton("", new ImageIcon(Import.loadImage("/images/buttons/bottom.png", 24, 24)));
 		botButton.setToolTipText("Scroll to bottom");
 		botButton.addActionListener(actionEvent -> scrollToBottom());
 		toolBar.add(botButton);

+ 2 - 2
src/holeg/ui/view/dialog/AboutUsPopUp.java

@@ -2,7 +2,7 @@ package holeg.ui.view.dialog;
 
 import javax.swing.*;
 
-import holeg.utility.ImageImport;
+import holeg.utility.image.Import;
 
 import java.awt.*;
 
@@ -56,7 +56,7 @@ public class AboutUsPopUp extends JFrame {
         contentPanel2.setLayout(new BoxLayout(contentPanel2, BoxLayout.Y_AXIS));
         contentPanel3.setLayout(new BoxLayout(contentPanel3, BoxLayout.Y_AXIS));
         
-        this.setIconImage(ImageImport.loadImage("/images/logo/holeg.png",30,30));
+        this.setIconImage(Import.loadImage("/images/logo/holeg.png",30,30));
         setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
         setBounds(100, 100, 500, 800);
         setLocationRelativeTo(parentFrame);

+ 2 - 2
src/holeg/ui/view/dialog/AddElementPopUp.java

@@ -19,7 +19,7 @@ import javax.swing.border.EmptyBorder;
 import holeg.model.HolonElement;
 import holeg.model.HolonObject;
 import holeg.preferences.ColorPreference;
-import holeg.utility.ImageImport;
+import holeg.utility.image.Import;
 
 /**
  * popup for adding an Holon Element to a holon Object.
@@ -55,7 +55,7 @@ public class AddElementPopUp extends JDialog {
 	 */
 	AddElementPopUp(JFrame parentFrame) {
 		super((java.awt.Frame) null, true);
-		this.setIconImage(ImageImport.loadImage("/images/logo/holeg.png", 30, 30));
+		this.setIconImage(Import.loadImage("/images/logo/holeg.png", 30, 30));
 		setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);
 		setBounds(100, 100, 400, 245);
 		setLocationRelativeTo(parentFrame);

+ 4 - 4
src/holeg/ui/view/dialog/AddObjectPopUp.java

@@ -36,7 +36,7 @@ import holeg.model.HolonElement;
 import holeg.model.HolonObject;
 import holeg.preferences.ColorPreference;
 import holeg.ui.controller.Control;
-import holeg.utility.ImageImport;
+import holeg.utility.image.Import;
 
 /**
  * Popup for adding a Holon Object to a Category.
@@ -74,7 +74,7 @@ public class AddObjectPopUp extends JDialog {
 
 		toEdit = obj;
 		editState = edit;
-		this.setIconImage(ImageImport.loadImage("/images/logo/holeg.png", 30, 30));
+		this.setIconImage(Import.loadImage("/images/logo/holeg.png", 30, 30));
 		setBounds(100, 100, 450, 342);
 		setLocationRelativeTo(parentFrame);
 		getContentPane().setLayout(new BorderLayout());
@@ -148,7 +148,7 @@ public class AddObjectPopUp extends JDialog {
 				}
 			});
 			if (edit) {
-				lblImagePreview.setIcon(new ImageIcon(ImageImport.loadImage(obj.getImage(), 50, 50)));
+				lblImagePreview.setIcon(new ImageIcon(Import.loadImage(obj.getImage(), 50, 50)));
 			}
 			sourcePath.setBounds(148, 77, 271, 20);
 			if (edit) {
@@ -297,7 +297,7 @@ public class AddObjectPopUp extends JDialog {
 			selectedFile = fileChooser.getSelectedFile();
 			filePath = selectedFile.getAbsolutePath();
 			sourcePath.setText(filePath);
-			ImageIcon icon = new ImageIcon(ImageImport.loadImage(filePath, 50, 50));
+			ImageIcon icon = new ImageIcon(Import.loadImage(filePath, 50, 50));
 			lblImagePreview.setIcon(icon);
 			imageChanged = true;
 		} else {

+ 5 - 5
src/holeg/ui/view/dialog/CanvasResizePopUp.java

@@ -6,8 +6,8 @@ import holeg.ui.controller.Control;
 import holeg.ui.model.GuiSettings;
 import holeg.ui.model.Model;
 import holeg.ui.view.canvas.Canvas;
-import holeg.utility.ImageImport;
-import holeg.utility.Vector2Int;
+import holeg.utility.image.Import;
+import holeg.utility.math.vector.Vec2i;
 
 import java.awt.*;
 import java.awt.event.ActionEvent;
@@ -35,7 +35,7 @@ public class CanvasResizePopUp extends JDialog {
 		this.canvas = canvas;
 
 		// properties and stuff
-		this.setIconImage(ImageImport.loadImage("/images/logo/holeg.png",30,30));
+		this.setIconImage(Import.loadImage("/images/logo/holeg.png",30,30));
 		this.setTitle("Set the Size of the View");
 		setBounds(200, 100, 200, 100);
         setLocationRelativeTo(parentFrame);
@@ -55,7 +55,7 @@ public class CanvasResizePopUp extends JDialog {
 			public void actionPerformed(ActionEvent e) {
 				GuiSettings.canvasSize.setX(Integer.parseInt(tFieldWidht.getText()));
 				GuiSettings.canvasSize.setY(Integer.parseInt(tFieldHeight.getText()));
-				Vector2Int actualCanvasSize = GuiSettings.canvasSize;
+				Vec2i actualCanvasSize = GuiSettings.canvasSize;
 				
 				Dimension preferedSize = new Dimension(actualCanvasSize.getX(), actualCanvasSize.getY());
 				canvas.setPreferredSize(new Dimension(preferedSize));
@@ -72,7 +72,7 @@ public class CanvasResizePopUp extends JDialog {
 				canvas.repaint();
 				
 				controller.getModel().getCanvas().getAllObjectsRecursive().forEach(obj -> {
-					Vector2Int position = obj.getPosition();
+					Vec2i position = obj.getPosition();
 					position.clampX(0, actualCanvasSize.getX());
 					position.clampY(0, actualCanvasSize.getY());
 				});

+ 4 - 4
src/holeg/ui/view/dialog/CreateTemplatePopUp.java

@@ -25,7 +25,7 @@ import holeg.ui.controller.Control;
 import holeg.ui.model.GuiSettings;
 import holeg.ui.model.Model;
 import holeg.ui.view.main.Category;
-import holeg.utility.ImageImport;
+import holeg.utility.image.Import;
 
 /**
  * PopUp for creating Holon Object Template.
@@ -112,7 +112,7 @@ public class CreateTemplatePopUp extends JDialog {
 		/*
 		 * create Frame and GUI
 		 */
-		setIconImage(ImageImport.loadImage("/images/logo/holeg.png", 30, 30));
+		setIconImage(Import.loadImage("/images/logo/holeg.png", 30, 30));
 		setBounds(100, 100, 476, 344);
 		setLocationRelativeTo(parentFrame);
 		getContentPane().setLayout(new BorderLayout());
@@ -192,7 +192,7 @@ public class CreateTemplatePopUp extends JDialog {
 		 * Image Preview
 		 */
 		lblImagePreview = new JLabel("Image Preview");
-		lblImagePreview.setIcon(new ImageIcon(ImageImport.loadImage(
+		lblImagePreview.setIcon(new ImageIcon(Import.loadImage(
 				template.getImage(), 62, 62)));
 		lblImagePreview.setBounds(298, 13, 62, 62);
 		contentPanel.add(lblImagePreview);
@@ -278,7 +278,7 @@ public class CreateTemplatePopUp extends JDialog {
 			File selectedFile = fileChooser.getSelectedFile();
 			String filePath = selectedFile.getAbsolutePath();
 			textField_imagePath.setText(filePath);
-			ImageIcon icon = new ImageIcon(ImageImport.loadImage(filePath, 62,
+			ImageIcon icon = new ImageIcon(Import.loadImage(filePath, 62,
 					62));
 			lblImagePreview.setIcon(icon);
 		} else {

+ 2 - 2
src/holeg/ui/view/information/HolonInformationPanel.java

@@ -42,8 +42,8 @@ import holeg.ui.model.Passiv;
 import holeg.ui.model.Supplier;
 import holeg.ui.model.VisualRepresentationalState;
 import holeg.ui.model.DecoratedHolonObject.HolonObjectState;
+import holeg.utility.math.decimal.Format;
 import holeg.ui.model.GuiSettings;
-import holeg.utility.FormatFloat;
 
 public class HolonInformationPanel extends JPanel {
 	private static final Logger log = Logger.getLogger(JPanel.class.getName());
@@ -147,7 +147,7 @@ public class HolonInformationPanel extends JPanel {
 		float difference = Math.abs(production - consumption);
 		energyChart.updatePieSeries("Production", production);
 		energyChart.updatePieSeries("Consumption", consumption);
-		differenceEnergyLabelAmount.setText(FormatFloat.doubleFixedPlaces(1, difference));
+		differenceEnergyLabelAmount.setText(Format.doubleFixedPlaces(1, difference));
 		updateToolTips(panelEnergy);
 
 		// UPDATE FLEXIBILITIES

+ 9 - 9
src/holeg/ui/view/inspector/Inspector.java

@@ -25,10 +25,10 @@ import holeg.model.HolonElement;
 import holeg.model.HolonSwitch;
 import holeg.ui.controller.Control;
 import holeg.ui.model.GuiSettings;
-import holeg.utility.FormatFloat;
-import holeg.utility.ImageImport;
-import holeg.utility.Maths;
+import holeg.utility.image.Import;
 import holeg.utility.listener.ResizeListener;
+import holeg.utility.math.Maths;
+import holeg.utility.math.decimal.Format;
 
 public class Inspector extends JSplitPane {
 	private final UnitGraph unitGraph;
@@ -45,11 +45,11 @@ public class Inspector extends JSplitPane {
 	private final JToolBar toolBarGraph = new JToolBar();
 	private String[] comboContext = { "", "5", "10", "20", "100", "1000" };
 	private JComboBox<String> localPeriodInput = new JComboBox<String>(comboContext);
-	private JButton resetButton = new JButton("", new ImageIcon(ImageImport.loadImage("/images/buttons/reset_circle.png")));
-	private final ImageIcon localPeriodButtonImageEnabled = new ImageIcon(ImageImport.loadImage("/images/buttons/graph.png"));
+	private JButton resetButton = new JButton("", new ImageIcon(Import.loadImage("/images/buttons/reset_circle.png")));
+	private final ImageIcon localPeriodButtonImageEnabled = new ImageIcon(Import.loadImage("/images/buttons/graph.png"));
 
 	private final ImageIcon localPeriodButtonImageDisabled = new ImageIcon(
-			GrayFilter.createDisabledImage(ImageImport.loadImage("/images/buttons/graph.png")));
+			GrayFilter.createDisabledImage(Import.loadImage("/images/buttons/graph.png")));
 	private JButton localPeriodButton = new JButton("", localPeriodButtonImageEnabled);
 
 	public Inspector(Control control) {
@@ -180,12 +180,12 @@ public class Inspector extends JSplitPane {
 				Float::sum);
 		double minEnergy = elements.stream().map(ele -> ele.getEnergy()).filter(energy -> energy < 0).reduce(0.0f,
 				Float::sum);
-		double percentage = Maths.inverseLinearInterpolation(maxEnergy, minEnergy, 0.0);
+		double percentage = Maths.invLerp(maxEnergy, minEnergy, 0.0);
 		int widgetHeight = this.globalCurveLabel.getHeight();
 		int textMiddle = this.zeroEnergy.getPreferredSize().height / 4;
 		int zeroYPos = (int)(widgetHeight * percentage) - textMiddle;
-		this.minEnergy.setText(FormatFloat.doubleTwoPlaces(minEnergy));
-		this.maxEnergy.setText(FormatFloat.doubleTwoPlaces(maxEnergy));
+		this.minEnergy.setText(Format.doubleTwoPlaces(minEnergy));
+		this.maxEnergy.setText(Format.doubleTwoPlaces(maxEnergy));
 		this.maxEnergy.setBounds(0, 0, this.maxEnergy.getPreferredSize().width,
 				this.maxEnergy.getPreferredSize().height);
 		this.minEnergy.setBounds(0, widgetHeight - this.minEnergy.getPreferredSize().height, this.minEnergy.getPreferredSize().width,

+ 7 - 7
src/holeg/ui/view/inspector/InspectorTable.java

@@ -46,10 +46,10 @@ import holeg.ui.controller.Control;
 import holeg.ui.model.GuiSettings;
 import holeg.ui.view.component.TrippleCheckBox;
 import holeg.ui.view.component.TrippleCheckBox.State;
-import holeg.utility.ImageImport;
-import holeg.utility.Pool;
 import holeg.utility.events.Action;
+import holeg.utility.image.Import;
 import holeg.utility.listener.SimpleDocumentListener;
+import holeg.utility.pooling.Pool;
 import net.miginfocom.swing.MigLayout;
 
 public class InspectorTable extends JPanel {
@@ -232,7 +232,7 @@ public class InspectorTable extends JPanel {
 		buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
 		buttonPanel.add(Box.createRigidArea(new Dimension(2, 0)));
 
-		addButton.setIcon(new ImageIcon(ImageImport.loadImage("images/buttons/plus.png", 16, 16)));
+		addButton.setIcon(new ImageIcon(Import.loadImage("images/buttons/plus.png", 16, 16)));
 		addButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
 		addButton.addActionListener(clicked -> {
 			Optional<HolonObject> last = GuiSettings.getSelectedObjects().stream()
@@ -246,7 +246,7 @@ public class InspectorTable extends JPanel {
 		});
 		buttonPanel.add(addButton);
 
-		duplicateButton.setIcon(new ImageIcon(ImageImport.loadImage("images/buttons/duplicate.png", 16, 16)));
+		duplicateButton.setIcon(new ImageIcon(Import.loadImage("images/buttons/duplicate.png", 16, 16)));
 		duplicateButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
 		duplicateButton.addActionListener(clicked -> {
 			rowPool.getBorrowedStream().forEach(row -> {
@@ -259,7 +259,7 @@ public class InspectorTable extends JPanel {
 		});
 		buttonPanel.add(duplicateButton);
 
-		deleteButton.setIcon(new ImageIcon(ImageImport.loadImage("images/buttons/minus.png", 16, 16)));
+		deleteButton.setIcon(new ImageIcon(Import.loadImage("images/buttons/minus.png", 16, 16)));
 		deleteButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
 		deleteButton.addActionListener(clicked -> {
 			rowPool.getBorrowedStream().forEach(row -> {
@@ -272,12 +272,12 @@ public class InspectorTable extends JPanel {
 		});
 		buttonPanel.add(deleteButton);
 
-		pageIncreaseButton.setIcon(new ImageIcon(ImageImport.loadImage("images/buttons/page_increase.png", 16, 16)));
+		pageIncreaseButton.setIcon(new ImageIcon(Import.loadImage("images/buttons/page_increase.png", 16, 16)));
 		;
 		pageIncreaseButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
 		pageIncreaseButton.addActionListener(clicked -> this.performPageAction(PageAction.Increase));
 
-		pageDecreaseButton.setIcon(new ImageIcon(ImageImport.loadImage("images/buttons/page_decrease.png", 16, 16)));
+		pageDecreaseButton.setIcon(new ImageIcon(Import.loadImage("images/buttons/page_decrease.png", 16, 16)));
 		pageDecreaseButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
 		pageDecreaseButton.addActionListener(clicked -> this.performPageAction(PageAction.Decrease));
 

+ 56 - 56
src/holeg/ui/view/inspector/UnitGraph.java

@@ -26,9 +26,9 @@ import holeg.interfaces.GraphEditable.GraphType;
 import holeg.model.HolonElement;
 import holeg.ui.controller.Control;
 import holeg.ui.model.Model;
-import holeg.utility.Maths;
-import holeg.utility.Vector2Float;
-import holeg.utility.Vector2Int;
+import holeg.utility.math.Maths;
+import holeg.utility.math.vector.Vec2f;
+import holeg.utility.math.vector.Vec2i;
 
 /**
  * This Class represents a Graph where the User can model the behavior of
@@ -65,7 +65,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	}
 
 	private ArrayList<Series> seriesList = new ArrayList<Series>();
-	private Vector2Int editPosition;
+	private Vec2i editPosition;
 	private Optional<Series> actualSeries;
 
 	private class GlobalCurve {
@@ -149,13 +149,13 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 		// sample curve
 		for (int i = 0; i < model.getMaxIterations(); i++) {
 			curve.points.add(new UnitGraphPoint((double) i / (double)model.getMaxIterations(),
-					Maths.inverseLinearInterpolation(curve.minEnergy, curve.maxEnergy, sample[i]), false));
+					Maths.invLerp(curve.minEnergy, curve.maxEnergy, sample[i]), false));
 		}
 		// update displayPosition
 		for (UnitGraphPoint p : curve.points) {
 			p.calcDisplayedPosition(border, widthWithBorder, heightWithBorder);
 		}
-		double zeroLineYPos = Maths.inverseLinearInterpolation(curve.minEnergy, curve.maxEnergy, 0.0);
+		double zeroLineYPos = Maths.invLerp(curve.minEnergy, curve.maxEnergy, 0.0);
 		curve.zeroLinePoints.add(new UnitGraphPoint(0.0,zeroLineYPos, false));
 		curve.zeroLinePoints.add(new UnitGraphPoint(1.0,zeroLineYPos, false));
 		for (UnitGraphPoint p : curve.zeroLinePoints) {
@@ -315,8 +315,8 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 					int lPeriod = series.element.getLocalPeriod();
 					where = ((double) cur % lPeriod) / ((double) lPeriod);
 				}
-				Vector2Int oben = new Vector2Int(border + (int) (where * widthWithBorder), 0);
-				Vector2Int unten = new Vector2Int(border + (int) (where * widthWithBorder),
+				Vec2i oben = new Vec2i(border + (int) (where * widthWithBorder), 0);
+				Vec2i unten = new Vec2i(border + (int) (where * widthWithBorder),
 						2 * border + heightWithBorder);
 				g.setColor(series.color);
 				drawLine(g, oben, unten);
@@ -329,8 +329,8 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 				int lPeriod = getFirstLocalPeriod();
 				where = ((double) cur % lPeriod) / ((double) lPeriod);
 			}
-			Vector2Int oben = new Vector2Int(border + (int) (where * widthWithBorder), 0);
-			Vector2Int unten = new Vector2Int(border + (int) (where * widthWithBorder), 2 * border + heightWithBorder);
+			Vec2i oben = new Vec2i(border + (int) (where * widthWithBorder), 0);
+			Vec2i unten = new Vec2i(border + (int) (where * widthWithBorder), 2 * border + heightWithBorder);
 			g.setColor(dotColor);
 			drawLine(g, oben, unten);
 		}
@@ -347,7 +347,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * @param start the Position of one end of the line to draw.
 	 * @param end   the other Ends Position of the Line to draw.
 	 */
-	private void drawLine(Graphics2D g, Vector2Int start, Vector2Int end) {
+	private void drawLine(Graphics2D g, Vec2i start, Vec2i end) {
 		Path2D.Double path = new Path2D.Double();
 		path.moveTo(start.getX(), start.getY());
 		path.lineTo(end.getX(), end.getY());
@@ -362,7 +362,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * 
 	 * @param start The Position to start the Curve.
 	 */
-	private Path2D.Double initBezier(Vector2Int start) {
+	private Path2D.Double initBezier(Vec2i start) {
 		// Good Source for basic understanding for Bezier Curves
 		// http://www.theappguruz.com/blog/bezier-curve-in-games
 		Path2D.Double path = new Path2D.Double();
@@ -381,7 +381,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * @param actaul the actual Position of the Path.
 	 * @param target the end Position of the Curve.
 	 */
-	private void curveTo(Path2D.Double path, Vector2Int actual, Vector2Int target) {
+	private void curveTo(Path2D.Double path, Vec2i actual, Vec2i target) {
 		double mitte = (actual.getX() + target.getX()) * 0.5;
 		path.curveTo(mitte, actual.getY(), mitte, target.getY(), target.getX(), target.getY());
 	}
@@ -395,7 +395,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * @param g to draw.
 	 * @param p the position of the Dot.
 	 */
-	private void drawDot(Graphics2D g, Vector2Int p) {
+	private void drawDot(Graphics2D g, Vec2i p) {
 		g.fillOval(p.getX() - dotSize / 2, p.getY() - dotSize / 2, dotSize, dotSize);
 	}
 
@@ -410,16 +410,16 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	private void drawBoolGraph(Graphics2D g, Series series) {
 		if (series.points.size() <= 1)
 			return;
-		LinkedList<Vector2Int> cornerPoints = new LinkedList<Vector2Int>();
+		LinkedList<Vec2i> cornerPoints = new LinkedList<Vec2i>();
 		ListIterator<UnitGraphPoint> iter = series.points.listIterator();
-		Vector2Int actual = series.points.getFirst().displayedPosition;
+		Vec2i actual = series.points.getFirst().displayedPosition;
 		Path2D.Double path = new Path2D.Double();
 		path.moveTo(actual.getX(), actual.getY());
 		while (iter.hasNext()) {
-			Vector2Int target = iter.next().displayedPosition;
+			Vec2i target = iter.next().displayedPosition;
 			// BooleanConnection
 			path.lineTo(target.getX(), actual.getY()); // line to corner
-			cornerPoints.add(new Vector2Int(target.getX(), actual.getY())); // save corner
+			cornerPoints.add(new Vec2i(target.getX(), actual.getY())); // save corner
 			path.lineTo(target.getX(), target.getY()); // line to next Point
 
 			actual = target;
@@ -427,7 +427,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 		g.draw(path);
 		// Draw the Points on the Corner that dont exist in Data but should be visual
 		g.setColor(dotColor);
-		for (Vector2Int p : cornerPoints) {
+		for (Vec2i p : cornerPoints) {
 			drawDot(g, p);
 		}
 
@@ -442,8 +442,8 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * @param g2D to draw.
 	 */
 	private void drawBoolGraphInEditMode(Graphics2D g, Series series) {
-		LinkedList<Vector2Int> before = new LinkedList<Vector2Int>();
-		LinkedList<Vector2Int> after = new LinkedList<Vector2Int>();
+		LinkedList<Vec2i> before = new LinkedList<Vec2i>();
+		LinkedList<Vec2i> after = new LinkedList<Vec2i>();
 		for (UnitGraphPoint p : series.points) {
 			if (p.displayedPosition.getX() < editPosition.getX())
 				before.add(p.displayedPosition);
@@ -455,7 +455,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 		g.setColor(series.color);
 		drawBoolGraphFromList(g, after);
 		// EditGraph
-		LinkedList<Vector2Int> middle = new LinkedList<Vector2Int>();
+		LinkedList<Vec2i> middle = new LinkedList<Vec2i>();
 		if (!before.isEmpty())
 			middle.add(before.getLast());
 		middle.add(editPosition);
@@ -500,25 +500,25 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * @param g2D  to draw.
 	 * @param list the PositionList to draw a BoolGraph
 	 */
-	private void drawBoolGraphFromList(Graphics2D g, LinkedList<Vector2Int> list) {
+	private void drawBoolGraphFromList(Graphics2D g, LinkedList<Vec2i> list) {
 		if (list.size() <= 1)
 			return;
-		ListIterator<Vector2Int> iter = list.listIterator();
-		LinkedList<Vector2Int> cornerPoints = new LinkedList<Vector2Int>();
-		Vector2Int actual = list.getFirst();
+		ListIterator<Vec2i> iter = list.listIterator();
+		LinkedList<Vec2i> cornerPoints = new LinkedList<Vec2i>();
+		Vec2i actual = list.getFirst();
 		Path2D.Double path = new Path2D.Double();
 		path.moveTo(actual.getX(), actual.getY());
 		while (iter.hasNext()) {
-			Vector2Int target = iter.next();
+			Vec2i target = iter.next();
 			// BooleanConnection
 			path.lineTo(target.getX(), actual.getY()); // line to corner
-			cornerPoints.add(new Vector2Int(target.getX(), actual.getY())); // save corner
+			cornerPoints.add(new Vec2i(target.getX(), actual.getY())); // save corner
 			path.lineTo(target.getX(), target.getY()); // line to next Point
 			actual = target;
 		}
 		g.draw(path);
 		g.setColor(dotColor);
-		for (Vector2Int p : cornerPoints) {
+		for (Vec2i p : cornerPoints) {
 			drawDot(g, p);
 		}
 	}
@@ -535,10 +535,10 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 		if (points.isEmpty())
 			return;
 		ListIterator<UnitGraphPoint> iter = points.listIterator();
-		Vector2Int actual = iter.next().displayedPosition;
+		Vec2i actual = iter.next().displayedPosition;
 		Path2D.Double path = this.initBezier(actual);
 		while (iter.hasNext()) {
-			Vector2Int target = iter.next().displayedPosition;
+			Vec2i target = iter.next().displayedPosition;
 			this.curveTo(path, actual, target);
 			actual = target;
 		}
@@ -555,8 +555,8 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * @param g2D to draw.
 	 */
 	private void drawDoubleGraphInEditMode(Graphics2D g, Series series) {
-		LinkedList<Vector2Int> before = new LinkedList<Vector2Int>();
-		LinkedList<Vector2Int> after = new LinkedList<Vector2Int>();
+		LinkedList<Vec2i> before = new LinkedList<Vec2i>();
+		LinkedList<Vec2i> after = new LinkedList<Vec2i>();
 		for (UnitGraphPoint p : series.points) {
 			if (p.displayedPosition.getX() < editPosition.getX())
 				before.add(p.displayedPosition);
@@ -566,7 +566,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 		drawUnitGraphFromList(g, before);
 		drawUnitGraphFromList(g, after);
 		// EditGraph
-		LinkedList<Vector2Int> middle = new LinkedList<Vector2Int>();
+		LinkedList<Vec2i> middle = new LinkedList<Vec2i>();
 		if (!before.isEmpty())
 			middle.add(before.getLast());
 		middle.add(editPosition);
@@ -586,14 +586,14 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * @param g2D  to draw.
 	 * @param list the PositionList to draw a DoubleGraph
 	 */
-	private void drawUnitGraphFromList(Graphics2D g, LinkedList<Vector2Int> list) {
+	private void drawUnitGraphFromList(Graphics2D g, LinkedList<Vec2i> list) {
 		if (list.size() <= 1)
 			return;
-		ListIterator<Vector2Int> iter = list.listIterator();
-		Vector2Int actual = list.getFirst();
+		ListIterator<Vec2i> iter = list.listIterator();
+		Vec2i actual = list.getFirst();
 		Path2D.Double path = this.initBezier(actual);
 		while (iter.hasNext()) {
-			Vector2Int target = iter.next();
+			Vec2i target = iter.next();
 			curveTo(path, actual, target);
 			actual = target;
 		}
@@ -631,9 +631,9 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * 
 	 * @param stateCurve the list of GraphPoint
 	 */
-	private void overrideUnitGraph(Series series, LinkedList<Vector2Float> stateCurve) {
+	private void overrideUnitGraph(Series series, LinkedList<Vec2f> stateCurve) {
 		series.points.clear();
-		for (Vector2Float p : stateCurve) {
+		for (Vec2f p : stateCurve) {
 			UnitGraphPoint point = new UnitGraphPoint(p);
 			point.calcDisplayedPosition(border, widthWithBorder, heightWithBorder);
 			series.points.add(point);
@@ -654,7 +654,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 */
 	private void saveGraph() {
 		for (Series series : seriesList) {
-			LinkedList<Vector2Float> actual = series.element.getStateGraph();
+			LinkedList<Vec2f> actual = series.element.getStateGraph();
 			actual.clear();
 			for (UnitGraphPoint p : series.points) {
 				actual.add(p.getPoint());
@@ -669,7 +669,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * 
 	 * @param mPosition
 	 */
-	private void removePointNearPosition(Series series, Vector2Int mPosition) {
+	private void removePointNearPosition(Series series, Vec2i mPosition) {
 		ListIterator<UnitGraphPoint> iter = series.points.listIterator();
 		while (iter.hasNext()) {
 			if (near(mPosition, iter.next().displayedPosition, series.type)) {
@@ -680,13 +680,13 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 
 	}
 
-	private void removePointsNearPosition(Vector2Int mPosition) {
+	private void removePointsNearPosition(Vec2i mPosition) {
 		for (Series series : seriesList) {
 			removePointNearPosition(series, mPosition);
 		}
 	}
 
-	private Optional<Series> detectSeries(Vector2Int mPosition) {
+	private Optional<Series> detectSeries(Vec2i mPosition) {
 		return seriesList.stream().min((a, b) -> {
 			float minDistanceA = a.points.stream().map(point -> point.displayedPosition.getSquaredDistance(mPosition))
 					.min(Float::compare).get();
@@ -702,7 +702,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * 
 	 * @param mPosition The Position to check.
 	 */
-	private EditPointType detectStartEndPoint(Series series, Vector2Int mPosition) {
+	private EditPointType detectStartEndPoint(Series series, Vec2i mPosition) {
 		UnitGraphPoint first = series.points.getFirst();
 		UnitGraphPoint last = series.points.getLast();
 		if (near(mPosition, first.displayedPosition, series.type))
@@ -721,7 +721,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * @param target
 	 * @return
 	 */
-	private boolean near(Vector2Int actual, Vector2Int target, GraphType graphType) {
+	private boolean near(Vec2i actual, Vec2i target, GraphType graphType) {
 		switch (graphType) {
 		case boolGraph: // Distance only with X
 			int xDis = target.getX() - actual.getX();
@@ -738,9 +738,9 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * 
 	 * @param newPosition
 	 */
-	private void updateEditPointPosition(Vector2Int newPosition, EditPointType editPointType, GraphType graphType) {
+	private void updateEditPointPosition(Vec2i newPosition, EditPointType editPointType, GraphType graphType) {
 		// make it in the bounds of the UnitGraph no Point out of the Border
-		Vector2Int currentPosition = setInBounds(newPosition);
+		Vec2i currentPosition = setInBounds(newPosition);
 		if (editPointType != EditPointType.Normal) {
 			attachToBorder(currentPosition, editPointType);
 		}
@@ -756,7 +756,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * @param p the Position
 	 * @return the updated Position.
 	 */
-	private Vector2Int setInBounds(Vector2Int p) {
+	private Vec2i setInBounds(Vec2i p) {
 		p.clampX(border, border + widthWithBorder);
 		p.clampY(border, border + heightWithBorder);
 		return p;
@@ -768,7 +768,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * @param p the Position
 	 * @return the updated Position.
 	 */
-	private Vector2Int snapBoolean(Vector2Int p) {
+	private Vec2i snapBoolean(Vec2i p) {
 		if (p.getY() < border + heightWithBorder / 2) {
 			p.setY(border);
 		} else {
@@ -784,7 +784,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * @param p the Position
 	 * @return the updated Position.
 	 */
-	private Vector2Int attachToBorder(Vector2Int p, EditPointType editPointType) {
+	private Vec2i attachToBorder(Vec2i p, EditPointType editPointType) {
 		switch (editPointType) {
 		case StartPoint:
 			p.setX(border);
@@ -804,11 +804,11 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 * 
 	 * @param pos The new UnitGraphPoints Position
 	 */
-	private void insertNewGraphPoint(Series series, Vector2Int pos) {
+	private void insertNewGraphPoint(Series series, Vec2i pos) {
 		setInBounds(pos);
 		ListIterator<UnitGraphPoint> iter = series.points.listIterator();
 		while (iter.hasNext()) {
-			Vector2Int tempPosition = iter.next().displayedPosition;
+			Vec2i tempPosition = iter.next().displayedPosition;
 			if (pos.getX() <= tempPosition.getX()) {
 				// previous to go back a position to make the new point before the the Position
 				// with greater X
@@ -830,7 +830,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 *            0..Height
 	 * @return a UnitGraphPoint
 	 */
-	private UnitGraphPoint generateUnitGraphPoint(Vector2Int pos) {
+	private UnitGraphPoint generateUnitGraphPoint(Vec2i pos) {
 		UnitGraphPoint temp = new UnitGraphPoint((double) (pos.getX() - border) / (double) widthWithBorder,
 				1 - (double) (pos.getY() - border) / (double) heightWithBorder, true);
 		temp.displayedPosition = pos;
@@ -843,7 +843,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	@Override
 	public void mouseDragged(MouseEvent e) {
 		actualSeries.ifPresent(series -> {
-			updateEditPointPosition(new Vector2Int(e.getPoint().x, e.getPoint().y), this.editPointType, series.type);
+			updateEditPointPosition(new Vec2i(e.getPoint().x, e.getPoint().y), this.editPointType, series.type);
 			updateGlobalCurve();
 			repaint();
 		});
@@ -873,7 +873,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
 	 */
 	@Override
 	public void mousePressed(MouseEvent e) {
-		Vector2Int mPosition = new Vector2Int(e.getPoint().x, e.getPoint().y);
+		Vec2i mPosition = new Vec2i(e.getPoint().x, e.getPoint().y);
 		actualSeries = detectSeries(mPosition);
 		actualSeries.ifPresent(series -> {
 			if (e.getButton() == MouseEvent.BUTTON3) {

+ 8 - 8
src/holeg/ui/view/inspector/UnitGraphPoint.java

@@ -1,7 +1,7 @@
 package holeg.ui.view.inspector;
 
-import holeg.utility.Vector2Float;
-import holeg.utility.Vector2Int;
+import holeg.utility.math.vector.Vec2f;
+import holeg.utility.math.vector.Vec2i;
 
 /**
  * A class for saving all points of a Object with a editable state.
@@ -15,7 +15,7 @@ public class UnitGraphPoint {
 	/** To determine if this point has changed to only write back points that are changed.*/
 	public boolean changed;
 	/** The displayed Position of the UnitGraphPoint*/
-	public Vector2Int displayedPosition;
+	public Vec2i displayedPosition;
 	
 	/** Default Constructor */
 	public UnitGraphPoint(double x, double y, boolean changed){
@@ -24,7 +24,7 @@ public class UnitGraphPoint {
 		this.changed = changed;
 	}
 	/** Constructor with a Point2D.Double*/
-	public UnitGraphPoint(Vector2Float pos, boolean changed){
+	public UnitGraphPoint(Vec2f pos, boolean changed){
 		this.x = pos.getX();
 		this.y = pos.getY();
 		this.changed = changed;
@@ -32,7 +32,7 @@ public class UnitGraphPoint {
 	/** Constructor with a Point2D.Double
 	 * when changed not specified is false;
 	 * */
-	public UnitGraphPoint(Vector2Float pos){
+	public UnitGraphPoint(Vec2f pos){
 		this.x = pos.getX();
 		this.y = pos.getY();
 		this.changed = false;
@@ -41,12 +41,12 @@ public class UnitGraphPoint {
 	public void calcDisplayedPosition(int border, int widthWithBorder, int heightWithBorder) {
     	//Relativ to Border
     	//1-p.y because its on the Top
-		displayedPosition =  new Vector2Int((int) (x * widthWithBorder) + border, (int) ((1-y) * heightWithBorder) + border);
+		displayedPosition =  new Vec2i((int) (x * widthWithBorder) + border, (int) ((1-y) * heightWithBorder) + border);
     }
 	
-	public Vector2Float getPoint()
+	public Vec2f getPoint()
 	{
-		 return new Vector2Float((float)x, (float)y);
+		 return new Vec2f((float)x, (float)y);
 	}
 	@Override
 	public String toString() {

+ 10 - 10
src/holeg/ui/view/main/GUI.java

@@ -90,7 +90,7 @@ import holeg.ui.view.inspector.UnitGraph;
 import holeg.ui.view.window.AddOnWindow;
 import holeg.ui.view.window.FlexWindow;
 import holeg.ui.view.window.Outliner;
-import holeg.utility.ImageImport;
+import holeg.utility.image.Import;
 
 /**
  * Graphical User Interface.
@@ -509,7 +509,7 @@ public class GUI {
 
 		holegJFrame.setJMenuBar(menuBar);
 
-		holegJFrame.setIconImage(ImageImport.loadImage("/images/logo/holeg.png", 30, 30));
+		holegJFrame.setIconImage(Import.loadImage("/images/logo/holeg.png", 30, 30));
 
 		menuBar.add(mnNewMenu);
 
@@ -700,7 +700,7 @@ public class GUI {
 					for (Category cat : GuiSettings.getCategories()) {
 						for (AbstractCanvasObject cps : cat.getObjects()) {
 							if (value.toString().equals(cps.getName())) {
-								imgR = ImageImport.loadImage(cps.getImage(), 50, 50);
+								imgR = Import.loadImage(cps.getImage(), 50, 50);
 								if (imgR != null) {
 									label.setIcon(new ImageIcon(imgR));
 								}
@@ -717,7 +717,7 @@ public class GUI {
 				if (label.getText().isEmpty()) {
 					label.setText(value.toString());
 					if (!value.toString().equals("Categories")) {
-						label.setIcon(new ImageIcon(ImageImport.loadImage("/images/buttons/folder.png")));
+						label.setIcon(new ImageIcon(Import.loadImage("/images/buttons/folder.png")));
 					}
 				}
 
@@ -917,7 +917,7 @@ public class GUI {
 										img = new ImageIcon(cps.getImage()).getImage().getScaledInstance(32, 32,
 												java.awt.Image.SCALE_SMOOTH);
 									} else {
-										img = ImageImport.loadImage(cps.getImage(), 32, 32);
+										img = Import.loadImage(cps.getImage(), 32, 32);
 									}
 									tempCps = cps;
 									dragging = true;
@@ -975,7 +975,7 @@ public class GUI {
 			new CreateNewDialog(control, Option.Switch, holegJFrame);
 		});
 		btnAdd.addActionListener(actionEvent -> btnAddPopUp.show(btnAdd, -1, +20));
-		btnAdd.setIcon(new ImageIcon(ImageImport.loadImage("images/buttons/plus.png", 16, 16)));
+		btnAdd.setIcon(new ImageIcon(Import.loadImage("images/buttons/plus.png", 16, 16)));
 		btnAdd.setToolTipText("<html><b>New</b><br>Add a new Category or Item to the library.</html>");
 		toolBar.add(btnAdd);
 		/**
@@ -1067,7 +1067,7 @@ public class GUI {
 			}
 			categoryTree.repaint();
 		});
-		btnDel.setIcon(new ImageIcon(ImageImport.loadImage("images/buttons/minus.png", 16, 16)));
+		btnDel.setIcon(new ImageIcon(Import.loadImage("images/buttons/minus.png", 16, 16)));
 		btnDel.setToolTipText("<html><b>Delete</b><br>Removes a Category or a Category Item.</html>");
 		toolBar.add(btnDel);
 
@@ -1305,7 +1305,7 @@ public class GUI {
 	private void initWindowMenu() {
 		menuBar.add(menuWindow);
 		// Algo
-		JMenuItem openMenu = new JMenuItem("Open Algorithm Panel", new ImageIcon(ImageImport
+		JMenuItem openMenu = new JMenuItem("Open Algorithm Panel", new ImageIcon(Import
 				.loadImage("/images/buttons/algo.png").getScaledInstance(20, 20, java.awt.Image.SCALE_SMOOTH)));
 		openMenu.addActionListener(actionEvent -> {
 			new AddOnWindow(holegJFrame, control);
@@ -1313,7 +1313,7 @@ public class GUI {
 		openMenu.setAccelerator(KeyStroke.getKeyStroke('N', Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx()));
 		menuWindow.add(openMenu);
 		// Outliner
-		JMenuItem openOutliner = new JMenuItem("Open Outliner", new ImageIcon(ImageImport
+		JMenuItem openOutliner = new JMenuItem("Open Outliner", new ImageIcon(Import
 				.loadImage("/images/buttons/outliner.png").getScaledInstance(20, 20, java.awt.Image.SCALE_SMOOTH)));
 		openOutliner.addActionListener(actionEvent -> {
 			new Outliner(holegJFrame, model, control);
@@ -1322,7 +1322,7 @@ public class GUI {
 				.setAccelerator(KeyStroke.getKeyStroke('O', Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx()));
 		menuWindow.add(openOutliner);
 		// FlexWindow
-		JMenuItem openFlexMenuItem = new JMenuItem("Open Flexibility Panel", new ImageIcon(ImageImport
+		JMenuItem openFlexMenuItem = new JMenuItem("Open Flexibility Panel", new ImageIcon(Import
 				.loadImage("/images/buttons/algo.png").getScaledInstance(20, 20, java.awt.Image.SCALE_SMOOTH)));
 		openFlexMenuItem.addActionListener(actionEvent -> {
 			new FlexWindow(holegJFrame, control);

+ 8 - 8
src/holeg/ui/view/main/TimePanel.java

@@ -36,7 +36,7 @@ import javax.swing.plaf.basic.BasicSliderUI;
 import holeg.preferences.ColorPreference;
 import holeg.ui.controller.Control;
 import holeg.ui.model.GuiSettings;
-import holeg.utility.ImageImport;
+import holeg.utility.image.Import;
 import holeg.utility.listener.LostFocusListener;
 
 /**
@@ -159,13 +159,13 @@ public class TimePanel extends JPanel implements ActionListener {
 		playBtn.setContentAreaFilled(false);
 		playBtn.setBorderPainted(false);
 		playBtn.setBorder(null);
-		playBtn.setIcon(new ImageIcon(ImageImport.loadImage("/images/buttons/play.png", 30, 30)));
+		playBtn.setIcon(new ImageIcon(Import.loadImage("/images/buttons/play.png", 30, 30)));
 		playBtn.addActionListener(clicked -> play());
 		timeResetBtn.setToolTipText("Reset");
 
 		timeResetBtn.setContentAreaFilled(false);
 		timeResetBtn.setBorder(null);
-		timeResetBtn.setIcon(new ImageIcon(ImageImport.loadImage("/images/buttons/reset.png", 30, 30)));
+		timeResetBtn.setIcon(new ImageIcon(Import.loadImage("/images/buttons/reset.png", 30, 30)));
 		timeResetBtn.addActionListener(new ActionListener() {
 			public void actionPerformed(ActionEvent ae) {
 				timeSlider.setValue(timeSlider.getMinimum());
@@ -181,7 +181,7 @@ public class TimePanel extends JPanel implements ActionListener {
 
 		timeForwardBtn.setContentAreaFilled(false);
 		timeForwardBtn.setBorder(null);
-		timeForwardBtn.setIcon(new ImageIcon(ImageImport.loadImage("/images/buttons/forward.png", 30, 30)));
+		timeForwardBtn.setIcon(new ImageIcon(Import.loadImage("/images/buttons/forward.png", 30, 30)));
 		timeForwardBtn.addActionListener(new ActionListener() {
 			public void actionPerformed(ActionEvent ae) {
 				timeSlider.setValue(timeSlider.getValue() + 1);
@@ -191,7 +191,7 @@ public class TimePanel extends JPanel implements ActionListener {
 		timeBackwardBtn.setToolTipText("Backward");
 
 		timeBackwardBtn.setBorder(null);
-		timeBackwardBtn.setIcon(new ImageIcon(ImageImport.loadImage("/images/buttons/backward.png", 30, 30)));
+		timeBackwardBtn.setIcon(new ImageIcon(Import.loadImage("/images/buttons/backward.png", 30, 30)));
 		timeBackwardBtn.addActionListener(new ActionListener() {
 			public void actionPerformed(ActionEvent ae) {
 				timeSlider.setValue(timeSlider.getValue() - 1);
@@ -327,7 +327,7 @@ public class TimePanel extends JPanel implements ActionListener {
 		timer.setDelay(GuiSettings.timerSpeed);
 		if (timeSlider.getValue() >= control.getModel().getMaxIterations() - 1) {
 			running = false;
-			playBtn.setIcon(new ImageIcon(ImageImport.loadImage("/images/buttons/play.png", 30, 30)));
+			playBtn.setIcon(new ImageIcon(Import.loadImage("/images/buttons/play.png", 30, 30)));
 			timer.stop();
 		}
 	}
@@ -339,10 +339,10 @@ public class TimePanel extends JPanel implements ActionListener {
 		if (running) {
 			timer.setDelay(GuiSettings.timerSpeed);
 			timer.start();
-			playBtn.setIcon(new ImageIcon(ImageImport.loadImage("/images/buttons/pause.png", 30, 30)));
+			playBtn.setIcon(new ImageIcon(Import.loadImage("/images/buttons/pause.png", 30, 30)));
 		} else {
 			timer.stop();
-			playBtn.setIcon(new ImageIcon(ImageImport.loadImage("/images/buttons/play.png", 30, 30)));
+			playBtn.setIcon(new ImageIcon(Import.loadImage("/images/buttons/play.png", 30, 30)));
 		}
 	}
 	

+ 2 - 2
src/holeg/ui/view/window/AddOnWindow.java

@@ -27,7 +27,7 @@ import javax.tools.ToolProvider;
 
 import holeg.api.AddOn;
 import holeg.ui.controller.Control;
-import holeg.utility.ImageImport;
+import holeg.utility.image.Import;
 
 public class AddOnWindow extends JFrame{
 	private AddOn actual;
@@ -38,7 +38,7 @@ public class AddOnWindow extends JFrame{
 		this.setTitle("Add-Ons");
 		this.setVisible(true);
 		this.setContentPane(content);
-		this.setIconImage(ImageImport.loadImage("/images/logo/holeg.png", 30, 30));
+		this.setIconImage(Import.loadImage("/images/logo/holeg.png", 30, 30));
 		initMenuBar();
 		initDefaultContentPanel();
 		this.pack();

+ 2 - 2
src/holeg/ui/view/window/FlexWindow.java

@@ -58,7 +58,7 @@ import holeg.model.HolonObject;
 import holeg.preferences.ColorPreference;
 import holeg.ui.controller.Control;
 import holeg.ui.model.Model;
-import holeg.utility.ImageImport;
+import holeg.utility.image.Import;
 import holeg.utility.listener.WindowClosingListener;
 
 
@@ -110,7 +110,7 @@ public class FlexWindow extends JFrame {
 
 	private void initWindowPanel(JFrame parentFrame) {
 		this.setBounds(0, 0, 400, parentFrame.getHeight()>20?parentFrame.getHeight()- 20:parentFrame.getHeight());
-		this.setIconImage(ImageImport.loadImage("/images/logo/holeg.png", 30, 30));
+		this.setIconImage(Import.loadImage("/images/logo/holeg.png", 30, 30));
 		this.setTitle("Flexibility");
 		this.setLocationRelativeTo(parentFrame);
 		this.setVisible(true);

+ 5 - 5
src/holeg/ui/view/window/Outliner.java

@@ -28,7 +28,7 @@ import holeg.ui.model.MinimumNetwork;
 import holeg.ui.model.Model;
 import holeg.ui.model.Passiv;
 import holeg.ui.model.Supplier;
-import holeg.utility.ImageImport;
+import holeg.utility.image.Import;
 import holeg.utility.listener.WindowClosingListener;
 
 
@@ -46,7 +46,7 @@ public class Outliner extends JFrame {
 	Runnable update = this::update;
 	public Outliner(JFrame parentFrame, Model model, Control control){ 
 		setBounds(0, 0, 400, parentFrame.getHeight());
-		this.setIconImage(ImageImport.loadImage("/images/logo/holeg.png", 30, 30));
+		this.setIconImage(Import.loadImage("/images/logo/holeg.png", 30, 30));
 		this.setTitle("Outliner");
 		setLocationRelativeTo(parentFrame);
 		this.setVisible(true);
@@ -155,9 +155,9 @@ public class Outliner extends JFrame {
 
 
 	private void signIconsForTree(JTree t) {
-		ImageIcon ClosedIcon = new ImageIcon(ImageImport.loadImage("/images/buttons/close.png",9,9));
-		ImageIcon OpenIcon = new ImageIcon(ImageImport.loadImage("/images/buttons/open.png",9,9));
-		ImageIcon LeafIcon = new ImageIcon(ImageImport.loadImage("/images/buttons/leaf.png",9,9));
+		ImageIcon ClosedIcon = new ImageIcon(Import.loadImage("/images/buttons/close.png",9,9));
+		ImageIcon OpenIcon = new ImageIcon(Import.loadImage("/images/buttons/open.png",9,9));
+		ImageIcon LeafIcon = new ImageIcon(Import.loadImage("/images/buttons/leaf.png",9,9));
 		if (ClosedIcon != null && OpenIcon != null && LeafIcon!= null) {
 		    DefaultTreeCellRenderer renderer = 
 		        new DefaultTreeCellRenderer();

+ 0 - 14
src/holeg/utility/Maths.java

@@ -1,14 +0,0 @@
-package holeg.utility;
-
-public class Maths {
-	private final static double EPSILON = 1E-6;
-	
-	public static double linearInterpolate(double first, double second, double alpha) {
-		return first * (1.0 - alpha) + second * alpha;
-	}
-	
-	public static double inverseLinearInterpolation(double min, double max, double value) {
-		if (Math.abs(max - min) < EPSILON) return max;
-		else return (value - min) / (max - min);
-	}
-}

+ 4 - 4
src/holeg/utility/ImageImport.java → src/holeg/utility/image/Import.java

@@ -1,4 +1,4 @@
-package holeg.utility;
+package holeg.utility.image;
 
 import java.awt.Image;
 import java.io.File;
@@ -14,14 +14,14 @@ import javax.imageio.ImageIO;
  * @author TU-Darmstadt BP Gruppe 7 WS17/18 Centralized resource loading methods
  *         for improved performance and easier troubleshooting.
  */
-public class ImageImport {
+public class Import {
 	/*
 	 * Save nothing: Reload every image whenever requested. Save external: Only save
 	 * images that were found as external file. Save raw: Save all non-scaled
 	 * images. Save everything: self-explanatory.
 	 */
 	private static HashMap<String, Image> imgStorage;
-	private static ImageImport xmp = new ImageImport();// Used to load resources from the JAR.
+	private static Import xmp = new Import();// Used to load resources from the JAR.
 
 	static {
 		imgStorage = new HashMap<String, Image>();
@@ -120,6 +120,6 @@ public class ImageImport {
 
 	// Nobody needs an instance of this. I do, because I use it to load images from
 	// inside the JAR.
-	private ImageImport() {
+	private Import() {
 	}
 }

+ 27 - 0
src/holeg/utility/math/Maths.java

@@ -0,0 +1,27 @@
+package holeg.utility.math;
+
+public class Maths {
+	private final static double EPSILON = 1E-6;
+	
+	/**
+	 * Linear Interpolation from first to second via alpha amount.
+	 * @param first
+	 * @param second
+	 * @param alpha
+	 * @return
+	 */
+	public static double lerp(double first, double second, double alpha) {
+		return first * (1.0 - alpha) + second * alpha;
+	}
+	/**
+	 * Inverse Linear Interpolation from min to max to get the corresponding alpha from value.
+	 * @param min
+	 * @param max
+	 * @param value
+	 * @return
+	 */
+	public static double invLerp(double min, double max, double value) {
+		if (Math.abs(max - min) < EPSILON) return max;
+		else return (value - min) / (max - min);
+	}
+}

+ 1 - 1
src/holeg/utility/Random.java → src/holeg/utility/math/Random.java

@@ -1,4 +1,4 @@
-package holeg.utility;
+package holeg.utility.math;
 
 
 

+ 2 - 2
src/holeg/utility/FormatFloat.java → src/holeg/utility/math/decimal/Format.java

@@ -1,11 +1,11 @@
-package holeg.utility;
+package holeg.utility.math.decimal;
 
 import java.math.RoundingMode;
 import java.text.DecimalFormat;
 import java.text.NumberFormat;
 import java.util.Locale;
 
-public class FormatFloat {
+public class Format {
 	
 	private static DecimalFormat formatter;
 	private static DecimalFormat twoFormatter;

+ 6 - 6
src/holeg/utility/FloatLog.java → src/holeg/utility/math/decimal/Sampler.java

@@ -1,10 +1,10 @@
-package holeg.utility;
+package holeg.utility.math.decimal;
 
 import java.util.HashMap;
 import java.util.stream.Collectors;
 //To sample floats and get basic statistical values;
-public class FloatLog {
-	public class LogInfo{
+public class Sampler {
+	public class SampleInfo{
 		public String parameterName;
 		public int sampleSize = 0;
 		public float min = Float.MAX_VALUE;
@@ -25,14 +25,14 @@ public class FloatLog {
 			return "[" + parameterName + " in Range(" + min + ", " + max + ") with a Average of " + getAvg() + " from "+ sampleSize + " Smaples]"; 
 		}
 	}
-	public HashMap<String, LogInfo> logMap = new HashMap<String, LogInfo>();
+	public HashMap<String, SampleInfo> logMap = new HashMap<String, SampleInfo>();
 	public void addSample(String parameterName, float sample) {
 		//Puts the sample in the right LogInfo container or create a new container if not exist jet
 		if(logMap.containsKey(parameterName)) {
-			LogInfo info = logMap.get(parameterName);
+			SampleInfo info = logMap.get(parameterName);
 			info.addSample(sample);
 		}else {
-			LogInfo info = new LogInfo();
+			SampleInfo info = new SampleInfo();
 			info.parameterName = parameterName;
 			info.addSample(sample);
 			logMap.put(parameterName, info);

+ 17 - 17
src/holeg/utility/Vector2Float.java → src/holeg/utility/math/vector/Vec2f.java

@@ -1,20 +1,20 @@
-package holeg.utility;
+package holeg.utility.math.vector;
 
-public class Vector2Float {
+public class Vec2f {
 
 	public float x;
 	public float y;
 
-	public Vector2Float()
+	public Vec2f()
 	{
 		x = y = 0;
 	}
-	public Vector2Float(float x, float y)
+	public Vec2f(float x, float y)
 	{
 		setX(x);
 		setY(y);
 	}
-	public Vector2Float(Vector2Float other)
+	public Vec2f(Vec2f other)
 	{
 		x = other.x;
 		y = other.y;
@@ -43,7 +43,7 @@ public class Vector2Float {
 	}
 
 
-	public float dot(Vector2Float other)
+	public float dot(Vec2f other)
 	{
 		float result = 0.0f;
 		result = x * other.getX() + y * other.getY();
@@ -60,7 +60,7 @@ public class Vector2Float {
 	 * @param other the other Position.
 	 * @return distance to the Position.
 	 */
-	public float getDistance(Vector2Float other)
+	public float getDistance(Vec2f other)
 	{
 		return (float) Math.sqrt(getSquaredDistance(other));
 	}
@@ -70,45 +70,45 @@ public class Vector2Float {
 	 * @param other the other Position.
 	 * @return squared distance to the Position
 	 */
-	public float getSquaredDistance(Vector2Float other)
+	public float getSquaredDistance(Vec2f other)
 	{
 		float xDistance = other.getX() - x;
 		float yDistance = other.getY() - y;
 		return xDistance * xDistance + yDistance * yDistance;
 	}
 
-	public Vector2Float add(Vector2Float other)
+	public Vec2f add(Vec2f other)
 	{
-		Vector2Float result = new Vector2Float();
+		Vec2f result = new Vec2f();
 		result.setX(x + other.getX());
 		result.setY(y + other.getY());
 		return result;
 	}
 
-	public Vector2Float subtract(Vector2Float other)
+	public Vec2f subtract(Vec2f other)
 	{
-		Vector2Float result = new Vector2Float();
+		Vec2f result = new Vec2f();
 		result.setX(x - other.getX());
 		result.setY(y - other.getY());
 		return result;
 	}
 
-	public Vector2Float multiply(float scaleFactor)
+	public Vec2f multiply(float scaleFactor)
 	{
-		Vector2Float result = new Vector2Float();
+		Vec2f result = new Vec2f();
 		result.setX(x * scaleFactor);
 		result.setY(y * scaleFactor);
 		return result;
 	}
-	public Vector2Float divide(float divideFactor)
+	public Vec2f divide(float divideFactor)
 	{
-		Vector2Float result = new Vector2Float();
+		Vec2f result = new Vec2f();
 		result.setX(x / divideFactor);
 		result.setY(y / divideFactor);
 		return result;
 	}
 
-	public Vector2Float normalize()
+	public Vec2f normalize()
 	{
 		float len = getLength();
 		if (len != 0.0f)

+ 16 - 16
src/holeg/utility/Vector2Int.java → src/holeg/utility/math/vector/Vec2i.java

@@ -1,4 +1,4 @@
-package holeg.utility;
+package holeg.utility.math.vector;
 
 
 /**
@@ -6,21 +6,21 @@ package holeg.utility;
  * @author Tom Troppmann
  *
  */
-public class Vector2Int {
+public class Vec2i {
 	private int x;
 	private int y;
 
-	public Vector2Int()
+	public Vec2i()
 	{
 		x = y = 0;
 	}
 
-	public Vector2Int(int x, int y)
+	public Vec2i(int x, int y)
 	{
 		setX(x);
 		setY(y);
 	}
-	public Vector2Int(Vector2Int other)
+	public Vec2i(Vec2i other)
 	{
 		x = other.x;
 		y = other.y;
@@ -46,14 +46,14 @@ public class Vector2Int {
 		setX(x);
 		setY(y);
 	}
-	public void set(Vector2Int other)
+	public void set(Vec2i other)
 	{
 		setX(other.x);
 		setY(other.y);
 	}
 
 
-	public float dot(Vector2Int other)
+	public float dot(Vec2i other)
 	{
 		float result = 0.0f;
 		result = x * other.getX() + y * other.getY();
@@ -70,7 +70,7 @@ public class Vector2Int {
 	 * @param other the other Position.
 	 * @return distance to the Position.
 	 */
-	public float getDistance(Vector2Int other)
+	public float getDistance(Vec2i other)
 	{
 		return (float) Math.sqrt(getSquaredDistance(other));
 	}
@@ -80,38 +80,38 @@ public class Vector2Int {
 	 * @param other the other Position.
 	 * @return squared distance to the Position
 	 */
-	public float getSquaredDistance(Vector2Int other)
+	public float getSquaredDistance(Vec2i other)
 	{
 		int xDistance = other.getX() - x;
 		int yDistance = other.getY() - y;
 		return xDistance * xDistance + yDistance * yDistance;
 	}
 
-	public Vector2Int add(Vector2Int other)
+	public Vec2i add(Vec2i other)
 	{
-		Vector2Int result = new Vector2Int();
+		Vec2i result = new Vec2i();
 		result.setX(x + other.getX());
 		result.setY(y + other.getY());
 		return result;
 	}
 
-	public Vector2Int subtract(Vector2Int other)
+	public Vec2i subtract(Vec2i other)
 	{
-		Vector2Int result = new Vector2Int();
+		Vec2i result = new Vec2i();
 		result.setX(x - other.getX());
 		result.setY(y - other.getY());
 		return result;
 	}
 
-	public Vector2Int multiply(float scaleFactor)
+	public Vec2i multiply(float scaleFactor)
 	{
-		Vector2Int result = new Vector2Int();
+		Vec2i result = new Vec2i();
 		result.setX((int)(x * scaleFactor));
 		result.setY((int)(y * scaleFactor));
 		return result;
 	}
 	
-	public Vector2Int divide(float divideFactor)
+	public Vec2i divide(float divideFactor)
 	{
 		return this.multiply(1.0f/divideFactor);
 	}

+ 1 - 1
src/holeg/utility/Pool.java → src/holeg/utility/pooling/Pool.java

@@ -1,4 +1,4 @@
-package holeg.utility;
+package holeg.utility.pooling;
 
 import java.util.ArrayList;
 import java.util.stream.Stream;