Game Control Plus
1.2.2
|
Classes | |
class | G4Pstyle |
Static Public Member Functions | |
static String | getPrettyVersion () |
static String | getVersion () |
static void | registerSketch (PApplet app) |
static void | setGlobalColorScheme (int cs) |
static void | setWindowColorScheme (PApplet app, int cs) |
static void | setGlobalAlpha (int alpha) |
static void | setWindowAlpha (PApplet app, int alpha) |
static void | messagesEnabled (boolean enable) |
static void | setMouseOverEnabled (boolean enable) |
static void | setCursorOff (int cursorOff) |
static void | setCursor (int cursorOff) |
static int | getCursor () |
static int | getCursorOff () |
static ArrayList< MWindow > | getOpenWindowsAsList (ArrayList< MWindow > list) |
static MWindow[] | getOpenWindowsAsArray () |
static boolean | isWindowOpen (MWindow window) |
static String | selectFolder (String prompt) |
static String | selectInput (String prompt) |
static String | selectInput (String prompt, String types, String typeDesc) |
static String | selectOutput (String prompt) |
static String | selectOutput (String prompt, String types, String typeDesc) |
static void | showMessage (PApplet owner, String message, String title, int messageType) |
static int | selectOption (PApplet owner, String message, String title, int messageType, int optionType) |
Static Package Functions | |
static void | registerWindow (MWindow window) |
static void | deregisterWindow (MWindow window) |
static void | registerControl (MAbstractControl control) |
static boolean | removeControl (MAbstractControl control) |
static void | pushStyle () |
static void | popStyle () |
Static Package Attributes | |
static PApplet | sketchWindow = null |
static MWindowImpl | sketchWindowImpl = null |
static List< MWindow > | allWindows = new LinkedList<MWindow>() |
static int | globalColorScheme = MCScheme.BLUE_SCHEME |
static int | globalAlpha = 255 |
static Font | globalFont = new Font("Dialog", Font.PLAIN, 12) |
static Font | numericLabelFont = new Font("DialogInput", Font.BOLD, 12) |
static MAbstractControl.Z_Order | zorder = new MAbstractControl.Z_Order() |
static boolean | cursorChangeEnabled = true |
static int | mouseOff = ARROW |
static boolean | showMessages = true |
static LinkedList< G4Pstyle > | styles = new LinkedList<G4Pstyle>() |
static JColorChooser | chooser = null |
static Color | lastColor = Color.white |
Static Private Member Functions | |
static String | selectImpl (String prompt, int mode, String types, String typeDesc) |
static Frame | getFrame (PApplet owner) |
Static Private Attributes | |
static String | PANE_TEXT_STYLE_MACOS |
static String | PANE_TEXT_STYLE_OTHER |
Additional Inherited Members | |
Public Attributes inherited from org.gamecontrolplus.gui.MConstants | |
int | RED_SCHEME = 0 |
int | GREEN_SCHEME = 1 |
int | YELLOW_SCHEME = 2 |
int | PURPLE_SCHEME = 3 |
int | ORANGE_SCHEME = 4 |
int | CYAN_SCHEME = 5 |
int | BLUE_SCHEME = 6 |
int | GOLD_SCHEME = 7 |
int | SCHEME_8 = 8 |
int | SCHEME_9 = 9 |
int | SCHEME_10 = 10 |
int | SCHEME_11 = 11 |
int | SCHEME_12 = 12 |
int | SCHEME_13 = 13 |
int | SCHEME_14 = 14 |
int | SCHEME_15 = 15 |
char | HOME = java.awt.event.KeyEvent.VK_HOME |
char | END = java.awt.event.KeyEvent.VK_END |
int | CTRL_ANGULAR = 0x00000501 |
int | CTRL_HORIZONTAL = 0x00000502 |
int | CTRL_VERTICAL = 0x00000503 |
int | EXIT_APP = 0x00000f01 |
int | CLOSE_WINDOW = 0x00000f02 |
int | KEEP_OPEN = 0x00000f03 |
int | USER_COL_SCHEME = 0x00010102 |
int | ALPHA_BLOCK = 128 |
int | ALPHA_PICK = 48 |
int | SCROLLBARS_NONE = 0x0000 |
int | SCROLLBARS_VERTICAL_ONLY = 0x0001 |
int | SCROLLBARS_HORIZONTAL_ONLY = 0x0002 |
int | SCROLLBARS_BOTH = 0x0003 |
int | SCROLLBARS_AUTOHIDE = 0x1000 |
int | SCROLLBAR_VERTICAL = 1 |
int | SCROLLBAR_HORIZONTAL = 2 |
int | INTEGER = 0 |
int | DECIMAL = 1 |
int | EXPONENT = 2 |
int | ORIENT_LEFT = -1 |
int | ORIENT_TRACK = 0 |
int | ORIENT_RIGHT = 1 |
int | X4 = 1 |
int | X8 = 2 |
int | PLAIN = JOptionPane.PLAIN_MESSAGE |
int | ERROR = JOptionPane.ERROR_MESSAGE |
int | INFO = JOptionPane.INFORMATION_MESSAGE |
int | WARNING = JOptionPane.WARNING_MESSAGE |
int | QUERY = JOptionPane.QUESTION_MESSAGE |
int | YES_NO = JOptionPane.YES_NO_OPTION |
int | YES_NO_CANCEL = JOptionPane.YES_NO_CANCEL_OPTION |
int | OK_CANCEL = JOptionPane.OK_CANCEL_OPTION |
int | OK = JOptionPane.OK_OPTION |
int | YES = JOptionPane.YES_OPTION |
int | NO = JOptionPane.NO_OPTION |
int | CANCEL = JOptionPane.CANCEL_OPTION |
int | CLOSED = JOptionPane.CLOSED_OPTION |
TextAttribute | FAMILY = TextAttribute.FAMILY |
TextAttribute | WEIGHT = TextAttribute.WEIGHT |
Float | WEIGHT_EXTRA_LIGHT = new Float(0.5f) |
Float | WEIGHT_LIGHT = new Float(0.75f) |
Float | WEIGHT_DEMILIGHT = new Float(0.875f) |
Float | WEIGHT_REGULAR = new Float(1.0f) |
Float | WEIGHT_SEMIBOLD = new Float(1.25f) |
Float | WEIGHT_MEDIUM = new Float(1.5f) |
Float | WEIGHT_DEMIBOLD = new Float(1.75f) |
Float | WEIGHT_BOLD = new Float(2.0f) |
Float | WEIGHT_HEAVY = new Float(2.25f) |
Float | WEIGHT_EXTRABOLD = new Float(2.5f) |
Float | WEIGHT_ULTRABOLD = new Float(2.75f) |
TextAttribute | WIDTH = TextAttribute.WIDTH |
Float | WIDTH_CONDENSED = new Float(0.75f) |
Float | WIDTH_SEMI_CONDENSED = new Float(0.875f) |
Float | WIDTH_REGULAR = new Float(1.0f) |
Float | WIDTH_SEMI_EXTENDED = new Float(1.25f) |
Float | WIDTH_EXTENDED = new Float(1.5f) |
TextAttribute | POSTURE = TextAttribute.POSTURE |
Float | POSTURE_REGULAR = new Float(0.0f) |
Float | POSTURE_OBLIQUE = new Float(0.20f) |
TextAttribute | SIZE = TextAttribute.SIZE |
TextAttribute | SUPERSCRIPT = TextAttribute.SUPERSCRIPT |
Integer | SUPERSCRIPT_SUPER = new Integer(1) |
Integer | SUPERSCRIPT_SUB = new Integer(-1) |
Integer | SUPERSCRIPT_OFF = new Integer(0) |
TextAttribute | FOREGROUND = TextAttribute.FOREGROUND |
TextAttribute | BACKGROUND = TextAttribute.BACKGROUND |
TextAttribute | STRIKETHROUGH = TextAttribute.STRIKETHROUGH |
Boolean | STRIKETHROUGH_ON = new Boolean(true) |
Boolean | STRIKETHROUGH_OFF = new Boolean(false) |
The core class for the global manipulation and execution of G4P.
It also gives access to many of the constants used in this library.
|
staticpackage |
De-register a window , this is done when a window is closed
window |
|
static |
Get the cursor shape used when the mouse is not over a G4P control set for the
|
static |
|
staticprivate |
Find the Frame associated with this object.
owner | the object that is responsible for this message |
|
static |
|
static |
Get a list of all open MWindow objects even if minimised or invisible.
If an ArrayList is provided then its contents are cleared before adding references to all open MWindow objects. If an ArrayList is not provided then a new ArrayList will be created.
This method never returns null, if there are no open windows the list will be of size zero.
list | an optional ArrayList to use. In null will create a new ArrayList. |
|
static |
return the pretty version of the library.
|
static |
return the version of the library used by Processing
|
static |
Use this to check whether a MWindow window is still open (as far as G4P is concerned).
window | the window we are interested in |
|
static |
G4P has a range of support messages eg
if you create a GUI component without an event handler or,
a slider where the visible size of the slider is less than the difference between min and max values.
This method allows the user to enable (default) or disable this option. If disable then it should be called before any GUI components are created.
If you are adding your own event handlers then I suggest that you disable messages.
enable |
|
staticpackage |
Remove and restore the current style from the stack.
There should be a matching pushStyle otherwise the program will crash.
|
staticpackage |
Save the current style on a stack.
There should be a matching popStyle otherwise the program it will cause a memory leakage.
|
staticpackage |
Used internally to register a control with its window. It will replace the addControl method in the controls constructors
control |
|
static |
Used to register the main sketch window with G4P. This is ignored if any G4P controls or windows have already been created because the act of creating a control will do this for you.
Some controls are created without passing a reference to the sketch applet but still need to know it. An example is the GColorChooser control which cannot be used until this method is called or some other G4P control has been created.
Also some other libraries such as PeasyCam change the transformation matrix. In which case either a G4P control should be created or this method called before creating a PeasyCam object.
app |
|
staticpackage |
|
staticpackage |
Display the library version in the ProcessingIDE Remove a control from the window. This is used in preparation for disposing of a control.
control |
|
static |
This will open a version of the Java Swing color chooser dialog. The dialog's UI is dependent on the OS and JVM implementation running.
If you click on Cancel then it returns the last color previously selected.
prompt | the frame text for the chooser |
|
staticprivate |
The implementation of the select input and output methods.
prompt | |
mode | |
types | |
typeDesc |
|
static |
Select a file for input from the local file system.
prompt | the frame text for the chooser |
|
static |
Select a file for input from the local file system.
This version allows the dialog window to filter the output based on file extensions. This is not available on all platforms, if not then it is ignored.
It is definitely available on Linux systems because it uses the standard Swing JFileFinder component.
prompt | the frame text for the chooser |
types | a comma separated list of file extensions e.g. "png,gif,jpg,jpeg" |
typeDesc | simple textual description of the file types e.g. "Image files" |
|
static |
Display a simple message dialog window.
The actual UI will depend on the platform your application is running on.
The message type should be one of the following
G4P.PLAIN, G4P.ERROR, G4P.INFO, G4P.WARNING, G4P.QUERY
The option type should be one of the following
G4P.YES_NO, G4P.YES_NO_CANCEL, G4P.OK_CANCEL
This method returns a value to indicate which button was clicked. It will be one of the following
G4P.OK, G4P.YES, G4P.NO, G4P.CANCEL, G4P.CLOSED
Some comments on the returned value:
owner | the control responsible for this dialog. |
message | the text to be displayed in the main area of the dialog |
title | the text to appear in the dialog's title bar. |
messageType | the message type |
optionType |
|
static |
Select a file for output from the local file system.
prompt | the frame text for the chooser |
|
static |
Select a file for output from the local file system.
This version allows the dialog window to filter the output based on file extensions. This is not available on all platforms, if not then it is ignored.
It is definitely available on Linux systems because it uses the standard swing JFileFinder component.
prompt | the frame text for the chooser |
types | a comma separated list of file extensions e.g. "png,jpf,tiff" |
typeDesc | simple textual description of the file types e.g. "Image files" |
|
static |
Set the cursor shape to be used when the mouse is not over a G4P control for the entire application including secondary windows.
cursorOff | the cursor shape. |
|
static |
|
static |
Set the transparency of all controls. If the alpha level for a control falls below G4P.ALPHA_BLOCK then it will no longer respond to mouse and keyboard events.
alpha | value in the range 0 (transparent) to 255 (opaque) |
|
static |
Set the global colour scheme. This will change the local colour scheme for every control.
cs | colour scheme to use (0-15) |
|
static |
Enables or disables cursor over component change.
Calls to this method are ignored if no G4P controls have been created.
enable | true to enable cursor change over components. |
|
static |
Set the transparency level for all controls drawn by the given PApplet. If the alpha level for a control falls below G4P.ALPHA_BLOCK then it will no longer respond to mouse and keyboard events.
app | |
alpha | value in the range 0 (transparent) to 255 (opaque) |
|
static |
Versions of G4P prior to 3.5 used logical fonts for the controls. So if you have old sketches then the text may look different with this and later versions of G4P.
If this is causing a problem then call this method before creating any controls. Set the colour scheme for all the controls drawn by the given PApplet. This will override any previous colour scheme for these controls.
app | |
cs |
|
static |
Display a simple message dialog window.
The actual UI will depend on the platform your application is running on.
The message type should be one of the following
G4P.PLAIN, G4P.ERROR, G4P.INFO, G4P.WARNING, G4P.QUERY
owner | the control responsible for this dialog. |
message | the text to be displayed in the main area of the dialog |
title | the text to appear in the dialog's title bar. |
messageType | the message type |
|
staticprivate |
|
staticprivate |