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.
Constructor Summary |
NullPainter()
Creates a new Nullpainter instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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()
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.
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.
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.
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