当前位置: 首页>>代码示例>>Java>>正文


Java MouseListener类代码示例

本文整理汇总了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);
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:25,代码来源:TileBasedVisualization.java

示例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();
            
}
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:41,代码来源:Window.java

示例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);
}
 
开发者ID:Helioviewer-Project,项目名称:JHelioviewer-SWHV,代码行数:9,代码来源:InputController.java

示例4: getMouseListener

import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
public MouseListener getMouseListener() {
    return resolver;
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:4,代码来源:UIManager.java

示例5: getMouseListener

import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public MouseListener getMouseListener() {
    return mouseListener;
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:5,代码来源:DirectBatchUIOverlay.java

示例6: getMouseListener

import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public MouseListener getMouseListener() {
    return ui.getMouseListener();
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:5,代码来源:ScenarioAreaOverlay.java

示例7: getMouseListener

import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public MouseListener getMouseListener() {
    return mouseController;
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:5,代码来源:TileBasedVisualization.java

示例8: mouseClicked

import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public void mouseClicked(MouseEvent e) {
    resolve(e, MouseListener::mouseClicked, controller::mouseClicked);
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:5,代码来源:TileBasedVisualization.java

示例9: mousePressed

import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public void mousePressed(MouseEvent e) {
    resolve(e, MouseListener::mousePressed, controller::mousePressed);
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:5,代码来源:TileBasedVisualization.java

示例10: mouseReleased

import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public void mouseReleased(MouseEvent e) {
    resolve(e, MouseListener::mouseReleased, controller::mouseReleased);
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:5,代码来源:TileBasedVisualization.java

示例11: mouseMoved

import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public void mouseMoved(MouseEvent e) {
    resolve(e, MouseListener::mouseMoved, controller::mouseMoved);
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:5,代码来源:TileBasedVisualization.java

示例12: mouseDragged

import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public void mouseDragged(MouseEvent e) {
    resolve(e, MouseListener::mouseDragged, controller::mouseDragged);
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:5,代码来源:TileBasedVisualization.java

示例13: mouseWheelMoved

import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public void mouseWheelMoved(MouseEvent e) {
    resolve(e, MouseListener::mouseWheelMoved, controller::mouseWheelMoved);
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:5,代码来源:TileBasedVisualization.java

示例14: mouseEntered

import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
@Override
public void mouseEntered(MouseEvent e) {
    resolve(e, MouseListener::mouseEntered, controller::mouseEntered);
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:5,代码来源:TileBasedVisualization.java

示例15: NEWTMouseAdapter

import com.jogamp.newt.event.MouseListener; //导入依赖的package包/类
public NEWTMouseAdapter(MouseListener _l) {
    l = _l;
}
 
开发者ID:Helioviewer-Project,项目名称:JHelioviewer-SWHV,代码行数:4,代码来源:NEWTMouseAdapter.java


注:本文中的com.jogamp.newt.event.MouseListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。