Package com.explodingpixels.painter
Class FocusStatePainter
- java.lang.Object
-
- com.explodingpixels.painter.FocusStatePainter
-
- All Implemented Interfaces:
MacWidgetsPainter<java.awt.Component>
public class FocusStatePainter extends java.lang.Object implements MacWidgetsPainter<java.awt.Component>
An implementation ofMacWidgetsPainter
that delegates to givenPainter
based on the focused state of theComponent
supplied in thepaint(java.awt.Graphics2D, java.awt.Component, int, int)
method.
-
-
Constructor Summary
Constructors Constructor Description FocusStatePainter(MacWidgetsPainter<java.awt.Component> componentFocusedPainter, MacWidgetsPainter<java.awt.Component> windowUnfocusedPainter)
Creates aMacWidgetsPainter
that delegates to the givenPainter
s based on the focus state of the suppliedComponent
or the focus state of it's parentWindow
.FocusStatePainter(MacWidgetsPainter<java.awt.Component> componentFocusedPainter, MacWidgetsPainter<java.awt.Component> windowFocusedPainter, MacWidgetsPainter<java.awt.Component> windowUnfocusedPainter)
Creates aMacWidgetsPainter
that delegates to the givenPainter
s based on the focus state of the suppliedComponent
or the focus state of it's parentWindow
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
paint(java.awt.Graphics2D g, java.awt.Component component, int width, int height)
Renders to the givenGraphics2D
.
-
-
-
Constructor Detail
-
FocusStatePainter
public FocusStatePainter(MacWidgetsPainter<java.awt.Component> componentFocusedPainter, MacWidgetsPainter<java.awt.Component> windowUnfocusedPainter)
Creates aMacWidgetsPainter
that delegates to the givenPainter
s based on the focus state of the suppliedComponent
or the focus state of it's parentWindow
.- Parameters:
componentFocusedPainter
- thePainter
to use when the givenComponent
is focused or it's parentjava.awt.Window
is focused.windowUnfocusedPainter
- thePainter
to use when the givenComponent
's parentjava.awt.Window
is unfocused.
-
FocusStatePainter
public FocusStatePainter(MacWidgetsPainter<java.awt.Component> componentFocusedPainter, MacWidgetsPainter<java.awt.Component> windowFocusedPainter, MacWidgetsPainter<java.awt.Component> windowUnfocusedPainter)
Creates aMacWidgetsPainter
that delegates to the givenPainter
s based on the focus state of the suppliedComponent
or the focus state of it's parentWindow
.- Parameters:
componentFocusedPainter
- thePainter
to use when the givenComponent
is focused.windowFocusedPainter
- thePainter
to use when the givenComponent
is unfocused but theComponent
's parent window is focused.windowUnfocusedPainter
- thePainter
to use when the givenComponent
's parentjava.awt.Window
is unfocused.
-
-
Method Detail
-
paint
public void paint(java.awt.Graphics2D g, java.awt.Component component, int width, int height)
Description copied from interface:MacWidgetsPainter
Renders to the givenGraphics2D
. The supplied graphics context may be modified - it's state need not be restored upon completion of painting.- Specified by:
paint
in interfaceMacWidgetsPainter<java.awt.Component>
- Parameters:
g
- the graphics context to paint into. It's state need not be restored. Will not be null.component
- the object to be painted.width
- the width within the object to paint.height
- the height within the object to paint.
-
-