SystemInformationMonitorApp.getApplication();
}
@Override
public void update() {
final MemoryObject memObj = getMemoryInfo();
threadLock.lock();
try {
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
sysApp = SystemInformationMonitorApp.getApplication();
NumberFormat nf = NumberFormat.getPercentInstance();
long total = memObj.getTotalMemoryLong();
long free = memObj.getFreeMemoryLong();
long used = memObj.getUsedMemoryLong();
double freePercent = (double) ((double) free / total) * 100;
double usedPercent = (double) ((double) used / total) * 100;
sysApp.getView().setUsedMemoryProgressBar(
(int) usedPercent, memObj.getActualUsed());
sysApp.getView().setFreeMemoryProgressBar(
(int) freePercent, memObj.getActualFree());
sysApp.getView().setTotalMemoryProgressBar(100, memObj.getTotalMemory());
DefaultPieDataset dataset = (DefaultPieDataset) ((PiePlot) ((ChartPanel) sysApp.getView().
getMemoryPieChartPanel()).getChart().getPlot()).getDataset();
dataset.setValue("Free Memory", (int) freePercent);
dataset.setValue("Used Memory", (int) usedPercent);
}