|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
---|
String[] getAvailableFontFamilyNames()
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.
String
containing font family names
localized for the default locale, or a suitable alternative
name if no name exists for this locale.IFont
,
IFont.getFamily()
IFont createFont(String pName, int pStyle, int pSize)
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.
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
IFont
IFont
,
getAvailableFontFamilyNames()
IColor createColor(int pRGBA)
pHasalpha
argument is false
, alpha
is defaulted to 255.
pRGBA
- the combined RGBA components
IColor
IColor
,
IColor.getRed()
,
IColor.getGreen()
,
IColor.getBlue()
,
IColor.getAlpha()
,
IColor.getRGBA()
IColor getSystemColor(String pType)
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.
pType
- the color type.
IColor
IColor
void setSystemColor(String pType, IColor pSystemColor)
IColor
as SystemColor.
If pSystemColor
is null
the
original SystemColor
is restored.
pType
- the color type.pSystemColor
- the IColor
IColor
ICursor getPredefinedCursor(int pType)
ICursor
object with the specified type.
pType
- the type of cursor
ICursor
ICursor
ICursor getSystemCustomCursor(String pCursorName)
ICursor
object matching the
specified name. Cursor names are, for example: "Invalid.16x16"
pCursorName
- a string describing the desired system-specific custom cursor
ICursor
IImage getImage(String pImageName)
pImageName
- the name of a resource containing pixel data
in a recognized file format.
IImage
which gets its pixel data from
the specified file.IImage
IImage getImage(String pImageName, byte[] pData)
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
String getImageMapping(String pMappingName)
pMappingName
- the mapping name.
void setImageMapping(String pMappingName, String pImageName)
pMappingName
- the mapping name.pImageName
- the image name.String[] getImageMappingNames()
IPoint createPoint(int pX, int pY)
IPoint
with the given x and y.
pX
- the x valuepY
- the y value
IPoint
IPoint
IDimension createDimension(int pWidth, int pHeight)
IDimension
with the given with and height.
pWidth
- the widthpHeight
- the height
IDimension
IDimension
IRectangle createRectangle(int pX, int pY, int pWidth, int pHeight)
IRectangle
with the given x, y, width and height.
pX
- the x valuepY
- the y valuepWidth
- the widthpHeight
- the height
IRectangle
IRectangle
IInsets createInsets(int pTop, int pLeft, int pBottom, int pRight)
IInsets
.
pTop
- the toppLeft
- the leftpBottom
- the bottompRight
- the right
IInsets
IInsets
ILabel createLabel()
ILabel
.
ILabel
ILabel
ITextField createTextField()
ITextField
.
ITextField
ITextField
IPasswordField createPasswordField()
IPasswordField
.
IPasswordField
IPasswordField
ITextArea createTextArea()
ITextArea
.
ITextArea
ITextArea
IIcon createIcon()
IIcon
.
IIcon
IIcon
IButton createButton()
IButton
.
IButton
IButton
IToggleButton createToggleButton()
IToggleButton
.
IToggleButton
IToggleButton
ICheckBox createCheckBox()
ICheckBox
.
ICheckBox
ICheckBox
IRadioButton createRadioButton()
IRadioButton
.
IRadioButton
IRadioButton
IMenuItem createMenuItem()
IMenuItem
.
IMenuItem
IMenuItem
ISeparator createSeparator()
ISeparator
.
ISeparator
ISeparator
ICheckBoxMenuItem createCheckBoxMenuItem()
ICheckBoxMenuItem
.
ICheckBoxMenuItem
ICheckBoxMenuItem
IMenu createMenu()
IMenu
.
IMenu
IMenu
IMenuBar createMenuBar()
IMenuBar
.
IMenuBar
IMenuBar
IPopupMenu createPopupMenu()
IPopupMenu
.
IPopupMenu
IPopupMenu
ITable createTable()
ITable
.
ITable
ITable
ITree createTree()
ITree
.
ITree
ITree
IChart createChart()
IChart
.
IChart
IChart
ICellFormat createCellFormat(IColor pBackground, IColor pForeground, IFont pFont, IImage pImage, int pLeftIndent)
ICellFormat
.
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.
ICellFormat
ICellFormat
IEditor createEditor()
IEditor
.
IEditor
IEditor
ICellEditor getDefaultCellEditor(Class<?> pClass)
ICellEditor
for the given class.
This function should always return an editor.
It should look for best matching editor with Class.isAssignableFrom.
pClass
- the class type to be edited.
ICellEditor
ICellEditor
void setDefaultCellEditor(Class<?> pClass, ICellEditor pCellEditor)
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.
pClass
- the class type to be edited.pCellEditor
- the ICellEditor
ICellEditor
IImageViewer createImageViewer()
IImageViewer
.
IImageViewer
IImageViewer
IChoiceCellEditor createChoiceCellEditor()
IChoiceCellEditor
.
IChoiceCellEditor
IChoiceCellEditor
IDateCellEditor createDateCellEditor()
IDateCellEditor
.
IDateCellEditor
IDateCellEditor
ILinkedCellEditor createLinkedCellEditor()
ILinkedCellEditor
.
ILinkedCellEditor
ILinkedCellEditor
INumberCellEditor createNumberCellEditor()
INumberCellEditor
.
INumberCellEditor
INumberCellEditor
ITextCellEditor createTextCellEditor()
ITextCellEditor
.
ITextCellEditor
ITextCellEditor
IPanel createPanel()
IPanel
.
IPanel
IPanel
IToolBarPanel createToolBarPanel()
IToolBarPanel
.
IToolBarPanel
IToolBarPanel
IGroupPanel createGroupPanel()
IGroupPanel
.
IGroupPanel
IGroupPanel
IScrollPanel createScrollPanel()
IScrollPanel
.
IScrollPanel
IScrollPanel
ISplitPanel createSplitPanel()
ISplitPanel
.
ISplitPanel
ISplitPanel
ITabsetPanel createTabsetPanel()
ITabsetPanel
.
ITabsetPanel
ITabsetPanel
IToolBar createToolBar()
IToolBar
.
IToolBar
IToolBar
IDesktopPanel createDesktopPanel()
IDesktopPanel
.
IDesktopPanel
IDesktopPanel
IInternalFrame createInternalFrame(IDesktopPanel pDesktop)
IInternalFrame
.
pDesktop
- the associated desktop for the internal frame
IInternalFrame
IInternalFrame
IWindow createWindow()
IWindow
.
IWindow
IWindow
IFrame createFrame()
IFrame
.
IFrame
IFrame
IComponent createCustomComponent(Object pCustomComponent)
pCustomComponent
- the custom Component.
IComponent
custom component.IContainer createCustomContainer(Object pCustomContainer)
pCustomContainer
- the custom Container.
IContainer
custom container.IBorderLayout createBorderLayout()
IBorderLayout
.
IBorderLayout
IBorderLayout
IFlowLayout createFlowLayout()
IFlowLayout
.
IFlowLayout
IFlowLayout
IFormLayout createFormLayout()
IFormLayout
.
IFormLayout
IFormLayout
void invokeLater(Runnable pRunnable)
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.
pRunnable
- the asynchronous callinvokeAndWait(Runnable)
void invokeAndWait(Runnable pRunnable) throws Exception
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.
pRunnable
- the call
Exception
- if the call causes an exceptionvoid invokeInThread(Runnable pRunnable)
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.
pRunnable
- the callinvokeAndWait(Runnable)
,
invokeLater(Runnable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |