com.sibvisions.rad.ui.qt.impl
Class QtFactory

java.lang.Object
  extended by com.sibvisions.rad.ui.qt.impl.QtFactory
All Implemented Interfaces:
IFactory

public class QtFactory
extends Object
implements IFactory

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:
  • File
  • ClassLoader
resource.
 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

QtFactory

public QtFactory()
Method Detail

createBorderLayout

public IBorderLayout createBorderLayout()
Creates a new instance of IBorderLayout.

Specified by:
createBorderLayout in interface IFactory
Returns:
the IBorderLayout
See Also:
IBorderLayout

createFlowLayout

public IFlowLayout createFlowLayout()
Creates a new instance of IFlowLayout.

Specified by:
createFlowLayout in interface IFactory
Returns:
the IFlowLayout
See Also:
IFlowLayout

createFormLayout

public IFormLayout createFormLayout()
Creates a new instance of IFormLayout.

Specified by:
createFormLayout in interface IFactory
Returns:
the IFormLayout
See Also:
IFormLayout

createButton

public IButton createButton()
Creates a new instance of IButton.

Specified by:
createButton in interface IFactory
Returns:
the IButton
See Also:
IButton

createToggleButton

public IToggleButton createToggleButton()
Creates a new instance of IToggleButton.

Specified by:
createToggleButton in interface IFactory
Returns:
the IToggleButton
See Also:
IToggleButton

createIcon

public IIcon createIcon()
Creates a new instance of IIcon.

Specified by:
createIcon in interface IFactory
Returns:
the IIcon
See Also:
IIcon

createCheckBox

public ICheckBox createCheckBox()
Creates a new instance of ICheckBox.

Specified by:
createCheckBox in interface IFactory
Returns:
the ICheckBox
See Also:
ICheckBox

createRadioButton

public IRadioButton createRadioButton()
Creates a new instance of IRadioButton.

Specified by:
createRadioButton in interface IFactory
Returns:
the IRadioButton
See Also:
IRadioButton

createTextField

public ITextField createTextField()
Creates a new instance of ITextField.

Specified by:
createTextField in interface IFactory
Returns:
the ITextField
See Also:
ITextField

createPasswordField

public IPasswordField createPasswordField()
Creates a new instance of IPasswordField.

Specified by:
createPasswordField in interface IFactory
Returns:
the IPasswordField
See Also:
IPasswordField

createTextArea

public ITextArea createTextArea()
Creates a new instance of ITextArea.

Specified by:
createTextArea in interface IFactory
Returns:
the ITextArea
See Also:
ITextArea

createMenuBar

public IMenuBar createMenuBar()
Creates a new instance of IMenuBar.

Specified by:
createMenuBar in interface IFactory
Returns:
the IMenuBar
See Also:
IMenuBar

createPopupMenu

public IPopupMenu createPopupMenu()
Creates a new instance of IPopupMenu.

Specified by:
createPopupMenu in interface IFactory
Returns:
the IPopupMenu
See Also:
IPopupMenu

createMenu

public IMenu createMenu()
Creates a new instance of IMenu.

Specified by:
createMenu in interface IFactory
Returns:
the IMenu
See Also:
IMenu

createMenuItem

public IMenuItem createMenuItem()
Creates a new instance of IMenuItem.

Specified by:
createMenuItem in interface IFactory
Returns:
the IMenuItem
See Also:
IMenuItem

createCheckBoxMenuItem

public ICheckBoxMenuItem createCheckBoxMenuItem()
Creates a new instance of ICheckBoxMenuItem.

Specified by:
createCheckBoxMenuItem in interface IFactory
Returns:
the ICheckBoxMenuItem
See Also:
ICheckBoxMenuItem

createToolBar

public IToolBar createToolBar()
Creates a new instance of IToolBar.

Specified by:
createToolBar in interface IFactory
Returns:
the IToolBar
See Also:
IToolBar

createToolBarPanel

public IToolBarPanel createToolBarPanel()
Creates a new instance of IToolBarPanel.

Specified by:
createToolBarPanel in interface IFactory
Returns:
the IToolBarPanel
See Also:
IToolBarPanel

createWindow

public IWindow createWindow()
Creates a new instance of IWindow.

Specified by:
createWindow in interface IFactory
Returns:
the IWindow
See Also:
IWindow

createFrame

public IFrame createFrame()
Creates a new instance of IFrame.

Specified by:
createFrame in interface IFactory
Returns:
the IFrame
See Also:
IFrame

createPanel

public IPanel createPanel()
Creates a new instance of IPanel.

Specified by:
createPanel in interface IFactory
Returns:
the IPanel
See Also:
IPanel

createGroupPanel

public IGroupPanel createGroupPanel()
Creates a new instance of IGroupPanel.

Specified by:
createGroupPanel in interface IFactory
Returns:
the IGroupPanel
See Also:
IGroupPanel

createSplitPanel

public ISplitPanel createSplitPanel()
Creates a new instance of ISplitPanel.

Specified by:
createSplitPanel in interface IFactory
Returns:
the ISplitPanel
See Also:
ISplitPanel

createDesktopPanel

public IDesktopPanel createDesktopPanel()
Creates a new instance of IDesktopPanel.

Specified by:
createDesktopPanel in interface IFactory
Returns:
the IDesktopPanel
See Also:
IDesktopPanel

createInternalFrame

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

Specified by:
createInternalFrame in interface IFactory
Parameters:
pDesktop - the associated desktop for the internal frame
Returns:
the IInternalFrame
See Also:
IInternalFrame

createTable

public ITable createTable()
Creates a new instance of ITable.

Specified by:
createTable in interface IFactory
Returns:
the ITable
See Also:
ITable

createTree

public ITree createTree()
Creates a new instance of ITree.

Specified by:
createTree in interface IFactory
Returns:
the ITree
See Also:
ITree

createTabsetPanel

public ITabsetPanel createTabsetPanel()
Creates a new instance of ITabsetPanel.

Specified by:
createTabsetPanel in interface IFactory
Returns:
the ITabsetPanel
See Also:
ITabsetPanel

createEditor

public IEditor createEditor()
Creates a new instance of IEditor.

Specified by:
createEditor in interface IFactory
Returns:
the IEditor
See Also:
IEditor

createTextCellEditor

public ITextCellEditor createTextCellEditor()
Creates a new instance of ITextCellEditor.

Specified by:
createTextCellEditor in interface IFactory
Returns:
the ITextCellEditor
See Also:
ITextCellEditor

createNumberCellEditor

public INumberCellEditor createNumberCellEditor()
Creates a new instance of INumberCellEditor.

Specified by:
createNumberCellEditor in interface IFactory
Returns:
the INumberCellEditor
See Also:
INumberCellEditor

createDateCellEditor

public IDateCellEditor createDateCellEditor()
Creates a new instance of IDateCellEditor.

Specified by:
createDateCellEditor in interface IFactory
Returns:
the IDateCellEditor
See Also:
IDateCellEditor

createImageViewer

public IImageViewer createImageViewer()
Creates a new instance of IImageViewer.

Specified by:
createImageViewer in interface IFactory
Returns:
the IImageViewer
See Also:
IImageViewer

createChoiceCellEditor

public IChoiceCellEditor createChoiceCellEditor()
Creates a new instance of IChoiceCellEditor.

Specified by:
createChoiceCellEditor in interface IFactory
Returns:
the IChoiceCellEditor
See Also:
IChoiceCellEditor

createLinkedCellEditor

public ILinkedCellEditor createLinkedCellEditor()
Creates a new instance of ILinkedCellEditor.

Specified by:
createLinkedCellEditor in interface IFactory
Returns:
the ILinkedCellEditor
See Also:
ILinkedCellEditor

createCellFormat

public ICellFormat createCellFormat(IColor pBackground,
                                    IColor pForeground,
                                    IFont pFont)
Creates a new instance of ICellFormat.

Specified by:
createCellFormat in interface IFactory
Parameters:
pBackground - the background of the Cell.
pForeground - the foreground of the Cell.
pFont - the font of the Cell.
Returns:
the ICellFormat
See Also:
ICellFormat

createColor

public 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. If the pHasalpha argument is false, alpha is defaulted to 255.

Specified by:
createColor in interface IFactory
Parameters:
pRgb - the combined RGBA components
Returns:
the IColor
See Also:
IColor, IColor.getRed(), IColor.getGreen(), IColor.getBlue(), IColor.getAlpha(), IColor.getRGBA()

createLabel

public ILabel createLabel()
Creates a new instance of ILabel.

Specified by:
createLabel in interface IFactory
Returns:
the ILabel
See Also:
ILabel

createDimension

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

Specified by:
createDimension in interface IFactory
Parameters:
pWidth - the width
pHeight - the height
Returns:
the IDimension
See Also:
IDimension

createInsets

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

Specified by:
createInsets in interface IFactory
Parameters:
pTop - the top
pLeft - the left
pBottom - the bottom
pRight - the right
Returns:
the IInsets
See Also:
IInsets

createPoint

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

Specified by:
createPoint in interface IFactory
Parameters:
pX - the x value
pY - the y value
Returns:
the IPoint
See Also:
IPoint

createRectangle

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

Specified by:
createRectangle in interface IFactory
Parameters:
pX - the x value
pY - the y value
pWidth - the width
pHeight - the height
Returns:
the IRectangle
See Also:
IRectangle

getAvailableFontFamilyNames

public 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.

Specified by:
getAvailableFontFamilyNames in interface IFactory
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()

getImage

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

Specified by:
getImage in interface IFactory
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

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

Specified by:
getImage in interface IFactory
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.
byData - the image data
Returns:
the image created from the byte data

getImageMapping

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

Specified by:
getImageMapping in interface IFactory
Parameters:
pMappingName - the mapping name.
Returns:
the image name.

setImageMapping

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

Specified by:
setImageMapping in interface IFactory
Parameters:
pMappingName - the mapping name.
pImageName - the image name.

getImageMappingNames

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

Specified by:
getImageMappingNames in interface IFactory
Returns:
the mapping names.

createFont

public 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.

Specified by:
createFont in interface IFactory
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, IFactory.getAvailableFontFamilyNames()

getPredefinedCursor

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

Specified by:
getPredefinedCursor in interface IFactory
Parameters:
pType - the type of cursor
Returns:
the ICursor
See Also:
ICursor

getSystemCustomCursor

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

Specified by:
getSystemCustomCursor in interface IFactory
Parameters:
pCursorName - a string describing the desired system-specific custom cursor
Returns:
the system specific custom cursor named
See Also:
ICursor

setSystemColor

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

Specified by:
setSystemColor in interface IFactory
Parameters:
pType - the color type.
pDefaultAlternateColor - the IColor
See Also:
IColor

getSystemColor

public 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.

Specified by:
getSystemColor in interface IFactory
Parameters:
pType - the color type.
Returns:
the IColor
See Also:
IColor

getDefaultCellEditor

public 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.

Specified by:
getDefaultCellEditor in interface IFactory
Parameters:
pClass - the class type to be edited.
Returns:
the ICellEditor
See Also:
ICellEditor

setDefaultCellEditor

public 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.

Specified by:
setDefaultCellEditor in interface IFactory
Parameters:
pClass - the class type to be edited.
pCellEditor - the ICellEditor
See Also:
ICellEditor

createCustomComponent

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

Specified by:
createCustomComponent in interface IFactory
Parameters:
pCustomComponent - the custom Component.
Returns:
the IComponent custom component.

createCustomContainer

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

Specified by:
createCustomContainer in interface IFactory
Parameters:
pCustomContainer - the custom Container.
Returns:
the IContainer custom container.

invokeLater

public 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.

Specified by:
invokeLater in interface IFactory
Parameters:
pRunnable - the asynchronous call
See Also:
IFactory.invokeAndWait(Runnable)

invokeAndWait

public void invokeAndWait(Runnable pRunnable)
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.

Specified by:
invokeAndWait in interface IFactory
Parameters:
pRunnable - the call

invokeInThread

public 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. This gives the IFactory implementation a chance to decide how and when to run the threads.

Specified by:
invokeInThread in interface IFactory
Parameters:
pRunnable - the call
See Also:
IFactory.invokeAndWait(Runnable), IFactory.invokeLater(Runnable)

getJavaModifiers

public static int getJavaModifiers(QInputEvent pEvent)
Translates a QT modifier mask to the expected java modifier mask.

Parameters:
pEvent - the QT input event
Returns:
the java modifier mask

getQtShortcut

public static QKeySequence getQtShortcut(Key pKey)
Gets the QT Shortcut key sequence for a Key.

Parameters:
pKey - the Key
Returns:
the QT shortcut key

getActionAt

public static QAction getActionAt(IContainer pContainer,
                                  int pIndex)
Gets the action near a specific index of a menu or menubar.

Parameters:
pContainer - the QtMenu or QtMenuBar
pIndex - the action index
Returns:
the QAction near the specified index or null if the index is invalid or there is no action available

getVerticalQtAlignment

public static Qt.AlignmentFlag getVerticalQtAlignment(int pAlign)
Gets the vertical Qt.AlignmentFlag alignment from given IAlignmentConstants alignment.

Parameters:
pAlign - the alignment from IAlignmentConstants
Returns:
alignment from Qt.AlignmentFlag

getHorizontalQtAlignment

public static Qt.AlignmentFlag getHorizontalQtAlignment(int pAlign)
Gets the horizontal Qt.AlignmentFlag alignment from given IAlignmentConstants alignment.

Parameters:
pAlign - the alignment from IAlignmentConstants
Returns:
alignment from Qt.AlignmentFlag

getAlignment

public static int getAlignment(Qt.AlignmentFlag pAlignment)
Gets the IAlignmentConstants value from a given Qt.AlignmentFlag.

Parameters:
pAlignment - the Qt.AlignmentFlag
Returns:
the alignment from IAlignmentConstants

setLookAndFeel

public static void setLookAndFeel(String pClassName)
Sets the look and feel (style) for the application.

Parameters:
pClassName - the full qualified style class e.g. com.trolltech.qt.gui.PlastiqueStyle

createCellFormatter

public static ICellFormatter createCellFormatter(Object pCellFormatter,
                                                 String pMethodName)
Creates a cell formatter instance with the given object and method name.

Parameters:
pCellFormatter - the object.
pMethodName - the method name.
Returns:
the cell formatter.

createFileHandleReceiver

public static IFileHandleReceiver createFileHandleReceiver(Object pFileHandleReceiver,
                                                           String pMethodName)
Creates a file handle receiver instance with the given object and method name.

Parameters:
pFileHandleReceiver - the object.
pMethodName - the method name.
Returns:
the file handle receiver.

setLayout

public static void setLayout(QWidget pWidget,
                             ILayout pLayout)
Sets/Changes the layout of a widget.

Parameters:
pWidget - the widget to change/set the layout
pLayout - a layout


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.