com.sibvisions.rad.ui.swing.impl.component
Class SwingAbstractLabeledIconButton<C extends AbstractButton>

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>
                  extended by com.sibvisions.rad.ui.swing.impl.component.SwingAbstractLabeledIconButton<C>
Type Parameters:
C - instance of AbstractButton.
All Implemented Interfaces:
ComponentListener, FocusListener, KeyListener, MouseListener, EventListener, IIcon, ILabel, ILabeledIcon, IAlignmentConstants, IComponent, IContainer, IResource, INamedObject
Direct Known Subclasses:
SwingAbstractButton, SwingPopupMenuButton

public abstract class SwingAbstractLabeledIconButton<C extends AbstractButton>
extends SwingComponent<C>
implements ILabeledIcon

The SwingAbstractLabeledIconButton is a labeled icon button implementation for swing.

See Also:
AbstractButton, ILabeledIcon

Field Summary
protected  IImage image
          the icon image.
 
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
SwingAbstractLabeledIconButton(C pAbstractButton)
          Creates a new instance of SwingAbstractLabeledIconButton.
 
Method Summary
 IImage getImage()
          Returns the default image.
 String getText()
          Returns the text string that the label displays.
 boolean isPreserveAspectRatio()
          If the aspect ratio of the image should be preserved if it is stretched in any direction.
 void setBackground(IColor pBackground)
          Sets the background color of this component.
 void setHorizontalAlignment(int pHorizontalAlignment)
          Sets the horizontal alignment.
 void setImage(IImage pImage)
          Sets the default image.
 void setPreserveAspectRatio(boolean pPreserveAspectRatio)
          Sets if the aspect ratio of the image should be preserved if it is stretched in any direction.
 void setText(String pText)
          Defines the single line of text this component will display.
 void setVerticalAlignment(int pVerticalAlignment)
          Sets the vertical alignment.
 
Methods inherited from class com.sibvisions.rad.ui.swing.impl.SwingComponent
capture, getToolTipText, setTabIndex, setToolTipText
 
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, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setStyle, 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
capture, 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, getToolTipText, 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, setTabIndex, setToolTipText, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 
Methods inherited from interface javax.rad.ui.IAlignmentConstants
getHorizontalAlignment, getVerticalAlignment
 

Field Detail

image

protected IImage image
the icon image.

Constructor Detail

SwingAbstractLabeledIconButton

public SwingAbstractLabeledIconButton(C pAbstractButton)
Creates a new instance of SwingAbstractLabeledIconButton.

Parameters:
pAbstractButton - the instance of AbstractButton.
Method Detail

getText

public String getText()
Returns the text string that the label displays.

Specified by:
getText in interface ILabel
Returns:
a String
See Also:
ILabel.setText(java.lang.String)

setText

public void setText(String pText)
Defines the single line of text this component will display. If the value of text is null or empty string, nothing is displayed.

Specified by:
setText in interface ILabel
Parameters:
pText - the text

getImage

public IImage getImage()
Returns the default image.

Specified by:
getImage in interface IIcon
Returns:
the default image
See Also:
IIcon.setImage(IImage)

setImage

public void setImage(IImage pImage)
Sets the default image.

Specified by:
setImage in interface IIcon
Parameters:
pImage - the image
See Also:
IIcon.getImage()

isPreserveAspectRatio

public boolean isPreserveAspectRatio()
If the aspect ratio of the image should be preserved if it is stretched in any direction.

Specified by:
isPreserveAspectRatio in interface IIcon
Returns:
true if the aspect ratio of the image is preserved when stretched.

setPreserveAspectRatio

public void setPreserveAspectRatio(boolean pPreserveAspectRatio)
Sets if the aspect ratio of the image should be preserved if it is stretched in any direction.

Specified by:
setPreserveAspectRatio in interface IIcon
Parameters:
pPreserveAspectRatio - true if the aspect ratio of the image is preserved when stretched.

setHorizontalAlignment

public void setHorizontalAlignment(int pHorizontalAlignment)
Sets the horizontal alignment. Possible values are defined in AlignmentConstants.

Specified by:
setHorizontalAlignment in interface IAlignmentConstants
Overrides:
setHorizontalAlignment in class AwtComponent<C extends AbstractButton>
Parameters:
pHorizontalAlignment - the new vertical alignment

setVerticalAlignment

public void setVerticalAlignment(int pVerticalAlignment)
Sets the vertical alignment. Possible values are defined in AlignmentConstants.

Specified by:
setVerticalAlignment in interface IAlignmentConstants
Overrides:
setVerticalAlignment in class AwtComponent<C extends AbstractButton>
Parameters:
pVerticalAlignment - the new vertical alignment

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 SwingComponent<C extends AbstractButton>
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()


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.