Methods Summary |
---|
void | dispose()
this.component = null;
this.style = null;
releaseContext(this);
|
public javax.swing.JComponent | getComponent()Returns the hosting component containing the region.
return component;
|
public int | getComponentState()Returns the state of the widget, which is a bitmask of the
values defined in SynthConstants . A region will at least
be in one of
ENABLED , MOUSE_OVER , PRESSED
or DISABLED .
return state;
|
static javax.swing.plaf.synth.SynthContext | getContext(java.lang.Class type, javax.swing.JComponent component, javax.swing.plaf.synth.Region region, javax.swing.plaf.synth.SynthStyle style, int state)
contextMap = new HashMap();
SynthContext context = null;
synchronized(contextMap) {
java.util.List instances = (java.util.List)contextMap.get(type);
if (instances != null) {
int size = instances.size();
if (size > 0) {
context = (SynthContext)instances.remove(size - 1);
}
}
}
if (context == null) {
try {
context = (SynthContext)type.newInstance();
} catch (IllegalAccessException iae) {
} catch (InstantiationException ie) {
}
}
context.reset(component, region, style, state);
return context;
|
javax.swing.plaf.synth.SynthPainter | getPainter()Convenience method to get the Painter from the current SynthStyle.
This will NEVER return null.
SynthPainter painter = getStyle().getPainter(this);
if (painter != null) {
return painter;
}
return SynthPainter.NULL_PAINTER;
|
public javax.swing.plaf.synth.Region | getRegion()Returns the Region identifying this state.
return region;
|
public javax.swing.plaf.synth.SynthStyle | getStyle()Returns the style associated with this Region.
return style;
|
boolean | isSubregion()A convenience method for getRegion().isSubregion() .
return getRegion().isSubregion();
|
static void | releaseContext(javax.swing.plaf.synth.SynthContext context)
synchronized(contextMap) {
java.util.List instances = (java.util.List)contextMap.get(
context.getClass());
if (instances == null) {
instances = new ArrayList(5);
contextMap.put(context.getClass(), instances);
}
instances.add(context);
}
|
void | reset(javax.swing.JComponent component, javax.swing.plaf.synth.Region region, javax.swing.plaf.synth.SynthStyle style, int state)Resets the state of the Context.
this.component = component;
this.region = region;
this.style = style;
this.state = state;
|
void | setComponentState(int state)
this.state = state;
|
void | setStyle(javax.swing.plaf.synth.SynthStyle style)
this.style = style;
|