public class SimpleImageButton extends ButtonGuiImpl
Modifier and Type | Field and Description |
---|---|
private ImageWrapper<java.awt.image.BufferedImage> |
imgDisabled
The pre-rendered image of the button in disabled state.
|
private ImageWrapper<java.awt.image.BufferedImage> |
imgEnabled
The pre-rendered image of the button in normal, enabled state.
|
private ImageWrapper<java.awt.image.BufferedImage> |
imgHighlighted
The pre-rendered image of the button when mouse hovers it.
|
private boolean |
imgLoaded
A flag to mark whether the images were loaded (at least attempted).
|
private ImageWrapper<java.awt.image.BufferedImage> |
imgPressed
The pre-rendered image of the button when pressed down.
|
cc, DOT_LINE_WIDTH, gd, gf
config, widgetFocused
insets, location, LOG, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
SimpleImageButton(WidgetId id,
java.lang.String text)
This constructor creates a button with a given text label.
|
Modifier and Type | Method and Description |
---|---|
void |
draw()
Draw the button.
|
private void |
drawImage(NativeDimension d,
ImageWrapper<java.awt.image.BufferedImage> img)
Draws the image on a button.
|
afterConfigUpdate, createMnemonic, focusTraversable, getImgDisabled, getImgDown, getImgUp, handleBasicEvents, handleCursorKeys, hasImages, hasPrepackagedImages, height, highlighted, initialize, isAutoResize, isDefaultButton, isDroppable, isFocusable, isMnemonicSupported, isPressed, loadImage, mouseClicked, onFocusLost, physicalBounds, processMnemonic, refresh, requestFocus, setActionCode, setImage, supportsCustomMousePointer, toString, updateSize, updateSizeWorker, width
isMouseOver, mouseActions, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased
addListener, checkKey, config, destroy, getColon, getColumnLabelText, getCommand, getLabelInstance, getLabelText, getMnemonic, getTo, initButtonText, isForceLabel, isNoLabels, isRightAligned, postprocessConfig, processEvent, processKeyEvent, setCommand, setHidden, setLabelInstance, setMnemonic, setNoLabels, setSupportsMnemonic, setText, setTextLabel, setVisible, setWasVisible, textLabel, wasVisible
dimension, forceCursorOnFocus, getDefaultEvent, ignoreAction, manageSystemActions, minimumSize, onFocusGained, onKeyPressed, onKeyTyped, processKeyEventCommon
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, copyColors, copyState, createMouseHoverAction, deactivateDirectManipulation, debug, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, findMouseSource, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, insets, isCurrent, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isHeader, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalDimension, physicalLocation, prepParentLocation, processDirectManipulationEvent, processFocusEvent, processKeyListeners, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectAncestorChange, reflectLocationChange, refresh, registerWidgetStateListener, repaint, repaint, requestFocus, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setEnabled, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, showPopupMenu, sync, topLevelWindow, translate, unrealize, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, defaultMousePtr, dimension, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, insets, isCurrent, isDirectManipulable, isDisplayed, isEnabled, isHeader, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, minimumSize, moveToBottom, moveToTop, name, navigable, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalDimension, physicalLocation, processDirectManipulationEvent, processFocusEvent, processKeyListeners, raiseLegacyMouseEvents, repaint, repaint, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setEnabled, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, topLevelWindow, unrealize, window
getColumnMnemonic, getMnemonicCharacter, getMnemonicKeyCode, getMnemonicLabel, setColumnMnemonic, updateMnemonic
private boolean imgLoaded
private ImageWrapper<java.awt.image.BufferedImage> imgEnabled
private ImageWrapper<java.awt.image.BufferedImage> imgDisabled
private ImageWrapper<java.awt.image.BufferedImage> imgHighlighted
private ImageWrapper<java.awt.image.BufferedImage> imgPressed
public SimpleImageButton(WidgetId id, java.lang.String text)
id
- The widget's ID.text
- The string to be used as the button text.public void draw()
draw
in interface Widget<GuiOutputManager>
draw
in class ButtonGuiImpl
private void drawImage(NativeDimension d, ImageWrapper<java.awt.image.BufferedImage> img)
d
- The button dimension (in pixels).img
- The image to be drawn.