org.fraid
Class ScriptingGraphics

java.lang.Object
  extended by org.fraid.ScriptingGraphics

public class ScriptingGraphics
extends java.lang.Object

This is the graphics part of Fraid's scripting interface. A set of static methods helping when FrAid is embedded in Java, Jython, BeanShell, Groovy, etc. This is the easyest way to use FrAid programmatically from your Java or Java scripting environment. For efficiency direct calls to the internal functions may be better though. It consists of static members/methods only so no construction is needed. In a scripting environment though you may save some typing by doing s = new org.fraid.ScriptingGraphics() and then work only with s.


Constructor Summary
ScriptingGraphics()
           
 
Method Summary
static int close_w(java.lang.Object... aWindowList)
          Close the windows listed in aWindowList (integers).
static BehaviorBean get_p(int aWindowNumber)
          Get the plugin for this window.
static int new_w()
          Open a new empty window.
static void paint_w(int aWindowNumber)
          Repaint window number aWindowNumber.
static java.lang.Object[] query_w()
          Get a list of the currently open window numbers.
static java.awt.Dimension size_w(int aWindowNumber)
          Get the size of window number aWindowNumber.
static java.awt.Dimension size_w(int aWindowNumber, int aWidth, int aHeight)
          Set the size of window number aWindowNumber.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptingGraphics

public ScriptingGraphics()
Method Detail

new_w

public static int new_w()
                 throws ParseException
Open a new empty window.

Returns:
the window number which you can use to resize, close, etc.
Throws:
ParseException - if an error occurs

query_w

public static java.lang.Object[] query_w()
Get a list of the currently open window numbers.

Returns:
an Object[] value which actually is a list of Integer(s)

size_w

public static java.awt.Dimension size_w(int aWindowNumber)
                                 throws ParseException
Get the size of window number aWindowNumber.

Parameters:
aWindowNumber - an int value
Returns:
a Dimension value
Throws:
ParseException - if an error occurs

size_w

public static java.awt.Dimension size_w(int aWindowNumber,
                                        int aWidth,
                                        int aHeight)
                                 throws ParseException
Set the size of window number aWindowNumber.

Parameters:
aWindowNumber - an int value
aWidth - an int value
aHeight - an int value
Returns:
a Dimension value
Throws:
ParseException - if an error occurs

paint_w

public static void paint_w(int aWindowNumber)
                    throws ParseException
Repaint window number aWindowNumber. Use after you have changed anything in the plugin.

Parameters:
aWindowNumber - an int value
Throws:
ParseException - if an error occurs

close_w

public static int close_w(java.lang.Object... aWindowList)
                   throws java.lang.Exception
Close the windows listed in aWindowList (integers). Example: close_w( query_w() ) - closes all windows. close_w( 1,2,3 ) - closes the specifyed windows.

Returns:
an int value
Throws:
java.lang.Exception - if an error occurs

get_p

public static BehaviorBean get_p(int aWindowNumber)
                          throws ParseException
Get the plugin for this window. The plugin is basically a bean whose properties you can override.

Parameters:
aWindowNumber - an int value
Returns:
a BehaviourPlugInAdapter value
Throws:
ParseException - if an error occurs


Fraid (system and language). (C) 2003-2007 Ivaylo Iliev
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.