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 aMacWidgetsPainterthat delegates to the givenPainters based on the focus state of the suppliedComponentor the focus state of it's parentWindow.FocusStatePainter(MacWidgetsPainter<Component> componentFocusedPainter, MacWidgetsPainter<Component> windowFocusedPainter, MacWidgetsPainter<Component> windowUnfocusedPainter) Creates aMacWidgetsPainterthat delegates to the givenPainters based on the focus state of the suppliedComponentor the focus state of it's parentWindow. -
Method Summary
Modifier and TypeMethodDescriptionvoidpaint(Graphics2D g, Component component, int width, int height) Renders to the givenGraphics2D.
-
Constructor Details
-
FocusStatePainter
public FocusStatePainter(MacWidgetsPainter<Component> componentFocusedPainter, MacWidgetsPainter<Component> windowUnfocusedPainter) Creates aMacWidgetsPainterthat delegates to the givenPainters based on the focus state of the suppliedComponentor the focus state of it's parentWindow.- Parameters:
componentFocusedPainter- thePainterto use when the givenComponentis focused or it's parentjava.awt.Windowis focused.windowUnfocusedPainter- thePainterto use when the givenComponent's parentjava.awt.Windowis unfocused.
-
FocusStatePainter
public FocusStatePainter(MacWidgetsPainter<Component> componentFocusedPainter, MacWidgetsPainter<Component> windowFocusedPainter, MacWidgetsPainter<Component> windowUnfocusedPainter) Creates aMacWidgetsPainterthat delegates to the givenPainters based on the focus state of the suppliedComponentor the focus state of it's parentWindow.- Parameters:
componentFocusedPainter- thePainterto use when the givenComponentis focused.windowFocusedPainter- thePainterto use when the givenComponentis unfocused but theComponent's parent window is focused.windowUnfocusedPainter- thePainterto use when the givenComponent's parentjava.awt.Windowis unfocused.
-
-
Method Details
-
paint
Description copied from interface:MacWidgetsPainterRenders to the givenGraphics2D. The supplied graphics context may be modified - it's state need not be restored upon completion of painting.- Specified by:
paintin 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.
-