We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › G4P - GUI Inteface Library - latest release
Pages: 1 2 
G4P - GUI Inteface Library - latest release (Read 12432 times)
Re: G4P - GUI Inteface Library - latest release
Reply #15 - Jun 14th, 2009, 10:00pm
 
I just had an epiphany. I had to declare my visualizer class public so the draw handler would work. Here's an example:

Code:

import guicomponents.*;

Visualizer visualizer;

void setup(){
size(400, 300);
visualizer = new Visualizer(this);
noLoop();
}

void draw(){
background(192, 220, 192);
}

public class Visualizer extends GWindow {

Visualizer(PApplet _theApplet){
super(_theApplet, "Visualizer", 650, 100, 300, 200, false, P2D);
this.addDrawHandler(this, "drawMe");
}

public void drawMe(GWinApplet appc, GWinData data){
appc.background(220, 192, 192);
}
}


Remove that public keyword from the class definition and you get the error I was having trouble with ^^
Re: G4P - GUI Inteface Library - latest release
Reply #16 - Jun 15th, 2009, 4:14am
 
In Java it is best if all classes, methods and attributes have access specifiers i.e. public/protected/private but this will not always work in Processing for instance
Code:

public void setup(){
}

will produce an error in Processing. By default Processing declares everything as public but this doesn't seem to apply to class definitions.
Re: G4P - GUI Inteface Library - latest release
Reply #17 - Jun 4th, 2010, 1:47am
 
Testing http://www.lagers.org.uk/g4p/applets/g4p_showcase/index.html mentioned by Cedric. Works fine. But when I activate the Panel Position Window, I get an error (on the setWindowAlwaysOnTop action) and I cannot close the secondary window (because apparently you attempt to call exit()).
Quote:
java.security.AccessControlException: access denied (java.awt.AWTPermission setWindowAlwaysOnTop)
     at java.security.AccessControlContext.checkPermission(Unknown Source)
     at java.security.AccessController.checkPermission(Unknown Source)
     at java.lang.SecurityManager.checkPermission(Unknown Source)
     at java.awt.Window.setAlwaysOnTop(Unknown Source)
     at guicomponents.GWindow.setOnTop(GWindow.java:268)
     at guicomponents.GWindow.windowCtorCore(GWindow.java:227)
     at guicomponents.GWindow.<init>(GWindow.java:138)
     at G4P_Showcase.createControlWindow(G4P_Showcase.java:268)
     at G4P_Showcase.handleButtonEvents(G4P_Showcase.java:221)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at guicomponents.GComponent.fireEvent(GComponent.java:266)
     at guicomponents.GButton.mouseEvent(GButton.java:330)
     at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:724)
     at processing.core.PApplet.handleMouseEvent(PApplet.java:1591)
     at processing.core.PApplet.dequeueMouseEvents(PApplet.java:1545)
     at processing.core.PApplet.handleDraw(PApplet.java:1437)
     at processing.core.PApplet.run(PApplet.java:1328)
     at java.lang.Thread.run(Unknown Source)
Exception in thread "AWT-EventQueue-2" java.security.AccessControlException: access denied (java.lang.RuntimePermission exitVM.0)
     at java.security.AccessControlContext.checkPermission(Unknown Source)
     at java.security.AccessController.checkPermission(Unknown Source)
     at java.lang.SecurityManager.checkPermission(Unknown Source)
     at java.lang.SecurityManager.checkExit(Unknown Source)
     at java.lang.Runtime.exit(Unknown Source)
     at java.lang.System.exit(Unknown Source)
     at guicomponents.GWindow$1.windowClosing(GWindow.java:211)
     at java.awt.Window.processWindowEvent(Unknown Source)
     at java.awt.Window.processEvent(Unknown Source)
     at java.awt.Component.dispatchEventImpl(Unknown Source)
     at java.awt.Container.dispatchEventImpl(Unknown Source)
     at java.awt.Window.dispatchEventImpl(Unknown Source)
     at java.awt.Component.dispatchEvent(Unknown Source)
     at java.awt.EventQueue.dispatchEvent(Unknown Source)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.run(Unknown Source)
Re: G4P - GUI Inteface Library - latest release
Reply #18 - Jun 4th, 2010, 7:14am
 
Quote:
Testing http://www.lagers.org.uk/g4p/applets/g4p_showcase/index.html mentioned by Cedric. Works fine. But when I activate the Panel Position Window, I get an error (on the setWindowAlwaysOnTop action) and I cannot close the secondary window (because apparently you attempt to call exit()).

I can't find a post from Cedric on this thread. Undecided

Also I have been unable to reproduce this error. The GWindow class has a setOnTop() method that calls setWindowAlwaysOnTop() from within a try/catch block (the catch will produce a stack trace - I need to change that for a simpler message) but an access denied exception should only be called if running as an Applet from a remote server.

Were you testing showcase from the downloaded library or from the web page? If the latter what platform/browser were you using.

Smiley

Re: G4P - GUI Inteface Library - latest release
Reply #19 - Jun 4th, 2010, 8:33am
 
It was mentioned in the ControlP5: Buttons that are images thread... Smiley
Just thought I should report here for better visibility.  Cool

And it was from the Web page indicated above, on Windows XP, with Firefox 3.6.
Indeed, perhaps the first stack trace was just dumped by your catch procedure.
Re: G4P - GUI Inteface Library - latest release
Reply #20 - Jun 5th, 2010, 6:30am
 
Thanks for letting me know and I will get rid of the stack trace and replace it with a friendly message in the next version.
Smiley
Pages: 1 2