Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.image.painter
Class AbstractPainter

java.lang.Object
  |
  +--oracle.cabo.image.painter.AbstractPainter
All Implemented Interfaces:
Painter
Direct Known Subclasses:
AbstractWrappingPainter, ImagePainter, NullPainter, PainterStacker, TabBarPainter, TextPainter

public abstract class AbstractPainter
extends java.lang.Object
implements Painter

Abstract base class for most of the painters. This class takes care of appropriately stubbing out the methods of the Painter interface, making writing Painters easier.


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
AbstractPainter()
          Create an AbstractPainter.
 
Method Summary
 boolean contains(PaintContext context, int availableWidth, int availableHeight, int x, int y)
          Returns true if the specified x, y location is inside the Painter.
protected  java.lang.Object getData(PaintContext context)
           
protected  java.lang.Object getDataKey()
           
 int getInvalidateFlags(PaintContext context)
          Returns the flags indicating the conditions under which the Painter must be invalidated.
 java.awt.Dimension getMaximumSize(PaintContext context)
          Returns the maximum size of the painter.
 Painter getPainterAt(PaintContext context, int availableWidth, int availableHeight, int x, int y, Painter proxyPainter)
          Returns the Painter inside this Painter at location x,y of the available size.
 java.awt.Dimension getPreferredSize(PaintContext context)
          Returns the preferred size of the painter.
 int getRepaintFlags(PaintContext context)
          Returns the flags indicating the conditions under which the Painter must be repainted.
 java.awt.Dimension getSize(PaintContext context, int availableWidth, int availableHeight)
          Returns the size of the Painter for the specified amount of availableWidth and availableHeight.
 boolean isTransparent(PaintContext context)
          Returns true if the Painter doesn't paint all of its pixels.
 
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
getMinimumSize, paint
 

Constructor Detail

AbstractPainter

public AbstractPainter()
Create an AbstractPainter.
Method Detail

getSize

public java.awt.Dimension getSize(PaintContext context,
                                  int availableWidth,
                                  int availableHeight)
Returns the size of the Painter for the specified amount of availableWidth and availableHeight. Most Painters will simply return the availableWidth and availableHeight.

Specified by:
getSize in interface Painter
Parameters:
context - Context for deterimining the size.
availableWidth - Amount of width available to the Painter.
availableHeight - Amount of height available to the Painter.

Returns:
The size of the Painter.

getPreferredSize

public java.awt.Dimension getPreferredSize(PaintContext context)
Returns the preferred size of the painter.

Specified by:
getPreferredSize in interface Painter
Parameters:
context - Context for determining the preferred size.

Returns:
The preferred size of the Painter.

getMaximumSize

public java.awt.Dimension getMaximumSize(PaintContext context)
Returns the maximum size of the painter.

Specified by:
getMaximumSize in interface Painter
Parameters:
context - Context for determining the maximum size.

Returns:
The maximum size of the Painter.

contains

public final boolean contains(PaintContext context,
                              int availableWidth,
                              int availableHeight,
                              int x,
                              int y)
Returns true if the specified x, y location is inside the Painter.

Most subclasses will want to override getPainterAt instead of this method, as the two methods are related.

Specified by:
contains in interface Painter
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.

Returns:
True if the specified location is inside the Painter.

See Also:
getPainterAt(oracle.cabo.image.painter.PaintContext, int, int, int, int, oracle.cabo.image.painter.Painter)

getPainterAt

public Painter getPainterAt(PaintContext context,
                            int availableWidth,
                            int availableHeight,
                            int x,
                            int y,
                            Painter proxyPainter)
Returns the Painter inside this Painter at location x,y of the available size. If no Painter is at that location, this method returns null.

Specified by:
getPainterAt in interface Painter
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.

See Also:
contains(oracle.cabo.image.painter.PaintContext, int, int, int, int)

isTransparent

public boolean isTransparent(PaintContext context)
Returns true if the Painter doesn't paint all of its pixels.

Specified by:
isTransparent in interface Painter
Parameters:
context - Context for determining transparency.

Returns:
True if the Painter is transparent.

getRepaintFlags

public int getRepaintFlags(PaintContext context)
Returns the flags indicating the conditions under which the Painter must be repainted. Painter owners should call this method whenever any of the possible conditions occurs and check to see whether they must repaint the Painter as a result.

Specified by:
getRepaintFlags in interface 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.

getInvalidateFlags

public int getInvalidateFlags(PaintContext context)
Returns the flags indicating the conditions under which the Painter must be invalidated.

Specified by:
getInvalidateFlags in interface Painter
Parameters:
context - Context to use for determining the conditions under which invalidation is required.

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

getData

protected java.lang.Object getData(PaintContext context)

getDataKey

protected java.lang.Object getDataKey()

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

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