Пример #1
0
  /**
   * Notifies this UI delegate to repaint the specified component. This method paints the component
   * background, then calls the {@link #paint(SynthContext,Graphics)} method.
   *
   * <p>In general, this method does not need to be overridden by subclasses. All Look and Feel
   * rendering code should reside in the {@code paint} method.
   *
   * @param g the {@code Graphics} object used for painting
   * @param c the component being painted
   * @see #paint(SynthContext,Graphics)
   */
  @Override
  public void update(Graphics g, JComponent c) {
    SynthContext context = getContext(c);

    SynthLookAndFeel.update(context, g);
    context.getPainter().paintSplitPaneBackground(context, g, 0, 0, c.getWidth(), c.getHeight());
    paint(context, g);
    context.dispose();
  }
Пример #2
0
 @Override
 public int getIconHeight(SynthContext context) {
   if (context == null) {
     return height;
   }
   JComponent c = context.getComponent();
   if (c instanceof JToolBar) {
     JToolBar toolbar = (JToolBar) c;
     if (toolbar.getOrientation() == JToolBar.HORIZONTAL) {
       // we only do the -1 hack for UIResource borders, assuming
       // that the border is probably going to be our border
       if (toolbar.getBorder() instanceof UIResource) {
         return c.getHeight() - 1;
       } else {
         return c.getHeight();
       }
     } else {
       return scale(context, width);
     }
   } else {
     return scale(context, height);
   }
 }