Exemplo n.º 1
0
    public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
      AbstractButton b = (AbstractButton) c;
      ButtonModel model = b.getModel();

      if (model.isRollover() && !(model.isPressed() && !model.isArmed())) {
        super.paintBorder(c, g, x, y, w, h);
      }
    }
Exemplo n.º 2
0
 public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
   AbstractButton button = (AbstractButton) c;
   ButtonModel model = button.getModel();
   if (MetalLookAndFeel.usingOcean()) {
     if (model.isArmed() || !button.isEnabled()) {
       super.paintBorder(c, g, x, y, w, h);
     } else {
       g.setColor(MetalLookAndFeel.getControlDarkShadow());
       g.drawRect(0, 0, w - 1, h - 1);
     }
     return;
   }
   if (!c.isEnabled()) {
     MetalUtils.drawDisabledBorder(g, x, y, w - 1, h - 1);
   } else {
     if (model.isPressed() && model.isArmed()) {
       MetalUtils.drawPressed3DBorder(g, x, y, w, h);
     } else if (model.isSelected()) {
       MetalUtils.drawDark3DBorder(g, x, y, w, h);
     } else {
       MetalUtils.drawFlush3DBorder(g, x, y, w, h);
     }
   }
 }