diff --git a/resources/ui.xml b/resources/ui.xml
index bf800d2..8736a14 100644
--- a/resources/ui.xml
+++ b/resources/ui.xml
@@ -39,6 +39,14 @@
Icon="circle"
/>
+
+
+
+
+
+
+
+
-
diff --git a/src/guiTree/Animations/ColorAnimation.java b/src/guiTree/Animations/ColorAnimation.java
index 9ee740b..a162005 100644
--- a/src/guiTree/Animations/ColorAnimation.java
+++ b/src/guiTree/Animations/ColorAnimation.java
@@ -32,10 +32,10 @@ public class ColorAnimation implements AnimationInterface {
@Override
public boolean step() {
- if(from.a > to.a - 1 && from.a < to.a + 1 &&
- from.b > to.b - 1 && from.b < to.b + 1 &&
- from.c > to.c - 1 && from.c < to.c + 1 &&
- from.d > to.d - 1 && from.d < to.d + 1) {
+ if(((from.a + offset.a >= to.a && offset.a >= 0) || (from.a + offset.a <= to.a && offset.a <= 0)) &&
+ ((from.b + offset.b >= to.b && offset.b >= 0) || (from.b + offset.b <= to.b && offset.b <= 0)) &&
+ ((from.c + offset.c >= to.c && offset.c >= 0) || (from.c + offset.c <= to.c && offset.c <= 0)) &&
+ ((from.d + offset.d >= to.d && offset.d >= 0) || (from.d + offset.d <= to.d && offset.d <= 0))) {
element.setPaintColor(new Color(to.a, to.b, to.c, to.d));
Debugger.log("Animation for " + element.getName() + " finished", Debugger.Tag.ANIMATIONS);
return true;
diff --git a/src/guiTree/Animations/LocationAnimation.java b/src/guiTree/Animations/LocationAnimation.java
index 548772d..24fde6a 100644
--- a/src/guiTree/Animations/LocationAnimation.java
+++ b/src/guiTree/Animations/LocationAnimation.java
@@ -20,7 +20,8 @@ public class LocationAnimation implements AnimationInterface {
@Override
public boolean step() {
- if(from.x > to.x - 1 && from.x < to.x + 1 && from.y > to.y - 1 && from.y < to.y + 1) {
+ if(((from.x + offset.x >= to.x && offset.x >= 0) || (from.x + offset.x <= to.x && offset.x <= 0)) &&
+ ((from.y + offset.y >= to.y && offset.y >= 0) || (from.y + offset.y <= to.y && offset.y <= 0))) {
element.setLocation(to.x, to.y);
Debugger.log("Animation for " + element.getName() + " finished", Debugger.Tag.ANIMATIONS);
return true;
diff --git a/src/guiTree/Components/Border.java b/src/guiTree/Components/Border.java
index 47573fd..f0294dd 100644
--- a/src/guiTree/Components/Border.java
+++ b/src/guiTree/Components/Border.java
@@ -38,6 +38,11 @@ public class Border extends Visual {
update();
}
+ @Override
+ public boolean isInside(int x, int y) {
+ return false;
+ }
+
public void paint(BufferedImage imageBuffer) {
Graphics2D g = imageBuffer.createGraphics();
diff --git a/src/guiTree/Components/Button.java b/src/guiTree/Components/Button.java
index 6d76247..d35b4fa 100644
--- a/src/guiTree/Components/Button.java
+++ b/src/guiTree/Components/Button.java
@@ -161,24 +161,4 @@ public class Button extends MenuItem {
public void setOpenedSize(Integer width, Integer height) {
setSize(width, height);
}
-
- @Override
- public int getClosedWidth() {
- return getWidth();
- }
-
- @Override
- public int getClosedHeight() {
- return getHeight();
- }
-
- @Override
- public int getOpenedWidth() {
- return getWidth();
- }
-
- @Override
- public int getOpenedHeight() {
- return getHeight();
- }
}
diff --git a/src/guiTree/Components/DropDown.java b/src/guiTree/Components/DropDown.java
index ae4cea7..c82fced 100644
--- a/src/guiTree/Components/DropDown.java
+++ b/src/guiTree/Components/DropDown.java
@@ -1,18 +1,24 @@
package guiTree.Components;
+import guiTree.Animations.ColorAnimation;
import guiTree.Animations.SizeAnimation;
+import guiTree.Helper.Debugger;
import guiTree.Helper.Point2;
import guiTree.Visual;
import guiTree.events.MouseAdapter;
-import javafx.css.Size;
+import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-public class DropDown extends ToggleButton implements Menu{
+public class DropDown extends MenuItem implements Menu{
+ private String label;
+ private BufferedImage icon;
private List