Methods Summary |
---|
public sun.swing.plaf.synth.DefaultSynthStyle | addTo(sun.swing.plaf.synth.DefaultSynthStyle style)
if (!(style instanceof ParsedSynthStyle)) {
style = new ParsedSynthStyle(style);
}
ParsedSynthStyle pStyle = (ParsedSynthStyle)super.addTo(style);
pStyle._painters = mergePainterInfo(pStyle._painters, _painters);
return pStyle;
|
private javax.swing.plaf.synth.SynthPainter | getBestPainter(javax.swing.plaf.synth.SynthContext context, java.lang.String method, int direction)
// Check the state info first
StateInfo info = (StateInfo)getStateInfo(context.getComponentState());
SynthPainter painter;
if (info != null) {
if ((painter = getBestPainter(info.getPainters(), method,
direction)) != null) {
return painter;
}
}
if ((painter = getBestPainter(_painters, method, direction)) != null) {
return painter;
}
return SynthPainter.NULL_PAINTER;
|
private javax.swing.plaf.synth.SynthPainter | getBestPainter(javax.swing.plaf.synth.ParsedSynthStyle$PainterInfo[] info, java.lang.String method, int direction)
if (info != null) {
// Painter specified with no method
SynthPainter nullPainter = null;
// Painter specified for this method
SynthPainter methodPainter = null;
for (int counter = info.length - 1; counter >= 0; counter--) {
PainterInfo pi = info[counter];
if (pi.getMethod() == method) {
if (pi.getDirection() == direction) {
return pi.getPainter();
}
else if (methodPainter == null &&pi.getDirection() == -1) {
methodPainter = pi.getPainter();
}
}
else if (nullPainter == null && pi.getMethod() == null) {
nullPainter = pi.getPainter();
}
}
if (methodPainter != null) {
return methodPainter;
}
return nullPainter;
}
return null;
|
public javax.swing.plaf.synth.SynthPainter | getPainter(javax.swing.plaf.synth.SynthContext ss)
return DELEGATING_PAINTER_INSTANCE;
|
private static javax.swing.plaf.synth.ParsedSynthStyle$PainterInfo[] | mergePainterInfo(javax.swing.plaf.synth.ParsedSynthStyle$PainterInfo[] old, javax.swing.plaf.synth.ParsedSynthStyle$PainterInfo[] newPI)
if (old == null) {
return newPI;
}
if (newPI == null) {
return old;
}
int oldLength = old.length;
int newLength = newPI.length;
int dups = 0;
PainterInfo[] merged = new PainterInfo[oldLength + newLength];
System.arraycopy(old, 0, merged, 0, oldLength);
for (int newCounter = 0; newCounter < newLength; newCounter++) {
boolean found = false;
for (int oldCounter = 0; oldCounter < oldLength - dups;
oldCounter++) {
if (newPI[newCounter].equalsPainter(old[oldCounter])) {
merged[oldCounter] = newPI[newCounter];
dups++;
found = true;
break;
}
}
if (!found) {
merged[oldLength + newCounter - dups] = newPI[newCounter];
}
}
if (dups > 0) {
PainterInfo[] tmp = merged;
merged = new PainterInfo[merged.length - dups];
System.arraycopy(tmp, 0, merged, 0, merged.length);
}
return merged;
|
public void | setPainters(javax.swing.plaf.synth.ParsedSynthStyle$PainterInfo[] info)
_painters = info;
|
public java.lang.String | toString()
StringBuffer text = new StringBuffer(super.toString());
if (_painters != null) {
text.append(",painters=[");
for (int i = 0; i < +_painters.length; i++) {
text.append(_painters[i].toString());
}
text.append("]");
}
return text.toString();
|