com.sibvisions.rad.ui.swing.impl
Class SwingComponent<C extends javax.swing.JComponent>

java.lang.Object
  extended by com.sibvisions.rad.ui.awt.impl.AwtResource<C>
      extended by com.sibvisions.rad.ui.awt.impl.AwtComponent<C>
          extended by com.sibvisions.rad.ui.awt.impl.AwtContainer<C>
              extended by com.sibvisions.rad.ui.swing.impl.SwingComponent<C>
Type Parameters:
C - an instance of JComponent
All Implemented Interfaces:
java.awt.event.ComponentListener, java.awt.event.FocusListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.util.EventListener, IAlignmentConstants, IComponent, IContainer, IResource, INamedObject
Direct Known Subclasses:
SwingAbstractButton, SwingChart, SwingDesktopPanel, SwingEditor, SwingGroupPanel, SwingIcon, SwingLabel, SwingMenuBar, SwingPanel, SwingPopupMenu, SwingScrollComponent, SwingSeparator, SwingSplitPanel, SwingTabsetPanel, SwingToolBar, SwingToolBarPanel

public class SwingComponent<C extends javax.swing.JComponent>
extends AwtContainer<C>

The SwingComponent extends AwtComponent with setting the alignment.


Field Summary
 
Fields inherited from class com.sibvisions.rad.ui.awt.impl.AwtComponent
bComponentListener, bFocusListener, bKeyListener, bMouseListener, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, eventSource, factory, parent
 
Fields inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource
resource
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
SwingComponent(C pJComponent)
          Creates a new instance of SwingComponent.
 
Method Summary
 IImage capture(int pWidth, int pHeight)
          Creates an image/screenshot of the component.
 java.lang.String getToolTipText()
          Returns the tooltip string that has been set with setToolTipText.
 void setBackground(IColor pBackground)
          Sets the background color of this component.
 void setTabIndex(java.lang.Integer pTabIndex)
          Sets the desired tab index.
 void setToolTipText(java.lang.String pText)
          Registers the text to display in a tool tip.
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtContainer
add, add, add, add, addIntern, checkAdd, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, removeIntern, setLayout, setLayoutIntern
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtComponent
addComponentListener, addFocusListener, addKeyListener, addMouseListener, componentHidden, componentMoved, componentResized, componentShown, createImage, createMouseEvent, equals, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, focusGained, focusLost, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getHorizontalAlignment, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getStyle, getTabIndex, getVerticalAlignment, hashCode, invalidateLayout, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, requestFocus, setBounds, setCursor, setEnabled, setEventSource, setFactory, setFocusable, setFont, setForeground, setHorizontalAlignment, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setStyle, setVerticalAlignment, setVisible, validate
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource
getResource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.IComponent
eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getStyle, getTabIndex, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setStyle, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Constructor Detail

SwingComponent

public SwingComponent(C pJComponent)
Creates a new instance of SwingComponent.

Parameters:
pJComponent - An instance of JComponent
Method Detail

setBackground

public void setBackground(IColor pBackground)
Sets the background color of this component.

The background color affects each component differently and the parts of the component that are affected by the background color may differ between operating systems.

Specified by:
setBackground in interface IComponent
Overrides:
setBackground in class AwtComponent<C extends javax.swing.JComponent>
Parameters:
pBackground - the color to become this component's color; if this parameter is null, then this component will inherit the background color of its parent
See Also:
IComponent.getBackground()

setTabIndex

public void setTabIndex(java.lang.Integer pTabIndex)
Sets the desired tab index. If several editors have the same tab index, or it is null the behaviour is technology dependend.

Specified by:
setTabIndex in interface IComponent
Overrides:
setTabIndex in class AwtComponent<C extends javax.swing.JComponent>
Parameters:
pTabIndex - the desired tab index.

setToolTipText

public void setToolTipText(java.lang.String pText)
Registers the text to display in a tool tip. The text displays when the cursor lingers over the component.

Specified by:
setToolTipText in interface IComponent
Overrides:
setToolTipText in class AwtComponent<C extends javax.swing.JComponent>
Parameters:
pText - the string to display; if the text is null, the tool tip is turned off for this component

getToolTipText

public java.lang.String getToolTipText()
Returns the tooltip string that has been set with setToolTipText.

Specified by:
getToolTipText in interface IComponent
Overrides:
getToolTipText in class AwtComponent<C extends javax.swing.JComponent>
Returns:
the text of the tool tip
See Also:
IComponent.setToolTipText(String)

capture

public IImage capture(int pWidth,
                      int pHeight)
Creates an image/screenshot of the component.

Specified by:
capture in interface IComponent
Overrides:
capture in class AwtComponent<C extends javax.swing.JComponent>
Parameters:
pWidth - the expected width
pHeight - the expected height
Returns:
the image/screenshot


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.