Exemplo n.º 1
0
 protected void showInfoPopup(String info, int x, int y) {
   JPanel content = new JPanel();
   content.add(new JLabel(info));
   content.setBorder(BorderFactory.createLineBorder(Color.BLACK));
   Point location = getLocationOnScreen();
   location.x += x + 5;
   location.y += y + 5;
   popup = PopupFactory.getSharedInstance().getPopup(this, content, location.x, location.y);
   popup.show();
 }
Exemplo n.º 2
0
  public void paintComponent(Graphics g) {
    super.paintComponent(g);
    if (transformer.isSetupDone()) {
      thread.checkSetup(transformer, config);
      Graphics2D g2 = ((Graphics2D) g.create());

      // paint the background
      g2.setColor(MapPanel.BG_COLOR);
      g2.fillRect(0, 0, getWidth(), getHeight());

      MapPanelThread.PaintInfo paintInfo = thread.getPaintInfo(transformer);
      if (paintInfo != null) {
        /*g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
        RenderingHints.VALUE_INTERPOLATION_BILINEAR);*/
        g2.drawImage(paintInfo.image, paintInfo.x, paintInfo.y, paintInfo.w, paintInfo.h, this);
      }
    }
  }