public class SynthButtonUI extends BasicButtonUIimplements PropertyChangeListener , SynthUI
JButton.
defaultTextIconGap, defaultTextShiftOffsetDEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED| Constructor and Description |
|---|
SynthButtonUI()
|
| Modifier and Type | Method and Description |
|---|---|
static ComponentUI |
createUI(JComponent
Creates a new UI object for the given component.
|
int |
getBaseline(JComponent
Returns the baseline.
|
SynthContext |
getContext(JComponent
Returns the Context for the specified component.
|
protected Icon |
getDefaultIcon(AbstractButton
Returns the default icon.
|
protected Icon |
getIcon(AbstractButton
Returns the Icon to use for painting the button.
|
Dimension |
getMaximumSize(JComponent
Returns the specified component's maximum size appropriate for the look and feel.
|
Dimension |
getMinimumSize(JComponent
Returns the specified component's minimum size appropriate for the look and feel.
|
Dimension |
getPreferredSize(JComponent
Returns the specified component's preferred size appropriate for the look and feel.
|
protected Icon |
getSizingIcon(AbstractButton
Returns the Icon used in calculating the preferred/minimum/maximum size.
|
protected void |
installDefaults(AbstractButton
|
protected void |
installListeners(AbstractButton
|
void |
paint(Graphics
Paints the specified component according to the Look and Feel.
|
protected void |
paint(SynthContext
Paints the specified component.
|
void |
paintBorder(SynthContext
Paints the border.
|
void |
propertyChange(PropertyChangeEvent
This method gets called when a bound property is changed.
|
protected void |
uninstallDefaults(AbstractButton
|
protected void |
uninstallListeners(AbstractButton
|
void |
update(Graphics
Notifies this UI delegate to repaint the specified component.
|
clearTextShiftOffset, createButtonListener, getBaselineResizeBehavior, getDefaultTextIconGap, getPropertyPrefix, getTextShiftOffset, installKeyboardActions, installUI, paintButtonPressed, paintFocus, paintIcon, paintText, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallUIcontains, getAccessibleChild, getAccessibleChildrenCountpublic static ComponentUIcreateUI(JComponent c)
c - component to create UI object for
protected void installDefaults(AbstractButtonb)
protected void installListeners(AbstractButtonb)
protected void uninstallListeners(AbstractButtonb)
protected void uninstallDefaults(AbstractButtonb)
public SynthContextgetContext(JComponent c)
getContext in interface
SynthUI
c - Component requesting SynthContext.
public int getBaseline(JComponentc, int width, int height)
getBaseline in class
BasicButtonUI
c -
JComponent baseline is being requested for
width - the width to get the baseline for
height - the height to get the baseline for
JComponent.getBaseline(int, int)
public void update(Graphicsg, JComponent c)
paint(SynthContext,Graphics) method.
In general, this method does not need to be overridden by subclasses. All Look and Feel rendering code should reside in the paint method.
update in class
ComponentUI
g - the
Graphics object used for painting
c - the component being painted
paint(SynthContext,Graphics)
public void paint(Graphicsg, JComponent c)
This method is not used by Synth Look and Feel. Painting is handled by the paint(SynthContext,Graphics) method.
paint in class
BasicButtonUI
g - the
Graphics object used for painting
c - the component being painted
paint(SynthContext,Graphics)
protected void paint(SynthContextcontext, Graphics g)
context - context for the component being painted
g - the
Graphics object used for painting
update(Graphics,JComponent)
public void paintBorder(SynthContextcontext, Graphics g, int x, int y, int w, int h)
paintBorder in interface
SynthUI
context - a component context
g -
Graphics to paint on
x - the X coordinate
y - the Y coordinate
w - width of the border
h - height of the border
protected IcongetDefaultIcon(AbstractButton b)
b - button the icon is associated with
protected IcongetIcon(AbstractButton b)
b - button the icon is associated with
public DimensiongetMinimumSize(JComponent c)
null is returned, the minimum size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method invokes
getPreferredSize and returns that value.
getMinimumSize in class
BasicButtonUI
c - the component whose minimum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
Dimension object or
null
JComponent.getMinimumSize() ,
LayoutManager.minimumLayoutSize(java.awt.Container) ,
ComponentUI.getPreferredSize(javax.swing.JComponent)
public DimensiongetPreferredSize(JComponent c)
null is returned, the preferred size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method returns
null.
getPreferredSize in class
BasicButtonUI
c - the component whose preferred size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
JComponent.getPreferredSize() ,
LayoutManager.preferredLayoutSize(java.awt.Container)
public DimensiongetMaximumSize(JComponent c)
null is returned, the maximum size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method invokes
getPreferredSize and returns that value.
getMaximumSize in class
BasicButtonUI
c - the component whose maximum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
Dimension object or
null
JComponent.getMaximumSize() ,
LayoutManager2.maximumLayoutSize(java.awt.Container)
protected IcongetSizingIcon(AbstractButton b)
public void propertyChange(PropertyChangeEvente)
propertyChange in interface
PropertyChangeListener
e - A PropertyChangeEvent object describing the event source and the property that has changed.