@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()));
}
java类java.awt.Event的实例源码
MyGraphPanel.java 文件源码
项目:alevin-svn2
阅读 20
收藏 0
点赞 0
评论 0
UI.java 文件源码
项目:incubator-netbeans
阅读 31
收藏 0
点赞 0
评论 0
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;
}
}
}
Grid.java 文件源码
项目:OpenDiabetes
阅读 26
收藏 0
点赞 0
评论 0
/**
* 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;
}
Grid.java 文件源码
项目:sstore-soft
阅读 33
收藏 0
点赞 0
评论 0
/**
* 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;
}
Chat.java 文件源码
项目:java-irc
阅读 24
收藏 0
点赞 0
评论 0
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();
}
}
Grid.java 文件源码
项目:s-store
阅读 28
收藏 0
点赞 0
评论 0
/**
* 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;
}
Grid.java 文件源码
项目:dev-courses
阅读 29
收藏 0
点赞 0
评论 0
/**
* 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;
}
Grid.java 文件源码
项目:parabuild-ci
阅读 25
收藏 0
点赞 0
评论 0
/**
* 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;
}
Grid.java 文件源码
项目:parabuild-ci
阅读 25
收藏 0
点赞 0
评论 0
/**
* 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;
}
Grid.java 文件源码
项目:parabuild-ci
阅读 24
收藏 0
点赞 0
评论 0
/**
* 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;
}
Grid.java 文件源码
项目:parabuild-ci
阅读 31
收藏 0
点赞 0
评论 0
/**
* 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;
}
StageMaker.java 文件源码
项目:OpenNFMM
阅读 27
收藏 0
点赞 0
评论 0
@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;
}
StageMaker.java 文件源码
项目:OpenNFMM
阅读 21
收藏 0
点赞 0
评论 0
@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;
}
ModelApplet.java 文件源码
项目:PhET
阅读 24
收藏 0
点赞 0
评论 0
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;
}
ConfigurationForm.java 文件源码
项目:PhET
阅读 25
收藏 0
点赞 0
评论 0
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);
}
JIntellitypeTester.java 文件源码
项目:PhET
阅读 28
收藏 0
点赞 0
评论 0
/**
* 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.");
}
SimpleTextEditor.java 文件源码
项目:jGAF
阅读 25
收藏 0
点赞 0
评论 0
/**
* Adds particular key accelerators to the editor component.
*/
protected void addBindings(JTextPane editor) {
InputMap inputMap = editor.getInputMap();
//Ctrl-c to copy current selection
KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_C, Event.CTRL_MASK);
inputMap.put(key, DefaultEditorKit.copyAction);
//Ctrl-v to paste clipboard content
key = KeyStroke.getKeyStroke(KeyEvent.VK_V, Event.CTRL_MASK);
inputMap.put(key, DefaultEditorKit.pasteAction);
//Ctrl-x to cut current selection
key = KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.CTRL_MASK);
inputMap.put(key, DefaultEditorKit.cutAction);
}
VisualDCT.java 文件源码
项目:VisualDCT
阅读 30
收藏 0
点赞 0
评论 0
/**
* Return the CopyMenuItem property value.
* @return javax.swing.JMenuItem
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JMenuItem getCopyMenuItem() {
if (ivjCopyMenuItem == null) {
try {
ivjCopyMenuItem = new javax.swing.JMenuItem();
ivjCopyMenuItem.setName("CopyMenuItem");
ivjCopyMenuItem.setMnemonic('C');
ivjCopyMenuItem.setText("Copy");
ivjCopyMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C,java.awt.Event.CTRL_MASK));
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjCopyMenuItem;
}
VisualDCT.java 文件源码
项目:VisualDCT
阅读 22
收藏 0
点赞 0
评论 0
/**
* Return the CopyMenuItem property value.
* @return javax.swing.JMenuItem
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JMenuItem getSystemCopyMenuItem() {
if (ivjSystemCopyMenuItem == null) {
try {
ivjSystemCopyMenuItem = new javax.swing.JMenuItem();
ivjSystemCopyMenuItem.setName("SystemCopyMenuItem");
ivjSystemCopyMenuItem.setText("Copy to System Clipboard");
ivjSystemCopyMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C,java.awt.Event.CTRL_MASK|java.awt.Event.SHIFT_MASK));
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjSystemCopyMenuItem;
}
VisualDCT.java 文件源码
项目:VisualDCT
阅读 30
收藏 0
点赞 0
评论 0
/**
* Return the CutMenuItem property value.
* @return javax.swing.JMenuItem
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JMenuItem getCutMenuItem() {
if (ivjCutMenuItem == null) {
try {
ivjCutMenuItem = new javax.swing.JMenuItem();
ivjCutMenuItem.setName("CutMenuItem");
ivjCutMenuItem.setMnemonic('t');
ivjCutMenuItem.setText("Cut");
ivjCutMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X,java.awt.Event.CTRL_MASK));
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjCutMenuItem;
}
VisualDCT.java 文件源码
项目:VisualDCT
阅读 28
收藏 0
点赞 0
评论 0
/**
* Return the ExitMenuItem property value.
* @return javax.swing.JMenuItem
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JMenuItem getExitMenuItem() {
if (ivjExitMenuItem == null) {
try {
ivjExitMenuItem = new javax.swing.JMenuItem();
ivjExitMenuItem.setName("ExitMenuItem");
ivjExitMenuItem.setMnemonic('x');
ivjExitMenuItem.setText("Exit");
ivjExitMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q,java.awt.Event.CTRL_MASK));
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjExitMenuItem;
}
VisualDCT.java 文件源码
项目:VisualDCT
阅读 26
收藏 0
点赞 0
评论 0
/**
* Return the Level_UpMenuItem property value.
* @return javax.swing.JMenuItem
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JMenuItem getLevel_UpMenuItem() {
if (ivjLevel_UpMenuItem == null) {
try {
ivjLevel_UpMenuItem = new javax.swing.JMenuItem();
ivjLevel_UpMenuItem.setName("Level_UpMenuItem");
ivjLevel_UpMenuItem.setMnemonic('L');
ivjLevel_UpMenuItem.setText("Level Up");
ivjLevel_UpMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_UP, Event.SHIFT_MASK));
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjLevel_UpMenuItem;
}
VisualDCT.java 文件源码
项目:VisualDCT
阅读 28
收藏 0
点赞 0
评论 0
/**
* Return the Move_RenameMenuItem property value.
* @return javax.swing.JMenuItem
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JMenuItem getMove_RenameMenuItem() {
if (ivjMove_RenameMenuItem == null) {
try {
ivjMove_RenameMenuItem = new javax.swing.JMenuItem();
ivjMove_RenameMenuItem.setName("Move_RenameMenuItem");
ivjMove_RenameMenuItem.setMnemonic('M');
ivjMove_RenameMenuItem.setText("Move/Rename");
ivjMove_RenameMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R,java.awt.Event.CTRL_MASK));
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjMove_RenameMenuItem;
}
VisualDCT.java 文件源码
项目:VisualDCT
阅读 29
收藏 0
点赞 0
评论 0
private javax.swing.JMenuItem getMorphMenuItem() {
if (ivjMorphMenuItem == null) {
try {
ivjMorphMenuItem = new javax.swing.JMenuItem();
ivjMorphMenuItem.setName("MorphMenuItem");
ivjMorphMenuItem.setMnemonic('o');
ivjMorphMenuItem.setText("Morph");
ivjMorphMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M,java.awt.Event.CTRL_MASK));
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjMorphMenuItem;
}