Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.image.laf.browser
Class ButtonPainter

java.lang.Object
  |
  +--oracle.cabo.image.painter.AbstractPainter
        |
        +--oracle.cabo.image.painter.AbstractWrappingPainter
              |
              +--oracle.cabo.image.painter.AbstractBorderPainter
                    |
                    +--oracle.cabo.image.laf.browser.ButtonPainter
All Implemented Interfaces:
BorderPainter, ImageConstants, Painter

public class ButtonPainter
extends AbstractBorderPainter
implements ImageConstants

Painter used to paint action button objects with the correct Oracle Look and Feel. The values of the following keys from the ImageConstants interface affect how the button is rendered:


Fields inherited from interface oracle.cabo.image.ImageConstants
ACCESS_KEY_KEY, BACKGROUND_KEY, BORDER_COLOR_KEY, BUTTON_NAME, COLORIZED_ICON_NAME, DARK_ACCENT_COLOR_KEY, DARK_COLOR_KEY, DIRECTION_KEY, DISABLED_BACKGROUND_KEY, DISABLED_FONT_KEY, DISABLED_FOREGROUND_KEY, DISABLED_KEY, ENCODING_TYPE_KEY, END_ROUNDED_KEY, FLIPPED_ICON_NAME, FONT_KEY, FOREGROUND_KEY, GLOBAL_BUTTON_NAME, HEIGHT_RESPONSE_KEY, IMAGE_MAP_AREAS_RESPONSE_KEY, IMAGE_PROVIDER_PROPERTY, IMAGE_TYPE_MANAGER_PROPERTY, LAF_KEY, NAME_KEY, SELECTED_BACKGROUND_KEY, SELECTED_FONT_KEY, SELECTED_FOREGROUND_KEY, SELECTED_INDEX_KEY, SELECTED_KEY, SERVLET_URL_PROPERTY, SOURCE_INPUT_STREAM_PROVIDER_KEY, SOURCE_KEY, START_ROUNDED_KEY, SURROUNDING_COLOR_KEY, TAB_BAR_NAME, TABS_KEY, TECATE_NAMESPACE, TEXT_ANTIALIAS_KEY, TEXT_KEY, WIDTH_RESPONSE_KEY
 
Fields inherited from interface oracle.cabo.image.painter.Painter
STATE_ACTIVE_CHANGED, STATE_ARMED_CHANGED, STATE_BACKGROUND_CHANGED, STATE_ENABLED_CHANGED, STATE_FOCUSED_CHANGED, STATE_FONT_CHANGED, STATE_FOREGROUND_CHANGED, STATE_ISDEFAULT_CHANGED, STATE_MOUSE_OVER_CHANGED, STATE_READING_DIRECTION_CHANGED, STATE_SELECTED_CHANGED, STATE_SET_CHANGED, STATE_SIZE_CHANGED, STATE_XALIGNMENT_CHANGED, STATE_YALIGNMENT_CHANGED
 
Constructor Summary
ButtonPainter()
          Creates an ButtonPainter.
 
Method Summary
 Painter getContentPainterAt(PaintContext context, int availableWidth, int availableHeight, int x, int y, Painter proxyPainter)
          Implementation of getContentPainterAt()
static java.awt.Color getDefaultBackground(ImageContext context, boolean disabled)
           
static java.awt.Color getDefaultBorderColor(ImageContext context, boolean disabled)
           
static FontProxy getDefaultFont()
           
static java.awt.Color getDefaultForeground(ImageContext context, boolean disabled)
           
protected  ImmInsets getOwnInsets(PaintContext context)
          Returns the insets of just the ButtonPainter.
 int getRepaintFlags(PaintContext context)
          Implementation of getRepaintFlags()
protected  boolean isBorderTransparent(PaintContext context)
          Implementation of isBorderTransparent().
protected  void paintBorder(PaintContext context, java.awt.Graphics g, int x, int y, int width, int height)
          Paint just the border of the ButtonPainter.
 
Methods inherited from class oracle.cabo.image.painter.AbstractBorderPainter
borderContains, contentContains, getBorderPainterAt, getFillInsets, getInsets, getMaximumSize, getMinimumSize, getOwnFillInsets, getPainterAt, getPreferredSize, getSize, isTransparent, paint
 
Methods inherited from class oracle.cabo.image.painter.AbstractWrappingPainter
getInvalidateFlags, getWrappedPainter
 
Methods inherited from class oracle.cabo.image.painter.AbstractPainter
contains, getData, getDataKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.cabo.image.painter.Painter
contains, getInvalidateFlags
 

Constructor Detail

ButtonPainter

public ButtonPainter()
Creates an ButtonPainter.
Method Detail

getDefaultForeground

public static java.awt.Color getDefaultForeground(ImageContext context,
                                                  boolean disabled)

getDefaultBackground

public static java.awt.Color getDefaultBackground(ImageContext context,
                                                  boolean disabled)

getDefaultFont

public static FontProxy getDefaultFont()

getDefaultBorderColor

public static java.awt.Color getDefaultBorderColor(ImageContext context,
                                                   boolean disabled)

getContentPainterAt

public Painter getContentPainterAt(PaintContext context,
                                   int availableWidth,
                                   int availableHeight,
                                   int x,
                                   int y,
                                   Painter proxyPainter)
Implementation of getContentPainterAt()
Overrides:
getContentPainterAt in class AbstractBorderPainter
Following copied from class: oracle.cabo.image.painter.AbstractBorderPainter
Parameters:
context - Context for determining containership.
availableWidth - Amount of width available to the Painter.
availableHeight - Amount of height available to the Painter.
x - X location to test for containership in this Painter.
y - Y location to test for containership in this Painter.
proxyPainter - Painter to return instead of child painters

Returns:
The Painter at the specified loaction, or null if none.

#getPainterAt


getRepaintFlags

public int getRepaintFlags(PaintContext context)
Implementation of getRepaintFlags()
Overrides:
getRepaintFlags in class AbstractWrappingPainter
Following copied from interface: oracle.cabo.image.painter.Painter
Parameters:
context - Context to use for determining the conditions under which repainting is required.

Returns:
Flags indicating the conditions under which this Painter must be repainted.

See Also:
Painter.getInvalidateFlags(oracle.cabo.image.painter.PaintContext)

isBorderTransparent

protected boolean isBorderTransparent(PaintContext context)
Implementation of isBorderTransparent().
Overrides:
isBorderTransparent in class AbstractBorderPainter
Following copied from class: oracle.cabo.image.painter.AbstractBorderPainter
Parameters:
context - PaintContext to use when determining transparency.

Returns:
true if this BorderPainter is transparent.

See Also:
AbstractBorderPainter.isTransparent(oracle.cabo.image.painter.PaintContext)

getOwnInsets

protected ImmInsets getOwnInsets(PaintContext context)
Returns the insets of just the ButtonPainter.
Overrides:
getOwnInsets in class AbstractBorderPainter
Following copied from class: oracle.cabo.image.painter.AbstractBorderPainter
Parameters:
context - PaintContext to use when getting our own Insets

Returns:
The insets of just this BorderPainter.

See Also:
AbstractBorderPainter.getInsets(oracle.cabo.image.painter.PaintContext)

paintBorder

protected void paintBorder(PaintContext context,
                           java.awt.Graphics g,
                           int x,
                           int y,
                           int width,
                           int height)
Paint just the border of the ButtonPainter.
Overrides:
paintBorder in class AbstractBorderPainter
Following copied from class: oracle.cabo.image.painter.AbstractBorderPainter
Parameters:
context - PaintContext to use when painting the Border
g - Graphics context to use when painting
x - x coordinate to begin painting at
y - y coordinate to begin painting at
width - width of area to paint
height - height of area to paint

Returns:
The insets of just this BorderPainter.

See Also:
AbstractBorderPainter.paint(oracle.cabo.image.painter.PaintContext, java.awt.Graphics, int, int, int, int)

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.