本文整理汇总了Java中javax.media.opengl.GLCanvas.addMouseListener方法的典型用法代码示例。如果您正苦于以下问题:Java GLCanvas.addMouseListener方法的具体用法?Java GLCanvas.addMouseListener怎么用?Java GLCanvas.addMouseListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.media.opengl.GLCanvas
的用法示例。
在下文中一共展示了GLCanvas.addMouseListener方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GForceVis
import javax.media.opengl.GLCanvas; //导入方法依赖的package包/类
public GForceVis()
{
super("G-Force-Visualization");
setSize(800, 600);
// setDefaultCloseOperation(this.EXIT_ON_CLOSE);
// Canvas
canvas = new GLCanvas(new GLCapabilities());
canvas.addGLEventListener(this);
// KeyListener
canvas.addKeyListener(this);
canvas.addMouseListener(this);
canvas.addMouseMotionListener(this);
GForceMenuBar gfMenuBar = new GForceMenuBar();
setLayout(new BorderLayout());
add(canvas, BorderLayout.CENTER);
add(gfMenuBar.getMenuBar(), BorderLayout.WEST);
}
示例2: render
import javax.media.opengl.GLCanvas; //导入方法依赖的package包/类
public void render( GLCanvas canvas )
{
if( listener_installed == false )
{
if( !is_replay )
{
canvas.addKeyListener( this );
canvas.addMouseListener( this );
canvas.addMouseMotionListener( this );
listener_installed = true;
}
}
createTextures( );
renderDebugStats( );
if( selected_planet != null && !is_replay )
{
int total_creatures = selected_planet.getMoveableCreatures( loop.getClient().getPlayer().getId() );
for( Handle handle: move_handles )
handle.render( total_creatures );
}
renderChains( canvas );
renderTreeButton( canvas, selected_planet );
renderHoverPlanetStats( canvas );
renderPlayerStats( canvas );
renderMarks( canvas );
canvas.getGL().glPopMatrix();
}
示例3: MainWindow
import javax.media.opengl.GLCanvas; //导入方法依赖的package包/类
public MainWindow()
{
super("3D-Visualization");
preferences = new Preferences();
//WindowSize
setSize(preferences.getWindowWidth(), preferences.getWindowHeight());
//ClosingOperation
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
addMouseWheelListener(this);
//Canvas
canvas = new GLCanvas(new GLCapabilities());
canvas.addGLEventListener(this);
//KeyListener
canvas.addKeyListener(this);
canvas.addMouseListener(this);
canvas.addMouseMotionListener(this);
//MENU
Menu menu = new Menu(preferences);
JScrollPane scrollPane = menu.getScrollPane();
//StatusBar
JPanel statusPanel = menu.getStatusPanel();
menu.initMenuLogic();
setLayout(new BorderLayout());
add(menu.getMenuBar(),BorderLayout.NORTH);
add(canvas,BorderLayout.CENTER);
add(scrollPane,BorderLayout.WEST);
add(statusPanel,BorderLayout.SOUTH);
}