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 ofMacWidgetsPainterthat delegates to givenPainterbased on the focused state of theComponentsupplied 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 aMacWidgetsPainterthat delegates to the givenPainters based on the focus state of the suppliedComponentor the focus state of it's parentWindow.FocusStatePainter(MacWidgetsPainter<java.awt.Component> componentFocusedPainter, MacWidgetsPainter<java.awt.Component> windowFocusedPainter, MacWidgetsPainter<java.awt.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidpaint(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 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<java.awt.Component> componentFocusedPainter, MacWidgetsPainter<java.awt.Component> windowFocusedPainter, MacWidgetsPainter<java.awt.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 Detail
-
paint
public void paint(java.awt.Graphics2D g, java.awt.Component component, int width, int height)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<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.
-
-