Files
DeltaZern/paper-server/src/main/java/com/destroystokyo/paper/gui/GraphData.java
T
William Blake Galbreath fa7c667a3e Make the GUI graph fancier
2020-02-02 04:00:40 -06:00

48 lines
954 B
Java

package com.destroystokyo.paper.gui;
import java.awt.Color;
public class GraphData {
private long total;
private long free;
private long max;
private long usedMem;
private int usedPercent;
public GraphData(long total, long free, long max) {
this.total = total;
this.free = free;
this.max = max;
this.usedMem = total - free;
this.usedPercent = usedMem == 0 ? 0 : (int) (usedMem * 100L / max);
}
public long getTotal() {
return total;
}
public long getFree() {
return free;
}
public long getMax() {
return max;
}
public long getUsedMem() {
return usedMem;
}
public int getUsedPercent() {
return usedPercent;
}
public Color getFillColor() {
return GraphColor.getFillColor(usedPercent);
}
public Color getLineColor() {
return GraphColor.getLineColor(usedPercent);
}
}