Provides the look and feel for a styled text editor in the
Synth look and feel.
| Method from javax.swing.plaf.synth.SynthTextPaneUI Detail: |
public static ComponentUI createUI(JComponent c) {
return new SynthTextPaneUI();
}
Creates a UI for the JTextPane. |
protected String getPropertyPrefix() {
return "TextPane";
}
Fetches the name used as a key to lookup properties through the
UIManager. This is used as a prefix to all the standard
text properties. |
public void installUI(JComponent c) {
super.installUI(c);
updateForeground(c.getForeground());
updateFont(c.getFont());
}
|
void paintBackground(SynthContext context,
Graphics g,
JComponent c) {
context.getPainter().paintTextPaneBackground(context, g, 0, 0,
c.getWidth(), c.getHeight());
}
|
public void paintBorder(SynthContext context,
Graphics g,
int x,
int y,
int w,
int h) {
context.getPainter().paintTextPaneBorder(context, g, x, y, w, h);
}
|
protected void propertyChange(PropertyChangeEvent evt) {
super.propertyChange(evt);
String name = evt.getPropertyName();
if (name.equals("foreground")) {
updateForeground((Color)evt.getNewValue());
} else if (name.equals("font")) {
updateFont((Font)evt.getNewValue());
} else if (name.equals("document")) {
JComponent comp = getComponent();
updateForeground(comp.getForeground());
updateFont(comp.getFont());
}
}
This method gets called when a bound property is changed
on the associated JTextComponent. This is a hook
which UI implementations may change to reflect how the
UI displays bound properties of JTextComponent subclasses.
If the font, foreground or document has changed, the
the appropriate property is set in the default style of
the document. |