SynthPainterpublic abstract class SynthPainter extends Object SynthPainter is used for painting portions of
JComponent s. At a minimum each JComponent
has two paint methods: one for the border and one for the background. Some
JComponent s have more than one Region , and as
a consequence more paint methods.
Instances of SynthPainter are obtained from the
{@link javax.swing.plaf.synth.SynthStyle#getPainter} method.
You typically supply a SynthPainter by way of Synth's
file format. The following
example registers a painter for all JButton s that will
render the image myImage.png :
<style id="buttonStyle">
<imagePainter path="myImage.png" sourceInsets="2 2 2 2"
paintCenter="true" stretch="true"/>
<insets top="2" bottom="2" left="2" right="2"/>
</style>
<bind style="buttonStyle" type="REGION" key="button"/>
SynthPainter is abstract in so far as it does no painting,
all the methods
are empty. While none of these methods are typed to throw an exception,
subclasses can assume that valid arguments are passed in, and if not
they can throw a NullPointerException or
IllegalArgumentException in response to invalid arguments. |
Fields Summary |
---|
static SynthPainter | NULL_PAINTERUsed to avoid null painter checks everywhere. |
Methods Summary |
---|
public void | paintArrowButtonBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of an arrow button. Arrow buttons are created by
some components, such as JScrollBar .
| public void | paintArrowButtonBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of an arrow button. Arrow buttons are created by
some components, such as JScrollBar .
| public void | paintArrowButtonForeground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h, int direction)Paints the foreground of an arrow button. This method is responsible
for drawing a graphical representation of a direction, typically
an arrow. Arrow buttons are created by
some components, such as JScrollBar
| public void | paintButtonBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a button.
| public void | paintButtonBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a button.
| public void | paintCheckBoxBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a check box.
| public void | paintCheckBoxBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a check box.
| public void | paintCheckBoxMenuItemBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a check box menu item.
| public void | paintCheckBoxMenuItemBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a check box menu item.
| public void | paintColorChooserBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a color chooser.
| public void | paintColorChooserBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a color chooser.
| public void | paintComboBoxBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a combo box.
| public void | paintComboBoxBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a combo box.
| public void | paintDesktopIconBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a desktop icon.
| public void | paintDesktopIconBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a desktop icon.
| public void | paintDesktopPaneBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a desktop pane.
| public void | paintDesktopPaneBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a desktop pane.
| public void | paintEditorPaneBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of an editor pane.
| public void | paintEditorPaneBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of an editor pane.
| public void | paintFileChooserBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a file chooser.
| public void | paintFileChooserBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a file chooser.
| public void | paintFormattedTextFieldBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a formatted text field.
| public void | paintFormattedTextFieldBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a formatted text field.
| public void | paintInternalFrameBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of an internal frame.
| public void | paintInternalFrameBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of an internal frame.
| public void | paintInternalFrameTitlePaneBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of an internal frame title pane.
| public void | paintInternalFrameTitlePaneBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of an internal frame title pane.
| public void | paintLabelBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a label.
| public void | paintLabelBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a label.
| public void | paintListBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a list.
| public void | paintListBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a list.
| public void | paintMenuBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a menu.
| public void | paintMenuBarBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a menu bar.
| public void | paintMenuBarBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a menu bar.
| public void | paintMenuBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a menu.
| public void | paintMenuItemBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a menu item.
| public void | paintMenuItemBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a menu item.
| public void | paintOptionPaneBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of an option pane.
| public void | paintOptionPaneBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of an option pane.
| public void | paintPanelBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a panel.
| public void | paintPanelBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a panel.
| public void | paintPasswordFieldBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a password field.
| public void | paintPasswordFieldBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a password field.
| public void | paintPopupMenuBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a popup menu.
| public void | paintPopupMenuBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a popup menu.
| public void | paintProgressBarBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a progress bar.
| public void | paintProgressBarBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a progress bar.
| public void | paintProgressBarForeground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h, int orientation)Paints the foreground of a progress bar. This is responsible for
providing an indication of the progress of the progress bar.
| public void | paintRadioButtonBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a radio button.
| public void | paintRadioButtonBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a radio button.
| public void | paintRadioButtonMenuItemBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a radio button menu item.
| public void | paintRadioButtonMenuItemBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a radio button menu item.
| public void | paintRootPaneBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a root pane.
| public void | paintRootPaneBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a root pane.
| public void | paintScrollBarBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a scrollbar.
| public void | paintScrollBarBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a scrollbar.
| public void | paintScrollBarThumbBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h, int orientation)Paints the background of the thumb of a scrollbar. The thumb provides
a graphical indication as to how much of the Component is visible in a
JScrollPane .
| public void | paintScrollBarThumbBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h, int orientation)Paints the border of the thumb of a scrollbar. The thumb provides
a graphical indication as to how much of the Component is visible in a
JScrollPane .
| public void | paintScrollBarTrackBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of the track of a scrollbar. The track contains
the thumb.
| public void | paintScrollBarTrackBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of the track of a scrollbar. The track contains
the thumb.
| public void | paintScrollPaneBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a scroll pane.
| public void | paintScrollPaneBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a scroll pane.
| public void | paintSeparatorBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a separator.
| public void | paintSeparatorBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a separator.
| public void | paintSeparatorForeground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h, int orientation)Paints the foreground of a separator.
| public void | paintSliderBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a slider.
| public void | paintSliderBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a slider.
| public void | paintSliderThumbBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h, int orientation)Paints the background of the thumb of a slider.
| public void | paintSliderThumbBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h, int orientation)Paints the border of the thumb of a slider.
| public void | paintSliderTrackBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of the track of a slider.
| public void | paintSliderTrackBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of the track of a slider.
| public void | paintSpinnerBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a spinner.
| public void | paintSpinnerBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a spinner.
| public void | paintSplitPaneBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a split pane.
| public void | paintSplitPaneBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a split pane.
| public void | paintSplitPaneDividerBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of the divider of a split pane.
| public void | paintSplitPaneDividerForeground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h, int orientation)Paints the foreground of the divider of a split pane.
| public void | paintSplitPaneDragDivider(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h, int orientation)Paints the divider, when the user is dragging the divider, of a
split pane.
| public void | paintTabbedPaneBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a tabbed pane.
| public void | paintTabbedPaneBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a tabbed pane.
| public void | paintTabbedPaneContentBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of the area that contains the content of the
selected tab of a tabbed pane.
| public void | paintTabbedPaneContentBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of the area that contains the content of the
selected tab of a tabbed pane.
| public void | paintTabbedPaneTabAreaBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of the area behind the tabs of a tabbed pane.
| public void | paintTabbedPaneTabAreaBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of the area behind the tabs of a tabbed pane.
| public void | paintTabbedPaneTabBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h, int tabIndex)Paints the background of a tab of a tabbed pane.
| public void | paintTabbedPaneTabBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h, int tabIndex)Paints the border of a tab of a tabbed pane.
| public void | paintTableBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a table.
| public void | paintTableBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a table.
| public void | paintTableHeaderBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of the header of a table.
| public void | paintTableHeaderBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of the header of a table.
| public void | paintTextAreaBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a text area.
| public void | paintTextAreaBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a text area.
| public void | paintTextFieldBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a text field.
| public void | paintTextFieldBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a text field.
| public void | paintTextPaneBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a text pane.
| public void | paintTextPaneBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a text pane.
| public void | paintToggleButtonBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a toggle button.
| public void | paintToggleButtonBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a toggle button.
| public void | paintToolBarBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a tool bar.
| public void | paintToolBarBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a tool bar.
| public void | paintToolBarContentBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of the tool bar's content area.
| public void | paintToolBarContentBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of the content area of a tool bar.
| public void | paintToolBarDragWindowBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of the window containing the tool bar when it
has been detached from its primary frame.
| public void | paintToolBarDragWindowBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of the window containing the tool bar when it
has been detached from it's primary frame.
| public void | paintToolTipBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a tool tip.
| public void | paintToolTipBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a tool tip.
| public void | paintTreeBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of a tree.
| public void | paintTreeBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a tree.
| public void | paintTreeCellBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of the row containing a cell in a tree.
| public void | paintTreeCellBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of the row containing a cell in a tree.
| public void | paintTreeCellFocus(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the focus indicator for a cell in a tree when it has focus.
| public void | paintViewportBackground(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the background of the viewport.
| public void | paintViewportBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints the border of a viewport.
|
|