changed lock

changed placer to abstract class
This commit is contained in:
Macocian Adrian Radu
2020-06-10 21:41:05 +03:00
parent 58614024cc
commit 01bd4ce2e6
15 changed files with 106 additions and 525 deletions

View File

@@ -3,57 +3,7 @@ package guiTree.Components.Decorations.Placers;
import guiTree.Helper.Point2;
import guiTree.Helper.Point4;
public class GeneralPlacer implements Placer {
private Point2<Integer> location;
private Point2<Integer> size;
private Point2<Integer> parentSize;
private Point2<Float> relativeLocation;
private Point4<Integer> margin;
public GeneralPlacer() {
margin = new Point4<>(0, 0, 0, 0);
}
@Override
public void setRelativeLocation(float x, float y) {
relativeLocation = new Point2<>(x, y);
}
@Override
public void setLocation(int x, int y) {
location = new Point2<>(x, y);
}
@Override
public void setElementSize(int width, int height) {
size = new Point2<>(width, height);
}
@Override
public void setParentSize(int width, int height) {
parentSize = new Point2<>(width, height);
}
@Override
public void setMargins(int up, int down, int left, int right) {
margin.a = up;
margin.b = down;
margin.c = left;
margin.d = right;
}
@Override
public void setMargins(int margin) {
this.margin.a = margin;
this.margin.b = margin;
this.margin.c = margin;
this.margin.d = margin;
}
@Override
public Point4<Integer> getMargins() {
return margin;
}
public class GeneralPlacer extends Placer {
@Override
public Point2<Integer> getPosition() {