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


Java Event类代码示例

本文整理汇总了Java中java.awt.Event的典型用法代码示例。如果您正苦于以下问题:Java Event类的具体用法?Java Event怎么用?Java Event使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Event类属于java.awt包,在下文中一共展示了Event类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configVisualizationViewer

import java.awt.Event; //导入依赖的package包/类
@Override
public void configVisualizationViewer(final LayerViewer<V, E> vv) {
	PluggableGraphMouse mouse = new PluggableGraphMouse();
	mouse.add(new ScalingGraphMousePlugin(
			new CrossoverScalingControl(), Event.CTRL_MASK, 1 / 1.1f,
			1.1f));
	mouse.add(new PickingGraphMousePlugin<V, E>());
	mouse.add(new MyEditingPopupGraphMousePlugin<T, V, E, N>(vv, scenario));
	vv.setGraphMouse(mouse);

	vv.getRenderContext().setVertexFillPaintTransformer(
			new NodeFillPaintTransformer<V>(vv.getPickedVertexState()));
	vv.setVertexToolTipTransformer(nodeTTT);
	vv.getRenderContext().setVertexLabelTransformer(nodeLT);
	vv.getRenderer().getVertexLabelRenderer()
			.setPosition(Position.AUTO);

	vv.setEdgeToolTipTransformer(linkTTT);
	vv.getRenderContext().setEdgeLabelTransformer(linkLT);
	vv.getRenderContext().getEdgeLabelRenderer()
			.setRotateEdgeLabels(true);
	vv.getRenderContext().setEdgeDrawPaintTransformer(
			new LinkDrawPaintTransformer<E>(vv.getPickedEdgeState()));
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:25,代码来源:MyGraphPanel.java

示例2: processKey

import java.awt.Event; //导入依赖的package包/类
private void processKey(char key) {
//out("select: '" + key);
            if (((int) key) == Event.BACK_SPACE) {
                init();
                return;
            }
            myPrefix += key;
            myPrefix = myPrefix.toLowerCase();

//out("prefix: " + myPrefix);
            for (int i = myIndex; i < getItemCount(); i++) {
                String item = getItemAt(i).toString().toLowerCase();
//out("  see: " + item);

                if (item.startsWith(myPrefix)) {
                    myIndex = i;
                    return;
                }
            }
        }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:UI.java

示例3: handleEvent

import java.awt.Event; //导入依赖的package包/类
/**
     * Method declaration
     *
     *
     * @param e
     */

// [email protected] 20020130 - comment by fredt
// to remove this deprecated method we need to rewrite the Tree class as a
// ScrollPane component
    public boolean handleEvent(Event e) {

        switch (e.id) {

            case Event.SCROLL_LINE_UP :
            case Event.SCROLL_LINE_DOWN :
            case Event.SCROLL_PAGE_UP :
            case Event.SCROLL_PAGE_DOWN :
            case Event.SCROLL_ABSOLUTE :
                iX = sbHoriz.getValue();
                iY = iRowHeight * sbVert.getValue();

                repaint();

                return true;
        }

        return super.handleEvent(e);
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:30,代码来源:Tree.java

示例4: handleEvent

import java.awt.Event; //导入依赖的package包/类
/**
 * Method declaration
 *
 *
 * @param e
 */

// [email protected] 20020130 - comment by fredt
// to remove this deprecated method we need to rewrite the Grid class as a
// ScrollPane component
// sqlbob:  I believe that changing to the JDK1.1 event handler
// would require browsers to use the Java plugin.
public boolean handleEvent(Event e) {

    switch (e.id) {

        case Event.SCROLL_LINE_UP :
        case Event.SCROLL_LINE_DOWN :
        case Event.SCROLL_PAGE_UP :
        case Event.SCROLL_PAGE_DOWN :
        case Event.SCROLL_ABSOLUTE :
            iX = sbHoriz.getValue();
            iY = iRowHeight * sbVert.getValue();

            repaint();

            return true;
    }

    return super.handleEvent(e);
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:32,代码来源:Grid.java

示例5: mouseDrag

import java.awt.Event; //导入依赖的package包/类
/**
 * Method declaration
 *
 *
 * @param e
 * @param x
 * @param y
 */
public boolean mouseDrag(Event e, int x, int y) {

    if (bDrag && x < iWidth) {
        int w = x - iXDrag;

        if (w < 0) {
            w = 0;
        }

        iColWidth[iColDrag] = w;

        adjustScroll();
        repaint();
    }

    return true;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:26,代码来源:Grid.java

示例6: keyTyped

import java.awt.Event; //导入依赖的package包/类
public void keyTyped(KeyEvent eKey) {
 	if (eKey.getKeyChar() == Event.ENTER) {
 		if (textArea.getText().replaceAll("[\\r\\n]+", "").equals("")) {

} else {
	
	// Process the message
	MessageControler mc = MessageControler.getInstance();
	try {
		mc.process(textArea.getText().replaceAll("[\\r\\n]+", ""));
	} catch (MessageControlerException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}

}

textArea.setText("");
textArea.requestFocus();
 	}
 }
 
开发者ID:LittleSnake42,项目名称:java-irc,代码行数:22,代码来源:Chat.java

示例7: handleEvent

import java.awt.Event; //导入依赖的package包/类
/**
     * Method declaration
     *
     *
     * @param e
     *
     * @return
     */

// [email protected] 20020130 - comment by fredt
// to remove this deprecated method we need to rewrite the Tree class as a
// ScrollPane component
    public boolean handleEvent(Event e) {

        switch (e.id) {

            case Event.SCROLL_LINE_UP :
            case Event.SCROLL_LINE_DOWN :
            case Event.SCROLL_PAGE_UP :
            case Event.SCROLL_PAGE_DOWN :
            case Event.SCROLL_ABSOLUTE :
                iX = sbHoriz.getValue();
                iY = iRowHeight * sbVert.getValue();

                repaint();

                return true;
        }

        return super.handleEvent(e);
    }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:32,代码来源:Tree.java

示例8: addMenuItems

import java.awt.Event; //导入依赖的package包/类
private void addMenuItems(JMenu f, String m[]) {

        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();

        for (int i = 0; i < m.length; i++) {
            if (m[i].equals("--")) {
                f.addSeparator();
            } else if (m[i].equals("---")) {

                // (ulrivo): full size on screen with less than 640 width
                if (d.width >= 640) {
                    f.addSeparator();
                } else {
                    return;
                }
            } else {
                JMenuItem item = new JMenuItem(m[i].substring(1));
                char      c    = m[i].charAt(0);

                if (c != '-') {
                    KeyStroke key =
                        KeyStroke.getKeyStroke(c, Event.CTRL_MASK);

                    item.setAccelerator(key);
                }

                item.addActionListener(this);
                f.add(item);
            }
        }
    }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:32,代码来源:DatabaseManagerSwing.java

示例9: handleEvent

import java.awt.Event; //导入依赖的package包/类
/**
 * Method declaration
 *
 *
 * @param e
 *
 * @return
 */

// [email protected] 20020130 - comment by fredt
// to remove this deprecated method we need to rewrite the Grid class as a
// ScrollPane component
// sqlbob:  I believe that changing to the JDK1.1 event handler
// would require browsers to use the Java plugin.
public boolean handleEvent(Event e) {

    switch (e.id) {

        case Event.SCROLL_LINE_UP :
        case Event.SCROLL_LINE_DOWN :
        case Event.SCROLL_PAGE_UP :
        case Event.SCROLL_PAGE_DOWN :
        case Event.SCROLL_ABSOLUTE :
            iX = sbHoriz.getValue();
            iY = iRowHeight * sbVert.getValue();

            repaint();

            return true;
    }

    return super.handleEvent(e);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:34,代码来源:Grid.java

示例10: mouseDrag

import java.awt.Event; //导入依赖的package包/类
/**
 * Method declaration
 *
 *
 * @param e
 * @param x
 * @param y
 *
 * @return
 */
public boolean mouseDrag(Event e, int x, int y) {

    if (bDrag && x < iWidth) {
        int w = x - iXDrag;

        if (w < 0) {
            w = 0;
        }

        iColWidth[iColDrag] = w;

        adjustScroll();
        repaint();
    }

    return true;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:28,代码来源:Grid.java

示例11: keyDown

import java.awt.Event; //导入依赖的package包/类
@Override
public boolean keyDown(final Event event, final int i) {
    if (focuson) {
        if (i == 42 || i == 10 || i == 56 || i == 119 || i == 87 || i == 43 || i == 61) {
            zoomi = true;
        }
        if (i == 47 || i == 8 || i == 50 || i == 115 || i == 83 || i == 45) {
            zoomo = true;
        }
        if (i == 1006) {
            left = true;
        }
        if (i == 1007) {
            right = true;
        }
        if (i == 1005) {
            down = true;
        }
        if (i == 1004) {
            up = true;
        }
    }
    return false;
}
 
开发者ID:uwx,项目名称:OpenNFMM,代码行数:25,代码来源:StageMaker.java

示例12: keyUp

import java.awt.Event; //导入依赖的package包/类
@Override
public boolean keyUp(final Event event, final int i) {
    if (i == 42 || i == 10 || i == 56 || i == 119 || i == 87 || i == 43 || i == 61) {
        zoomi = false;
    }
    if (i == 47 || i == 8 || i == 50 || i == 115 || i == 83 || i == 45) {
        zoomo = false;
    }
    if (i == 1006) {
        left = false;
    }
    if (i == 1007) {
        right = false;
    }
    if (i == 1005) {
        down = false;
    }
    if (i == 1004) {
        up = false;
    }
    return false;
}
 
开发者ID:uwx,项目名称:OpenNFMM,代码行数:23,代码来源:StageMaker.java

示例13: keyDown

import java.awt.Event; //导入依赖的package包/类
public boolean keyDown(Event evt, int key)
{
	if ( key == 's' || key == 'S' )
	{
		if (bStop.isEnabled())
		{
			action( new Event( bStop, Event.ACTION_EVENT, null), null);
		}
		else
		{
			action( new Event( bStart, Event.ACTION_EVENT, null), null);
		}
		return true;
	}
	else if( key == 't' || key == 'T' )
	{
		action( new Event( bStimulate, Event.ACTION_EVENT, null), null);
		return true;
	}
	else if( key == 'o' || key == 'O' )
	{
		action( new Event( bOptions, Event.ACTION_EVENT, null), null);
		return true;
	}
	return false;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:27,代码来源:ModelApplet.java

示例14: action

import java.awt.Event; //导入依赖的package包/类
public boolean action (Event evt, Object arg) 
{
	for(int x = 0; x < recorder.plotSize; x++)
	{
		if(evt.target.equals(c[x]))
		{
			recorder.plot[x] = c[x].getState();
			figureYaxis();
			recorder.redraw();
			return true;
		}
	}

	if (evt.target.equals(cRightAxis))
	{
		setRightAxis();	
		return true;
	}

	return super.action(evt, arg);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:22,代码来源:ConfigurationForm.java

示例15: btnRegisterHotKey_actionPerformed

import java.awt.Event; //导入依赖的package包/类
/**
 * Method to register a hotkey using the RegisterHotKey Windows API call.
 * <p>
 * @param aEvent the ActionEvent fired.
 */
private void btnRegisterHotKey_actionPerformed(ActionEvent aEvent) {
   // assign the WINDOWS+A key to the unique id 88 for identification
   JIntellitype.getInstance().registerHotKey(WINDOWS_A, JIntellitype.MOD_WIN, 'A');
   JIntellitype.getInstance().registerHotKey(ALT_SHIFT_B, JIntellitype.MOD_ALT + JIntellitype.MOD_SHIFT, 'B');
   JIntellitype.getInstance().registerSwingHotKey(CTRL_SHIFT_C, Event.CTRL_MASK + Event.SHIFT_MASK, 'C');

   // use a 0 for the modifier if you just want a single keystroke to be a
   // hotkey
   JIntellitype.getInstance().registerHotKey(PRINT_SCREEN, 0, 44);
   JIntellitype.getInstance().registerHotKey(F11, "F11");
   JIntellitype.getInstance().registerHotKey(F12, JIntellitype.MOD_ALT, 123);
   JIntellitype.getInstance().registerHotKey(SEMICOLON, 0, 186);
   JIntellitype.getInstance().registerHotKey(TICK, 0, 192);
   // clear the text area
   textArea.setText("");
   output("RegisterHotKey WINDOWS+A was assigned uniqueID 88");
   output("RegisterHotKey ALT+SHIFT+B was assigned uniqueID 89");
   output("RegisterHotKey CTRL+SHIFT+C was assigned uniqueID 90");
   output("RegisterHotKey PRINT_SCREEN was assigned uniqueID 91");
   output("RegisterHotKey F9 was assigned uniqueID 92");
   output("RegisterHotKey F12 was assigned uniqueID 93");
   output("RegisterHotKey SEMICOLON was assigned uniqueID 94");
   output("Press WINDOWS+A or ALT+SHIFT+B or CTRL+SHIFT+C in another application and you will see the debug output in the textarea.");
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:30,代码来源:JIntellitypeTester.java


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