Java Doc for XComponentFactory.java in  » XML-UI » XUI » net » xoetrope » xui » 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.xui 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.xoetrope.xui.XComponentFactory

All known Subclasses:   net.xoetrope.xui.style.XStyleFactory,
XComponentFactory
public class XComponentFactory (Code)
A component factory. The factory is designed to create components for a null layout. The factory will use an incrementing id to name each component. When an XPanel is added it will automatically become the parent for subsequent components added using the factory. If another parent component is needed then the parent can be explicitly set.
When components are added their size is checked against that of the parent and reduced if they extend beyond the bounds of the parent.
The component factory can be extended by registering new XComponentConstructors. These constructors are invoked if the build in constructors cannot build the specified type. Components can be specified by a type name, an type constant or by a class name. The type constants for the built-in components are specified in XPage so as to make referencing the constants easier in the client code (subclasses of XPage).

Copyright (c) Xoetrope Ltd., 2002-2003

License: see license.txt

$Revision: 1.28 $


Field Summary
protected  StringbasePackageName
    
protected static  VectorcomponentFactories
    
protected  ObjectcurrentMenu
    
protected  ObjectcurrentMenuBar
    
protected  ResourceBundlelanguageResourceBundle
    
protected static  XLayoutHelperlayoutHelper
    
protected  ContainerparentPanel
    
protected  intparentWparentH
    
protected static  HashtabletypeNames
    

Constructor Summary
public  XComponentFactory(String packageName)
    

Method Summary
public  ComponentaddClass(String className, int x, int y, int w, int h)
     A generic factory for adding Components.
public  ComponentaddComponent(String type, int x, int y, int w, int h, String content)
     A generic factory for adding XComponents.
public  ComponentaddComponent(String type, Object pos, String content)
     A generic factory for adding XComponents.
public  voidaddComponent(Component c)
     Add a component to the panel.
public  voidaddComponent(Component c, Object constraint)
     Add a component to the panel.
public  ObjectaddElement(String type, String name, String content, Hashtable attribs)
     Add a non-component object to the panel or an element of the panel.
public  LayoutManageraddLayout(Container cont, int type)
    
protected  ComponentbuildRegisteredComponent(int type, String content)
     A generic factory for adding registered components via the XComponentConstructor interface or component factories.
protected  ComponentbuildRegisteredComponent(String type, String content)
     A generic factory for adding registered components via the XComponentConstructor interface or component factories.
public  ComponentconstructComponent(int type, String content)
     A generic factory for constructing XComponents.
public static  VectorgetFactories()
    
public static  XLayoutHelpergetLayoutHelper()
    
public  ComponentgetParentComponent()
    
public static  intgetTypeCode(String typeName)
    
public static  voidregisterComponentFactory(XComponentConstructor factory)
    
public static  voidsetLayoutHelper(XLayoutHelper newHelper)
    
public  voidsetParentComponent(Component c)
     Change the parent for new components.
public  voidsetResourceBundle(String resourceBundleName)
    
protected static  voidsetupTypeNames()
     Setup a hashtable of type names.
public  Stringtranslate(String key)
    
public static  voidupdateComponentFactories()
    

Field Detail
basePackageName
protected String basePackageName(Code)



componentFactories
protected static Vector componentFactories(Code)



currentMenu
protected Object currentMenu(Code)



currentMenuBar
protected Object currentMenuBar(Code)



languageResourceBundle
protected ResourceBundle languageResourceBundle(Code)



layoutHelper
protected static XLayoutHelper layoutHelper(Code)



parentPanel
protected Container parentPanel(Code)



parentWparentH
protected int parentWparentH(Code)



typeNames
protected static Hashtable typeNames(Code)




Constructor Detail
XComponentFactory
public XComponentFactory(String packageName)(Code)
Constructs a Component factory




Method Detail
addClass
public Component addClass(String className, int x, int y, int w, int h)(Code)
A generic factory for adding Components. The component is created dynamically positioned and added to the parent panel if one exists. The component is named with a counter value to uniquely identify the control.
Parameters:
  className - String value of the classname to be created
Parameters:
  x - the left coordinate
Parameters:
  y - the top coordinate
Parameters:
  w - the width
Parameters:
  h - the height



addComponent
public Component addComponent(String type, int x, int y, int w, int h, String content)(Code)
A generic factory for adding XComponents. The component is constructed, positioned and added to the parent panel if one exists. This method delegates to the registered component factories if any. All built in components are constructed with an ID. When a ScrollPane is addd it becomes the parent.
Parameters:
  type - a name identifying the type of component to be created
Parameters:
  x - the left coordinate
Parameters:
  y - the top coordinate
Parameters:
  w - the width
Parameters:
  h - the height
Parameters:
  content - the component text/content



addComponent
public Component addComponent(String type, Object pos, String content)(Code)
A generic factory for adding XComponents. The component is constructed, positioned and added to the parent panel if one exists. This method delegates to the registered component factories if any. All built in components are constructed with an ID. When a ScrollPane is addd it becomes the parent.
Parameters:
  type - a name identifying the type of component to be created
Parameters:
  x - the left coordinate
Parameters:
  y - the top coordinate
Parameters:
  w - the width
Parameters:
  h - the height
Parameters:
  content - the component text/content



addComponent
public void addComponent(Component c)(Code)
Add a component to the panel.
Parameters:
  c - the component to add



addComponent
public void addComponent(Component c, Object constraint)(Code)
Add a component to the panel.
Parameters:
  c - the component to add
Parameters:
  constraint - the layout manager constraint



addElement
public Object addElement(String type, String name, String content, Hashtable attribs)(Code)
Add a non-component object to the panel or an element of the panel. This method is invoked is the XuiBuilder fails to construct a component for an XML element
Parameters:
  type - the object type
Parameters:
  name - a name identifying the element to be created
Parameters:
  content - the component text/content
Parameters:
  attribs - the element attributes if any



addLayout
public LayoutManager addLayout(Container cont, int type)(Code)
Sets a LayoutManager for the panel
Parameters:
  cont - the container whose layout manager is being set or null to set the parent panel's layout manager
Parameters:
  type - the layout manager as defined in the XLayoutHelper class



buildRegisteredComponent
protected Component buildRegisteredComponent(int type, String content)(Code)
A generic factory for adding registered components via the XComponentConstructor interface or component factories.
Parameters:
  type - a constant identifying the type of component to be created
Parameters:
  x - the left coordinate
Parameters:
  y - the top coordinate
Parameters:
  w - the width
Parameters:
  h - the height
Parameters:
  content - the component text/content



buildRegisteredComponent
protected Component buildRegisteredComponent(String type, String content)(Code)
A generic factory for adding registered components via the XComponentConstructor interface or component factories.
Parameters:
  type - a name identifying the type of component to be created
Parameters:
  x - the left coordinate
Parameters:
  y - the top coordinate
Parameters:
  w - the width
Parameters:
  h - the height
Parameters:
  content - the component text/content



constructComponent
public Component constructComponent(int type, String content)(Code)
A generic factory for constructing XComponents.
Parameters:
  type - a constant identifying the type of component to be created
Parameters:
  content - the component text/content



getFactories
public static Vector getFactories()(Code)
Get the component factories a the factor store.



getLayoutHelper
public static XLayoutHelper getLayoutHelper()(Code)
Get the layout helper the layout helper



getParentComponent
public Component getParentComponent()(Code)
Get the current parent component the parent component.



getTypeCode
public static int getTypeCode(String typeName)(Code)
Get the type constant associated with a type name
Parameters:
  typeName - the type name the type constant



registerComponentFactory
public static void registerComponentFactory(XComponentConstructor factory)(Code)
Add a componentFactory to the static register of component constructors
Parameters:
  factory - the new componentFactory



setLayoutHelper
public static void setLayoutHelper(XLayoutHelper newHelper)(Code)
Set the layout helper
Parameters:
  newHelper - the new layout helper



setParentComponent
public void setParentComponent(Component c)(Code)
Change the parent for new components. This method will affect the next component added.
Parameters:
  c - the new parent, this should be an instance of java.awt.Container



setResourceBundle
public void setResourceBundle(String resourceBundleName)(Code)
Set the resource bundle for this component
Parameters:
  resourceBundleName -



setupTypeNames
protected static void setupTypeNames()(Code)
Setup a hashtable of type names. This will be moved to a helper class at some stage



translate
public String translate(String key)(Code)
Look up the translation of a key using the current language resource
Parameters:
  key - the key string the translation



updateComponentFactories
public static void updateComponentFactories()(Code)
Notify the component factories that some of their settings may have changed
Parameters:
  factory - the new componentFactory



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.