org.shetline.gui
Class ImageButton
java.lang.Object
   java.awt.Component
java.awt.Component
       java.awt.Container
java.awt.Container
           javax.swing.JComponent
javax.swing.JComponent
               javax.swing.AbstractButton
javax.swing.AbstractButton
                   javax.swing.JButton
javax.swing.JButton
                       org.shetline.gui.AutoRepeatButton
org.shetline.gui.AutoRepeatButton
                           org.shetline.gui.ImageButton
org.shetline.gui.ImageButton
- All Implemented Interfaces: 
- ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, SwingConstants
- Direct Known Subclasses: 
- MiniCalendar.ArrowButton
- public class ImageButton 
- extends AutoRepeatButton
- See Also:
- Serialized Form
 
 
 
 
 
 
 
 
| Fields inherited from class org.shetline.gui.AutoRepeatButton | 
| checkModelClass, currentDelay, DEFAULT_INITIAL_DELAY, DEFAULT_REPEAT_DELAY, eventTime, hasRepeated, initialDelay, mousePressed, REPEAT_KILL_DELAY, repeatDelay, repeater, repeating, savedModifiers | 
 
| Fields inherited from class javax.swing.AbstractButton | 
| actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY | 
 
 
 
| Fields inherited from interface javax.swing.SwingConstants | 
| BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST | 
 
 
| Constructor Summary | 
| ImageButton()
 | 
| ImageButton(Image enabledImage)
 | 
| ImageButton(Image enabledImage,
            Image pushedImage)
 | 
| ImageButton(Image enabledImage,
            Image pushedImage,
            Image disabledImage)
 | 
| ImageButton(String imagePath)
 | 
| ImageButton(String imagePath,
            Class resOwner)
 | 
| ImageButton(String enabledImagePath,
            String pushedImagePath)
 | 
| ImageButton(String enabledImagePath,
            String pushedImagePath,
            Class resOwner)
 | 
| ImageButton(String enabledImagePath,
            String pushedImagePath,
            String disabledImagePath)
 | 
| ImageButton(String enabledImagePath,
            String pushedImagePath,
            String disabledImagePath,
            Class resOwner)
 | 
 
 
| Methods inherited from class org.shetline.gui.AutoRepeatButton | 
| AutoRepeatButtonX, doClick, doClick, doClickAction, doClickAction, getInitialDelay, getRepeatDelay, isRepeating, processMouseEvent, readyForRepeat, readyForRepeatAux, setEnabled, setInitialDelay, setModel, setRepeatDelay, setRepeating | 
 
 
| Methods inherited from class javax.swing.AbstractButton | 
| actionPropertyChanged, addActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, configurePropertiesFromAction, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, init, isBorderPainted, isContentAreaFilled, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition | 
 
| Methods inherited from class javax.swing.JComponent | 
| addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update | 
 
| Methods inherited from class java.awt.Container | 
| add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree | 
 
| Methods inherited from class java.awt.Component | 
| action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle | 
 
 
disableFocusPainting
protected boolean disableFocusPainting
enabledImage
protected Image enabledImage
savedEnabled
protected Image savedEnabled
pushedImage
protected Image pushedImage
savedPushed
protected Image savedPushed
disabledImage
protected Image disabledImage
savedDisabled
protected Image savedDisabled
FILE_WILDCARD
protected static final Pattern FILE_WILDCARD
ImageButton
public ImageButton()
ImageButton
public ImageButton(String imagePath)
ImageButton
public ImageButton(String imagePath,
                   Class resOwner)
ImageButton
public ImageButton(String enabledImagePath,
                   String pushedImagePath)
ImageButton
public ImageButton(String enabledImagePath,
                   String pushedImagePath,
                   String disabledImagePath)
ImageButton
public ImageButton(String enabledImagePath,
                   String pushedImagePath,
                   Class resOwner)
ImageButton
public ImageButton(String enabledImagePath,
                   String pushedImagePath,
                   String disabledImagePath,
                   Class resOwner)
ImageButton
public ImageButton(Image enabledImage)
ImageButton
public ImageButton(Image enabledImage,
                   Image pushedImage)
ImageButton
public ImageButton(Image enabledImage,
                   Image pushedImage,
                   Image disabledImage)
updateIcons
protected void updateIcons()
- 
 
setImages
public void setImages(Image enabledImage,
                      Image pushedImage,
                      Image disabledImage)
- 
 
colorizeImages
public void colorizeImages(Color targetColor,
                           Color replacementColor)
- 
 
decolorizeImages
public void decolorizeImages()
- 
 
fillInWildcard
public static String fillInWildcard(String filePath,
                                    String substitute)
- This function takes a file path in the form path_*.file-extension or
 path_**.file-extension and returns a path where the "*" or "**" has been replaced by
 - substitute. If the double asterisk form (**) is used, and- substituteis
 the letter "d", then- nullis returned.
 - The main use for this function is to take a wildcard path like "button-image_*.png" and return
 an actual path to an enabled, a pressed, and a disabled version of a button image, designated by the
 substituted letters "e", "p", and "d", The double asterisk for is when you want the disabled form to
 be ignored so that a disabled image is automatically generated from the enabled image. - 
 
- 
- Parameters:
- filePath- wildcard file path
- substitute- replacement for * or ** wildcard.
- Returns:
- a path with the wildcard filled in, or null.
 
getEmptyBorderSize
public int getEmptyBorderSize()
- 
 
setEmptyBorderSize
public void setEmptyBorderSize(int size)
- 
 
isFocusPainted
public boolean isFocusPainted()
- 
- Overrides:
- isFocusPaintedin class- AbstractButton
 
- 
 
paintComponent
protected void paintComponent(Graphics g)
- 
- Overrides:
- paintComponentin class- JComponent
 
- 
 
paintFocus
protected void paintFocus(Graphics g)
-