/** Creates an FPSAnimator with a given target frames-per-second value, an initial drawable to animate, and a flag indicating whether to use fixed-rate scheduling. */ public FPSAnimator(final GLAutoDrawable drawable, final int fps, final boolean scheduleAtFixedRate) { super(); this.fps = fps; if (drawable != null) { add(drawable); } this.scheduleAtFixedRate = scheduleAtFixedRate; }
/** Creates an FPSAnimator with a given target frames-per-second value, an initial drawable to animate, and a flag indicating whether to use fixed-rate scheduling. */ public FPSAnimator(final GLAutoDrawable drawable, final int fps, final boolean scheduleAtFixedRate) { super(); this.fps = fps; if (drawable != null) { add(drawable); } this.scheduleAtFixedRate = scheduleAtFixedRate; }
/** Creates an FPSAnimator with a given target frames-per-second value, an initial drawable to animate, and a flag indicating whether to use fixed-rate scheduling. */ public FPSAnimator(final GLAutoDrawable drawable, final int fps, final boolean scheduleAtFixedRate) { super(); this.fps = fps; if (drawable != null) { add(drawable); } this.scheduleAtFixedRate = scheduleAtFixedRate; }
public void createAndShowGUI() { // Create and set up the window. mainFrame = new JFrame(Translator.get("TitlePrefix")); mainFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); mainFrame.addWindowListener(this); mainFrame.setJMenuBar(createMenuBar()); mainFrame.setContentPane(createContentPane()); adjustWindowSize(); mainFrame.setVisible(true); drawPanel.zoomToFitPaper(); // add the drag & drop support mainFrame.setTransferHandler(myTransferHandler); // start animation system animator = new FPSAnimator(30); animator.add(drawPanel); animator.start(); }
animator.add(canvas); animator.start();
public GLCore(int w, int h) { super(w, h); activeWindowGL = new WindowGL(0, 0, w, h); glGraphics = new GLGraphics2D(); graphic = new AWTGraphics3D(w,h); canvas.addMouseMotionListener(getMouse()); canvas.addMouseWheelListener(getMouse()); canvas.addMouseListener(getMouse()); canvas.getCanvas().addGLEventListener(this); animator = new FPSAnimator(REFRESH_FPS, true); animator.add(canvas.getCanvas()); initLoaders(); }