|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.rad.ui.awt.impl.AwtResource<C>
com.sibvisions.rad.ui.awt.impl.AwtComponent<C>
com.sibvisions.rad.ui.awt.impl.AwtContainer<C>
com.sibvisions.rad.ui.swing.impl.SwingComponent<C>
com.sibvisions.rad.ui.swing.impl.component.SwingAbstractButton<C>
C - instance of AbstractButton.public abstract class SwingAbstractButton<C extends javax.swing.AbstractButton>
The SwingButton is the IButton
implementation for swing.
AbstractButton,
IButton| Field Summary | |
|---|---|
protected IImage |
image
the IconImage. |
protected IImage |
imgOver
the mouse over image. |
protected IImage |
imgPressed
the mouse pressed 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 | |
|---|---|
SwingAbstractButton(C pAbstractButton)
Creates a new instance of SwingAbstractButton. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent pActionEvent)
|
ActionHandler |
eventAction()
The EventHandler for the action event. |
Key |
getAccelerator()
Returns the Key which serves as an accelerator
for the button. |
java.lang.String |
getActionCommand()
Returns the command name of the action event fired by this action component. |
int |
getHorizontalTextPosition()
Returns the horizontal position of the text relative to the icon. |
IImage |
getImage()
Returns the default image. |
int |
getImageTextGap()
Returns the amount of space between the text and the icon displayed in this button. |
IInsets |
getMargins()
Returns the margin between the component's border and the text. |
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. |
java.lang.String |
getText()
Returns the text string that the label displays. |
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. |
boolean |
isPreserveAspectRatio()
If the aspect ratio of the image should be preserved if it is stretched in any direction. |
void |
setAccelerator(Key pKey)
Sets the key combination which invokes the component's action listeners without selecting. |
void |
setActionCommand(java.lang.String pActionCommand)
Sets the command name for the action event fired by this action component. |
void |
setBackground(IColor pBackground)
Sets the background color of this component. |
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 |
setHorizontalAlignment(int pHorizontalAlignment)
Sets the horizontal alignment. |
void |
setHorizontalTextPosition(int pHorizontalPosition)
Sets the horizontal position of the text relative to the icon. |
void |
setImage(IImage pImage)
Sets the default image. |
void |
setImageTextGap(int pImageTextGap)
If both the icon and text properties are set, this property defines the space between them. |
void |
setMargins(IInsets pMargins)
Sets space for margin between the button's border and the text. |
void |
setMouseOverImage(IImage pImage)
Sets the image for the button when the mouse is over. |
void |
setPreserveAspectRatio(boolean pPreserveAspectRatio)
Sets if the aspect ratio of the image should be preserved if it is stretched in any direction. |
void |
setPressedImage(IImage pImage)
Sets the image for the button when the button is pressed. |
void |
setText(java.lang.String pText)
Defines the single line of text this component will display. |
void |
setVerticalAlignment(int pVerticalAlignment)
Sets the vertical alignment. |
void |
setVerticalTextPosition(int pVerticalPosition)
Sets the vertical position of the text relative to the icon. |
| 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.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.IResource |
|---|
getResource |
| Methods inherited from interface javax.rad.ui.IAlignmentConstants |
|---|
getHorizontalAlignment, getVerticalAlignment |
| Field Detail |
|---|
protected IImage image
protected IImage imgOver
protected IImage imgPressed
| Constructor Detail |
|---|
public SwingAbstractButton(C pAbstractButton)
SwingAbstractButton.
pAbstractButton - the instance of AbstractButton.| Method Detail |
|---|
public java.lang.String getText()
getText in interface ILabelILabel.setText(java.lang.String)public void setText(java.lang.String pText)
setText in interface ILabelpText - the textpublic IImage getImage()
getImage in interface IIconIIcon.setImage(IImage)public void setImage(IImage pImage)
setImage in interface IIconpImage - the imageIIcon.getImage()public int getImageTextGap()
getImageTextGap in interface IButtonIButton.setImageTextGap(int)public void setImageTextGap(int pImageTextGap)
The default value of this property is 4 pixels.
This is a JavaBeans bound property.
setImageTextGap in interface IButtonpImageTextGap - the image gapIButton.getImageTextGap()public void setVerticalTextPosition(int pVerticalPosition)
setVerticalTextPosition in interface IButtonpVerticalPosition - one of the following values:
public int getVerticalTextPosition()
getVerticalTextPosition in interface IButtonpublic void setHorizontalTextPosition(int pHorizontalPosition)
setHorizontalTextPosition in interface IButtonpHorizontalPosition - one of the following values:
public int getHorizontalTextPosition()
getHorizontalTextPosition in interface IButtonpublic boolean isBorderOnMouseEntered()
isBorderOnMouseEntered in interface IButtonpublic void setBorderOnMouseEntered(boolean pBorderOnMouseEntered)
setBorderOnMouseEntered in interface IButtonpBorderOnMouseEntered - true, if the border should only be shown on mouse entered.public void setAccelerator(Key pKey)
setAccelerator in interface IActionComponentpKey - the Key which will serve as an acceleratorpublic void setBorderPainted(boolean pBorderPainted)
true, the border will be painted.
The default value is that the border will be painted.
setBorderPainted in interface IButtonpBorderPainted - true to paint the border, otherwise falsepublic boolean isBorderPainted()
isBorderPainted in interface IButtontrue when the border will be painted, otherwise falsepublic void setMouseOverImage(IImage pImage)
setMouseOverImage in interface IButtonpImage - the mouse over imagepublic IImage getMouseOverImage()
getMouseOverImage in interface IButtonpublic void setPressedImage(IImage pImage)
setPressedImage in interface IButtonpImage - the mouse pressed imagepublic IImage getPressedImage()
getPressedImage in interface IButtonpublic Key getAccelerator()
Key which serves as an accelerator
for the button.
getAccelerator in interface IActionComponentKey object identifying the accelerator keypublic void setDefaultButton(boolean pDefault)
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.
setDefaultButton in interface IButtonpDefault - true to set this button as default button, otherwise falseIButton.isDefaultButton()public boolean isDefaultButton()
defaultButton property,
which if true means that this button is the current
default button.
isDefaultButton in interface IButtontrue if this button is defined as default button, otherwise falseIButton.setDefaultButton(boolean)public java.lang.String getActionCommand()
getActionCommand in interface IActionComponentpublic void setActionCommand(java.lang.String pActionCommand)
setActionCommand in interface IActionComponentpActionCommand - a string used to set the action command.ActionEventpublic ActionHandler eventAction()
eventAction in interface IActionComponentpublic void setMargins(IInsets pMargins)
null will cause the action component to
use the default margin.
setMargins in interface IActionComponentpMargins - the space between the border and the testpublic IInsets getMargins()
getMargins in interface IActionComponentIInsets object specifying the margin
between the component's border and the textIActionComponent.setMargins(IInsets)public void actionPerformed(java.awt.event.ActionEvent pActionEvent)
actionPerformed in interface java.awt.event.ActionListenerpublic boolean isPreserveAspectRatio()
isPreserveAspectRatio in interface IIcontrue if the aspect ratio of the image is preserved when stretched.public void setPreserveAspectRatio(boolean pPreserveAspectRatio)
setPreserveAspectRatio in interface IIconpPreserveAspectRatio - true if the aspect ratio of the image is preserved when stretched.public void setHorizontalAlignment(int pHorizontalAlignment)
setHorizontalAlignment in interface IAlignmentConstantssetHorizontalAlignment in class AwtComponent<C extends javax.swing.AbstractButton>pHorizontalAlignment - the new vertical alignmentpublic void setVerticalAlignment(int pVerticalAlignment)
setVerticalAlignment in interface IAlignmentConstantssetVerticalAlignment in class AwtComponent<C extends javax.swing.AbstractButton>pVerticalAlignment - the new vertical alignmentpublic void setBackground(IColor pBackground)
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.
setBackground in interface IComponentsetBackground in class SwingComponent<C extends javax.swing.AbstractButton>pBackground - the color to become this component's color;
if this parameter is null, then this
component will inherit the background color of its parentIComponent.getBackground()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||