javax.rad.ui
Interface IFactory

All Known Implementing Classes:
AwtFactory, SwingFactory

public interface IFactory

UIFactory Interface to create Platform and technology independent Components. It is designed for use with AWT, Swing, SWT, JSP, JSF,... . The directive for implemention is: - createXXX Methods should create new instances - getXXX Methods should use singleton and return one and the same instance for the given parameter.


Method Summary
 IBorderLayout createBorderLayout()
          Creates a new instance of IBorderLayout.
 IButton createButton()
          Creates a new instance of IButton.
 ICellFormat createCellFormat(IColor pBackground, IColor pForeground, IFont pFont, IImage pImage, int pLeftIndent)
          Creates a new instance of ICellFormat.
 IChart createChart()
          Creates a new instance of IChart.
 ICheckBox createCheckBox()
          Creates a new instance of ICheckBox.
 ICheckBoxMenuItem createCheckBoxMenuItem()
          Creates a new instance of ICheckBoxMenuItem.
 IChoiceCellEditor createChoiceCellEditor()
          Creates a new instance of IChoiceCellEditor.
 IColor createColor(int pRGBA)
          Creates an sRGB color with the specified combined RGBA value consisting of the alpha component in bits 24-31, the red component in bits 16-23, the green component in bits 8-15, and the blue component in bits 0-7.
 IComponent createCustomComponent(Object pCustomComponent)
          Creates a new Instance of IComponent that contains any Custom Component.
 IContainer createCustomContainer(Object pCustomContainer)
          Creates a new Instance of IContainer that contains any Custom Container.
 IDateCellEditor createDateCellEditor()
          Creates a new instance of IDateCellEditor.
 IDesktopPanel createDesktopPanel()
          Creates a new instance of IDesktopPanel.
 IDimension createDimension(int pWidth, int pHeight)
          Creates a new instance of IDimension with the given with and height.
 IEditor createEditor()
          Creates a new instance of IEditor.
 IFlowLayout createFlowLayout()
          Creates a new instance of IFlowLayout.
 IFont createFont(String pName, int pStyle, int pSize)
          Creates a new instance of IFont from the specified name, style and point size.
 IFormLayout createFormLayout()
          Creates a new instance of IFormLayout.
 IFrame createFrame()
          Creates a new instance of IFrame.
 IGroupPanel createGroupPanel()
          Creates a new instance of IGroupPanel.
 IIcon createIcon()
          Creates a new instance of IIcon.
 IImageViewer createImageViewer()
          Creates a new instance of IImageViewer.
 IInsets createInsets(int pTop, int pLeft, int pBottom, int pRight)
          Creates a new instance of IInsets.
 IInternalFrame createInternalFrame(IDesktopPanel pDesktop)
          Creates a new instance of IInternalFrame.
 ILabel createLabel()
          Creates a new instance of ILabel.
 ILinkedCellEditor createLinkedCellEditor()
          Creates a new instance of ILinkedCellEditor.
 IMenu createMenu()
          Creates a new instance of IMenu.
 IMenuBar createMenuBar()
          Creates a new instance of IMenuBar.
 IMenuItem createMenuItem()
          Creates a new instance of IMenuItem.
 INumberCellEditor createNumberCellEditor()
          Creates a new instance of INumberCellEditor.
 IPanel createPanel()
          Creates a new instance of IPanel.
 IPasswordField createPasswordField()
          Creates a new instance of IPasswordField.
 IPoint createPoint(int pX, int pY)
          Creates a new instance of IPoint with the given x and y.
 IPopupMenu createPopupMenu()
          Creates a new instance of IPopupMenu.
 IRadioButton createRadioButton()
          Creates a new instance of IRadioButton.
 IRectangle createRectangle(int pX, int pY, int pWidth, int pHeight)
          Creates a new instance of IRectangle with the given x, y, width and height.
 IScrollPanel createScrollPanel()
          Creates a new instance of IScrollPanel.
 ISeparator createSeparator()
          Creates a new instance of ISeparator.
 ISplitPanel createSplitPanel()
          Creates a new instance of ISplitPanel.
 ITable createTable()
          Creates a new instance of ITable.
 ITabsetPanel createTabsetPanel()
          Creates a new instance of ITabsetPanel.
 ITextArea createTextArea()
          Creates a new instance of ITextArea.
 ITextCellEditor createTextCellEditor()
          Creates a new instance of ITextCellEditor.
 ITextField createTextField()
          Creates a new instance of ITextField.
 IToggleButton createToggleButton()
          Creates a new instance of IToggleButton.
 IToolBar createToolBar()
          Creates a new instance of IToolBar.
 IToolBarPanel createToolBarPanel()
          Creates a new instance of IToolBarPanel.
 ITree createTree()
          Creates a new instance of ITree.
 IWindow createWindow()
          Creates a new instance of IWindow.
 String[] getAvailableFontFamilyNames()
          Returns an array containing the names of all font families in this GraphicsEnvironment localized for the default locale, as returned by Locale.getDefault().
 ICellEditor getDefaultCellEditor(Class<?> pClass)
          Gets the default ICellEditor for the given class.
 IImage getImage(String pImageName)
          Searches the image if it is available as: File ClassLoader resource.
 IImage getImage(String pImageName, byte[] pData)
          Creates an image from byte data.
 String getImageMapping(String pMappingName)
          Gets the image name for the given mapping name.
 String[] getImageMappingNames()
          Gets all used mapping names.
 ICursor getPredefinedCursor(int pType)
          Gets a ICursor object with the specified type.
 IColor getSystemColor(String pType)
          This encapsulate symbolic colors representing the color of native GUI objects on a system.
 ICursor getSystemCustomCursor(String pCursorName)
          Returns a system-specific custom ICursor object matching the specified name.
 void invokeAndWait(Runnable pRunnable)
          Causes pRunnable.run() to be executed synchronously on the event dispatching thread.
 void invokeInThread(Runnable pRunnable)
          Causes pRunnable.run() to be executed asynchronously in a new thread.
 void invokeLater(Runnable pRunnable)
          Causes pRunnable.run() to be executed asynchronously on the event dispatching thread.
 void setDefaultCellEditor(Class<?> pClass, ICellEditor pCellEditor)
          Sets the default ICellEditor for the given class.
 void setImageMapping(String pMappingName, String pImageName)
          Gets the image name for the given mapping name.
 void setSystemColor(String pType, IColor pSystemColor)
          Sets the given IColor as SystemColor.
 

Method Detail

getAvailableFontFamilyNames

String[] getAvailableFontFamilyNames()
Returns an array containing the names of all font families in this GraphicsEnvironment localized for the default locale, as returned by Locale.getDefault().

Typical usage would be for presentation to a user for selection of a particular family name. An application can then specify this name when creating a font, in conjunction with a style, such as bold or italic, giving the font system flexibility in choosing its own best match among multiple fonts in the same font family.

Returns:
an array of String containing font family names localized for the default locale, or a suitable alternative name if no name exists for this locale.
See Also:
IFont, IFont.getFamily()

createFont

IFont createFont(String pName,
                 int pStyle,
                 int pSize)
Creates a new instance of IFont from the specified name, style and point size.

The font name can be a font face name or a font family name. It is used together with the style to find an appropriate font face. When a font family name is specified, the style argument is used to select the most appropriate face from the family. When a font face name is specified, the face's style and the style argument are merged to locate the best matching font from the same family. For example if face name "Arial Bold" is specified with style IFont.ITALIC, the font system looks for a face in the "Arial" family that is bold and italic, and may associate the font instance with the physical font face "Arial Bold Italic". The style argument is merged with the specified face's style, not added or subtracted. This means, specifying a bold face and a bold style does not double-embolden the font, and specifying a bold face and a plain style does not lighten the font.

If no face for the requested style can be found, the font system may apply algorithmic styling to achieve the desired style. For example, if ITALIC is requested, but no italic face is available, glyphs from the plain face may be algorithmically obliqued (slanted).

Font name lookup is case insensitive, using the case folding rules of the US locale.

If the name parameter represents something other than a logical font, i.e. is interpreted as a physical font face or family, and this cannot be mapped by the implementation to a physical font or a compatible alternative, then the font system will map the Font to a standard font.

Parameters:
pName - the font name. This can be a font face name or a font family name, and may represent either a logical font or a physical font found in this GraphicsEnvironment.
pStyle - the style constant for the IFont The style argument is an integer bitmask that may be PLAIN, or a bitwise union of BOLD and/or ITALIC (for example, ITALIC or BOLD|ITALIC). If the style argument does not conform to one of the expected integer bitmasks then the style is set to PLAIN.
pSize - the point size of the IFont
Returns:
the IFont
See Also:
IFont, getAvailableFontFamilyNames()

createColor

IColor createColor(int pRGBA)
Creates an sRGB color with the specified combined RGBA value consisting of the alpha component in bits 24-31, the red component in bits 16-23, the green component in bits 8-15, and the blue component in bits 0-7. If the pHasalpha argument is false, alpha is defaulted to 255.

Parameters:
pRGBA - the combined RGBA components
Returns:
the IColor
See Also:
IColor, IColor.getRed(), IColor.getGreen(), IColor.getBlue(), IColor.getAlpha(), IColor.getRGBA()

getSystemColor

IColor getSystemColor(String pType)
This encapsulate symbolic colors representing the color of native GUI objects on a system. For systems which support the dynamic update of the system colors (when the user changes the colors) the actual RGB values of these symbolic colors will also change dynamically. In order to compare the "current" RGB value of a SystemColor object with a non-symbolic Color object, getRGB should be used rather than equals.

Note that the way in which these system colors are applied to GUI objects may vary slightly from platform to platform since GUI objects may be rendered differently on each platform.

Parameters:
pType - the color type.
Returns:
the IColor
See Also:
IColor

setSystemColor

void setSystemColor(String pType,
                    IColor pSystemColor)
Sets the given IColor as SystemColor. If pSystemColor is null the original SystemColor is restored.

Parameters:
pType - the color type.
pSystemColor - the IColor
See Also:
IColor

getPredefinedCursor

ICursor getPredefinedCursor(int pType)
Gets a ICursor object with the specified type.

Parameters:
pType - the type of cursor
Returns:
the ICursor
See Also:
ICursor

getSystemCustomCursor

ICursor getSystemCustomCursor(String pCursorName)
Returns a system-specific custom ICursor object matching the specified name. Cursor names are, for example: "Invalid.16x16"

Parameters:
pCursorName - a string describing the desired system-specific custom cursor
Returns:
the system specific custom cursor named
See Also:
ICursor

getImage

IImage getImage(String pImageName)
Searches the image if it is available as: resource.

Parameters:
pImageName - the name of a resource containing pixel data in a recognized file format.
Returns:
an IImage which gets its pixel data from the specified file.
See Also:
IImage

getImage

IImage getImage(String pImageName,
                byte[] pData)
Creates an image from byte data.

Parameters:
pImageName - the name for the image. The name will be used for cache mechanism. If the name is set to null then the cache will ignore the image.
pData - the image data
Returns:
the image created from the byte data

getImageMapping

String getImageMapping(String pMappingName)
Gets the image name for the given mapping name.

Parameters:
pMappingName - the mapping name.
Returns:
the image name.

setImageMapping

void setImageMapping(String pMappingName,
                     String pImageName)
Gets the image name for the given mapping name.

Parameters:
pMappingName - the mapping name.
pImageName - the image name.

getImageMappingNames

String[] getImageMappingNames()
Gets all used mapping names.

Returns:
the mapping names.

createPoint

IPoint createPoint(int pX,
                   int pY)
Creates a new instance of IPoint with the given x and y.

Parameters:
pX - the x value
pY - the y value
Returns:
the IPoint
See Also:
IPoint

createDimension

IDimension createDimension(int pWidth,
                           int pHeight)
Creates a new instance of IDimension with the given with and height.

Parameters:
pWidth - the width
pHeight - the height
Returns:
the IDimension
See Also:
IDimension

createRectangle

IRectangle createRectangle(int pX,
                           int pY,
                           int pWidth,
                           int pHeight)
Creates a new instance of IRectangle with the given x, y, width and height.

Parameters:
pX - the x value
pY - the y value
pWidth - the width
pHeight - the height
Returns:
the IRectangle
See Also:
IRectangle

createInsets

IInsets createInsets(int pTop,
                     int pLeft,
                     int pBottom,
                     int pRight)
Creates a new instance of IInsets.

Parameters:
pTop - the top
pLeft - the left
pBottom - the bottom
pRight - the right
Returns:
the IInsets
See Also:
IInsets

createLabel

ILabel createLabel()
Creates a new instance of ILabel.

Returns:
the ILabel
See Also:
ILabel

createTextField

ITextField createTextField()
Creates a new instance of ITextField.

Returns:
the ITextField
See Also:
ITextField

createPasswordField

IPasswordField createPasswordField()
Creates a new instance of IPasswordField.

Returns:
the IPasswordField
See Also:
IPasswordField

createTextArea

ITextArea createTextArea()
Creates a new instance of ITextArea.

Returns:
the ITextArea
See Also:
ITextArea

createIcon

IIcon createIcon()
Creates a new instance of IIcon.

Returns:
the IIcon
See Also:
IIcon

createButton

IButton createButton()
Creates a new instance of IButton.

Returns:
the IButton
See Also:
IButton

createToggleButton

IToggleButton createToggleButton()
Creates a new instance of IToggleButton.

Returns:
the IToggleButton
See Also:
IToggleButton

createCheckBox

ICheckBox createCheckBox()
Creates a new instance of ICheckBox.

Returns:
the ICheckBox
See Also:
ICheckBox

createRadioButton

IRadioButton createRadioButton()
Creates a new instance of IRadioButton.

Returns:
the IRadioButton
See Also:
IRadioButton

createMenuItem

IMenuItem createMenuItem()
Creates a new instance of IMenuItem.

Returns:
the IMenuItem
See Also:
IMenuItem

createSeparator

ISeparator createSeparator()
Creates a new instance of ISeparator.

Returns:
the ISeparator
See Also:
ISeparator

createCheckBoxMenuItem

ICheckBoxMenuItem createCheckBoxMenuItem()
Creates a new instance of ICheckBoxMenuItem.

Returns:
the ICheckBoxMenuItem
See Also:
ICheckBoxMenuItem

createMenu

IMenu createMenu()
Creates a new instance of IMenu.

Returns:
the IMenu
See Also:
IMenu

createMenuBar

IMenuBar createMenuBar()
Creates a new instance of IMenuBar.

Returns:
the IMenuBar
See Also:
IMenuBar

createPopupMenu

IPopupMenu createPopupMenu()
Creates a new instance of IPopupMenu.

Returns:
the IPopupMenu
See Also:
IPopupMenu

createTable

ITable createTable()
Creates a new instance of ITable.

Returns:
the ITable
See Also:
ITable

createTree

ITree createTree()
Creates a new instance of ITree.

Returns:
the ITree
See Also:
ITree

createChart

IChart createChart()
Creates a new instance of IChart.

Returns:
the IChart
See Also:
IChart

createCellFormat

ICellFormat createCellFormat(IColor pBackground,
                             IColor pForeground,
                             IFont pFont,
                             IImage pImage,
                             int pLeftIndent)
Creates a new instance of ICellFormat.

Parameters:
pBackground - the background of the Cell.
pForeground - the foreground of the Cell.
pFont - the font of the Cell.
pImage - the image of the Cell.
pLeftIndent - the left indent.
Returns:
the ICellFormat
See Also:
ICellFormat

createEditor

IEditor createEditor()
Creates a new instance of IEditor.

Returns:
the IEditor
See Also:
IEditor

getDefaultCellEditor

ICellEditor getDefaultCellEditor(Class<?> pClass)
Gets the default ICellEditor for the given class. This function should always return an editor. It should look for best matching editor with Class.isAssignableFrom.

Parameters:
pClass - the class type to be edited.
Returns:
the ICellEditor
See Also:
ICellEditor

setDefaultCellEditor

void setDefaultCellEditor(Class<?> pClass,
                          ICellEditor pCellEditor)
Sets the default ICellEditor for the given class. This function should always return an editor. It should look for best matching editor with Class.isAssignableFrom. If the given ICellEditor is null, it is removed as editor for the given class.

Parameters:
pClass - the class type to be edited.
pCellEditor - the ICellEditor
See Also:
ICellEditor

createImageViewer

IImageViewer createImageViewer()
Creates a new instance of IImageViewer.

Returns:
the IImageViewer
See Also:
IImageViewer

createChoiceCellEditor

IChoiceCellEditor createChoiceCellEditor()
Creates a new instance of IChoiceCellEditor.

Returns:
the IChoiceCellEditor
See Also:
IChoiceCellEditor

createDateCellEditor

IDateCellEditor createDateCellEditor()
Creates a new instance of IDateCellEditor.

Returns:
the IDateCellEditor
See Also:
IDateCellEditor

createLinkedCellEditor

ILinkedCellEditor createLinkedCellEditor()
Creates a new instance of ILinkedCellEditor.

Returns:
the ILinkedCellEditor
See Also:
ILinkedCellEditor

createNumberCellEditor

INumberCellEditor createNumberCellEditor()
Creates a new instance of INumberCellEditor.

Returns:
the INumberCellEditor
See Also:
INumberCellEditor

createTextCellEditor

ITextCellEditor createTextCellEditor()
Creates a new instance of ITextCellEditor.

Returns:
the ITextCellEditor
See Also:
ITextCellEditor

createPanel

IPanel createPanel()
Creates a new instance of IPanel.

Returns:
the IPanel
See Also:
IPanel

createToolBarPanel

IToolBarPanel createToolBarPanel()
Creates a new instance of IToolBarPanel.

Returns:
the IToolBarPanel
See Also:
IToolBarPanel

createGroupPanel

IGroupPanel createGroupPanel()
Creates a new instance of IGroupPanel.

Returns:
the IGroupPanel
See Also:
IGroupPanel

createScrollPanel

IScrollPanel createScrollPanel()
Creates a new instance of IScrollPanel.

Returns:
the IScrollPanel
See Also:
IScrollPanel

createSplitPanel

ISplitPanel createSplitPanel()
Creates a new instance of ISplitPanel.

Returns:
the ISplitPanel
See Also:
ISplitPanel

createTabsetPanel

ITabsetPanel createTabsetPanel()
Creates a new instance of ITabsetPanel.

Returns:
the ITabsetPanel
See Also:
ITabsetPanel

createToolBar

IToolBar createToolBar()
Creates a new instance of IToolBar.

Returns:
the IToolBar
See Also:
IToolBar

createDesktopPanel

IDesktopPanel createDesktopPanel()
Creates a new instance of IDesktopPanel.

Returns:
the IDesktopPanel
See Also:
IDesktopPanel

createInternalFrame

IInternalFrame createInternalFrame(IDesktopPanel pDesktop)
Creates a new instance of IInternalFrame.

Parameters:
pDesktop - the associated desktop for the internal frame
Returns:
the IInternalFrame
See Also:
IInternalFrame

createWindow

IWindow createWindow()
Creates a new instance of IWindow.

Returns:
the IWindow
See Also:
IWindow

createFrame

IFrame createFrame()
Creates a new instance of IFrame.

Returns:
the IFrame
See Also:
IFrame

createCustomComponent

IComponent createCustomComponent(Object pCustomComponent)
Creates a new Instance of IComponent that contains any Custom Component.

Parameters:
pCustomComponent - the custom Component.
Returns:
the IComponent custom component.

createCustomContainer

IContainer createCustomContainer(Object pCustomContainer)
Creates a new Instance of IContainer that contains any Custom Container.

Parameters:
pCustomContainer - the custom Container.
Returns:
the IContainer custom container.

createBorderLayout

IBorderLayout createBorderLayout()
Creates a new instance of IBorderLayout.

Returns:
the IBorderLayout
See Also:
IBorderLayout

createFlowLayout

IFlowLayout createFlowLayout()
Creates a new instance of IFlowLayout.

Returns:
the IFlowLayout
See Also:
IFlowLayout

createFormLayout

IFormLayout createFormLayout()
Creates a new instance of IFormLayout.

Returns:
the IFormLayout
See Also:
IFormLayout

invokeLater

void invokeLater(Runnable pRunnable)
Causes pRunnable.run() to be executed asynchronously on the event dispatching thread. This will happen after all pending events have been processed. This method should be used when an application thread needs to update the GUI.

Parameters:
pRunnable - the asynchronous call
See Also:
invokeAndWait(Runnable)

invokeAndWait

void invokeAndWait(Runnable pRunnable)
                   throws Exception
Causes pRunnable.run() to be executed synchronously on the event dispatching thread. This call blocks until all pending events have been processed and (then) pRunnable.run() returns. This method should be used when an application thread needs to update the GUI.

Parameters:
pRunnable - the call
Throws:
Exception - if the call causes an exception

invokeInThread

void invokeInThread(Runnable pRunnable)
Causes pRunnable.run() to be executed asynchronously in a new thread. Action calls and UI Calls in the thread should be synchronized with the event dispatching thread by using invokeLater or invokeAndWait. To guarantee functionality of invokeLater in Threads, IFactory implementations should use InvokeLaterThread to create threads. The InvokeLaterThread calls all invokeLater notifications after the Thread. In thread loops InvokeLaterThread.executeInvokeLater can be called to invoke thread safe all invokeLater runnables immediate. This gives the IFactory implementation a chance to decide how and when to run the threads.

Parameters:
pRunnable - the call
See Also:
invokeAndWait(Runnable), invokeLater(Runnable)


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.