|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.rad.ui.qt.impl.QtFactory
public class QtFactory
The QtFactory class encapsulates methods to
create and access QT components.
| Constructor Summary | |
|---|---|
QtFactory()
|
|
| 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)
Creates a new instance of ICellFormat. |
static ICellFormatter |
createCellFormatter(Object pCellFormatter,
String pMethodName)
Creates a cell formatter instance with the given object and method name. |
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 pRgb)
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. |
static IFileHandleReceiver |
createFileHandleReceiver(Object pFileHandleReceiver,
String pMethodName)
Creates a file handle receiver instance with the given object and method name. |
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. |
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. |
static QAction |
getActionAt(IContainer pContainer,
int pIndex)
Gets the action near a specific index of a menu or menubar. |
static int |
getAlignment(Qt.AlignmentFlag pAlignment)
Gets the IAlignmentConstants value from a given Qt.AlignmentFlag. |
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. |
static Qt.AlignmentFlag |
getHorizontalQtAlignment(int pAlign)
Gets the horizontal Qt.AlignmentFlag alignment from given
IAlignmentConstants alignment. |
IImage |
getImage(String pImageName)
Searches the image if it is available as:
|
IImage |
getImage(String pImageName,
byte[] byData)
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. |
static int |
getJavaModifiers(QInputEvent pEvent)
Translates a QT modifier mask to the expected java modifier mask. |
ICursor |
getPredefinedCursor(int pType)
Gets a ICursor object with the specified type. |
static QKeySequence |
getQtShortcut(Key pKey)
Gets the QT Shortcut key sequence for a Key. |
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. |
static Qt.AlignmentFlag |
getVerticalQtAlignment(int pAlign)
Gets the vertical Qt.AlignmentFlag alignment from given
IAlignmentConstants alignment. |
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. |
static void |
setLayout(QWidget pWidget,
ILayout pLayout)
Sets/Changes the layout of a widget. |
static void |
setLookAndFeel(String pClassName)
Sets the look and feel (style) for the application. |
void |
setSystemColor(String pType,
IColor pDefaultAlternateColor)
Sets the given IColor as SystemColor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public QtFactory()
| Method Detail |
|---|
public IBorderLayout createBorderLayout()
IBorderLayout.
createBorderLayout in interface IFactoryIBorderLayoutIBorderLayoutpublic IFlowLayout createFlowLayout()
IFlowLayout.
createFlowLayout in interface IFactoryIFlowLayoutIFlowLayoutpublic IFormLayout createFormLayout()
IFormLayout.
createFormLayout in interface IFactoryIFormLayoutIFormLayoutpublic IButton createButton()
IButton.
createButton in interface IFactoryIButtonIButtonpublic IToggleButton createToggleButton()
IToggleButton.
createToggleButton in interface IFactoryIToggleButtonIToggleButtonpublic IIcon createIcon()
IIcon.
createIcon in interface IFactoryIIconIIconpublic ICheckBox createCheckBox()
ICheckBox.
createCheckBox in interface IFactoryICheckBoxICheckBoxpublic IRadioButton createRadioButton()
IRadioButton.
createRadioButton in interface IFactoryIRadioButtonIRadioButtonpublic ITextField createTextField()
ITextField.
createTextField in interface IFactoryITextFieldITextFieldpublic IPasswordField createPasswordField()
IPasswordField.
createPasswordField in interface IFactoryIPasswordFieldIPasswordFieldpublic ITextArea createTextArea()
ITextArea.
createTextArea in interface IFactoryITextAreaITextAreapublic IMenuBar createMenuBar()
IMenuBar.
createMenuBar in interface IFactoryIMenuBarIMenuBarpublic IPopupMenu createPopupMenu()
IPopupMenu.
createPopupMenu in interface IFactoryIPopupMenuIPopupMenupublic IMenu createMenu()
IMenu.
createMenu in interface IFactoryIMenuIMenupublic IMenuItem createMenuItem()
IMenuItem.
createMenuItem in interface IFactoryIMenuItemIMenuItempublic ICheckBoxMenuItem createCheckBoxMenuItem()
ICheckBoxMenuItem.
createCheckBoxMenuItem in interface IFactoryICheckBoxMenuItemICheckBoxMenuItempublic IToolBar createToolBar()
IToolBar.
createToolBar in interface IFactoryIToolBarIToolBarpublic IToolBarPanel createToolBarPanel()
IToolBarPanel.
createToolBarPanel in interface IFactoryIToolBarPanelIToolBarPanelpublic IWindow createWindow()
IWindow.
createWindow in interface IFactoryIWindowIWindowpublic IFrame createFrame()
IFrame.
createFrame in interface IFactoryIFrameIFramepublic IPanel createPanel()
IPanel.
createPanel in interface IFactoryIPanelIPanelpublic IGroupPanel createGroupPanel()
IGroupPanel.
createGroupPanel in interface IFactoryIGroupPanelIGroupPanelpublic ISplitPanel createSplitPanel()
ISplitPanel.
createSplitPanel in interface IFactoryISplitPanelISplitPanelpublic IDesktopPanel createDesktopPanel()
IDesktopPanel.
createDesktopPanel in interface IFactoryIDesktopPanelIDesktopPanelpublic IInternalFrame createInternalFrame(IDesktopPanel pDesktop)
IInternalFrame.
createInternalFrame in interface IFactorypDesktop - the associated desktop for the internal frame
IInternalFrameIInternalFramepublic ITable createTable()
ITable.
createTable in interface IFactoryITableITablepublic ITree createTree()
ITree.
createTree in interface IFactoryITreeITreepublic ITabsetPanel createTabsetPanel()
ITabsetPanel.
createTabsetPanel in interface IFactoryITabsetPanelITabsetPanelpublic IEditor createEditor()
IEditor.
createEditor in interface IFactoryIEditorIEditorpublic ITextCellEditor createTextCellEditor()
ITextCellEditor.
createTextCellEditor in interface IFactoryITextCellEditorITextCellEditorpublic INumberCellEditor createNumberCellEditor()
INumberCellEditor.
createNumberCellEditor in interface IFactoryINumberCellEditorINumberCellEditorpublic IDateCellEditor createDateCellEditor()
IDateCellEditor.
createDateCellEditor in interface IFactoryIDateCellEditorIDateCellEditorpublic IImageViewer createImageViewer()
IImageViewer.
createImageViewer in interface IFactoryIImageViewerIImageViewerpublic IChoiceCellEditor createChoiceCellEditor()
IChoiceCellEditor.
createChoiceCellEditor in interface IFactoryIChoiceCellEditorIChoiceCellEditorpublic ILinkedCellEditor createLinkedCellEditor()
ILinkedCellEditor.
createLinkedCellEditor in interface IFactoryILinkedCellEditorILinkedCellEditor
public ICellFormat createCellFormat(IColor pBackground,
IColor pForeground,
IFont pFont)
ICellFormat.
createCellFormat in interface IFactorypBackground - the background of the Cell.pForeground - the foreground of the Cell.pFont - the font of the Cell.
ICellFormatICellFormatpublic IColor createColor(int pRgb)
pHasalpha argument is false, alpha
is defaulted to 255.
createColor in interface IFactorypRgb - the combined RGBA components
IColorIColor,
IColor.getRed(),
IColor.getGreen(),
IColor.getBlue(),
IColor.getAlpha(),
IColor.getRGBA()public ILabel createLabel()
ILabel.
createLabel in interface IFactoryILabelILabel
public IDimension createDimension(int pWidth,
int pHeight)
IDimension with the given with and height.
createDimension in interface IFactorypWidth - the widthpHeight - the height
IDimensionIDimension
public IInsets createInsets(int pTop,
int pLeft,
int pBottom,
int pRight)
IInsets.
createInsets in interface IFactorypTop - the toppLeft - the leftpBottom - the bottompRight - the right
IInsetsIInsets
public IPoint createPoint(int pX,
int pY)
IPoint with the given x and y.
createPoint in interface IFactorypX - the x valuepY - the y value
IPointIPoint
public IRectangle createRectangle(int pX,
int pY,
int pWidth,
int pHeight)
IRectangle with the given x, y, width and height.
createRectangle in interface IFactorypX - the x valuepY - the y valuepWidth - the widthpHeight - the height
IRectangleIRectanglepublic 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.
getAvailableFontFamilyNames in interface IFactoryString containing font family names
localized for the default locale, or a suitable alternative
name if no name exists for this locale.IFont,
IFont.getFamily()public IImage getImage(String pImageName)
getImage in interface IFactorypImageName - 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(String pImageName,
byte[] byData)
getImage in interface IFactorypImageName - 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.byData - the image data
public String getImageMapping(String pMappingName)
getImageMapping in interface IFactorypMappingName - the mapping name.
public void setImageMapping(String pMappingName,
String pImageName)
setImageMapping in interface IFactorypMappingName - the mapping name.pImageName - the image name.public String[] getImageMappingNames()
getImageMappingNames in interface IFactory
public 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.
createFont in interface IFactorypName - 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
IFontIFont,
IFactory.getAvailableFontFamilyNames()public ICursor getPredefinedCursor(int pType)
ICursor object with the specified type.
getPredefinedCursor in interface IFactorypType - the type of cursor
ICursorICursorpublic ICursor getSystemCustomCursor(String pCursorName)
ICursor object matching the
specified name. Cursor names are, for example: "Invalid.16x16"
getSystemCustomCursor in interface IFactorypCursorName - a string describing the desired system-specific custom cursor
ICursor
public void setSystemColor(String pType,
IColor pDefaultAlternateColor)
IColor as SystemColor.
If pSystemColor is null the
original SystemColor is restored.
setSystemColor in interface IFactorypType - the color type.pDefaultAlternateColor - the IColorIColorpublic 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.
getSystemColor in interface IFactorypType - the color type.
IColorIColorpublic 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.
getDefaultCellEditor in interface IFactorypClass - the class type to be edited.
ICellEditorICellEditor
public 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.
setDefaultCellEditor in interface IFactorypClass - the class type to be edited.pCellEditor - the ICellEditorICellEditorpublic IComponent createCustomComponent(Object pCustomComponent)
createCustomComponent in interface IFactorypCustomComponent - the custom Component.
IComponent custom component.public IContainer createCustomContainer(Object pCustomContainer)
createCustomContainer in interface IFactorypCustomContainer - the custom Container.
IContainer custom container.public 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.
invokeLater in interface IFactorypRunnable - the asynchronous callIFactory.invokeAndWait(Runnable)public void invokeAndWait(Runnable pRunnable)
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.
invokeAndWait in interface IFactorypRunnable - the callpublic void 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.
This gives the IFactory implementation a chance to decide how and when to run the threads.
invokeInThread in interface IFactorypRunnable - the callIFactory.invokeAndWait(Runnable),
IFactory.invokeLater(Runnable)public static int getJavaModifiers(QInputEvent pEvent)
pEvent - the QT input event
public static QKeySequence getQtShortcut(Key pKey)
Key.
pKey - the Key
public static QAction getActionAt(IContainer pContainer,
int pIndex)
pContainer - the QtMenu or QtMenuBarpIndex - the action index
QAction near the specified index or null
if the index is invalid or there is no action availablepublic static Qt.AlignmentFlag getVerticalQtAlignment(int pAlign)
Qt.AlignmentFlag alignment from given
IAlignmentConstants alignment.
pAlign - the alignment from IAlignmentConstants
Qt.AlignmentFlagpublic static Qt.AlignmentFlag getHorizontalQtAlignment(int pAlign)
Qt.AlignmentFlag alignment from given
IAlignmentConstants alignment.
pAlign - the alignment from IAlignmentConstants
Qt.AlignmentFlagpublic static int getAlignment(Qt.AlignmentFlag pAlignment)
IAlignmentConstants value from a given Qt.AlignmentFlag.
pAlignment - the Qt.AlignmentFlag
IAlignmentConstantspublic static void setLookAndFeel(String pClassName)
pClassName - the full qualified style class e.g. com.trolltech.qt.gui.PlastiqueStyle
public static ICellFormatter createCellFormatter(Object pCellFormatter,
String pMethodName)
pCellFormatter - the object.pMethodName - the method name.
public static IFileHandleReceiver createFileHandleReceiver(Object pFileHandleReceiver,
String pMethodName)
pFileHandleReceiver - the object.pMethodName - the method name.
public static void setLayout(QWidget pWidget,
ILayout pLayout)
pWidget - the widget to change/set the layoutpLayout - a layout
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||