All Packages Class Hierarchy This Package Previous Next Index
Class uk.co.demon.sspl.jforge.BuilderAPI
java.lang.Object
|
+----uk.co.demon.sspl.jforge.BuilderAPI
- public final class BuilderAPI
- extends Object
Provides an Application Programmer Interface to JForge. This API
allows external BeanInfo and Customizer classes to interact with
JForge. It also provides the methods needed by user-defined menus
and methods that need to be called by AWT support code. You could also
use it to write external code to extend JForge's capabilities. Note that
if you use any of the methods in this API, your BeanInfo or Customizer
will become JForge specific.
JForge v2.5
Copyright (c)1998 by Tek-Tools Inc. & Cameron Newham.
-
ADD_FAILED
- Return value for the addComponent() method.
-
ADD_SPECIAL_SUCCEEDED
- Return value for the addComponent() method.
-
ADD_SUCCEEDED
- Return value for the addComponent() method.
-
FILE_BLANK
- A file save state indicating that there is nothing on the Work Bench.
-
FILE_NEW_NOT_SAVED
- A file save state of a new GUI that has not been saved before.
-
FILE_NOT_SAVED
- A file save state of "not saved".
-
FILE_SAVED
- A file save state of "saved".
-
VERSION_HIGH
- The most significant part of the JForge version number.
-
VERSION_LOW
- The least significant part of the JForge version number.
-
VERSION_NAME
- The JForge version name.
-
BuilderAPI()
-
-
addAdditionalJavaSource(String[])
- Adds additional lines of code after the constructor body in the generated
code.
-
addComponent(Component, Component)
- Adds a child component to the given component.
-
addIdentifier(String)
- Adds the name to JForge's internal list of identifiers.
-
addIdentifierDeclaration(String, String)
- Adds an additional identifier declaration to the class.
-
addImportStatements(String[])
- Adds additional import lines to the source code during code generation.
-
addJavaSourceLine(String)
- Adds a line of source directly into the code generation.
-
addSharedColor(Color)
- Adds a colour to the end of the shared colour list.
-
changeColor(Color, int, int, int)
- Changes the R/G/B values of the given Color object.
-
createAndDisplaySplashScreen()
- Creates and displays the JForge Splash Screen.
-
deleteComponent(Component)
- Deletes the given component.
-
editSelected()
- Edits the selected component.
-
findSharedColorIndex(Color)
- Returns the index of a shared colour.
-
generateBorder(Border, Component, String)
- Generates an appropriate line of code representing the given Border.
-
generateColor(Color)
- Generates an appropriate line of code for Color.
-
generateComponent(Component)
- Generates source code for the given component.
-
generateIdentifier(String)
- Returns a unique identifier based on the given class name.
-
generateLayout(Component, Container, Component[], String)
- Generate source code for the layout and sub-components of the
given component.
-
generatePartComponent(Component, BeanInfo[], String, int)
- Generates source code for the given component using the BeanInfo
provided and starting at the level specified.
-
generateUniqueIdentifier(String)
- Returns a unique identifier based on the given identifier.
-
getBaseColor()
- The base colour for JForge.
-
getBeanInfo(Component)
- Obtain bean information for the specified component.
-
getCodeGenMarker(Object)
- Gets a general purpose "marker" during code generation.
-
getColorTool()
- Gets the colour tool.
-
getContainer(Component)
- Obtains the container for the specified component.
-
getCopiedComponent()
- Gets the component currently in the copy buffer.
-
getCurrentClassName()
- Gets the name of the class that will be written out during code
generation.
-
getCurrentCodeGenComponent()
- Gets the component that source is currently being generated for.
-
getCurrentCodeGenMethod()
- Gets the set method name that source is currently being generated for.
-
getCurrentDirectory()
- Gets the name of the current directory that files are being loaded from
and saved into.
-
getCurrentFileName()
- Gets the name of the current file that has been loaded or is being saved.
-
getCurrentProperties()
- Returns the current properties for the JForge application in a
BuilderProperties object.
-
getCurrentSelectedComponents()
- Gets the components that are currently selected.
-
getCurrentTopLevelComponent()
- Gets the current Work Bench top level component.
-
getDebugLevel()
- The current debug level.
-
getDefaultLayout(Container)
- Returns the default layout manager (the original layout manager object that
was generated for) the given component.
-
getEntryColor()
- The colour for entry text in JForge.
-
getHighColor()
- The high colour for JForge.
-
getIconPath()
- The relative path from uk\co\demon\sspl\jforge to the Toolbar icons and
logos.
-
getIconPathForComponent(Component)
- Returns the URL path for the given component and the "current method".
-
getIconPathsForComponent(Component)
- Returns a Vector of URL paths for the given component.
-
getMediumColor()
- The medium colour for JForge.
-
getPropertyDisplay(Component, Container, BeanInfo[])
- Obtain a property sheet for the specified component.
-
getReadoutColor()
- The colour for readout type text in JForge.
-
getSaveState()
- Returns the current save state of the current Work Bench.
-
getSharedColorAtIndex(int)
- Returns the Color object for a given index.
-
getSharedColors()
- Returns the current set of Shared colours in an array.
-
getStandardBorder()
- The current border that is being used by the JForge user interface.
-
getStandardFont()
- The current font that is being used by the JForge user interface.
-
getTextColor()
- The colour for text in JForge.
-
getTopFrame()
- Gets the top level frame of JForge.
-
getUniqueColorAtIndex(int)
- Returns the Color object for a given index.
-
getUniqueColors()
- Returns the current set of Unique colours in an array.
-
getWorkBench()
- Gets the work bench container.
-
getWorkBenchGlassPane()
- Gets the glass pane that covers the Work Bench.
-
insertSharedColor(Color, int)
- Inserts a colour into the shared colour list at the specified index.
-
isDebugOn()
- True if debug is switched on.
-
isIdentifierUsed(String)
- Returns true if the given name is already used as an identifier.
-
isSharedColor(Color)
- Returns true if the given colour is a shared colour.
-
loadComponentIntoBuilder(Component)
- Loads the specified component into JForge.
-
menuColourTool()
- Displays the Colour dialogue.
-
menuCompilationStatus()
- Displays the Compilation Status dialogue.
-
menuCopySelected()
- Performs a copy.
-
menuCutSelected()
- Performs a cut.
-
menuDeleteSelected()
- Performs a delete.
-
menuEditSelected()
- Performs an Edit.
-
menuExit()
- Performs an exit.
-
menuLoadSerial()
- Performs a load serial.
-
menuNew()
- Performs a new.
-
menuOpen()
- Performs an open.
-
menuPasteBuffer()
- Performs a paste.
-
menuPreferences()
- Displays the preferences dialogue.
-
menuSave()
- Performs a save.
-
menuSaveAs()
- Performs a save as.
-
menuSaveCompile()
- Performs a save and compile.
-
menuSaveSerial()
- Performs a save serial.
-
menuShowAbout()
- Shows the "About" dialogue.
-
menuTreeTool()
- Displays the Tree dialogue.
-
mouseDragged(MouseEvent)
- Executes a programmatic "mouse drag".
-
mousePressed(MouseEvent, Component)
- Executes a programmatic "mouse press".
-
mouseReleased(MouseEvent)
- Executes a programmatic "mouse release".
-
removeIdentifier(String)
- Removes the given name from JForge's internal list of identifier
names.
-
removeSharedColor(int)
- Removes the specified colour from the shared colour list.
-
setCodeGenMarker(Object, Object)
- Sets a general purpose "marker" during code generation.
-
setCurrentProperties(BuilderProperties)
- Sets the current properties for the JForge application.
-
setIconPathForComponent(Component, String)
- Sets the URL of the icon for the given component.
-
setSaveState(int)
- Sets the current save state of the current Work Bench.
-
setURLMethodName(String)
- Sets the method name to which Icons are are associated.
-
showErrorDialog(String)
- A convenience method for poping up an error dialog associated with
the Builder's main window.
-
updatePropertiesDialog()
- Updates the Preferences (properties) dialog with the current values.
-
updatePropertySheet(BuilderPropertySheet)
- Updates the property sheet with the latest values from the component.
ADD_FAILED
public static final int ADD_FAILED
- Return value for the addComponent() method. This indicates that
the add failed.
ADD_SUCCEEDED
public static final int ADD_SUCCEEDED
- Return value for the addComponent() method. This indicates that
the add succeeded.
ADD_SPECIAL_SUCCEEDED
public static final int ADD_SPECIAL_SUCCEEDED
- Return value for the addComponent() method. This indicates that
the add succeeded and was to a "special" component - one that has a valid
addComponent() method in its BuilderBeanInfo. This distinction is
needed for the internal workings of JForge and may or may not be of use
for external code.
FILE_BLANK
public static final int FILE_BLANK
- A file save state indicating that there is nothing on the Work Bench.
FILE_SAVED
public static final int FILE_SAVED
- A file save state of "saved".
FILE_NOT_SAVED
public static final int FILE_NOT_SAVED
- A file save state of "not saved".
FILE_NEW_NOT_SAVED
public static final int FILE_NEW_NOT_SAVED
- A file save state of a new GUI that has not been saved before.
VERSION_HIGH
public static final int VERSION_HIGH
- The most significant part of the JForge version number.
VERSION_LOW
public static final int VERSION_LOW
- The least significant part of the JForge version number.
VERSION_NAME
public static final String VERSION_NAME
- The JForge version name.
BuilderAPI
public BuilderAPI()
getStandardBorder
public static Border getStandardBorder()
- The current border that is being used by the JForge user interface. This
will either be the default border or the one the user has set through
the Preferences menu option.
getStandardFont
public static Font getStandardFont()
- The current font that is being used by the JForge user interface. This
will either be the default font or the one the user has set through
the Preferences menu option.
getIconPath
public static String getIconPath()
- The relative path from uk\co\demon\sspl\jforge to the Toolbar icons and
logos.
getBaseColor
public static Color getBaseColor()
- The base colour for JForge. Usually used for major component backgrounds.
getMediumColor
public static Color getMediumColor()
- The medium colour for JForge. Usually used for sub-component backgrounds.
getHighColor
public static Color getHighColor()
- The high colour for JForge. Usually used for control backgrounds.
getEntryColor
public static Color getEntryColor()
- The colour for entry text in JForge.
getTextColor
public static Color getTextColor()
- The colour for text in JForge.
getReadoutColor
public static Color getReadoutColor()
- The colour for readout type text in JForge.
isDebugOn
public static boolean isDebugOn()
- True if debug is switched on.
getDebugLevel
public static int getDebugLevel()
- The current debug level.
getSaveState
public static int getSaveState()
- Returns the current save state of the current Work Bench.
Can be one of FILE_BLANK, FILE_SAVED, FILE_NOT_SAVED, FILE_NEW_NOT_SAVED.
- Returns:
- the save state.
setSaveState
public static void setSaveState(int state)
- Sets the current save state of the current Work Bench.
Should be one of FILE_BLANK, FILE_SAVED, FILE_NOT_SAVED, FILE_NEW_NOT_SAVED.
- Parameters:
- state - the save state to set.
loadComponentIntoBuilder
public static void loadComponentIntoBuilder(Component component)
- Loads the specified component into JForge. Any components already on the
current Work Bench will be removed and the Builder will be reset.
- Parameters:
- component - the component to load into the Work Bench.
getCurrentProperties
public static BuilderProperties getCurrentProperties()
- Returns the current properties for the JForge application in a
BuilderProperties object.
- Returns:
- the current properties.
setCurrentProperties
public static void setCurrentProperties(BuilderProperties properties)
- Sets the current properties for the JForge application. After calling
this method you should call updatePropertiesDialog() to keep
things in sync.
- Parameters:
- properties - a Properties object with values to make current.
updatePropertiesDialog
public static void updatePropertiesDialog()
- Updates the Preferences (properties) dialog with the current values.
createAndDisplaySplashScreen
public static void createAndDisplaySplashScreen()
- Creates and displays the JForge Splash Screen. This method should
only be called from the PublicStartStopJForge constructor.
showErrorDialog
public static void showErrorDialog(String message)
- A convenience method for poping up an error dialog associated with
the Builder's main window.
- Parameters:
- message - the String to display in the dialogue.
generateComponent
public static void generateComponent(Component component)
- Generates source code for the given component. The source code is
stored in an internal buffer and written to a file during a Save.
This method should be used by BeanInfos that need to generate
code for standard JFC or AWT sub-components.
- Parameters:
- component - the component for which source generation is required.
generatePartComponent
public static void generatePartComponent(Component component,
BeanInfo beanInfo[],
String identName,
int beanInfoNum)
- Generates source code for the given component using the BeanInfo
provided and starting at the level specified. The source code is
stored in an internal buffer and written to a file during a Save.
This method should be used by BeanInfos that need to generate
code for standard JFC or AWT super classes. For example, a sub-classed
component of JComponent could write out its specific properties and
then call this method to write out the properties for JComponent,
Container, Component, etc. The first beanInfo in the array (0), as obtained
from getBeanInfo, would be for the component and successive
array elements for the subclasses. In this case, setting beanInfoNum
to 1 would ignore array element (beanInfo) 0 and only generate code for
the subclasses. If beanInfoNum is outside the range of the given beanInfo
array (0 > beanInfoNum >= beanInfo.length), this method does nothing.
This method also serves as a more flexible version of
generateComponent().
- Parameters:
- component - the component for which source generation is required.
- beanInfo - an array of bean infos for the component.
- identName - a String representing the identifier name of this instance.
- beanInfoNum - the array element to start generating from.
getCurrentCodeGenComponent
public static Component getCurrentCodeGenComponent()
- Gets the component that source is currently being generated for. This
is only valid during code generation.
- Returns:
- the component.
getCurrentCodeGenMethod
public static String getCurrentCodeGenMethod()
- Gets the set method name that source is currently being generated for. This
is only valid during code generation.
- Returns:
- the method name.
getCurrentSelectedComponents
public static Component[] getCurrentSelectedComponents()
- Gets the components that are currently selected.
- Returns:
- the components in an array.
getCurrentClassName
public static String getCurrentClassName()
- Gets the name of the class that will be written out during code
generation.
- Returns:
- the name of the class.
getCurrentDirectory
public static String getCurrentDirectory()
- Gets the name of the current directory that files are being loaded from
and saved into.
- Returns:
- the load/save directory name.
getCurrentFileName
public static String getCurrentFileName()
- Gets the name of the current file that has been loaded or is being saved.
- Returns:
- the load/save file name.
getTopFrame
public static JFrame getTopFrame()
- Gets the top level frame of JForge.
- Returns:
- the top level frame.
getWorkBenchGlassPane
public static Component getWorkBenchGlassPane()
- Gets the glass pane that covers the Work Bench.
- Returns:
- the glass pane.
getWorkBench
public static Container getWorkBench()
- Gets the work bench container.
- Returns:
- the work bench.
getColorTool
public static BuilderColorTool getColorTool()
- Gets the colour tool.
getCurrentTopLevelComponent
public static Component getCurrentTopLevelComponent()
- Gets the current Work Bench top level component. Returns null if there
is nothing on the current work bench.
- Returns:
- the top level component.
generateIdentifier
public static String generateIdentifier(String className)
- Returns a unique identifier based on the given class name.
The resulting identifier is all in lowercase. The identifier is
not added to the internal list.
- Parameters:
- className - a class name.
- Returns:
- a unique identifier based on the class name.
generateUniqueIdentifier
public static String generateUniqueIdentifier(String identifier)
- Returns a unique identifier based on the given identifier.
If the identifier is not already in use, the identifier is returned.
If it is already in use, a number is appended to it. The identifier is
not added to the internal list.
- Parameters:
- identifier - an identifier name.
- Returns:
- a unique identifier based on the given identifier.
addIdentifier
public static void addIdentifier(String name)
- Adds the name to JForge's internal list of identifiers.
- Parameters:
- name - the name to add.
isIdentifierUsed
public static boolean isIdentifierUsed(String name)
- Returns true if the given name is already used as an identifier.
- Parameters:
- name - the name to check.
- Returns:
- true if the name is in use.
removeIdentifier
public static void removeIdentifier(String name)
- Removes the given name from JForge's internal list of identifier
names.
- Parameters:
- name - the name to remove.
getCopiedComponent
public static Component getCopiedComponent()
- Gets the component currently in the copy buffer. If there is
no component, it returns null.
- Returns:
- the component in the copy buffer.
addComponent
public static int addComponent(Component component,
Component child)
- Adds a child component to the given component. The add occurs through
the appropriate mechanism for the parent component (directly through
a BuilderBeanInfo addComponent(), through the content, or by
the normal add provided by the Container class). If the
add fails for any reason (eg: adding to a non-container) a dialogue
box pops up informing the user and the method returns ADD_FAILED.
If the add succeeds, the method returns ADD_SUCCEEDED (if the add
occured through a BuilderBeanInfo getContent() or by a straight
add()) or ADD_SPECIAL_SUCCEEDED (if the add occured through a
BuilderBeanInfo addComponent()).
- Parameters:
- component - the parent component that is added to.
- child - the component that is to be added to the parent component.
- Returns:
- whether the add succeeded or failed.
deleteComponent
public static void deleteComponent(Component component)
- Deletes the given component. The delete occurs through
the appropriate mechanism for the parent component (directly through
a BuilderBeanInfo removeComponent(), through the content, or by
the normal remove provided by the Container class). Once
the deletion has taken place a COMPONENT_DESTROYED event is fired for
all sub-components and the component itself (starting with the leaf nodes
of the component hierarchy).
BuilderBeanInfo remove is currently not supported. This is JForge
Bug Number 98100004.
- Parameters:
- component - the component to be deleted.
generateLayout
public static void generateLayout(Component component,
Container content,
Component components[],
String name)
- Generate source code for the layout and sub-components of the
given component. This call avoids full generation of the attributes
of the given component. It is intended as a convenience routine for
BeanInfos and customizers. If the layout in the content is the default
layout it won't be explicitely generated.
- Parameters:
- component - the component that has the layout.
- content - the container for the component.
- components - the components in the container.
- name - the component name used for generation.
getDefaultLayout
public static Object getDefaultLayout(Container container)
- Returns the default layout manager (the original layout manager object that
was generated for) the given component. If the current layout and the
default layout are the same object, then code generation for the layout
manager may be dispensed with. If the default was null then a
null string ("") is returned. If the container is not in the internal
list of created components, null is returned.
- Parameters:
- container - the container to find the default layout manager for.
- Returns:
- the layout manager object that was originally created.
setCodeGenMarker
public static void setCodeGenMarker(Object key,
Object value)
- Sets a general purpose "marker" during code generation. The
marker is valid throughout the context of the current code generation
and is removed once generation is complete.
If either the key or value is null no marker is set.
- Parameters:
- key - a Key for refering to the marker.
- value - the value of the marker.
getCodeGenMarker
public static Object getCodeGenMarker(Object key)
- Gets a general purpose "marker" during code generation. The
marker is valid throughout the context of the current code generation
and is removed once generation is complete.
If the key is null or there is no value for the specified key
the returned value is null.
- Parameters:
- key - a Key for refering to the marker.
- Returns:
- the value of the marker.
addJavaSourceLine
public static void addJavaSourceLine(String line)
- Adds a line of source directly into the code generation. This is provided
as an alternative for Customizer and BeanInfo source generators that
want source to be inserted at a particular point rather than having it
inserted later, which is what occurs when the source is returned as an
array of strings via getJavaInitializationStrings(). Note that using this
method will make the Customizer or BeanInfo JForge specific.
- Parameters:
- line - the line of source to be added.
addAdditionalJavaSource
public static void addAdditionalJavaSource(String lines[])
- Adds additional lines of code after the constructor body in the generated
code. This method could be used, for example, to add additional methods
that simplify code generation for components or layouts.
Note:
JForge will not recognise additional methods when the class is
loaded back into the builder and hence will not generate the additional
source lines unless this method is once again used to add them during
code generation. Also note that material added via this method outside
the context of code generation will be lost when the code generator is
called.
- Parameters:
- lines - additional lines of source code to be added.
addImportStatements
public static void addImportStatements(String packageNames[])
- Adds additional import lines to the source code during code generation.
If the array contains more than one instance of a name, only one
import line with that package name will be generated. If an entry in
the array is null or the empty string ("") it is ignored.
Note: Material added outside the context of code generation will
be lost when the code generator is called.
- Parameters:
- packageNames - an array of Java package names.
addIdentifierDeclaration
public static void addIdentifierDeclaration(String type,
String name)
- Adds an additional identifier declaration to the class.
Note: Material added outside the context of code generation will
be lost when the code generator is called.
- Parameters:
- type - the type of object to declare.
- name - the identifier name.
generateColor
public static String generateColor(Color color)
- Generates an appropriate line of code for Color. JForge examines
its internal shared colour table and returns a line of code that
corresponds to the shared colour. If the colour is not shared,
this method returns a line of code that creates the colour. This
method should be used by any source generating code that needs to
write out a colour.
- Parameters:
- color - the specified colour for which source code is needed.
- Returns:
- the line of source code that represents the colour.
getUniqueColors
public static Color[] getUniqueColors()
- Returns the current set of Unique colours in an array. Unique colours
are colours that are not shared across multiple components (each
component that uses a certain colour gets a new instance of that Color).
- Returns:
- an array of the current unique colours.
getSharedColors
public static Color[] getSharedColors()
- Returns the current set of Shared colours in an array. Shared colours
are colours that are shared across multiple components (each
component that uses a certain colour gets a a shared instance of that
Color). Changes in the Color instance will therefore occur across all
components that use that colour.
- Returns:
- an array of the current shared colours.
findSharedColorIndex
public static int findSharedColorIndex(Color color)
- Returns the index of a shared colour. The index can be used to access
the colour in the array returned by getSharedColors(). A return
value of -1 indicates that the given colour could not be found in the list
of shared colours.
- Parameters:
- color - the color to find the index of.
- Returns:
- an index for the colour.
getUniqueColorAtIndex
public static Color getUniqueColorAtIndex(int index)
- Returns the Color object for a given index. If the index is outside
the range of valid indexes, null is returned.
- Parameters:
- index - the index of the colour.
- Returns:
- the Color object for the given index.
getSharedColorAtIndex
public static Color getSharedColorAtIndex(int index)
- Returns the Color object for a given index. If the index is outside
the range of valid indexes, null is returned.
- Parameters:
- index - the index of the colour.
- Returns:
- the Color object for the given index.
changeColor
public static Color changeColor(Color color,
int red,
int green,
int blue)
- Changes the R/G/B values of the given Color object. If the
colour is Unique, a new instance is returned. If the colour is Shared,
the colour values of the instance are changed. NOTE: shared and unique
attributes are internal to JForge.
- Parameters:
- color - the Color to change.
- red - the red value.
- green - the green value.
- blue - the blue value.
- Returns:
- a Color object with the given R/G/B values.
insertSharedColor
public static Color insertSharedColor(Color color,
int index)
- Inserts a colour into the shared colour list at the specified index.
If the colour is a Unique colour, then it is changed to a Shared colour.
The returned colour is a new Shared instance if the original colour
was a Unique color.
- Parameters:
- color - the colour to insert.
- index - the index to insert the colour at.
- Returns:
- the shared colour that was inserted.
addSharedColor
public static Color addSharedColor(Color color)
- Adds a colour to the end of the shared colour list.
If the colour is a Unique colour, then it is changed to a Shared colour.
The returned colour is a new Shared instance if the original colour
was a Unique color.
- Parameters:
- color - the colour to insert.
- Returns:
- the shared colour that was inserted.
removeSharedColor
public static void removeSharedColor(int index)
- Removes the specified colour from the shared colour list.
- Parameters:
- index - the index of the colour to remove.
isSharedColor
public static boolean isSharedColor(Color color)
- Returns true if the given colour is a shared colour. Sharedness is an
internal JForge distinction and this method should not have to be used.
This method does not determine if the colour is currently in the Shared
colour list; use findSharedColorIndex instead.
- Parameters:
- the - color to test for sharedness.
- Returns:
- true if the colour is a shared colour.
generateBorder
public static String generateBorder(Border border,
Component component,
String name)
- Generates an appropriate line of code representing the given Border.
This method is a convenience method for BeanInfos that need to write
out source code for a Border.
- Parameters:
- border - the Border for which code generation is needed.
- component - the component that uses the Border.
- name - the source code identifier name of the component.
- Returns:
- a string that sets the Components Border to the specified Border.
getIconPathsForComponent
public static Vector getIconPathsForComponent(Component component)
- Returns a Vector of URL paths for the given component. An empty Vector
is returned if there is no URL. The Vector consists of two element
arrays. The first element in each array is the setter method name for
the URL and the second element is the URL path.
- Parameters:
- component - the Component to find the icon paths for.
- Returns:
- a Vector of two elemnt arrays representing the methods and URLs.
getIconPathForComponent
public static String getIconPathForComponent(Component component)
- Returns the URL path for the given component and the "current method".
A value of null is returned if there is no URL.
The "current method" is a set method determined automatically by the
JForge property sheet mechanism. The method for the association may
also be set through setURLMethodName.
- Parameters:
- component - the Component to find the icon path for.
- Returns:
- a String representing the URL.
setIconPathForComponent
public static void setIconPathForComponent(Component component,
String URL)
- Sets the URL of the icon for the given component. Some components may
have multiple icons; the URL is associated with a set method for the given
component, the set method being determined by the JForge property sheet
mechanism. The set method for the association may also be set through
setURLMethodName.
- Parameters:
- component - the Component to set the icon path for.
- URL - the URL to set it to.
setURLMethodName
public static void setURLMethodName(String name)
- Sets the method name to which Icons are are associated. Normally this
method should not be used; the property sheet mechanism sets this value
automatically when a value is edited (for displayable type
properties only).
- Parameters:
- name - the name to set the "current method" to.
getBeanInfo
public static BeanInfo[] getBeanInfo(Component component)
- Obtain bean information for the specified component. An array of
BeanInfos is returned. The first BeanInfo in the array is the
BeanInfo for the components' class. Subsequent BeanInfos are for
each successive superclass, all the way up to class java.awt.Component.
- Parameters:
- component - the component to find the BeanInfos for.
- Returns:
- an array of BeanInfo representing this component.
getContainer
public static Container getContainer(Component component)
- Obtains the container for the specified component. For components
that have no container, null is returned. For simple components
(eg: JPanel), the component itself is returned. For complex
components (ie: those that have a BuilderBeanInfo) the bean info
is consulted and the appropriate content is returned.
- Parameters:
- component - the component to find the content for.
- Returns:
- the content component for the given component.
getPropertyDisplay
public static BuilderPropertyDisplay getPropertyDisplay(Component component,
Container container,
BeanInfo beanInfo[])
- Obtain a property sheet for the specified component. A Property
Display component is returned for the specified component and its
beaninfo array. Each element in the array ia a BeanInfo in the
components' superclass hierarchy. Once the sheet is finished with,
you must call shutdown() in the PropertyDisplay. If you want to
generate a Property Sheet for a Layout, you should also supply
the container that is the subject of the layout so that it can be
properly validated.
- Parameters:
- component - the component to create a Property Sheet for.
- container - the container if this is a Layout, otherwise null.
- beanInfo - an array of BeanInfos for the component.
- Returns:
- a property sheet component.
updatePropertySheet
public static void updatePropertySheet(BuilderPropertySheet sheet)
- Updates the property sheet with the latest values from the component.
- Parameters:
- sheet - the property sheet to update.
editSelected
public static void editSelected()
- Edits the selected component. This method should be called by anything
that needs to switch editing to the selected component. It is designed
to be called by the BeanInfo handlers provided for AWT-based components.
mousePressed
public static void mousePressed(MouseEvent source,
Component comp)
- Executes a programmatic "mouse press". This method should be called by
anything that needs to perform a mouse press. It is designed to be
called by the BeanInfo handlers provided for AWT-based components.
- Parameters:
- source - the MouseEvent source passed to the handler.
- comp - the component that requires the mouse press.
mouseReleased
public static void mouseReleased(MouseEvent source)
- Executes a programmatic "mouse release". This method should be called by
anything that needs to perform a mouse release. It is designed to be
called by the BeanInfo handlers provided for AWT-based components.
- Parameters:
- source - the MouseEvent source passed to the handler.
mouseDragged
public static void mouseDragged(MouseEvent source)
- Executes a programmatic "mouse drag". This method should be called by
anything that needs to perform a mouse drag. It is designed to be
called by the BeanInfo handlers provided for AWT-based components.
- Parameters:
- source - the MouseEvent source passed to the handler.
menuShowAbout
public static void menuShowAbout()
- Shows the "About" dialogue. This method should be called by menus
that provide the appropriate menu component.
menuDeleteSelected
public static void menuDeleteSelected()
- Performs a delete. This method should be called by menus
that provide the appropriate menu component.
menuCutSelected
public static void menuCutSelected()
- Performs a cut. This method should be called by menus
that provide the appropriate menu component.
menuEditSelected
public static void menuEditSelected()
- Performs an Edit. This method should be called by menus
that provide the appropriate menu component.
menuCopySelected
public static void menuCopySelected()
- Performs a copy. This method should be called by menus
that provide the appropriate menu component.
menuPasteBuffer
public static void menuPasteBuffer()
- Performs a paste. This method should be called by menus
that provide the appropriate menu component.
menuPreferences
public static void menuPreferences()
- Displays the preferences dialogue. This method should be called by menus
that provide the appropriate menu component.
menuSave
public static void menuSave()
- Performs a save. This method should be called by menus
that provide the appropriate menu component.
menuSaveCompile
public static void menuSaveCompile()
- Performs a save and compile. This method should be called by menus
that provide the appropriate menu component.
menuSaveAs
public static void menuSaveAs()
- Performs a save as. This method should be called by menus
that provide the appropriate menu component.
menuSaveSerial
public static void menuSaveSerial()
- Performs a save serial. This method should be called by menus
that provide the appropriate menu component.
menuLoadSerial
public static void menuLoadSerial()
- Performs a load serial. This method should be called by menus
that provide the appropriate menu component.
menuOpen
public static void menuOpen()
- Performs an open. This method should be called by menus
that provide the appropriate menu component.
menuNew
public static void menuNew()
- Performs a new. This method should be called by menus
that provide the appropriate menu component.
menuColourTool
public static void menuColourTool()
- Displays the Colour dialogue. This method should be called by menus
that provide the appropriate menu component.
menuCompilationStatus
public static void menuCompilationStatus()
- Displays the Compilation Status dialogue. This method should be called by
menus that provide the appropriate menu component.
menuTreeTool
public static void menuTreeTool()
- Displays the Tree dialogue. This method should be called by menus
that provide the appropriate menu component.
menuExit
public static void menuExit()
- Performs an exit. This method should be called by menus
that provide the appropriate menu component.
All Packages Class Hierarchy This Package Previous Next Index