public class GWindow extends Frame implements GConstants, GConstantsInternal
Window.Type
Component.BaselineResizeBehavior
Modifier and Type | Field and Description |
---|---|
GWinData |
data |
Method |
mouseHandlerMethod
The method in mouseHandlerObject to execute
|
Object |
mouseHandlerObject
The object to handle the mouse event
|
GWinApplet |
papplet
Gives direct access to the PApplet object inside the frame
|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ALPHA_BLOCK, ALPHA_PICK, BACKGROUND, BLUE_SCHEME, CLOSE_WINDOW, CTRL_ANGULAR, CTRL_HORIZONTAL, CTRL_VERTICAL, CYAN_SCHEME, DECIMAL, EXIT_APP, EXPONENT, FAMILY, FOREGROUND, GOLD_SCHEME, GREEN_SCHEME, INTEGER, KEEP_OPEN, ORANGE_SCHEME, ORIENT_LEFT, ORIENT_RIGHT, ORIENT_TRACK, POSTURE, POSTURE_OBLIQUE, POSTURE_REGULAR, PURPLE_SCHEME, RED_SCHEME, SCHEME_10, SCHEME_11, SCHEME_12, SCHEME_13, SCHEME_14, SCHEME_15, SCHEME_8, SCHEME_9, SCROLLBAR_HORIZONTAL, SCROLLBAR_VERTICAL, SCROLLBARS_AUTOHIDE, SCROLLBARS_BOTH, SCROLLBARS_HORIZONTAL_ONLY, SCROLLBARS_NONE, SCROLLBARS_VERTICAL_ONLY, SIZE, STRIKETHROUGH, STRIKETHROUGH_OFF, STRIKETHROUGH_ON, SUPERSCRIPT, SUPERSCRIPT_OFF, SUPERSCRIPT_SUB, SUPERSCRIPT_SUPER, USER_COL_SCHEME, WEIGHT, WEIGHT_BOLD, WEIGHT_DEMIBOLD, WEIGHT_DEMILIGHT, WEIGHT_EXTRA_LIGHT, WEIGHT_EXTRABOLD, WEIGHT_HEAVY, WEIGHT_LIGHT, WEIGHT_MEDIUM, WEIGHT_REGULAR, WEIGHT_SEMIBOLD, WEIGHT_ULTRABOLD, WIDTH, WIDTH_CONDENSED, WIDTH_EXTENDED, WIDTH_REGULAR, WIDTH_SEMI_CONDENSED, WIDTH_SEMI_EXTENDED, YELLOW_SCHEME
ALL_METHOD, CLIP_RUN, COMBI_MODES, DRAW_METHOD, EXCP_IN_HANDLER, grid, I_CL, I_COVERED, I_CR, I_INSIDE, I_MODES, I_NONE, I_TL, I_TR, KEY_METHOD, MERGE_RUNS, MISSING, MOUSE_METHOD, NONEXISTANT, OFF_CONTROL, OVER_CONTROL, pen_1_0, pen_2_0, pen_3_0, pen_4_0, POST_METHOD, PRE_METHOD, PRESS_CONTROL, RUNTIME_ERROR, TINT_FOR_ALPHA
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
GWindow(PApplet theApplet,
String name,
int x,
int y,
int w,
int h,
boolean noFrame,
String mode)
Create a window that can be used to hold G4P components or used
for drawing or both together.
|
GWindow(PApplet theApplet,
String name,
int x,
int y,
PImage image,
boolean noFrame,
String mode) |
Modifier and Type | Method and Description |
---|---|
void |
addData(GWinData data)
Add an object that holds the data this window needs to use.
|
void |
addDrawHandler(Object obj,
String methodName)
Attempt to add the 'draw' handler method.
|
void |
addMouseHandler(Object obj,
String methodName)
Attempt to add the 'mouse' handler method.
|
void |
addPostHandler(Object obj,
String methodName)
Attempt to add the 'post' handler method.
|
void |
addPreHandler(Object obj,
String methodName)
Attempt to add the 'pre' handler method.
|
void |
close()
Allows the user to close this window and release its resources.
|
int |
getActionOnClose()
Get the action to be performed when the user attempts to close
the window.
|
void |
setActionOnClose(int action)
This sets what happens when the users attempts to close the window.
|
void |
setAutoClear(boolean auto_clear)
By default the background() method is called to set the background image/colour
every frame.
|
void |
setBackground(int col)
Set the background color for the window.
|
void |
setBackground(PImage image)
Set the background image to be used instead of a plain color background
The window will resize to accommodate the image. |
void |
setLocation(int x,
int y)
Sets the location of the window.
|
void |
setOnTop(boolean onTop)
Always make this window appear on top of other windows (or not).
|
void |
setResizable(boolean resizable)
Determines whether the window is resizabale or not.
|
void |
setVisible(boolean visible)
Sets the visibility of the window
(Already available from the Frame class - helps visibility of method in G4P reference) |
addNotify, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setOpacity, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, show, toBack, toFront
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFont, postEvent
public GWinApplet papplet
public GWinData data
public Object mouseHandlerObject
public Method mouseHandlerMethod
public GWindow(PApplet theApplet, String name, int x, int y, int w, int h, boolean noFrame, String mode)
theApplet
- name
- x
- initial position on the screeny
- initial position on the screenw
- width of the drawing area (the frame will be bigger to accommodate border)h
- height of the drawing area (the frame will be bigger to accommodate border and title bar)noFrame
- if true then the frame has no bordermode
- JAVA2D / P2D / P3D / OPENGLpublic GWindow(PApplet theApplet, String name, int x, int y, PImage image, boolean noFrame, String mode)
theApplet
- name
- x
- initial position on the screeny
- initial position on the screenimage
- background image (used to size window)noFrame
- if true then the frame has no bordermode
- JAVA2D / OPENGLpublic void addData(GWinData data)
data
- public void setOnTop(boolean onTop)
onTop
- public void setLocation(int x, int y)
setLocation
in class Window
public void setVisible(boolean visible)
setVisible
in class Window
public void setResizable(boolean resizable)
setResizable
in class Frame
public void setBackground(PImage image)
image
- public void setBackground(int col)
col
- public void setAutoClear(boolean auto_clear)
auto_clear
- whether to call the background method() or notpublic void setActionOnClose(int action)
action
- public int getActionOnClose()
public void close()
public void addDrawHandler(Object obj, String methodName)
obj
- the object to handle the eventmethodName
- the method to execute in the object handler classpublic void addPreHandler(Object obj, String methodName)
obj
- the object to handle the eventmethodName
- the method to execute in the object handler classpublic void addMouseHandler(Object obj, String methodName)
obj
- the object to handle the eventmethodName
- the method to execute in the object handler classpublic void addPostHandler(Object obj, String methodName)
obj
- the object to handle the eventmethodName
- the method to execute in the object handler classProcessing library G4P by Peter Lager. (C) 2012