예제 #1
0
 @Override
 public BufferedImage load(String key) {
   File file = ImageKeys.getImageFile(key);
   if (file != null) {
     try {
       return ImageIO.read(file);
     } catch (IOException ex) {
       BugReporter.reportException(
           ex, "Could not read image file " + file.getAbsolutePath() + " ");
     }
   }
   return null;
 }
예제 #2
0
  public void draw(Graphics g) {
    try {
      drawBackground(g);

      boolean needOverlayDrawn = true;
      for (FDisplayObject child : children) {
        if (child.isVisible()) {
          if (child.drawAboveOverlay() && needOverlayDrawn) {
            drawOverlay(g);
            needOverlayDrawn = false;
          }

          final boolean disabled = !child.isEnabled();
          if (disabled) {
            g.setAlphaComposite(DISABLED_COMPOSITE);
          }

          g.draw(child);

          if (disabled) {
            g.resetAlphaComposite();
          }

          child.drawOnContainer(
              g); // give child an additional chance to draw additional content on container outside
                  // its bounds
        }
      }

      if (needOverlayDrawn) {
        drawOverlay(g);
      }
    } catch (ConcurrentModificationException ex) {
      // ignore concurrent modification exceptions during render
    } catch (Exception ex) {
      BugReporter.reportException(ex);
    }
  }