|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
javax.swing.JApplet
net.xoetrope.html.XApplet
public class XApplet
This class is constructed with a window or frame and can be part of an applet or an application. The class acts as the main entry point to an XUI application and provides some of the infrastructure needed to support the application.
The applet can provide support for a frameset or a single page. Page display functions are also supported to allow the application to display more than a single page or change the page that is displayed.
By choosing either the AWT or Swing version of the XApplet you choose to have either an AWT or a Swing application/applet. In general once this choice has been made you should not mix toolkits.
Copyright (c) Xoetrope Ltd., 1998-2004
License: see license.txt
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JApplet |
|---|
javax.swing.JApplet.AccessibleJApplet |
| Nested classes/interfaces inherited from class java.applet.Applet |
|---|
java.applet.Applet.AccessibleApplet |
| Nested classes/interfaces inherited from class java.awt.Panel |
|---|
java.awt.Panel.AccessibleAWTPanel |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected int |
clientHeight
|
protected int |
clientWidth
|
protected static java.lang.Class |
defaultSourceClass
|
protected netscape.javascript.JSObject |
doc
|
protected static int |
index
|
protected XDataSource |
modelDataSource
|
protected XPageManager |
pageMgr
|
protected static java.lang.String[][] |
values
|
protected netscape.javascript.JSObject |
win
|
| Fields inherited from class javax.swing.JApplet |
|---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
XApplet()
|
|
| Method Summary | |
|---|---|
XContentHolder |
addTarget(java.lang.String name,
java.lang.Object constraint,
int preferredWidth,
int preferredHeight)
Add a new frame or target area to a frameset |
void |
callMethod(java.lang.String methodName)
|
PageSupport |
displayPage(PageSupport page)
Called when a page has been added or shown via the XPageManager. |
PageSupport |
displayPage(PageSupport pageObj,
java.lang.String target)
Called when a page has been added or shown via the XPageManager. |
XHtmlTarget |
findTarget(java.lang.String target)
Finds the target area for a page display request, this only applies to a frameset. |
static XApplet |
getApplet()
|
int |
getClientHeight()
Get the height of the main window. |
int |
getClientWidth()
Get the width of the main window. |
XHtmlPage |
getCurrentPage()
|
java.net.URL |
getDocumentBase()
Template method, unused at present |
java.lang.Object |
getFrame()
Gets the Frame containing the applet. |
static java.lang.Object |
getMenuBar()
Get the menubar. |
int |
getNumTargets()
Get the number of target areas in the container |
protected XPageLoader |
getSecondaryClassLoader(java.lang.String packageName)
Construct a new builder and set the default package. |
XHtmlTarget |
getTarget(int idx)
Get the target for a page display request. |
void |
hidePage(netscape.javascript.JSObject page)
Remove the page from container. |
void |
init()
Initializes the applet XApplet |
protected void |
initialise(netscape.javascript.JSObject s)
Generic function which is called from the constructor if it's an application or from start if its an applet. |
protected void |
register()
Load the componentFactories by reading the factory names from the startup file. |
protected void |
setContent(netscape.javascript.JSObject s)
Load the content into the model. |
static void |
setDefaultDataSource(java.lang.String className)
Sets the default datasource class. |
void |
setHome()
Set the home page using the startup properties. |
static void |
setMenuBar(java.lang.Object mb)
Set the menubar. |
protected void |
setResourceFile(java.lang.String startFile)
Setup the default resource file for the application and load some of the information in it. |
protected void |
setup(java.lang.String[] args)
Setup the applet by setting paths and then initializing the applet. |
void |
storeValues(java.lang.String id,
java.lang.String value)
Stores the values entered in the edit fields in a static String[][]. |
void |
XApplet()
|
| Methods inherited from class javax.swing.JApplet |
|---|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
| Methods inherited from class java.applet.Applet |
|---|
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop |
| Methods inherited from class java.awt.Panel |
|---|
addNotify |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected netscape.javascript.JSObject win
protected netscape.javascript.JSObject doc
protected XPageManager pageMgr
protected XDataSource modelDataSource
protected static java.lang.Class defaultSourceClass
protected int clientWidth
protected int clientHeight
protected static java.lang.String[][] values
protected static int index
| Constructor Detail |
|---|
public XApplet()
| Method Detail |
|---|
public void XApplet()
public void init()
init in class java.applet.Appletpublic void callMethod(java.lang.String methodName)
public XHtmlPage getCurrentPage()
public void storeValues(java.lang.String id,
java.lang.String value)
id - the id of the edit field (MUST be the same as one of the values in
the first column of the static String[][]).value - the value to be saved.public static XApplet getApplet()
protected void setup(java.lang.String[] args)
frame - the owner frameargs - the command line argumentsprotected XPageLoader getSecondaryClassLoader(java.lang.String packageName)
Construct a new builder and set the default package. XUI sometimes uses additional class loaders to find the resources needed in a project. By default XUI uses the XuiBuilder class loader to convert XML files to Java classes.
A custom class loader can be referenced in the startup properties file using the 'BuilderClass' property. Once this property has been determined this method will instantiate an instance of that class if necessary.
packageName - the name of the default widget package e.g. net.xoetrope.awt, this
is normally defined as a result of choosing the appropriate
version of the XApplet classpublic static void setDefaultDataSource(java.lang.String className)
className - the name of the datasource class e.g.
net.xoetrope.data.XDataSource.class, this class reads data from an
XML fileprotected void setResourceFile(java.lang.String startFile)
startFile - The name of the file to be loaded, by default startup.propertiespublic java.lang.Object getFrame()
protected void initialise(netscape.javascript.JSObject s)
Generic function which is called from the constructor if it's an application or from start if its an applet.
The initialization process proceeds in the following order
f - The Frame which acts as the parent.skipReset - Lets the application know whether to skip resetting the style
managerprotected void register()
protected void setContent(netscape.javascript.JSObject s)
f - the framepublic void setHome()
public PageSupport displayPage(PageSupport page)
page - The XPage which has been loaded.
public PageSupport displayPage(PageSupport pageObj,
java.lang.String target)
Called when a page has been added or shown via the XPageManager. The page manager then requests that the applet/application then displays the page in the appropriate location.
The sequence with which the page transition occurs is as follows:
page - The XPage which has been loaded.target - the area to update
public void hidePage(netscape.javascript.JSObject page)
page - public XHtmlTarget findTarget(java.lang.String target)
target - the target area name
public XHtmlTarget getTarget(int idx)
idx - the target area
public int getNumTargets()
public XContentHolder addTarget(java.lang.String name,
java.lang.Object constraint,
int preferredWidth,
int preferredHeight)
name - the frame nameconstraint - the BorderlayoutConstraintpreferredWidth - the preferred widthpreferredHeight - the preferred heightreturn - the new targetpublic int getClientWidth()
public int getClientHeight()
public static void setMenuBar(java.lang.Object mb)
mb - public static java.lang.Object getMenuBar()
public java.net.URL getDocumentBase()
getDocumentBase in class java.applet.Applet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||