Methods Summary |
---|
public static javax.swing.plaf.ComponentUI | createUI(javax.swing.JComponent c)
return new SynthViewportUI();
|
private int | getComponentState(javax.swing.JComponent c)
return SynthLookAndFeel.getComponentState(c);
|
private javax.swing.plaf.synth.SynthContext | getContext(javax.swing.JComponent c, int state)
return SynthContext.getContext(SynthContext.class, c,
getRegion(c), style, state);
|
public javax.swing.plaf.synth.SynthContext | getContext(javax.swing.JComponent c)
return getContext(c, getComponentState(c));
|
private javax.swing.plaf.synth.Region | getRegion(javax.swing.JComponent c)
return SynthLookAndFeel.getRegion(c);
|
protected void | installDefaults(javax.swing.JComponent c)
updateStyle(c);
|
protected void | installListeners(javax.swing.JComponent c)
c.addPropertyChangeListener(this);
|
public void | installUI(javax.swing.JComponent c)
super.installUI(c);
installDefaults(c);
installListeners(c);
|
public void | paint(java.awt.Graphics g, javax.swing.JComponent c)
SynthContext context = getContext(c);
paint(context, g);
context.dispose();
|
protected void | paint(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g)
|
public void | paintBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)
// This does nothing on purpose, JViewport doesn't allow a border
// and therefor this will NEVER be called.
|
public void | propertyChange(java.beans.PropertyChangeEvent e)
if (SynthLookAndFeel.shouldUpdateStyle(e)) {
updateStyle((JComponent)e.getSource());
}
|
protected void | uninstallDefaults(javax.swing.JComponent c)
SynthContext context = getContext(c, ENABLED);
style.uninstallDefaults(context);
context.dispose();
style = null;
|
protected void | uninstallListeners(javax.swing.JComponent c)
c.removePropertyChangeListener(this);
|
public void | uninstallUI(javax.swing.JComponent c)
super.uninstallUI(c);
uninstallListeners(c);
uninstallDefaults(c);
|
public void | update(java.awt.Graphics g, javax.swing.JComponent c)
SynthContext context = getContext(c);
SynthLookAndFeel.update(context, g);
context.getPainter().paintViewportBackground(context,
g, 0, 0, c.getWidth(), c.getHeight());
paint(context, g);
context.dispose();
|
private void | updateStyle(javax.swing.JComponent c)
SynthContext context = getContext(c, ENABLED);
// Note: JViewport is special cased as it does not allow for
// a border to be set. JViewport.setBorder is overriden to throw
// an IllegalArgumentException. Refer to SynthScrollPaneUI for
// details of this.
SynthStyle newStyle = SynthLookAndFeel.getStyle(context.getComponent(),
context.getRegion());
SynthStyle oldStyle = context.getStyle();
if (newStyle != oldStyle) {
if (oldStyle != null) {
oldStyle.uninstallDefaults(context);
}
context.setStyle(newStyle);
newStyle.installDefaults(context);
}
this.style = newStyle;
context.dispose();
|