public class GWindow extends Frame implements GConstants
Window.TypeComponent.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_CURSORBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTADD_DUPLICATE, BACKGROUND, CHANGED, CLICKED, CLOSE_WINDOW, COLLAPSED, CTRL_ANGULAR, CTRL_HORIZONTAL, CTRL_VERTICAL, DESELECTED, DISABLE_AUTO_DRAW, DRAGGED, ENTERED, EXCP_IN_HANDLER, EXIT_APP, EXPANDED, FAMILY, FOREGROUND, HUD_UNSUPPORTED, INVALID_STATUS, JUSTIFICATION, JUSTIFICATION_FULL, JUSTIFICATION_NONE, KEEP_OPEN, MISSING, NONEXISTANT, NOT_PEASYCAM, POSTURE, POSTURE_OBLIQUE, POSTURE_REGULAR, PRESSED, RELEASED, RUNTIME_ERROR, SCROLL_DOWN, SCROLL_LEFT, SCROLL_RIGHT, SCROLL_UP, SCROLLBAR_HORIZONTAL, SCROLLBAR_VERTICAL, SCROLLBARS_AUTOHIDE, SCROLLBARS_BOTH, SCROLLBARS_HORIZONTAL_ONLY, SCROLLBARS_NONE, SCROLLBARS_VERTICAL_ONLY, SELECTED, SET, SIZE, STRIKETHROUGH, STRIKETHROUGH_OFF, STRIKETHROUGH_ON, SUPERSCRIPT, 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_EXTENDEDABORT, 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 |
add(GComponent component)
Add a G4P component onto the window.
|
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, setUndecoratedaddPropertyChangeListener, 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, toFrontadd, 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, validateaction, 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, transferFocusUpCycleequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFont, postEventpublic 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 / P2D / P3D / OPENGLpublic void add(GComponent component)
component - public void addData(GWinData data)
data - public void setOnTop(boolean onTop)
onTop - public void setLocation(int x,
int y)
setLocation in class Windowpublic void setVisible(boolean visible)
setVisible in class Windowpublic void setResizable(boolean resizable)
setResizable in class Framepublic 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 guicomponents by Peter Lager. (C) 2012