Example #1
0
 public void paintForeground(java.awt.Graphics g) {
   super.paintForeground(g);
   if (mouseOver) {
     Object oldAntialiasing = null;
     if (g instanceof java.awt.Graphics2D) {
       oldAntialiasing =
           ((java.awt.Graphics2D) g).getRenderingHint(java.awt.RenderingHints.KEY_ANTIALIASING);
       ((java.awt.Graphics2D) g)
           .addRenderingHints(
               new java.awt.RenderingHints(
                   java.awt.RenderingHints.KEY_ANTIALIASING,
                   java.awt.RenderingHints.VALUE_ANTIALIAS_ON));
     }
     java.awt.Rectangle bounds = getBounds();
     for (int i = 1; i <= 2; i++) {
       g.setColor(
           new java.awt.Color(
               HIGHLITE.getRed(), HIGHLITE.getGreen(), HIGHLITE.getBlue(), (255 - (i - 1) * 60)));
       g.drawRoundRect(i, i, bounds.width - 2 * i, bounds.height - 2 * i, arcWidth, arcHeight);
     }
     if (g instanceof java.awt.Graphics2D) {
       ((java.awt.Graphics2D) g)
           .addRenderingHints(
               new java.awt.RenderingHints(
                   java.awt.RenderingHints.KEY_ANTIALIASING, oldAntialiasing));
     }
   }
 }
 @Override
 public void paintForeground(java.awt.Graphics g) {
   super.paintForeground(g);
   if (m_element != null) {
     if (isDisabled()) {
       java.awt.Rectangle bounds = new java.awt.Rectangle(0, 0, getWidth(), getHeight());
       edu.cmu.cs.stage3.alice.authoringtool.util.GUIEffects.paintDisabledEffect(g, bounds);
     }
   }
 }