MotifButtonUIpublic class MotifButtonUI extends BasicButtonUI MotifButton implementation
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is appropriate
for short term storage or RMI between applications running the same
version of Swing. A future release of Swing will provide support for
long term persistence. |
Fields Summary |
---|
private static final MotifButtonUI | motifButtonUI | protected Color | selectColor | private boolean | defaults_initialized |
Methods Summary |
---|
protected javax.swing.plaf.basic.BasicButtonListener | createButtonListener(javax.swing.AbstractButton b)
return new MotifButtonListener(b);
| public static javax.swing.plaf.ComponentUI | createUI(javax.swing.JComponent c)
// ********************************
// Create PLAF
// ********************************
return motifButtonUI;
| protected void | fillContentArea(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Color fillColor)
if (b.isContentAreaFilled()) {
Insets margin = b.getMargin();
Insets insets = b.getInsets();
Dimension size = b.getSize();
g.setColor(fillColor);
g.fillRect(insets.left - margin.left,
insets.top - margin.top,
size.width - (insets.left-margin.left) - (insets.right - margin.right),
size.height - (insets.top-margin.top) - (insets.bottom - margin.bottom));
}
| protected java.awt.Color | getSelectColor()
return selectColor;
| public void | installDefaults(javax.swing.AbstractButton b)
super.installDefaults(b);
if(!defaults_initialized) {
selectColor = UIManager.getColor(getPropertyPrefix() + "select");
defaults_initialized = true;
}
LookAndFeel.installProperty(b, "opaque", Boolean.FALSE);
| public void | paint(java.awt.Graphics g, javax.swing.JComponent c)
fillContentArea( g, (AbstractButton)c , c.getBackground() );
super.paint(g,c);
| protected void | paintButtonPressed(java.awt.Graphics g, javax.swing.AbstractButton b)
fillContentArea( g, b , selectColor );
| protected void | paintFocus(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle viewRect, java.awt.Rectangle textRect, java.awt.Rectangle iconRect)
// focus painting is handled by the border
| protected void | paintIcon(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Rectangle iconRect)
Shape oldClip = g.getClip();
Rectangle newClip =
AbstractBorder.getInteriorRectangle(c, c.getBorder(), 0, 0,
c.getWidth(), c.getHeight());
Rectangle r = oldClip.getBounds();
newClip =
SwingUtilities.computeIntersection(r.x, r.y, r.width, r.height,
newClip);
g.setClip(newClip);
super.paintIcon(g, c, iconRect);
g.setClip(oldClip);
| protected void | uninstallDefaults(javax.swing.AbstractButton b)
super.uninstallDefaults(b);
defaults_initialized = false;
|
|