previous chapter table of contents next chapter

Current Factories

A service may supply lots of these user interface factories, each capable of creating a different user interface object. This allows for the differing capabilities of viewing devices, or even for different user preferences. One user may always like a Webstyle interface, another may be content with an AWT interface, a third may want the accessibility mechanisms possible with a Swing interface, and so on.

The set of proposed factories currently includes the following:

  • DialogFactory , which returns an instance of java.awt.Dialog (or one of its subclasses)
  • FrameFactory , which returns an instance of java.awt.Frame (or one of its subclasses)
  • JComponentFactory , which returns an instance of javax.swing.JComponent (or one of its subclasses, such as a JList )
  • JDialogFactory , which returns an instance of javax.swing.JDialog (or one of its subclasses)
  • JFrameFactory , which returns an instance of javax.swing.JFrame (or one of its subclasses)
  • PanelFactory , which returns an instance of java.awt.Panel (or one of its subclasses)

These factories are all defined as interfaces. An implementation will define a getXXX() method that will return a user interface object. The current set of factories returns objects that belong to the Swing or AWT classes. Factories added in later iterations of the specification may return objects belonging to other user interface styles, such as speech objects. Although an interface may specify that a method, such as getJFrame() , will return a JFrame , an implementation will in fact return a subclass of this, which also implements a role interface.


A Programmer[ap]s Guide to Jini Technology
A Programmer[ap]s Guide to Jini Technology
ISBN: 1893115801
Year: 2000
Pages: 189

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net