Java Doc for XApplet.java in  » XML-UI » XUI » net » xoetrope » swing » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML UI » XUI » net.xoetrope.swing 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.swing.JApplet
   net.xoetrope.swing.XApplet

XApplet
public class XApplet extends JApplet implements WindowListener,XPageDisplay(Code)

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: Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt
version:
   $Revision: 1.24 $



Field Summary
protected static  WindowappWindow
    
protected  booleanbUseWindow
    
protected static  JFrameclientFrame
    
protected  intclientHeight
    
protected  intclientWidth
    
protected static  ClassdefaultSourceClass
    
protected  XDataSourcemodelDataSource
    
protected  XPageManagerpageMgr
    
protected  XProjectproject
    
protected static  XAppletthisApplet
    

Constructor Summary
public  XApplet()
     A default constructor.

Method Summary
public  voidaddTarget(String name, Object constraint, int preferredWidth, int preferredHeight)
    
public  voidaddTarget(XTarget frame, Object constraint)
    
public  XPagedisplayPage(XPage page)
     Called when a page has been added or shown via the XPageManager.
public  XPagedisplayPage(XPage page, String target)
    

Called when a page has been added or shown via the XPageManager.

public  ContainerfindTarget(String target)
     Finds the target area for a page display request, this only applies to a frameset.
public  intgetClientHeight()
     Get the height of the main window.
public  intgetClientWidth()
     Get the width of the main window.
public  JFramegetFrame()
     Gets the Frame containing the applet.
public static  JMenuBargetMenuBar()
     Get the menubar.
public  intgetNumTargets()
    
protected  XPageLoadergetSecondaryClassLoader(String packageName)
    

Construct a new builder and set the default package.

public  ContainergetTarget(int idx)
     Get the target for a page display request.
public  voidhidePage(XPage page)
     Remove the page from container.
public  voidinit()
     Invoked when used as an applet.
protected  voidinitialise(JFrame f)
    
public static  voidmain(String args)
     main method to be invoked as an application.
protected  voidregister()
     Load the componentFactories by reading the factory names from the startup file.
protected  voidsetContent(JFrame f)
     Load the content into the model.
public static  voidsetDefaultDataSource(String className)
     Sets the default datasource class.
public  voidsetHome()
     Set the home page using the startup properties.
public static  voidsetMenuBar(JMenuBar mb)
     Set the menubar.
protected  voidsetResourceFile(String startFile)
     Setup the default resource file for the application and load some of the information in it.
protected  voidsetup(JFrame frame, String[] args)
     Setup the applet by setting paths and then initializing the applet.
public  voidwindowActivated(WindowEvent e)
    
public  voidwindowClosed(WindowEvent e)
    
public  voidwindowClosing(WindowEvent e)
    
public  voidwindowDeactivated(WindowEvent e)
    
public  voidwindowDeiconified(WindowEvent e)
    
public  voidwindowIconified(WindowEvent e)
    
public  voidwindowOpened(WindowEvent e)
    

Field Detail
appWindow
protected static Window appWindow(Code)



bUseWindow
protected boolean bUseWindow(Code)



clientFrame
protected static JFrame clientFrame(Code)



clientHeight
protected int clientHeight(Code)



clientWidth
protected int clientWidth(Code)



defaultSourceClass
protected static Class defaultSourceClass(Code)



modelDataSource
protected XDataSource modelDataSource(Code)



pageMgr
protected XPageManager pageMgr(Code)



project
protected XProject project(Code)



thisApplet
protected static XApplet thisApplet(Code)




Constructor Detail
XApplet
public XApplet()(Code)
A default constructor. Most of the setup work is actually done by the initialize method and is called by the main method or the init method depending on whether or not an application of applet is being launched.




Method Detail
addTarget
public void addTarget(String name, Object constraint, int preferredWidth, int preferredHeight)(Code)
Add a new frame or target area to a frameset
Parameters:
  name - the frame name
Parameters:
  constraint - the BorderlayoutConstraint
Parameters:
  preferredWidth - the preferred width
Parameters:
  preferredHeight - the preferred height



addTarget
public void addTarget(XTarget frame, Object constraint)(Code)
Adds a target frame to the frameset
Parameters:
  frame - the new traget frame



displayPage
public XPage displayPage(XPage page)(Code)
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.
Parameters:
  page - The XPage which has been loaded. the page being displayed



displayPage
public XPage displayPage(XPage page, String target)(Code)

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:

  • Find the appropriate target area
  • Ask the page to make its components non visible (to avoid flicker during the page update)
  • Set the page size
  • Save the current page's data by calling 'saveBoundComponentValues
  • Mark the current page as deactivated, and call the page's deactivated() method
  • Remove the old page from the container
  • Add the new page
  • Update the new page's bindings by calling updateBindings()
  • Update the new page's data by calling updateBoundComponentValues()
  • Layout the container and request it to repaint
  • Show the new page
  • Mark the new page as activated, and call its pageActivated method

    Parameters:
      page - The XPage which has been loaded.
    Parameters:
      target - the area to update the page being displayed



    findTarget
    public Container findTarget(String target)(Code)
    Finds the target area for a page display request, this only applies to a frameset. If there is no frameset the main area or default area is named 'content' and this area is used if null is used as the target name.
    Parameters:
      target - the target area name the container to be updated



    getClientHeight
    public int getClientHeight()(Code)
    Get the height of the main window. Retrieved from the startup file or defaulted



    getClientWidth
    public int getClientWidth()(Code)
    Get the width of the main window. Retrieved from the startup file or defaulted



    getFrame
    public JFrame getFrame()(Code)
    Gets the Frame containing the applet. Frame which is the applet or application's parent



    getMenuBar
    public static JMenuBar getMenuBar()(Code)
    Get the menubar.
    Parameters:
      mb -



    getNumTargets
    public int getNumTargets()(Code)
    Get the number of targets in the container



    getSecondaryClassLoader
    protected XPageLoader getSecondaryClassLoader(String packageName)(Code)

    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.
    Parameters:
      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 ofthe XApplet class




    getTarget
    public Container getTarget(int idx)(Code)
    Get the target for a page display request. The target areas are stored in the order in which they were declared or added.
    Parameters:
      idx - the target area the container to be updated



    hidePage
    public void hidePage(XPage page)(Code)
    Remove the page from container. The page is simply removed and the container validated.
    Parameters:
      page -



    init
    public void init()(Code)
    Invoked when used as an applet. Sets up the startup file and initialises the application. Reads the applet parameters and calls initialize.



    initialise
    protected void initialise(JFrame f)(Code)

    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
    1. Register the component factories
    2. Setup the project class
    3. Setup the page manager
    4. Setup the resource manager
    5. Setup the style manager
    6. Size the main window
    7. Set the layout
    8. Add a shutdown hook
    9. Display the main window

    Parameters:
      f - The Frame which acts as the parent.the style manager



    main
    public static void main(String args)(Code)
    main method to be invoked as an application. This method is invoked as the entry point to the 'Application', it is not used if an Applet is being launched. This method establishes the frame within which the application runs. If overloading this method remeber to call the setup method.



    register
    protected void register()(Code)
    Load the componentFactories by reading the factory names from the startup file. The value of the 'NumComponentFactories' is first read and then the value of ComponentFactory (i.e. ComponentFactory0, ComponentFactory1) where is the number, starting at zero, of the factory. Each factory is then instantiated and will be called upon to construct components in the order in which the factories were registered.



    setContent
    protected void setContent(JFrame f)(Code)
    Load the content into the model. In the process an instance of the default model data source class is instantiated and reads data from a file pointed to by the 'ModelData' startup parameter.
    Parameters:
      f - the frame



    setDefaultDataSource
    public static void setDefaultDataSource(String className)(Code)
    Sets the default datasource class. The default data source will be used to provide any initial data for the XModel. Normally this data is static data that will be used to populate things like lists and provide default values.
    Parameters:
      className - the name of the datasource classe.g. net.xoetrope.data.XDataSource.class, this class reads data from an XML file



    setHome
    public void setHome()(Code)
    Set the home page using the startup properties. The home page is established by combining the two startup properties 'StartPackage' and 'StartClass'. By default 'StartClass' is set to a value of 'home. Both startup parameters are optional. Load the first page for the application.



    setMenuBar
    public static void setMenuBar(JMenuBar mb)(Code)
    Set the menubar.
    Parameters:
      mb -



    setResourceFile
    protected void setResourceFile(String startFile)(Code)
    Setup the default resource file for the application and load some of the information in it. The resource file is the startup properties file
    Parameters:
      startFile - The name of the file to be loaded, by default startup.properties



    setup
    protected void setup(JFrame frame, String[] args)(Code)
    Setup the applet by setting paths and then initializing the applet. This method is a stand-in for the main method, processing the commandline parameters, so that its work is reusable and does not needed to be redone by derived classes. This method should not be called directly by user code.
    Parameters:
      frame - the owner frame
    Parameters:
      args - the command line arguments



    windowActivated
    public void windowActivated(WindowEvent e)(Code)
    Template method, unused at present



    windowClosed
    public void windowClosed(WindowEvent e)(Code)
    Template method, unused at present



    windowClosing
    public void windowClosing(WindowEvent e)(Code)
    Exit the application



    windowDeactivated
    public void windowDeactivated(WindowEvent e)(Code)
    Template method, unused at present



    windowDeiconified
    public void windowDeiconified(WindowEvent e)(Code)
    Template method, unused at present



    windowIconified
    public void windowIconified(WindowEvent e)(Code)
    Template method, unused at present



    windowOpened
    public void windowOpened(WindowEvent e)(Code)
    Template method, unused at present



    Fields inherited from javax.swing.JApplet
    protected AccessibleContext accessibleContext(Code)(Java Doc)
    protected JRootPane rootPane(Code)(Java Doc)
    protected boolean rootPaneCheckingEnabled(Code)(Java Doc)

    Methods inherited from javax.swing.JApplet
    protected void addImpl(Component comp, Object constraints, int index)(Code)(Java Doc)
    protected JRootPane createRootPane()(Code)(Java Doc)
    public AccessibleContext getAccessibleContext()(Code)(Java Doc)
    public Container getContentPane()(Code)(Java Doc)
    public Component getGlassPane()(Code)(Java Doc)
    public Graphics getGraphics()(Code)(Java Doc)
    public JMenuBar getJMenuBar()(Code)(Java Doc)
    public JLayeredPane getLayeredPane()(Code)(Java Doc)
    public JRootPane getRootPane()(Code)(Java Doc)
    public TransferHandler getTransferHandler()(Code)(Java Doc)
    protected boolean isRootPaneCheckingEnabled()(Code)(Java Doc)
    protected String paramString()(Code)(Java Doc)
    public void remove(Component comp)(Code)(Java Doc)
    public void repaint(long time, int x, int y, int width, int height)(Code)(Java Doc)
    public void setContentPane(Container contentPane)(Code)(Java Doc)
    public void setGlassPane(Component glassPane)(Code)(Java Doc)
    public void setJMenuBar(JMenuBar menuBar)(Code)(Java Doc)
    public void setLayeredPane(JLayeredPane layeredPane)(Code)(Java Doc)
    public void setLayout(LayoutManager manager)(Code)(Java Doc)
    protected void setRootPane(JRootPane root)(Code)(Java Doc)
    protected void setRootPaneCheckingEnabled(boolean enabled)(Code)(Java Doc)
    public void setTransferHandler(TransferHandler newHandler)(Code)(Java Doc)
    public void update(Graphics g)(Code)(Java Doc)

    www.java2java.com | Contact Us
    Copyright 2009 - 12 Demo Source and Support. All rights reserved.
    All other trademarks are property of their respective owners.