public class Application
extends processing.core.PApplet
implements java.awt.event.ActionListener
Modifier and Type | Field and Description |
---|---|
static int |
backgroundColour |
static java.lang.String |
backgroundImage |
static java.lang.String |
BRUSH_SELECTED
The event ID for "a brush was selected" event.
|
static int |
deleteColour |
static java.lang.String |
ITEM_ADDED
The event ID for "an item was added" event.
|
static java.lang.String |
ITEM_REMOVED
The event ID for "an item was removed" event.
|
static int |
LEFT_DRAWER |
static java.lang.String |
PAINT_SELECTED
The event ID for "a paint was selected" event.
|
static int |
primaryColour |
static int |
RIGHT_DRAWER |
static int |
secondaryColour |
static int |
textColour |
static int |
TOP_DRAWER |
static int |
transparentAlpha |
static int |
transparentColour |
args, ARGS_BGCOLOR, ARGS_DISPLAY, ARGS_EDITOR_LOCATION, ARGS_EXTERNAL, ARGS_FULL_SCREEN, ARGS_HIDE_STOP, ARGS_LOCATION, ARGS_PRESENT, ARGS_SKETCH_FOLDER, ARGS_STOP_COLOR, DEFAULT_HEIGHT, DEFAULT_WIDTH, defaultSize, displayHeight, displayWidth, EXTERNAL_MOVE, EXTERNAL_STOP, finished, firstMouse, focused, frame, frameCount, frameRate, g, height, javaVersion, javaVersionName, key, keyCode, keyEvent, keyPressed, MIN_WINDOW_HEIGHT, MIN_WINDOW_WIDTH, mouseButton, mouseEvent, mousePressed, mouseX, mouseY, online, paused, pixels, platform, pmouseX, pmouseY, recorder, requestImageMax, sketchPath, useNativeSelect, useQuartz, width
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ADD, ALPHA, ALT, AMBIENT, ARC, ARGB, ARROW, BACKSPACE, BASELINE, BEVEL, BEZIER_VERTEX, BLEND, BLUR, BOTTOM, BOX, BREAK, BURN, CENTER, CHATTER, CHORD, CLAMP, CLOSE, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CURVE_VERTEX, CUSTOM, DARKEST, DEG_TO_RAD, DELETE, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_DEPTH_MASK, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_NATIVE_FONTS, DISABLE_OPENGL_ERRORS, DISABLE_OPTIMIZED_STROKE, DISABLE_STROKE_PERSPECTIVE, DISABLE_STROKE_PURE, DISABLE_TEXTURE_MIPMAPS, DODGE, DOWN, DXF, ELLIPSE, ENABLE_DEPTH_MASK, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_ERRORS, ENABLE_OPTIMIZED_STROKE, ENABLE_STROKE_PERSPECTIVE, ENABLE_STROKE_PURE, ENABLE_TEXTURE_MIPMAPS, ENTER, EPSILON, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, GIF, GRAY, GROUP, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LANDSCAPE, LEFT, LIGHTEST, LINE, LINE_LOOP, LINE_STRIP, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MODELVIEW, MOVE, MULTIPLY, NORMAL, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, PIE, platformNames, POINT, POINTS, POLYGON, PORTRAIT, POSTERIZE, PROBLEM, PROJECT, PROJECTION, QUAD, QUAD_BEZIER_VERTEX, QUAD_STRIP, QUADS, QUARTER_PI, RAD_TO_DEG, RADIUS, RECT, REPEAT, REPLACE, RETURN, RGB, RIGHT, ROUND, SCREEN, SHAPE, SHIFT, SOFT_LIGHT, SPHERE, SPOT, SQUARE, SUBTRACT, TAB, TARGA, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP, VERTEX, WAIT, WHITESPACE, WINDOWS, X, Y, Z
Constructor and Description |
---|
Application() |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Listen to the events sent by FileBrowserDialog and handle them
appropriately.
|
static void |
addItem(MoveableItem item)
Add an item to the screen.
|
static void |
addListener(java.awt.event.ActionListener listener)
Add a listener.
|
static void |
clearCanvas()
Clear the canvas.
|
static void |
clearWorkspace()
Clear the entire workspace by removing all zones and then loading the GUI
again.
|
static void |
closeApplication()
Close the application.
|
static void |
colouringMode()
Start the colouring mode: show a file browser set to the colouring
folder.
|
void |
draw()
Draw loop.
|
static java.util.ArrayList<Brush> |
getAllBrushes() |
static java.util.ArrayList<Paint> |
getAllPaints() |
static Canvas |
getCanvas()
Get the current Canvas.
|
static vialab.SMT.Zone[] |
getChildren() |
static Drawer |
getDrawer(int drawerId)
Get the drawer in a certain position.
|
static long |
getInactiveTime() |
static Brush |
getSelectedBrush() |
static Paint |
getSelectedPaint() |
static ApplicationState |
getState() |
static void |
idleApplication()
Put the application into idle state.
|
static boolean |
isItemAboveDrawer(MoveableItem item)
Determine if the item is above on of the drawers.
|
void |
keyPressed()
Handle key press events.
|
static void |
load()
Show a file browser set to the save folder.
|
static void |
loadGUI()
Load the GUI from a file.
|
static void |
loadLayout(java.lang.String filename)
Load a workspace layout from the provided file.
|
static void |
loadSave(SaveFile save)
Load a save file, including the layout and painting.
|
static void |
pauseApplication()
Pause the application.
|
static void |
print()
Print the current painting.
|
static void |
removeItem(MoveableItem item)
Remove an item from the screen.
|
static boolean |
removeListener(java.awt.event.ActionListener listener)
Remove a listener.
|
static void |
resetToDefaults()
Reset the workspace to defaults: clear the workspace and then load the
default layout.
|
static void |
resumeApplication()
Resume the application.
|
static void |
save()
Show the save dialog.
|
static void |
saveLayout(java.lang.String filename)
Save the current workspace layout into the provided file.
|
static void |
setActionPerformed()
This method should be called each time user touched the screen.
|
static void |
setCanvas(Canvas newCanvas)
Add a canvas to GUI.
|
static void |
setDrawer(Drawer newDrawer,
int drawerId)
Set the provided drawer to a certain position.
|
static void |
setSelectedBrush(Brush b)
Set the provided Brush object as currently selected.
|
static void |
setSelectedPaint(Paint p)
Set the provided Paint object as currently selected.
|
void |
setup()
Perform the initial setup: set size, initialise TouchClient, load GUI and
layout, initialise PromptManager and TTSManager.
|
boolean |
sketchFullScreen()
Display the application in full screen mode.
|
static void |
takeScreenshot()
Take a screenshot and save it using the current time as the file name.
|
abs, abs, acos, addListeners, alpha, ambient, ambient, ambient, ambientLight, ambientLight, append, append, append, append, append, append, applyMatrix, applyMatrix, applyMatrix, applyMatrix, applyMatrix, arc, arc, arraycopy, arrayCopy, arraycopy, arrayCopy, arraycopy, arrayCopy, asin, atan, atan2, background, background, background, background, background, background, background, beginCamera, beginContour, beginPGL, beginRaw, beginRaw, beginRecord, beginRecord, beginShape, beginShape, bezier, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, bezierVertex, binary, binary, binary, binary, blend, blend, blendColor, blendMode, blue, box, box, brightness, camera, camera, ceil, clip, color, color, color, color, color, color, color, color, colorMode, colorMode, colorMode, colorMode, concat, concat, concat, concat, concat, concat, concat, constrain, constrain, copy, copy, cos, createFont, createFont, createFont, createGraphics, createGraphics, createGraphics, createImage, createInput, createInput, createInputRaw, createOutput, createOutput, createPath, createPath, createReader, createReader, createReader, createShape, createShape, createShape, createShape, createTable, createWriter, createWriter, createWriter, cursor, cursor, cursor, cursor, curve, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, curveVertex, dataFile, dataPath, day, debug, degrees, delay, destroy, die, die, directionalLight, displayable, dispose, dist, dist, edge, ellipse, ellipseMode, emissive, emissive, emissive, endCamera, endContour, endPGL, endRaw, endRecord, endShape, endShape, exec, exit, exp, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, expand, fill, fill, fill, fill, fill, fill, filter, filter, filter, floor, flush, focusGained, focusGained, focusLost, focusLost, frameRate, frustum, get, get, get, getCache, getExtension, getMatrix, getMatrix, getMatrix, green, handleDraw, hex, hex, hex, hex, hint, hour, hue, image, image, image, imageMode, init, insertFrame, isGL, join, join, keyPressed, keyReleased, keyReleased, keyTyped, keyTyped, lerp, lerpColor, lerpColor, lightFalloff, lights, lightSpecular, line, line, link, link, loadBytes, loadBytes, loadBytes, loadFont, loadImage, loadImage, loadPixels, loadShader, loadShader, loadShape, loadStrings, loadStrings, loadStrings, loadStrings, loadTable, loadTable, loadXML, log, loop, mag, mag, main, main, main, map, mask, match, matchAll, max, max, max, max, max, max, method, millis, min, min, min, min, min, min, minute, modelX, modelY, modelZ, month, mouseClicked, mouseClicked, mouseDragged, mouseDragged, mouseEntered, mouseEntered, mouseExited, mouseExited, mouseMoved, mouseMoved, mousePressed, mousePressed, mouseReleased, mouseReleased, nf, nf, nf, nf, nfc, nfc, nfc, nfc, nfp, nfp, nfp, nfp, nfs, nfs, nfs, nfs, noClip, noCursor, noFill, noise, noise, noise, noiseDetail, noiseDetail, noiseSeed, noLights, noLoop, norm, normal, noSmooth, noStroke, noTexture, noTint, open, open, openStream, orientation, ortho, ortho, ortho, paint, param, parseBoolean, parseBoolean, parseBoolean, parseBoolean, parseByte, parseByte, parseByte, parseByte, parseByte, parseByte, parseByte, parseByte, parseByte, parseChar, parseChar, parseChar, parseChar, parseFloat, parseFloat, parseFloat, parseFloat, parseFloat, parseFloat, parseInt, parseInt, parseInt, parseInt, parseInt, parseInt, parseInt, parseInt, parseInt, parseInt, parseInt, parseInt, pause, perspective, perspective, point, point, pointLight, popMatrix, popStyle, postEvent, pow, print, print, print, print, print, print, print, print, print, printCamera, println, println, println, println, println, println, println, println, println, println, printMatrix, printProjection, pushMatrix, pushStyle, quad, quadraticVertex, quadraticVertex, radians, random, random, randomSeed, rect, rect, rect, rectMode, red, redraw, registerDispose, registerDraw, registerKeyEvent, registerMethod, registerMouseEvent, registerPost, registerPre, registerSize, removeCache, removeListeners, requestImage, requestImage, resetMatrix, resetShader, resetShader, resume, reverse, reverse, reverse, reverse, reverse, reverse, reverse, rotate, rotate, rotateX, rotateY, rotateZ, round, run, runSketch, saturation, save, saveBytes, saveBytes, saveBytes, saveFile, saveFrame, saveFrame, savePath, saveStream, saveStream, saveStream, saveStream, saveStream, saveStrings, saveStrings, saveStrings, scale, scale, scale, screenX, screenX, screenY, screenY, screenZ, second, selectFolder, selectFolder, selectFolder, selectFolder, selectInput, selectInput, selectInput, selectInput, selectOutput, selectOutput, selectOutput, selectOutput, set, set, setCache, setMatrix, setMatrix, setMatrix, setupExternalMessages, setupFrameResizeListener, shader, shader, shape, shape, shape, shapeMode, shearX, shearY, shininess, shorten, shorten, shorten, shorten, shorten, shorten, shorten, showDepthWarning, showDepthWarningXYZ, showMethodWarning, showMissingWarning, showVariationWarning, sin, size, size, size, sketchFile, sketchHeight, sketchPath, sketchQuality, sketchRenderer, sketchWidth, smooth, smooth, sort, sort, sort, sort, sort, sort, sort, sort, sort, sort, specular, specular, specular, sphere, sphereDetail, sphereDetail, splice, splice, splice, splice, splice, splice, splice, splice, splice, splice, splice, splice, splice, split, split, splitTokens, splitTokens, spotLight, sq, sqrt, start, status, stop, str, str, str, str, str, str, str, str, str, str, stroke, stroke, stroke, stroke, stroke, stroke, strokeCap, strokeJoin, strokeWeight, style, subset, subset, subset, subset, subset, subset, subset, subset, subset, subset, subset, subset, subset, subset, tan, text, text, text, text, text, text, text, text, text, text, text, textAlign, textAlign, textAscent, textDescent, textFont, textFont, textLeading, textMode, textSize, texture, textureMode, textureWrap, textWidth, textWidth, textWidth, thread, tint, tint, tint, tint, tint, tint, translate, translate, triangle, trim, trim, unbinary, unhex, unregisterDispose, unregisterDraw, unregisterKeyEvent, unregisterMethod, unregisterMouseEvent, unregisterPost, unregisterPre, unregisterSize, update, updateListeners, updatePixels, updatePixels, urlDecode, urlEncode, vertex, vertex, vertex, vertex, vertex, year
getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, validate
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final int TOP_DRAWER
public static final int LEFT_DRAWER
public static final int RIGHT_DRAWER
public static final java.lang.String ITEM_ADDED
public static final java.lang.String ITEM_REMOVED
public static final java.lang.String BRUSH_SELECTED
public static final java.lang.String PAINT_SELECTED
public static int backgroundColour
public static java.lang.String backgroundImage
public static int primaryColour
public static int secondaryColour
public static int textColour
public static int transparentColour
public static int transparentAlpha
public static int deleteColour
public void setup()
setup
in class processing.core.PApplet
public void draw()
draw
in class processing.core.PApplet
public boolean sketchFullScreen()
sketchFullScreen
in class processing.core.PApplet
public void keyPressed()
keyPressed
in class processing.core.PApplet
public static ApplicationState getState()
ApplicationState
public static void pauseApplication()
public static void resumeApplication()
public static void idleApplication()
public static void setSelectedPaint(Paint p)
p
- Paint object to mark as selectedpublic static Paint getSelectedPaint()
public static java.util.ArrayList<Paint> getAllPaints()
public static void setSelectedBrush(Brush b)
b
- Brush object to mark as selectedpublic static Brush getSelectedBrush()
public static java.util.ArrayList<Brush> getAllBrushes()
public static vialab.SMT.Zone[] getChildren()
public static void setDrawer(Drawer newDrawer, int drawerId)
newDrawer
- new drawer to add to the GUIdrawerId
- position of the new drawer, can be on of the following:
TOP_DRAWER
, LEFT_DRAWER
or
RIGHT_DRAWER
public static Drawer getDrawer(int drawerId)
drawerId
- position of the drawer, can be on of the following:
TOP_DRAWER
, LEFT_DRAWER
or
RIGHT_DRAWER
public static void setCanvas(Canvas newCanvas)
newCanvas
- new Canvas to be added to the screenpublic static Canvas getCanvas()
public static boolean isItemAboveDrawer(MoveableItem item)
item
- the item to checkDrawer.isItemAbove(Zone)
public static void setActionPerformed()
public static long getInactiveTime()
public static void addItem(MoveableItem item)
item
- the item to addpublic static void removeItem(MoveableItem item)
item
- the item to removepublic static void addListener(java.awt.event.ActionListener listener)
listener
- listener object to addpublic static boolean removeListener(java.awt.event.ActionListener listener)
listener
- listener object to removepublic static void loadGUI()
public static void clearWorkspace()
public static void loadSave(SaveFile save)
save
- SaveFile object to load data frompublic static void saveLayout(java.lang.String filename)
filename
- valid file name to save layout intopublic static void loadLayout(java.lang.String filename)
filename
- valid file that contains a workspace layoutpublic static void takeScreenshot()
public static void save()
SaveDialog
public static void load()
FileBrowserDialog
public static void clearCanvas()
Canvas.clear()
public static void resetToDefaults()
public static void colouringMode()
FileBrowserDialog
public static void print()
DrawingPrinter
public static void closeApplication()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener