本文整理汇总了Java中com.jogamp.newt.event.MouseListener类的典型用法代码示例。如果您正苦于以下问题:Java MouseListener类的具体用法?Java MouseListener怎么用?Java MouseListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MouseListener类属于com.jogamp.newt.event包,在下文中一共展示了MouseListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolve
import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
/**
* Resolves the given event by distributing it to the overlays and the top-level controller. The
* distribution-process stops as soon as any overlay fully consumes the event (i.e. the callback of this event
* returns {@code true}) and thus blocks subsequent overlays from receiving this event.
*
* @param e the event to resolveKeyEvent.
* @param fn the function to be executed for each overlay.
* @param toplevel the top-level receiver of the event.
*/
private void resolve(MouseEvent e, MouseListenerFunction fn, Consumer<MouseEvent> toplevel) {
ArrayList<MouseListener> listeners = getAllOverlays().stream()
.filter(Overlay::isEnabled)
.map(Overlay::getMouseListener)
.filter(Objects::nonNull)
.collect(Collectors.toCollection(ArrayList::new));
for (int i = listeners.size() - 1; i >= 0; i--) {
fn.call(listeners.get(i), e);
if (e.isConsumed())
return;
}
toplevel.accept(e);
}
示例2: Window
import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
public Window(KeyboardInputHandler aKeyboardInputHandler, MouseHandler aMouseHandler)
{
//m_GLWindow
//ICON TEST
//IOUtil.ClassResources res = new ClassResources(new String[]{"brick.png"}, getClass().getClassLoader(), getClass());
System.setProperty("newt.window.icons", "grimhaus/com/G2Dj/Resource/Graphics/icon-16.png grimhaus/com/G2Dj/Resource/Graphics/icon-32.png");
//NewtFactory.setWindowIcons(res);
//Configure the GL
Display display = NewtFactory.createDisplay(null);
Screen screen = NewtFactory.createScreen(display, 0);
GLProfile glProfile = GLProfile.get(GLProfile./*GL4ES3*/GL2ES2);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
//Create the GL context & create the window
m_GLWindow = GLWindow.create(screen, glCapabilities);
//Configure the window
setTitle("G2Dj");
setSize(1024, 768);
setPosition(50, 50);
setAlwaysOnTop(false);
setDisplayMode(DisplayMode.Windowed);
setPointerVisible(true);
setPointerLockMode(PointerLockMode.Free);
//Bypass JOGL's multithreaded event system
m_GLWindow.setAutoSwapBufferMode(false);//timing of bufferswaps is up to me
m_GLWindow.getContext().makeCurrent();//Ownership of the context is given to this thread
//Attach window event listeners
m_GLWindow.addWindowListener((WindowListener)this);
m_GLWindow.addKeyListener((KeyListener)aKeyboardInputHandler);
m_GLWindow.addMouseListener((MouseListener)aMouseHandler);
GL gl = m_GLWindow.getGL();
grimhaus.com.G2Dj.Imp.Graphics.GL.gl = m_GLWindow.getGL().getGL2ES2();
}
示例3: mouseMoved
import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public void mouseMoved(MouseEvent e) {
Displayer.setActiveViewport(e.getX(), e.getY());
ImageViewerGui.getCurrentInteraction().mouseMoved(e);
for (MouseListener listener : mouseListeners)
listener.mouseMoved(e);
}
示例4: getMouseListener
import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
public MouseListener getMouseListener() {
return resolver;
}
示例5: getMouseListener
import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public MouseListener getMouseListener() {
return mouseListener;
}
示例6: getMouseListener
import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public MouseListener getMouseListener() {
return ui.getMouseListener();
}
示例7: getMouseListener
import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public MouseListener getMouseListener() {
return mouseController;
}
示例8: mouseClicked
import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public void mouseClicked(MouseEvent e) {
resolve(e, MouseListener::mouseClicked, controller::mouseClicked);
}
示例9: mousePressed
import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public void mousePressed(MouseEvent e) {
resolve(e, MouseListener::mousePressed, controller::mousePressed);
}
示例10: mouseReleased
import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public void mouseReleased(MouseEvent e) {
resolve(e, MouseListener::mouseReleased, controller::mouseReleased);
}
示例11: mouseMoved
import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public void mouseMoved(MouseEvent e) {
resolve(e, MouseListener::mouseMoved, controller::mouseMoved);
}
示例12: mouseDragged
import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public void mouseDragged(MouseEvent e) {
resolve(e, MouseListener::mouseDragged, controller::mouseDragged);
}
示例13: mouseWheelMoved
import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public void mouseWheelMoved(MouseEvent e) {
resolve(e, MouseListener::mouseWheelMoved, controller::mouseWheelMoved);
}
示例14: mouseEntered
import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public void mouseEntered(MouseEvent e) {
resolve(e, MouseListener::mouseEntered, controller::mouseEntered);
}
示例15: NEWTMouseAdapter
import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
public NEWTMouseAdapter(MouseListener _l) {
l = _l;
}