javax.rad.ui.component
Interface IButton

All Superinterfaces:
IActionComponent, IAlignmentConstants, IComponent, IIcon, ILabel, INamedObject, IResource
All Known Subinterfaces:
ICheckBox, IRadioButton, IToggleButton
All Known Implementing Classes:
AbstractUIButton, AbstractUIToggleButton, SwingAbstractButton, SwingButton, SwingCheckBox, SwingCheckBoxMenuItem, SwingMenu, SwingMenuItem, SwingRadioButton, SwingToggleButton, UIButton, UICheckBox, UIRadioButton, UIToggleButton

public interface IButton
extends IActionComponent

Platform and technology independent button definition. It is designed for use with AWT, Swing, SWT, JSP, JSF, ... .

See Also:
Button, JButton

Field Summary
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Method Summary
 int getHorizontalTextPosition()
          Returns the horizontal position of the text relative to the icon.
 int getImageTextGap()
          Returns the amount of space between the text and the icon displayed in this button.
 IImage getMouseOverImage()
          Gets the image for the button when the mouse is over.
 IImage getPressedImage()
          Gets the image for the button when the button is pressed.
 int getVerticalTextPosition()
          Returns the vertical position of the text relative to the icon.
 boolean isBorderOnMouseEntered()
          Gets, if the border should only be shown on mouse entered.
 boolean isBorderPainted()
          Gets whether the border will be painted.
 boolean isDefaultButton()
          Gets the value of the defaultButton property, which if true means that this button is the current default button.
 void setBorderOnMouseEntered(boolean pBorderOnMouseEntered)
          Sets, if the border should only be shown on mouse entered.
 void setBorderPainted(boolean pBorderPainted)
          Sets whether the border will be painted.
 void setDefaultButton(boolean pDefault)
          Sets the defaultButton property.
 void setHorizontalTextPosition(int pHorizontalPosition)
          Sets the horizontal position of the text relative to the icon.
 void setImageTextGap(int pImageTextGap)
          If both the icon and text properties are set, this property defines the space between them.
 void setMouseOverImage(IImage pImage)
          Sets the image for the button when the mouse is over.
 void setPressedImage(IImage pImage)
          Sets the image for the button when the button is pressed.
 void setVerticalTextPosition(int pVerticalPosition)
          Sets the vertical position of the text relative to the icon.
 
Methods inherited from interface javax.rad.ui.component.IActionComponent
eventAction, getAccelerator, getActionCommand, getMargins, setAccelerator, setActionCommand, setMargins
 
Methods inherited from interface javax.rad.ui.component.IIcon
getImage, setImage
 
Methods inherited from interface javax.rad.ui.component.ILabel
getText, setText
 
Methods inherited from interface javax.rad.ui.IComponent
capture, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getToolTipText, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBackground, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setToolTipText, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 
Methods inherited from interface javax.rad.ui.IAlignmentConstants
getHorizontalAlignment, getVerticalAlignment, setHorizontalAlignment, setVerticalAlignment
 

Method Detail

getImageTextGap

int getImageTextGap()
Returns the amount of space between the text and the icon displayed in this button.

Returns:
an int equal to the number of pixels between the text and the icon.
See Also:
setImageTextGap(int)

setImageTextGap

void setImageTextGap(int pImageTextGap)
If both the icon and text properties are set, this property defines the space between them.

The default value of this property is 4 pixels.

This is a JavaBeans bound property.

Parameters:
pImageTextGap - the image gap
See Also:
getImageTextGap()

setVerticalTextPosition

void setVerticalTextPosition(int pVerticalPosition)
Sets the vertical position of the text relative to the icon.

Parameters:
pVerticalPosition - one of the following values:
  • IAlignmentConstants.CENTER
  • IAlignmentConstants.TOP
  • IAlignmentConstants.BOTTOM

getVerticalTextPosition

int getVerticalTextPosition()
Returns the vertical position of the text relative to the icon.

Returns:
one of the following values:
  • IAlignmentConstants.CENTER
  • IAlignmentConstants.TOP
  • IAlignmentConstants.BOTTOM

setHorizontalTextPosition

void setHorizontalTextPosition(int pHorizontalPosition)
Sets the horizontal position of the text relative to the icon.

Parameters:
pHorizontalPosition - one of the following values:
  • IAlignmentConstants.CENTER
  • IAlignmentConstants.LEFT
  • IAlignmentConstants.RIGHT

getHorizontalTextPosition

int getHorizontalTextPosition()
Returns the horizontal position of the text relative to the icon.

Returns:
one of the following values:
  • IAlignmentConstants.CENTER
  • IAlignmentConstants.LEFT
  • IAlignmentConstants.RIGHT

isBorderOnMouseEntered

boolean isBorderOnMouseEntered()
Gets, if the border should only be shown on mouse entered.

Returns:
true, if the border should only be shown on mouse entered.

setBorderOnMouseEntered

void setBorderOnMouseEntered(boolean pBorderOnMouseEntered)
Sets, if the border should only be shown on mouse entered.

Parameters:
pBorderOnMouseEntered - true, if the border should only be shown on mouse entered.

setBorderPainted

void setBorderPainted(boolean pBorderPainted)
Sets whether the border will be painted. If true, the border will be painted. The default value is that the border will be painted.

Parameters:
pBorderPainted - true to paint the border, otherwise false

isBorderPainted

boolean isBorderPainted()
Gets whether the border will be painted.

Returns:
true when the border will be painted, otherwise false

setMouseOverImage

void setMouseOverImage(IImage pImage)
Sets the image for the button when the mouse is over.

Parameters:
pImage - the mouse over image

getMouseOverImage

IImage getMouseOverImage()
Gets the image for the button when the mouse is over.

Returns:
the mouse over image

setPressedImage

void setPressedImage(IImage pImage)
Sets the image for the button when the button is pressed.

Parameters:
pImage - the mouse pressed image

getPressedImage

IImage getPressedImage()
Gets the image for the button when the button is pressed.

Returns:
the mouse pressed image

setDefaultButton

void setDefaultButton(boolean pDefault)
Sets the defaultButton property. The default button is the button which will be activated when a UI-defined activation event (typically the Enter key) occurs, regardless of whether or not the button has keyboard focus (unless there is another component within which consumes the activation event) For default activation to work, the button must be enabled.

Parameters:
pDefault - true to set this button as default button, otherwise false
See Also:
isDefaultButton()

isDefaultButton

boolean isDefaultButton()
Gets the value of the defaultButton property, which if true means that this button is the current default button.

Returns:
true if this button is defined as default button, otherwise false
See Also:
setDefaultButton(boolean)


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.