示例#1
0
  private void updateStyle(JComponent c) {
    SynthContext context = getContext(list, ENABLED);
    SynthStyle oldStyle = style;

    style = SynthLookAndFeel.updateStyle(context, this);

    if (style != oldStyle) {
      context.setComponentState(SELECTED);
      Color sbg = list.getSelectionBackground();
      if (sbg == null || sbg instanceof UIResource) {
        list.setSelectionBackground(style.getColor(context, ColorType.TEXT_BACKGROUND));
      }

      Color sfg = list.getSelectionForeground();
      if (sfg == null || sfg instanceof UIResource) {
        list.setSelectionForeground(style.getColor(context, ColorType.TEXT_FOREGROUND));
      }

      useListColors = style.getBoolean(context, "List.rendererUseListColors", true);
      useUIBorder = style.getBoolean(context, "List.rendererUseUIBorder", true);

      int height = style.getInt(context, "List.cellHeight", -1);
      if (height != -1) {
        list.setFixedCellHeight(height);
      }
      if (oldStyle != null) {
        uninstallKeyboardActions();
        installKeyboardActions();
      }
    }
    context.dispose();
  }
示例#2
0
  /** @inheritDoc */
  @Override
  protected void uninstallDefaults() {
    super.uninstallDefaults();

    SynthContext context = getContext(list, ENABLED);

    style.uninstallDefaults(context);
    context.dispose();
    style = null;
  }
示例#3
0
  /** {@inheritDoc} */
  @Override
  protected void uninstallDefaults(JScrollPane c) {
    SynthContext context = getContext(c, ENABLED);

    style.uninstallDefaults(context);

    if (scrollpane.getViewportBorder() instanceof UIResource) {
      scrollpane.setViewportBorder(null);
    }
  }