Ejemplo n.º 1
0
    @Override
    public void paint(Graphics g) {
      super.paint(g);
      if (g instanceof Graphics2D) {
        Graphics2D g2d = (Graphics2D) g;

        if (blackOutEnabled) {
          // background
          g2d.setColor(Color.BLACK);
          g2d.fillRect(0, 0, this.getWidth(), this.getHeight());
        } else if (whiteOutEnabled) {
          // background
          g2d.setColor(Color.WHITE);
          g2d.fillRect(0, 0, this.getWidth(), this.getHeight());
        } else {
          // background
          g2d.setColor(backgroundColor);
          g2d.fillRect(0, 0, this.getWidth(), this.getHeight());

          // text
          if (font == null)
            font = GuiHelper.maxFontSize(frame.getWidth(), frame.getHeight(), fontName, timeFormat);
          if (textY == -1) textY = GuiHelper.getTextYForCenter(timeFormat, font, frame.getHeight());
          g2d.setRenderingHint(
              RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
          g2d.setFont(font);
          g2d.setColor(textColor);
          g2d.drawString(timeToString(time), 0, textY);
        }
      }
    }
Ejemplo n.º 2
0
 /** The constructor for the project selection frame. */
 public ProjectSelector() {
   super("Select a Project");
   GuiHelper.setWindowIcon(this);
   // show all the tooltips for 15000 mili-seconds
   defaultTooltipDismissDelay = ToolTipManager.sharedInstance().getDismissDelay();
   ToolTipManager.sharedInstance().setDismissDelay(myTooltipDismissDelay);
 }