/** Clear the entire workspace by removing all zones and then loading the GUI again. */ public static void clearWorkspace() { LOGGER.info("Clearing workspace"); brushes.clear(); paints.clear(); // remove all zones Zone[] zones = TouchClient.getZones(); for (int i = 0; i < zones.length; i++) { Zone z = zones[i]; TouchClient.remove(z); } loadGUI(); }
/** * Draw loop. Only background and debug information is drawn here, everything else is drawn by * TouchClient and TTSManager. */ @Override public void draw() { background(backgroundColour); if (backgroundImage != null && backgroundImage.length() > 0 && bg != null) { imageMode(CORNER); image(bg, 0, 0, displayWidth, displayHeight); } if (Settings.showDebugInfo) { String s1 = Math.round(frameRate) + "fps, # of zones: " + TouchClient.getZones().length; String s2 = "brushes: " + brushes.size() + ", paints: " + paints.size(); String s3 = "state: "; switch (state) { case RUNNING: s3 += "Running"; break; case IDLE: s3 += "idle"; break; case PAUSED: s3 += "paused"; break; } text(s1, 10, 10); text(s2, 10, 20); text(s3, 10, 30); text(s1, 10, height - 30); text(s2, 10, height - 20); text(s3, 10, height - 10); text(s1, width - 150, 10); text(s2, width - 150, 20); text(s3, width - 150, 30); text(s1, width - 150, height - 30); text(s2, width - 150, height - 20); text(s3, width - 150, height - 10); } if (getInactiveTime() >= Settings.resetPromptDelay && !ResetDialog.isOnScreen()) TouchClient.add(new ResetDialog()); }
/** @return the array of all Zone objects currently registered with the TouchClient. */ public static Zone[] getChildren() { return TouchClient.getZones(); }