コード例 #1
0
 public boolean isActive(Component c) {
   if (c instanceof JComponent) {
     return JTattooUtilities.isActive((JComponent) c);
   } else {
     return true;
   }
 }
コード例 #2
0
 public void paint(Graphics g) {
   if (JTattooUtilities.isActive(this) || (alpha >= 1.0)) {
     super.paint(g);
   } else {
     Graphics2D g2D = (Graphics2D) g;
     Composite composite = g2D.getComposite();
     AlphaComposite alphaComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha);
     g2D.setComposite(alphaComposite);
     super.paint(g);
     g2D.setComposite(composite);
   }
 }