/** * @param context * @param style * @return */ public static SynthContext getContext(SynthContext context, SynthStyle style) { if (context.getStyle().equals(style)) return context; return getContext(context.getComponent(), context.getRegion(), style, context.getComponentState()); } /**
/** * @param context * @param style * @return */ public static SynthContext getContext(SynthContext context, SynthStyle style) { if (context.getStyle().equals(style)) return context; return getContext(context.getComponent(), context.getRegion(), style, context.getComponentState()); } /**
/** * @param context * @param style * @return */ public static SynthContext getContext(SynthContext context, SynthStyle style) { if (context.getStyle().equals(style)) return context; return getContext(context.getComponent(), context.getRegion(), style, context.getComponentState()); } /**
/** * @param context * @param style * @return */ public static SynthContext getContext(SynthContext context, SynthStyle style) { if (context.getStyle().equals(style)) return context; return getContext(context.getComponent(), context.getRegion(), style, context.getComponentState()); } /**
/** * Returns a context with the given component state and all other fields same as input context. * * @param context the context, must not be null * @param state the component state. * @return a context with the given component state and other fields as inpu context. */ public static SynthContext getContext(SynthContext context, int state) { if (context.getComponentState() == state) return context; return getContext(context.getComponent(), context.getRegion(), context.getStyle(), state); }
/** * Returns a context with the given component state and all other fields same as input context. * * @param context the context, must not be null * @param state the component state. * @return a context with the given component state and other fields as inpu context. */ public static SynthContext getContext(SynthContext context, int state) { if (context.getComponentState() == state) return context; return getContext(context.getComponent(), context.getRegion(), context.getStyle(), state); }
/** * Returns a context with the given component state and all other fields same as input context. * * @param context the context, must not be null * @param state the component state. * @return a context with the given component state and other fields as inpu context. */ public static SynthContext getContext(SynthContext context, int state) { if (context.getComponentState() == state) return context; return getContext(context.getComponent(), context.getRegion(), context.getStyle(), state); }
/** * Returns a context with the given component state and all other fields same as input context. * * @param context the context, must not be null * @param state the component state. * @return a context with the given component state and other fields as inpu context. */ public static SynthContext getContext(SynthContext context, int state) { if (context.getComponentState() == state) return context; return getContext(context.getComponent(), context.getRegion(), context.getStyle(), state); }
return ctx.getComponentState(); int state = ctx.getComponentState();
/** * Paint the close button for a tab. * * @param g the Graphics context. * @param tabContext the SynthContext for the tab itself. * @param tabIndex the tab index to paint. * * @return the new tab bounds. */ protected Rectangle paintCloseButton(Graphics g, SynthContext tabContext, int tabIndex) { Rectangle tabRect = new Rectangle(rects[tabIndex]); Rectangle bounds = getCloseButtonBounds(tabIndex); int offset = bounds.width + textIconGap; boolean onLeft = isCloseButtonOnLeft(); if (onLeft) { tabRect.x += offset; tabRect.width -= offset; } else { tabRect.width -= offset; } SeaGlassContext subcontext = getContext(tabPane, SeaGlassRegion.TABBED_PANE_TAB_CLOSE_BUTTON, getCloseButtonState(tabPane, tabIndex, (tabContext.getComponentState() & MOUSE_OVER) != 0)); SeaGlassLookAndFeel.updateSubregion(subcontext, g, bounds); SeaGlassSynthPainterImpl painter = (SeaGlassSynthPainterImpl) subcontext.getPainter(); painter.paintSearchButtonForeground(subcontext, g, bounds.x, bounds.y, bounds.width, bounds.height); subcontext.dispose(); return tabRect; }
JComponent c = context.getComponent(); Region id = context.getRegion(); int cs = context.getComponentState();