All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jdiai.tools.ClientRect Maven / Gradle / Ivy

There is a newer version: 1.1.8
Show newest version
package com.jdiai.tools;

import com.google.gson.JsonObject;

public class ClientRect {
    public int x, y, top, bottom, right, left, windowWidth, windowHeight;
    public ClientRect(JsonObject json) {
        x = roundUp(json, "x");
        y = roundUp(json, "y");
        top = roundUp(json, "top");
        bottom = roundDown(json, "bottom");
        right = roundDown(json, "right");
        left = roundUp(json, "left");
        windowWidth = roundDown(json, "wWidth");;
        windowHeight = roundDown(json, "wHeight");;
    }
    private int roundUp(JsonObject json, String variable) {
        return (int) Math.round(json.get(variable).getAsDouble());
    }
    private int roundDown(JsonObject json, String variable) {
        return (int) json.get(variable).getAsDouble();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy