use of com.jogamp.opengl.awt.GLJPanel in project Universal-G-Code-Sender by winder.
the class Visualizer2TopComponent method makeWindow.
private GLJPanel makeWindow() {
GLCapabilities glCaps = new GLCapabilities(null);
final GLJPanel p = new GLJPanel(glCaps);
GcodeRenderer renderer = Lookup.getDefault().lookup(GcodeRenderer.class);
if (renderer == null) {
throw new IllegalArgumentException("Failed to access GcodeRenderer.");
}
FPSAnimator animator = new FPSAnimator(p, 15);
this.rih = new RendererInputHandler(renderer, animator, new VisualizerPopupMenu(backend, renderer), backend.getSettings());
Preferences pref = NbPreferences.forModule(VisualizerOptionsPanel.class);
pref.addPreferenceChangeListener(this.rih);
File f = (backend.getProcessedGcodeFile() != null) ? backend.getProcessedGcodeFile() : backend.getGcodeFile();
if (f != null) {
this.rih.setGcodeFile(f.getAbsolutePath());
}
// Install listeners...
backend.addControllerListener(this.rih);
backend.addUGSEventListener(this.rih);
// shutdown hook...
// frame.addWindowListener(this.rih);
// key listener...
p.addKeyListener(this.rih);
// mouse wheel...
p.addMouseWheelListener(this.rih);
// mouse motion...
p.addMouseMotionListener(this.rih);
// mouse...
p.addMouseListener(this.rih);
p.addGLEventListener(renderer);
return p;
}
use of com.jogamp.opengl.awt.GLJPanel in project artisynth_core by artisynth.
the class JOGLTest method main.
public static void main(String[] args) {
// getting the capabilities object of GL2 profile
final GLProfile profile = GLProfile.get(GLProfile.GL2);
GLCapabilities capabilities = new GLCapabilities(profile);
// The canvas
final GLJPanel glcanvas = new GLJPanel(capabilities);
JOGLTest b = new JOGLTest();
glcanvas.addGLEventListener(b);
glcanvas.setSize(400, 400);
// creating frame
final JFrame frame = new JFrame(" Basic Frame");
// adding canvas to it
frame.getContentPane().add(glcanvas);
frame.setSize(frame.getContentPane().getPreferredSize());
frame.setVisible(true);
}
use of com.jogamp.opengl.awt.GLJPanel in project artisynth_core by artisynth.
the class GL3Sample method newJFrame.
public static JFrame newJFrame(String name, GLEventListener sample, int x, int y, int width, int height) {
JFrame frame = new JFrame(name);
frame.setBounds(x, y, width, height);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
GLProfile glp = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glp);
// GLCanvas canvas = new GLCanvas(glCapabilities);
GLJPanel canvas = new GLJPanel(glCapabilities);
canvas.addGLEventListener(sample);
frame.add(canvas);
return frame;
}
use of com.jogamp.opengl.awt.GLJPanel in project narchy by automenta.
the class DesktopOverlay method main.
public static void main(String[] args) throws IOException {
// Indeed, use GLJPanel instead of GLCanvas
GLProfile glp = GLProfile.getDefault();
GLCapabilities glcap = new GLCapabilities(glp);
glcap.setAlphaBits(8);
GLJPanel pane = new GLJPanel(glcap);
pane.setOpaque(false);
NWindow n = new NWindow("x", pane).show(500, 500);
}
Aggregations