|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.rad.ui.AbstractFactory
com.sibvisions.rad.ui.awt.impl.AwtFactory
com.sibvisions.rad.ui.swing.impl.SwingFactory
public class SwingFactory
The SwingFactory class encapsulates methods to
create and access Swing components.
AwtFactory| Field Summary |
|---|
| Fields inherited from class com.sibvisions.rad.ui.AbstractFactory |
|---|
properties |
| Constructor Summary | |
|---|---|
SwingFactory()
Creates a new instance of SwingFactory. |
|
| 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,
Style pStyle,
int pLeftIndent)
Creates a new instance of ICellFormat. |
IChart |
createChart()
Creates a new instance of IChart. |
ICheckBox |
createCheckBox()
Creates a new instance of ICheckBox. |
ICheckBoxCellEditor |
createCheckBoxCellEditor()
Creates a new instance of ICheckBoxCellEditor. |
ICheckBoxMenuItem |
createCheckBoxMenuItem()
Creates a new instance of ICheckBoxMenuItem. |
IChoiceCellEditor |
createChoiceCellEditor()
Creates a new instance of IChoiceCellEditor. |
IComponent |
createCustomComponent(java.lang.Object pCustomComponent)
Creates a new Instance of IComponent that contains any Custom Component. |
IContainer |
createCustomContainer(java.lang.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. |
IEditor |
createEditor()
Creates a new instance of IEditor. |
IFlowLayout |
createFlowLayout()
Creates a new instance of IFlowLayout. |
IFormLayout |
createFormLayout()
Creates a new instance of IFormLayout. |
IFrame |
createFrame()
Creates a new instance of IFrame. |
IGridLayout |
createGridLayout(int columns,
int rows)
Creates a new instance of IGridLayout. |
IGroupPanel |
createGroupPanel()
Creates a new instance of IGroupPanel. |
IIcon |
createIcon()
Creates a new instance of IIcon. |
IImageViewer |
createImageViewer()
Creates a new instance of IImageViewer. |
IInternalFrame |
createInternalFrame(IDesktopPanel pDesktopPanel)
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. |
IPopupMenu |
createPopupMenu()
Creates a new instance of IPopupMenu. |
IRadioButton |
createRadioButton()
Creates a new instance of IRadioButton. |
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. |
ICellEditor |
getDefaultCellEditor(java.lang.Class<?> pClass)
Gets the default ICellEditor for the given class. |
static int |
getHorizontalAlignment(int pAlign)
Gets the horizontal IAlignmentConstants alignment from given
JVxConstants alignment. |
static int |
getHorizontalSwingAlignment(int pAlign)
Gets the horizontal JVxConstants alignment from given
IAlignmentConstants alignment. |
IImage |
getImage(java.lang.String pImageName)
Searches the image if it is available as: File ClassLoader resource. |
IImage |
getImage(java.lang.String pImageName,
byte[] pData)
Creates an image from byte data. |
java.lang.String |
getImageMapping(java.lang.String pMappingName)
Gets the image name for the given mapping name. |
java.lang.String[] |
getImageMappingNames()
Gets all used mapping names. |
static Key |
getKey(javax.swing.KeyStroke pKeyStroke)
Gets the Key for a KeyStroke. |
static javax.swing.KeyStroke |
getKeyStroke(Key pKey)
Gets the KeyStroke for a Key. |
IColor |
getSystemColor(java.lang.String pType)
This encapsulate symbolic colors representing the color of native GUI objects on a system. |
static int |
getVerticalAlignment(int pAlign)
Gets the vertical IAlignmentConstants alignment from given
JVxConstants alignment. |
static int |
getVerticalSwingAlignment(int pAlign)
Gets the vertical JVxConstants alignment from given
IAlignmentConstants alignment. |
void |
invokeAndWait(java.lang.Runnable pRunnable)
Causes pRunnable.run() to be executed synchronously on the event dispatching thread. |
java.lang.Thread |
invokeInThread(java.lang.Runnable pRunnable)
Causes pRunnable.run() to be executed asynchronously in a new thread. |
void |
invokeLater(java.lang.Runnable pRunnable)
Causes pRunnable.run() to be executed asynchronously on the event dispatching thread. |
static boolean |
isLaFOpaque()
Gets whether the current Look and Feel draws its own background independent of the background color and opaque setting. |
void |
setDefaultCellEditor(java.lang.Class<?> pClass,
ICellEditor pCellEditor)
Sets the default ICellEditor for the given class. |
void |
setImageMapping(java.lang.String pMappingName,
java.lang.String pImageName)
Gets the image name for the given mapping name. |
static void |
setLookAndFeel(ILauncher pLauncher,
java.lang.String pClassName)
Sets the look and feel which decorates all components. |
void |
setSystemColor(java.lang.String pType,
IColor pSystemColor)
Sets the given IColor as SystemColor. |
| Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtFactory |
|---|
createColor, createDimension, createFont, createInsets, createPoint, createRectangle, getAvailableFontFamilyNames, getCurrentModifiers, getMostRecentEventTime, getPredefinedCursor, getSystemCustomCursor |
| Methods inherited from class com.sibvisions.rad.ui.AbstractFactory |
|---|
getProperty, setProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.rad.ui.IFactory |
|---|
getProperty, setProperty |
| Constructor Detail |
|---|
public SwingFactory()
SwingFactory.
| Method Detail |
|---|
public IColor getSystemColor(java.lang.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.
IColorIColor
public void setSystemColor(java.lang.String pType,
IColor pSystemColor)
IColor as SystemColor.
If pSystemColor is null the
original SystemColor is restored.
pType - the color type.pSystemColor - the IColorIColorpublic IImage getImage(java.lang.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
public IImage getImage(java.lang.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
public java.lang.String getImageMapping(java.lang.String pMappingName)
pMappingName - the mapping name.
public void setImageMapping(java.lang.String pMappingName,
java.lang.String pImageName)
pMappingName - the mapping name.pImageName - the image name.public java.lang.String[] getImageMappingNames()
public ILabel createLabel()
ILabel.
ILabelILabelpublic ITextField createTextField()
ITextField.
ITextFieldITextFieldpublic IPasswordField createPasswordField()
IPasswordField.
IPasswordFieldIPasswordFieldpublic ITextArea createTextArea()
ITextArea.
ITextAreaITextAreapublic IIcon createIcon()
IIcon.
IIconIIconpublic IButton createButton()
IButton.
IButtonIButtonpublic IToggleButton createToggleButton()
IToggleButton.
IToggleButtonIToggleButtonpublic ICheckBox createCheckBox()
ICheckBox.
ICheckBoxICheckBoxpublic IRadioButton createRadioButton()
IRadioButton.
IRadioButtonIRadioButtonpublic IMenuItem createMenuItem()
IMenuItem.
IMenuItemIMenuItempublic ICheckBoxMenuItem createCheckBoxMenuItem()
ICheckBoxMenuItem.
ICheckBoxMenuItemICheckBoxMenuItempublic IMenu createMenu()
IMenu.
IMenuIMenupublic IMenuBar createMenuBar()
IMenuBar.
IMenuBarIMenuBarpublic IPopupMenu createPopupMenu()
IPopupMenu.
IPopupMenuIPopupMenupublic ISeparator createSeparator()
ISeparator.
ISeparatorISeparatorpublic ITable createTable()
ITable.
ITableITablepublic ITree createTree()
ITree.
ITreeITreepublic IChart createChart()
IChart.
IChartIChart
public ICellFormat createCellFormat(IColor pBackground,
IColor pForeground,
IFont pFont,
IImage pImage,
Style pStyle,
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.pStyle - the style definition of the Cell.pLeftIndent - the left indent.
ICellFormatICellFormatpublic IEditor createEditor()
IEditor.
IEditorIEditorpublic ICellEditor getDefaultCellEditor(java.lang.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.
ICellEditorICellEditor
public void setDefaultCellEditor(java.lang.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 ICellEditorICellEditorpublic IImageViewer createImageViewer()
IImageViewer.
IImageViewerIImageViewerpublic IChoiceCellEditor createChoiceCellEditor()
IChoiceCellEditor.
IChoiceCellEditorIChoiceCellEditorpublic ICheckBoxCellEditor createCheckBoxCellEditor()
ICheckBoxCellEditor.
ICheckBoxCellEditorICheckBoxCellEditorpublic IDateCellEditor createDateCellEditor()
IDateCellEditor.
IDateCellEditorIDateCellEditorpublic ILinkedCellEditor createLinkedCellEditor()
ILinkedCellEditor.
ILinkedCellEditorILinkedCellEditorpublic INumberCellEditor createNumberCellEditor()
INumberCellEditor.
INumberCellEditorINumberCellEditorpublic ITextCellEditor createTextCellEditor()
ITextCellEditor.
ITextCellEditorITextCellEditorpublic IPanel createPanel()
IPanel.
IPanelIPanelpublic IToolBarPanel createToolBarPanel()
IToolBarPanel.
IToolBarPanelIToolBarPanelpublic IGroupPanel createGroupPanel()
IGroupPanel.
IGroupPanelIGroupPanelpublic IScrollPanel createScrollPanel()
IScrollPanel.
IScrollPanelIScrollPanelpublic ISplitPanel createSplitPanel()
ISplitPanel.
ISplitPanelISplitPanelpublic ITabsetPanel createTabsetPanel()
ITabsetPanel.
ITabsetPanelITabsetPanelpublic IToolBar createToolBar()
IToolBar.
IToolBarIToolBarpublic IDesktopPanel createDesktopPanel()
IDesktopPanel.
IDesktopPanelIDesktopPanelpublic IInternalFrame createInternalFrame(IDesktopPanel pDesktopPanel)
IInternalFrame.
pDesktopPanel - the associated desktop for the internal frame
IInternalFrameIInternalFramepublic IWindow createWindow()
IWindow.
IWindowIWindowpublic IFrame createFrame()
IFrame.
IFrameIFramepublic IComponent createCustomComponent(java.lang.Object pCustomComponent)
createCustomComponent in interface IFactorycreateCustomComponent in class AwtFactorypCustomComponent - the custom Component.
IComponent custom component.public IContainer createCustomContainer(java.lang.Object pCustomContainer)
createCustomContainer in interface IFactorycreateCustomContainer in class AwtFactorypCustomContainer - the custom Container.
IContainer custom container.public IBorderLayout createBorderLayout()
IBorderLayout.
IBorderLayoutIBorderLayoutpublic IFlowLayout createFlowLayout()
IFlowLayout.
IFlowLayoutIFlowLayoutpublic IFormLayout createFormLayout()
IFormLayout.
IFormLayoutIFormLayout
public IGridLayout createGridLayout(int columns,
int rows)
IGridLayout.
columns - the column countrows - the row count
IGridLayoutIGridLayoutpublic void invokeLater(java.lang.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 callIFactory.invokeAndWait(Runnable)
public void invokeAndWait(java.lang.Runnable pRunnable)
throws java.lang.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
java.lang.Exception - if the call causes an exceptionpublic java.lang.Thread invokeInThread(java.lang.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 call
Thread in which the Runnable is being executed, the Thread is already running.IFactory.invokeAndWait(Runnable),
IFactory.invokeLater(Runnable)public static int getVerticalAlignment(int pAlign)
IAlignmentConstants alignment from given
JVxConstants alignment.
pAlign - the alignment from JVxConstants
IAlignmentConstantspublic static int getVerticalSwingAlignment(int pAlign)
JVxConstants alignment from given
IAlignmentConstants alignment.
pAlign - the alignment from IAlignmentConstants
JComponentpublic static int getHorizontalAlignment(int pAlign)
IAlignmentConstants alignment from given
JVxConstants alignment.
pAlign - the alignment from JVxConstants
IAlignmentConstantspublic static int getHorizontalSwingAlignment(int pAlign)
JVxConstants alignment from given
IAlignmentConstants alignment.
pAlign - the alignment from IAlignmentConstants
JComponent
public static void setLookAndFeel(ILauncher pLauncher,
java.lang.String pClassName)
pLauncher - the launcher for which the LaF should be changedpClassName - the full qualified class name of the look and feelpublic static javax.swing.KeyStroke getKeyStroke(Key pKey)
KeyStroke for a Key.
pKey - the UI Key
KeyStrokepublic static Key getKey(javax.swing.KeyStroke pKeyStroke)
Key for a KeyStroke.
pKeyStroke - the swing KeyStroke
Keypublic static boolean isLaFOpaque()
true whether the LaF has its own opaque drawing mechanism
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||