Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.image.painter
Interface Painter

All Known Subinterfaces:
BorderPainter
All Known Implementing Classes:
AbstractPainter

public interface Painter

Interface implemented by objects that paint something.


Field Summary
static int STATE_ACTIVE_CHANGED
          State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's active state changes.
static int STATE_ARMED_CHANGED
          State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's armed state changes.
static int STATE_BACKGROUND_CHANGED
          State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's background color changes.
static int STATE_ENABLED_CHANGED
          State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's enabled state changes.
static int STATE_FOCUSED_CHANGED
          State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's keyboard focused state changes.
static int STATE_FONT_CHANGED
          State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's font changes.
static int STATE_FOREGROUND_CHANGED
          State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's foreground color changes.
static int STATE_ISDEFAULT_CHANGED
          State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's isdefault state changes.
static int STATE_MOUSE_OVER_CHANGED
          State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's mouse over state changes.
static int STATE_READING_DIRECTION_CHANGED
          State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's reading direction changes.
static int STATE_SELECTED_CHANGED
          State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's selected state changes.
static int STATE_SET_CHANGED
          State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's set state changes.
static int STATE_SIZE_CHANGED
          State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's size changes.
static int STATE_XALIGNMENT_CHANGED
          State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's interior X alignment changes.
static int STATE_YALIGNMENT_CHANGED
          State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's interior Y alignment changes.
 
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.
 int getInvalidateFlags(PaintContext context)
          Returns the flasg indicating the conditions under which the Painter must be invalidated.
 java.awt.Dimension getMaximumSize(PaintContext context)
          Returns the maximum size of the painter.
 java.awt.Dimension getMinimumSize(PaintContext context)
          Returns the minimum 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.
 void paint(PaintContext context, java.awt.Graphics g, int x, int y, int width, int height)
          Paints the Painter at the given location.
 

Field Detail

STATE_ENABLED_CHANGED

public static final int STATE_ENABLED_CHANGED
State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's enabled state changes.

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

STATE_ARMED_CHANGED

public static final int STATE_ARMED_CHANGED
State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's armed state changes.

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

STATE_ACTIVE_CHANGED

public static final int STATE_ACTIVE_CHANGED
State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's active state changes.

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

STATE_SET_CHANGED

public static final int STATE_SET_CHANGED
State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's set state changes.

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

STATE_MOUSE_OVER_CHANGED

public static final int STATE_MOUSE_OVER_CHANGED
State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's mouse over state changes.

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

STATE_FOCUSED_CHANGED

public static final int STATE_FOCUSED_CHANGED
State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's keyboard focused state changes.

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

STATE_ISDEFAULT_CHANGED

public static final int STATE_ISDEFAULT_CHANGED
State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's isdefault state changes.

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

STATE_SIZE_CHANGED

public static final int STATE_SIZE_CHANGED
State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's size changes.

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

STATE_FONT_CHANGED

public static final int STATE_FONT_CHANGED
State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's font changes.

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

STATE_FOREGROUND_CHANGED

public static final int STATE_FOREGROUND_CHANGED
State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's foreground color changes.

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

STATE_BACKGROUND_CHANGED

public static final int STATE_BACKGROUND_CHANGED
State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's background color changes.

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

STATE_XALIGNMENT_CHANGED

public static final int STATE_XALIGNMENT_CHANGED
State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's interior X alignment changes.

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

STATE_YALIGNMENT_CHANGED

public static final int STATE_YALIGNMENT_CHANGED
State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's interior Y alignment changes.

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

STATE_SELECTED_CHANGED

public static final int STATE_SELECTED_CHANGED
State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's selected state changes.

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

STATE_READING_DIRECTION_CHANGED

public static final int STATE_READING_DIRECTION_CHANGED
State modification constant indicating that the Painter wants to be repainted or invalidated when the PaintContext's reading direction changes.

See Also:
getRepaintFlags(oracle.cabo.image.painter.PaintContext), getInvalidateFlags(oracle.cabo.image.painter.PaintContext)
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.

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.

Parameters:
context - Context for determining the preferred size.

Returns:
The preferred size of the Painter.

getMinimumSize

public java.awt.Dimension getMinimumSize(PaintContext context)
Returns the minimum size of the painter.

Parameters:
context - Context for determining the minimum size.

Returns:
The minimum size of the Painter.

getMaximumSize

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

Parameters:
context - Context for determining the maximum size.

Returns:
The maximum size of the Painter.

paint

public void paint(PaintContext context,
                  java.awt.Graphics g,
                  int x,
                  int y,
                  int width,
                  int height)
Paints the Painter at the given location.

Parameters:
context - Context for painting.
g - Graphics object to draw into.
x - X position to draw at.
y - Y position to draw at.
width - Width to draw into.
height - Height to draw into.

contains

public boolean contains(PaintContext context,
                        int availableWidth,
                        int availableHeight,
                        int x,
                        int y)
Returns true if the specified x, y location is inside the 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.

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. Callers can also specify a painter to use to return if the painter that the point is contained in is actually that painter or any of its descendants.

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.

isTransparent

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

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.

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:
getInvalidateFlags(oracle.cabo.image.painter.PaintContext)

getInvalidateFlags

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

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.

See Also:
getRepaintFlags(oracle.cabo.image.painter.PaintContext)

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

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