Class GateBuilder

java.lang.Object
  |
  +--GateBuilder

class GateBuilder
extends java.lang.Object

The top level GateBuilder application class. Contains the program's main method and the methods that handle the program global constants and windowing.


Field Summary
(package private)  Tool currentTool
          The applications's currently selected tool
(package private)  ToolPalette tools
          The application's ToolPalette
 
Constructor Summary
(package private) GateBuilder()
          The default constructor, which does the same as GateBuilder(false)
(package private) GateBuilder(boolean _application)
          The GateBuilder object that contains the entire program.
 
Method Summary
 void close(int id)
          Closes the specified workspace window, and if it's the last open workspace, quits the program
 boolean getApplication()
          Returns a boolean indicating if GateBuilder is being run as an application or an applet
 java.awt.Window getCurrentWindow()
          Gets the window that currently has focus
 java.util.Properties getProperties()
          Gets the application's properties object for globalization of program properties like print settings.
 boolean getReady()
          Returns true if the GateBuilder is ready to make files, do shite.
 int getToolType()
          Returns the currently selected application-wide tool's type, which is an int specified in the Tool class.
static java.awt.Image loadImage(java.awt.Component owner, java.lang.String file)
          Loads an image from the jar file, caches it and returns it.
static void main(java.lang.String[] args)
          Runs the GateBuilder application, starting with the tools palette and a blank workspace
 void newFile(boolean visible)
          Creates a new workspace window, cascading from the previous window.
 void openFile()
          Creates a new workspace window, and loads a file into it.
 void openUrl()
          Crates a new workspace window and loads a URL into it.
 void quit()
          Closes all windows and quits the program
 void revertCurrentWindow()
          Reverts the current window to its previous value
 void setCurrentWindow(java.awt.Window _currentWindow)
          Sets the current window to the specified frame
 void setProperties(java.util.Properties _properties)
          Sets the application's properties object to the input object to allow other classes to modify the global properties settings.
 void setTool(Tool newTool)
          Sets the application's current tool to the input tool object.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tools

ToolPalette tools
The application's ToolPalette

currentTool

Tool currentTool
The applications's currently selected tool
Constructor Detail

GateBuilder

GateBuilder()
The default constructor, which does the same as GateBuilder(false)

GateBuilder

GateBuilder(boolean _application)
The GateBuilder object that contains the entire program. Takes no arguments, and creates a welcome message, followed by the tools palette and a blank workspace. It takes one argument, specifying if GateBuilder is being created in an applet environment or an application environment, for security purposes.
Parameters:
_application - true if GateBuilder is being created from an application
Method Detail

main

public static void main(java.lang.String[] args)
Runs the GateBuilder application, starting with the tools palette and a blank workspace

getProperties

public java.util.Properties getProperties()
Gets the application's properties object for globalization of program properties like print settings.
Returns:
a program-wide java.util.Properties object

getApplication

public boolean getApplication()
Returns a boolean indicating if GateBuilder is being run as an application or an applet

getReady

public boolean getReady()
Returns true if the GateBuilder is ready to make files, do shite.

setProperties

public void setProperties(java.util.Properties _properties)
Sets the application's properties object to the input object to allow other classes to modify the global properties settings. Should be preceeded by a getProperties() command, and then a modification of that Properties object.
Parameters:
_properties - a program-wide java.util.Properties object

setTool

public void setTool(Tool newTool)
Sets the application's current tool to the input tool object. This value is a program global, affecting the current tool in all open windows.
Parameters:
newTool - a program-wide Tool object

getToolType

public int getToolType()
Returns the currently selected application-wide tool's type, which is an int specified in the Tool class.
Returns:
an constant int from the Tool class

setCurrentWindow

public void setCurrentWindow(java.awt.Window _currentWindow)
Sets the current window to the specified frame
Parameters:
_currentWindow - The window that currently has focus

revertCurrentWindow

public void revertCurrentWindow()
Reverts the current window to its previous value

getCurrentWindow

public java.awt.Window getCurrentWindow()
Gets the window that currently has focus

newFile

public void newFile(boolean visible)
Creates a new workspace window, cascading from the previous window.
Parameters:
visible - true to make the window immediately visible

openFile

public void openFile()
Creates a new workspace window, and loads a file into it.

openUrl

public void openUrl()
Crates a new workspace window and loads a URL into it.

close

public void close(int id)
Closes the specified workspace window, and if it's the last open workspace, quits the program
Parameters:
id - the integer id of the window to close

quit

public void quit()
Closes all windows and quits the program

loadImage

public static java.awt.Image loadImage(java.awt.Component owner,
                                       java.lang.String file)
Loads an image from the jar file, caches it and returns it.
Parameters:
owner - the component that will own the image
file - the image path to get