PixmapStylepublic class PixmapStyle extends GTKStyle implements GTKConstantsPixmapStyle extends GTKStyle adding support for a set of Info s. |
Fields Summary |
---|
private static final GTKEngine | PIXMAP_ENGINEThere should only ever be one pixmap engine. | private Info[] | infoSet of Infos used to determine what to paint. |
Constructors Summary |
---|
public PixmapStyle(DefaultSynthStyle style)Creates a duplicate of the passed in style.
super(style);
if (style instanceof PixmapStyle) {
this.info = ((PixmapStyle)style).info;
}
| public PixmapStyle(StateInfo[] states, CircularIdentityList classSpecificValues, Font font, int xThickness, int yThickness, GTKStockIconInfo[] icons, Info[] info)Creates a PixmapStyle from the passed in arguments.
super(states, classSpecificValues, font, xThickness, yThickness, icons);
this.info = info;
|
Methods Summary |
---|
public sun.swing.plaf.synth.DefaultSynthStyle | addTo(sun.swing.plaf.synth.DefaultSynthStyle s)Adds the state of this PixmapStyle to that of s
returning a combined SynthStyle.
if (!(s instanceof PixmapStyle)) {
s = new PixmapStyle(s);
}
PixmapStyle style = (PixmapStyle)super.addTo(s);
if (info != null) {
if (style.info == null) {
style.info = info;
}
else {
// Place the more specific first.
Info[] merged = new Info[style.info.length + info.length];
System.arraycopy(info, 0, merged, 0, info.length);
System.arraycopy(style.info, 0, merged, info.length,
style.info.length);
style.info = merged;
}
}
return style;
| public java.lang.Object | clone()Creates a copy of the reciever and returns it.
PixmapStyle style = (PixmapStyle)super.clone();
// Info is immutable, no need to clone it.
style.info = this.info;
return style;
| public com.sun.java.swing.plaf.gtk.GTKEngine | getEngine(javax.swing.plaf.synth.SynthContext context)Returns a GTKEngine to use for rendering.
return PIXMAP_ENGINE;
| public com.sun.java.swing.plaf.gtk.PixmapStyle$Info | getInfo(java.lang.String function, java.lang.String detail, int componentState, int shadow, int orientation, int gapSide, int arrowDirection)Returns the first instance of Info that matches the past in args, may
return null if nothing matches.
if (info != null) {
for (int counter = 0, max = info.length; counter < max;counter++) {
if (info[counter].getFunction() == function && info[counter].
getMatchCount(detail, componentState, shadow,
orientation, gapSide, arrowDirection) != -1) {
return info[counter];
}
}
}
return null;
| private int | getMaxMatchCount(int componentState, int shadow, int orientation, int gapSide, int arrowDirection, java.lang.String detail)Returns the number of non-null arugments and arguments that are
!= UNDEFINED.
int count = 0;
if (detail != null) {
count++;
}
if (componentState != UNDEFINED) {
count++;
}
if (shadow != UNDEFINED) {
count++;
}
if (orientation != UNDEFINED) {
count++;
}
if (gapSide != UNDEFINED) {
count++;
}
if (arrowDirection != UNDEFINED) {
count++;
}
return count;
| public java.lang.String | toString()
if (info == null) {
return super.toString();
} else {
StringBuffer buf = new StringBuffer(super.toString());
if (buf.length() > 0) {
buf.append('\n");
}
buf.append("*** Pixmap Engine Info ***\n");
for (int i = 0; i < info.length; i++) {
buf.append(info[i].toString()).append('\n");
}
// remove last newline
buf.deleteCharAt(buf.length() - 1);
return buf.toString();
}
|
|