// Path: src/main/java/com/onkiup/minedroid/gui/primitives/Color.java
// public class Color {
//     /**
//      * Color components
//      */
//     public int alpha = 255, red = 0, green = 0, blue = 0;
// 
//     public Color(int red, int green, int blue, int alpha) {
//         this.alpha = alpha;
//         this.red = red;
//         this.green = green;
//         this.blue = blue;
//     }
// 
//     public Color(long color) {
//         blue = (int) (color & 255);
//         green = (int) (color >> 8 & 255);
//         red = (int) (color >> 16 & 255);
//         if (color > 0xFFFFFF) {
//             alpha = (int) (color >> 24 & 255);
//         }
//     }
// 
//     @Override
//     public Color clone() throws CloneNotSupportedException {
//         return new Color(red, green, blue, alpha);
//     }
// 
//     @Override
//     public String toString() {
//         return "rgba("+red+", "+green+", "+blue+", "+alpha+")";
//     }
// 
//     public long raw() {
//         Long raw = 0l;
//         raw = raw | alpha;
//         raw = (raw << 8) | red;
//         raw = (raw << 8) | green;
//         raw = (raw << 8) | blue;
//         return raw;
//     }
// }
// 
// Path: src/main/java/com/onkiup/minedroid/gui/primitives/GLColor.java
// public class GLColor {
//     public float red, green, blue, alpha;
// 
//     public GLColor(Color color) {
//         red = color.red / 255f;
//         green = color.green / 255f;
//         blue = color.blue / 255f;
//         alpha = color.alpha / 255f;
//     }
// 
//     public GLColor(float red, float green, float blue, float alpha) {
//         this.red = red;
//         this.green = green;
//         this.blue = blue;
//         this.alpha = alpha;
//     }
// 
//     public GLColor(int red, int green, int blue, int alpha) {
//         this.red = red / 255f;
//         this.green = green / 255f;
//         this.blue = blue / 255f;
//         this.alpha = alpha / 255f;
//     }
// 
//     @Override
//     public GLColor clone() {
//         return new GLColor(red, green, blue, alpha);
//     }
// 
//     @Override
//     public String toString() {
//         return "rgba_gl("+red+", "+green+", "+blue+", "+alpha+")";
//     }
// 
//     public Color getColor() {
//         return new Color((int) (red * 255), (int) (green *255), (int) (blue * 255), (int) (alpha * 255));
//     }
// 
//     public void add(GLColor step) {
//         red += step.red;
//         blue += step.blue;
//         green += step.green;
//         alpha += step.alpha;
//     }
// }
// 
// Path: src/main/java/com/onkiup/minedroid/gui/primitives/Point.java
// public class Point {
// 
//     public int x, y;
// 
//     public Point(int x, int y) {
//         this.x = x;
//         this.y = y;
//     }
// 
//     @Override
//     public Point clone() {
//         return new Point(x, y);
//     }
// 
//     @Override
//     public String toString() {
//         return "("+x+", "+y+")";
//     }
// 
//     /**
//      * Uses given point as an offset to create a moved point
//      * @param point Offset
//      * @return Moved point
//      */
//     public Point add(Point point) {
//         Point result = clone();
//         result.x += point.x;
//         result.y += point.y;
//         return result;
//     }
// 
//     /**
//      * Uses given point as a negative offset to create a moved point
//      * @param point Offset
//      * @return Moved point
//      */
//     public Point sub(Point point) {
//         Point result = clone();
//         result.x -= point.x;
//         result.y -= point.y;
//         return result;
//     }
// 
//     public void max(Point o) {
//         x = Math.max(x, o.x);
//         y = Math.max(y, o.y);
//     }
// }


import com.onkiup.minedroid.gui.primitives.Color;
import com.onkiup.minedroid.gui.primitives.GLColor;
import com.onkiup.minedroid.gui.primitives.Point;
package com.onkiup.minedroid.gui.drawables;


/**
 * Draws debug border
 */
public class BorderDrawable extends ColorDrawable {

    public BorderDrawable() {
        super();
    }

    public BorderDrawable(Color color) {
        super(color);
    }

    protected int thickness = 1;

    @Override
    public void draw(Point where) {
        ColorDrawable line = new ColorDrawable(color.getColor());

        // top
        line.setSize(new Point(thickness, size.y));
        line.draw(where);

        // bottom
        line.draw(where.add(new Point(size.x - thickness, 0)));

        // left
        line.setSize(new Point(size.x, thickness));
        line.draw(where);

        // right
        line.draw(where.add(new Point(0, size.y - thickness)));

//        ColorDrawable dot = new ColorDrawable(color.getColor());
//        dot.setSize(new Point(3, 3));
//
//        dot.draw(where.add(new Point(-1, -1)));                  // lt
//        dot.draw(where.add(new Point(size.x - 1, -1)));          // rt
//        dot.draw(where.add(new Point(size.x - 1, size.y - 1)));  // rb
//        dot.draw(where.add(new Point(-1, size.y - 1)));          // lb
    }

    @Override
    public BorderDrawable clone() {
        BorderDrawable result = new BorderDrawable(color.getColor());
        if (size != null) result.setSize(size.clone());
        return result;
    }

// Path: src/main/java/com/onkiup/minedroid/gui/primitives/Color.java
// public class Color {
//     /**
//      * Color components
//      */
//     public int alpha = 255, red = 0, green = 0, blue = 0;
// 
//     public Color(int red, int green, int blue, int alpha) {
//         this.alpha = alpha;
//         this.red = red;
//         this.green = green;
//         this.blue = blue;
//     }
// 
//     public Color(long color) {
//         blue = (int) (color & 255);
//         green = (int) (color >> 8 & 255);
//         red = (int) (color >> 16 & 255);
//         if (color > 0xFFFFFF) {
//             alpha = (int) (color >> 24 & 255);
//         }
//     }
// 
//     @Override
//     public Color clone() throws CloneNotSupportedException {
//         return new Color(red, green, blue, alpha);
//     }
// 
//     @Override
//     public String toString() {
//         return "rgba("+red+", "+green+", "+blue+", "+alpha+")";
//     }
// 
//     public long raw() {
//         Long raw = 0l;
//         raw = raw | alpha;
//         raw = (raw << 8) | red;
//         raw = (raw << 8) | green;
//         raw = (raw << 8) | blue;
//         return raw;
//     }
// }
// 
// Path: src/main/java/com/onkiup/minedroid/gui/primitives/GLColor.java
// public class GLColor {
//     public float red, green, blue, alpha;
// 
//     public GLColor(Color color) {
//         red = color.red / 255f;
//         green = color.green / 255f;
//         blue = color.blue / 255f;
//         alpha = color.alpha / 255f;
//     }
// 
//     public GLColor(float red, float green, float blue, float alpha) {
//         this.red = red;
//         this.green = green;
//         this.blue = blue;
//         this.alpha = alpha;
//     }
// 
//     public GLColor(int red, int green, int blue, int alpha) {
//         this.red = red / 255f;
//         this.green = green / 255f;
//         this.blue = blue / 255f;
//         this.alpha = alpha / 255f;
//     }
// 
//     @Override
//     public GLColor clone() {
//         return new GLColor(red, green, blue, alpha);
//     }
// 
//     @Override
//     public String toString() {
//         return "rgba_gl("+red+", "+green+", "+blue+", "+alpha+")";
//     }
// 
//     public Color getColor() {
//         return new Color((int) (red * 255), (int) (green *255), (int) (blue * 255), (int) (alpha * 255));
//     }
// 
//     public void add(GLColor step) {
//         red += step.red;
//         blue += step.blue;
//         green += step.green;
//         alpha += step.alpha;
//     }
// }
// 
// Path: src/main/java/com/onkiup/minedroid/gui/primitives/Point.java
// public class Point {
// 
//     public int x, y;
// 
//     public Point(int x, int y) {
//         this.x = x;
//         this.y = y;
//     }
// 
//     @Override
//     public Point clone() {
//         return new Point(x, y);
//     }
// 
//     @Override
//     public String toString() {
//         return "("+x+", "+y+")";
//     }
// 
//     /**
//      * Uses given point as an offset to create a moved point
//      * @param point Offset
//      * @return Moved point
//      */
//     public Point add(Point point) {
//         Point result = clone();
//         result.x += point.x;
//         result.y += point.y;
//         return result;
//     }
// 
//     /**
//      * Uses given point as a negative offset to create a moved point
//      * @param point Offset
//      * @return Moved point
//      */
//     public Point sub(Point point) {
//         Point result = clone();
//         result.x -= point.x;
//         result.y -= point.y;
//         return result;
//     }
// 
//     public void max(Point o) {
//         x = Math.max(x, o.x);
//         y = Math.max(y, o.y);
//     }
// }


// Path: src/main/java/com/onkiup/minedroid/gui/drawables/BorderDrawable.java
import com.onkiup.minedroid.gui.primitives.Color;
import com.onkiup.minedroid.gui.primitives.GLColor;
import com.onkiup.minedroid.gui.primitives.Point;

package com.onkiup.minedroid.gui.drawables;


/**
 * Draws debug border
 */
public class BorderDrawable extends ColorDrawable {

    public BorderDrawable() {
        super();
    }

    public BorderDrawable(Color color) {
        super(color);
    }

    protected int thickness = 1;

    @Override
    public void draw(Point where) {
        ColorDrawable line = new ColorDrawable(color.getColor());

        // top
        line.setSize(new Point(thickness, size.y));
        line.draw(where);

        // bottom
        line.draw(where.add(new Point(size.x - thickness, 0)));

        // left
        line.setSize(new Point(size.x, thickness));
        line.draw(where);

        // right
        line.draw(where.add(new Point(0, size.y - thickness)));

//        ColorDrawable dot = new ColorDrawable(color.getColor());
//        dot.setSize(new Point(3, 3));
//
//        dot.draw(where.add(new Point(-1, -1)));                  // lt
//        dot.draw(where.add(new Point(size.x - 1, -1)));          // rt
//        dot.draw(where.add(new Point(size.x - 1, size.y - 1)));  // rb
//        dot.draw(where.add(new Point(-1, size.y - 1)));          // lb
    }

    @Override
    public BorderDrawable clone() {
        BorderDrawable result = new BorderDrawable(color.getColor());
        if (size != null) result.setSize(size.clone());
        return result;
    }

    @Override