public class GWindow extends Frame implements GConstants
Modifier and Type | Class and Description |
---|---|
class |
GWindow.GWindowAdapter
Window adapter class that remembers the window it belongs to so
it can be used to mark it for closure if required.
|
Window.Type
Component.BaselineResizeBehavior
Modifier and Type | Field and Description |
---|---|
static int |
ALL_METHOD |
static int |
CLIP_RUN |
static int |
COMBI_MODES |
GWinData |
data |
static String |
DEFAULT_SLIDER_STYLE |
static int |
DRAG_CONTROL |
static int |
DRAW_METHOD |
static char |
EOL |
static int |
EXCP_IN_HANDLER |
static int[][] |
grid |
static int |
GROUP_CONTROL_METHOD |
static float |
HORZ_SCROLL_RATE |
static int |
I_CL |
static int |
I_COVERED |
static int |
I_CR |
static int |
I_INSIDE |
static int |
I_MODES |
static int |
I_NONE |
static int |
I_TL |
static int |
I_TR |
static int |
INVALID_PAPPLET |
static int |
INVALID_TYPE |
static int |
KEY_METHOD |
Method |
keyHandlerMethod
The method in keyHandlerObject to execute
|
Object |
keyHandlerObject
The object to handle the key event
|
static int |
MERGE_RUNS |
static int |
MISSING |
static int |
MOUSE_METHOD |
Method |
mouseHandlerMethod
The method in mouseHandlerObject to execute
|
Object |
mouseHandlerObject
The object to handle the mouse event
|
static int |
NONEXISTANT |
static int |
OFF_CONTROL |
static int |
OVER_CONTROL |
GWinApplet |
papplet
Gives direct access to the PApplet object inside the frame
|
static BasicStroke |
pen_1_0 |
static BasicStroke |
pen_2_0 |
static BasicStroke |
pen_3_0 |
static BasicStroke |
pen_4_0 |
static int |
POST_METHOD |
static int |
PRE_METHOD |
static int |
PRESS_CONTROL |
static int |
SCROLLBAR_HORIZONTAL |
static int |
SCROLLBAR_VERTICAL |
static String |
SLIDER_STYLES |
static int |
TINT_FOR_ALPHA |
static int |
TPAD2 |
static int |
TPAD4 |
static int |
TPAD6 |
static int |
TPAD8 |
static float |
VERT_SCROLL_RATE |
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, CANCEL, CLOSE_WINDOW, CLOSED, CTRL_ANGULAR, CTRL_HORIZONTAL, CTRL_VERTICAL, CYAN_SCHEME, DECIMAL, END, ERROR, EXIT_APP, EXPONENT, FAMILY, FOREGROUND, GOLD_SCHEME, GREEN_SCHEME, HOME, INFO, INTEGER, KEEP_OPEN, NO, OK, OK_CANCEL, ORANGE_SCHEME, ORIENT_LEFT, ORIENT_RIGHT, ORIENT_TRACK, PLAIN, POSTURE, POSTURE_OBLIQUE, POSTURE_REGULAR, PURPLE_SCHEME, QUERY, RED_SCHEME, SCHEME_10, SCHEME_11, SCHEME_12, SCHEME_13, SCHEME_14, SCHEME_15, SCHEME_8, SCHEME_9, 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, WARNING, 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, X4, X8, YELLOW_SCHEME, YES, YES_NO, YES_NO_CANCEL
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 |
addKeyHandler(Object obj,
String methodName)
Attempt to add the 'key' handler method.
|
void |
addMouseHandler(Object obj,
String methodName)
Attempt to add the 'mouse' handler method.
|
void |
addOnCloseHandler(Object obj,
String methodName)
Attempt to create the on-close-window event handler for this GWindow.
|
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()
This method will fire a WindowClosing event to be captured by the
GWindow$GWindowAdapter object.
|
void |
forceClose()
This method guarantees that the window is closed by overriding the KEEP_OPEN action-on-close
and will fire a WindowClosing event to be captured by the GWindow$GWindowAdapter object.
|
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)
Like the draw() method in the main sketch tab the user must include
the background(...) statement to clear the background.
|
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 keyHandlerObject
public Method keyHandlerMethod
public Object mouseHandlerObject
public Method mouseHandlerMethod
public static final String SLIDER_STYLES
public static final String DEFAULT_SLIDER_STYLE
public static final int DRAW_METHOD
public static final int MOUSE_METHOD
public static final int PRE_METHOD
public static final int KEY_METHOD
public static final int POST_METHOD
public static final int ALL_METHOD
public static final int GROUP_CONTROL_METHOD
public static final int MISSING
public static final int NONEXISTANT
public static final int INVALID_TYPE
public static final int INVALID_PAPPLET
public static final int EXCP_IN_HANDLER
public static final int OFF_CONTROL
public static final int OVER_CONTROL
public static final int PRESS_CONTROL
public static final int DRAG_CONTROL
public static final int TINT_FOR_ALPHA
public static final int I_NONE
public static final int I_TL
public static final int I_TR
public static final int I_CL
public static final int I_CR
public static final int I_INSIDE
public static final int I_COVERED
public static final int I_MODES
public static final int MERGE_RUNS
public static final int CLIP_RUN
public static final int COMBI_MODES
public static final int[][] grid
public static final BasicStroke pen_1_0
public static final BasicStroke pen_2_0
public static final BasicStroke pen_3_0
public static final BasicStroke pen_4_0
public static final int TPAD2
public static final int TPAD6
public static final int TPAD4
public static final int TPAD8
public static final int SCROLLBAR_VERTICAL
public static final int SCROLLBAR_HORIZONTAL
public static final float HORZ_SCROLL_RATE
public static final float VERT_SCROLL_RATE
public static final char EOL
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 addOnCloseHandler(Object obj, String methodName)
obj
- the object to handle the on-close-window eventmethodName
- the method to execute in the object handler classpublic 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
- the required close actionpublic int getActionOnClose()
public void close()
public void forceClose()
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 addKeyHandler(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) 2015