Beispiel #1
0
 /** Checks and answers if we should add a pseudo 3D effect. */
 private boolean is3D() {
   if (PlasticUtils.force3D(toolBar)) return true;
   if (PlasticUtils.forceFlat(toolBar)) return false;
   return PlasticUtils.is3D(PROPERTY_PREFIX)
       && (HeaderStyle.from(toolBar) != null)
       && (BorderStyle.from(toolBar, PlasticLookAndFeel.BORDER_STYLE_KEY) != BorderStyle.EMPTY);
 }
Beispiel #2
0
 public void update(Graphics g, JComponent c) {
   if (c.isOpaque()) {
     g.setColor(c.getBackground());
     g.fillRect(0, 0, c.getWidth(), c.getHeight());
     if (is3D()) {
       Rectangle bounds = new Rectangle(0, 0, c.getWidth(), c.getHeight());
       boolean isHorizontal = ((JToolBar) c).getOrientation() == SwingConstants.HORIZONTAL;
       PlasticUtils.addLight3DEffekt(g, bounds, isHorizontal);
     }
   }
   paint(g, c);
 }