Пример #1
0
  @Override
  protected void paintComponent(Graphics g1d) {
    super.paintComponent(g1d);
    Graphics2D g = (Graphics2D) g1d;

    // Hintergrund weiß zeichnen
    g.setColor(Color.WHITE);
    g.fillRect(0, 0, getWidth(), getHeight());

    // SceneRenderer den Rest machen lassen
    synchronized (origin) {
      zoom =
          (Math.min(getWidth(), getHeight()) - 2 * defborder)
              / (2 * renderer.getData().getRadius());
      origin = renderer.render(g, move, getWidth(), getHeight(), zoom);
    }
  }
Пример #2
0
 @Override
 public Dimension getPreferredSize() {
   return new Dimension(
       Math.round(2 * renderer.getData().getRadius() * defzoom + 2 * defborder),
       Math.round(2 * renderer.getData().getRadius() * defzoom + 2 * defborder));
 }