Package com.explodingpixels.painter
Class FocusStatePainter
java.lang.Object
com.explodingpixels.painter.FocusStatePainter
- All Implemented Interfaces:
MacWidgetsPainter<Component>
An implementation of
MacWidgetsPainter
that delegates to given Painter
based on the focused state of the Component
supplied in the
paint(java.awt.Graphics2D, java.awt.Component, int, int)
method.-
Constructor Summary
ConstructorsConstructorDescriptionFocusStatePainter
(MacWidgetsPainter<Component> componentFocusedPainter, MacWidgetsPainter<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<Component> componentFocusedPainter, MacWidgetsPainter<Component> windowFocusedPainter, MacWidgetsPainter<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
Modifier and TypeMethodDescriptionvoid
paint
(Graphics2D g, Component component, int width, int height) Renders to the givenGraphics2D
.
-
Constructor Details
-
FocusStatePainter
public FocusStatePainter(MacWidgetsPainter<Component> componentFocusedPainter, MacWidgetsPainter<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<Component> componentFocusedPainter, MacWidgetsPainter<Component> windowFocusedPainter, MacWidgetsPainter<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 Details
-
paint
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<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.
-