365 height = bounds.height;
366 }
367
368 // Fill in the background, if necessary.
369 boolean subregion = state.isSubregion();
370 if ((subregion && style.isOpaque(state)) ||
371 (!subregion && c.isOpaque())) {
372 g.setColor(style.getColor(state, ColorType.BACKGROUND));
373 g.fillRect(x, y, width, height);
374 }
375 }
376
377 static boolean isLeftToRight(Component c) {
378 return c.getComponentOrientation().isLeftToRight();
379 }
380
381 /**
382 * Returns the ui that is of type <code>klass</code>, or null if
383 * one can not be found.
384 */
385 static Object getUIOfType(ComponentUI ui, Class klass) {
386 if (klass.isInstance(ui)) {
387 return ui;
388 }
389 return null;
390 }
391
392 /**
393 * Creates the Synth look and feel <code>ComponentUI</code> for
394 * the passed in <code>JComponent</code>.
395 *
396 * @param c JComponent to create the <code>ComponentUI</code> for
397 * @return ComponentUI to use for <code>c</code>
398 */
399 public static ComponentUI createUI(JComponent c) {
400 String key = c.getUIClassID().intern();
401
402 if (key == "ButtonUI") {
403 return SynthButtonUI.createUI(c);
404 }
405 else if (key == "CheckBoxUI") {
|
365 height = bounds.height;
366 }
367
368 // Fill in the background, if necessary.
369 boolean subregion = state.isSubregion();
370 if ((subregion && style.isOpaque(state)) ||
371 (!subregion && c.isOpaque())) {
372 g.setColor(style.getColor(state, ColorType.BACKGROUND));
373 g.fillRect(x, y, width, height);
374 }
375 }
376
377 static boolean isLeftToRight(Component c) {
378 return c.getComponentOrientation().isLeftToRight();
379 }
380
381 /**
382 * Returns the ui that is of type <code>klass</code>, or null if
383 * one can not be found.
384 */
385 static Object getUIOfType(ComponentUI ui, Class<?> klass) {
386 if (klass.isInstance(ui)) {
387 return ui;
388 }
389 return null;
390 }
391
392 /**
393 * Creates the Synth look and feel <code>ComponentUI</code> for
394 * the passed in <code>JComponent</code>.
395 *
396 * @param c JComponent to create the <code>ComponentUI</code> for
397 * @return ComponentUI to use for <code>c</code>
398 */
399 public static ComponentUI createUI(JComponent c) {
400 String key = c.getUIClassID().intern();
401
402 if (key == "ButtonUI") {
403 return SynthButtonUI.createUI(c);
404 }
405 else if (key == "CheckBoxUI") {
|