Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.image.painter
Class NullPainter

java.lang.Object
  |
  +--oracle.cabo.image.painter.AbstractPainter
        |
        +--oracle.cabo.image.painter.NullPainter
All Implemented Interfaces:
BorderPainter, Painter

public class NullPainter
extends AbstractPainter
implements BorderPainter

A completely transparent painter object that has no size. This is useful as a default value and as a transparent painter.


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
NullPainter()
          Creates a new Nullpainter instance.
 
Method Summary
 ImmInsets getFillInsets(PaintContext context)
          Returns the amount of space by which fills should be inset.
 ImmInsets getInsets(PaintContext context)
          Returns the amount of space the border will require on each side.
 java.awt.Dimension getMaximumSize(PaintContext context)
          Returns the maximum size of the NullPainter.
 java.awt.Dimension getMinimumSize(PaintContext context)
          Returns the minimum size of the NullPainter.
static BorderPainter getPainter()
          Returns the shared instance of the NullPainter class.
 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 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 NullPainter 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 NullPainter at the given location.
 
Methods inherited from class oracle.cabo.image.painter.AbstractPainter
contains, getData, getDataKey, getInvalidateFlags, getPreferredSize, getRepaintFlags
 
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, getPreferredSize, getRepaintFlags
 

Constructor Detail

NullPainter

public NullPainter()
Creates a new Nullpainter instance. NullPainter is not a singleton, although there is a shared instance which most programmers will use. Being able to create new instances allows programmers to differentiate Nullpainter instances.

See Also:
getPainter()
Method Detail

getPainter

public static BorderPainter getPainter()
Returns the shared instance of the NullPainter class. This is the instance that most users should use.

Returns:
The shared instance of the NullPainter class.

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
Overrides:
getSize in class AbstractPainter
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.

getMinimumSize

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

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

Specified by:
getMaximumSize in interface Painter
Overrides:
getMaximumSize in class AbstractPainter
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 NullPainter at the given location.

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

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
Overrides:
getPainterAt in class AbstractPainter
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 NullPainter doesn't paint all of its pixels.

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

Returns:
True if the Painter is transparent.

getInsets

public ImmInsets getInsets(PaintContext context)
Returns the amount of space the border will require on each side.

Specified by:
getInsets in interface BorderPainter
Parameters:
context - the context for painting

getFillInsets

public ImmInsets getFillInsets(PaintContext context)
Returns the amount of space by which fills should be inset.

Specified by:
getFillInsets in interface BorderPainter
Parameters:
context - the context for painting

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

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