Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.image.painter
Class AbstractPainterSwitcher

java.lang.Object
  |
  +--oracle.cabo.image.painter.AbstractPainter
        |
        +--oracle.cabo.image.painter.AbstractWrappingPainter
              |
              +--oracle.cabo.image.painter.AbstractPainterSwitcher
All Implemented Interfaces:
Painter
Direct Known Subclasses:
BooleanDataSwitcher

public abstract class AbstractPainterSwitcher
extends AbstractWrappingPainter

Abstract base class for painters that switch between two painters depending only the value returned by the method useTruePainter. subclasses need to implement useTruePainter.

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

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
AbstractPainterSwitcher(Painter truePainter)
          Create an AbstAbstractPainterSwitcher that uses the truePainter when useTruePainter evaluates to true, and the NullPainter otherwise.
AbstractPainterSwitcher(Painter truePainter, Painter falsePainter)
          Create an AbstAbstractPainterSwitcher that uses the truePainter when useTruePainter evaluates to true, and the falsePainter otherwise.
 
Method Summary
protected  Painter getWrappedPainter(PaintContext context)
          Override to return the correct painter.
protected abstract  boolean useTruePainter(PaintContext context)
          Returns true if the true painter should be used.
 
Methods inherited from class oracle.cabo.image.painter.AbstractWrappingPainter
getInvalidateFlags, getMaximumSize, getMinimumSize, getPainterAt, getPreferredSize, getRepaintFlags, getSize, isTransparent, paint
 
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
 

Constructor Detail

AbstractPainterSwitcher

public AbstractPainterSwitcher(Painter truePainter)
Create an AbstAbstractPainterSwitcher that uses the truePainter when useTruePainter evaluates to true, and the NullPainter otherwise.

Parameters:
truePainter - Painter to use when useTruePainter is true.

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

AbstractPainterSwitcher

public AbstractPainterSwitcher(Painter truePainter,
                               Painter falsePainter)
Create an AbstAbstractPainterSwitcher that uses the truePainter when useTruePainter evaluates to true, and the falsePainter otherwise.

Parameters:
truePainter - Painter to use when useTruePainter is true.
falsePainter - Painter to use when useTruePainter is false.

See Also:
useTruePainter(oracle.cabo.image.painter.PaintContext)
Method Detail

useTruePainter

protected abstract boolean useTruePainter(PaintContext context)
Returns true if the true painter should be used. False if the false painter should be used.

getWrappedPainter

protected final Painter getWrappedPainter(PaintContext context)
Override to return the correct painter.
Overrides:
getWrappedPainter in class AbstractWrappingPainter
Following copied from class: oracle.cabo.image.painter.AbstractWrappingPainter
Parameters:
context - Context to use for determining the wrapped painter.

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

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