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


Java ActionEvent.getSource方法代码示例

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


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

示例1: actionPerformed

import java.awt.event.ActionEvent; //导入方法依赖的package包/类
/**
 * 
 */
public void actionPerformed(ActionEvent e)
{
	if (e.getSource() instanceof mxGraphComponent)
	{
		mxGraphComponent graphComponent = (mxGraphComponent) e
				.getSource();
		PrinterJob pj = PrinterJob.getPrinterJob();
		PageFormat format = pj.pageDialog(graphComponent
				.getPageFormat());

		if (format != null)
		{
			graphComponent.setPageFormat(format);
			graphComponent.zoomAndCenter();
		}
	}
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:21,代码来源:EditorActions.java

示例2: actionPerformed

import java.awt.event.ActionEvent; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e)
{
	if( e.getSource() == okButton )
	{
		closeDialog(!list.isSelectionEmpty());
	}
	else if( e.getSource() == cancelButton )
	{
		closeDialog(false);
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:13,代码来源:FilterDialog.java

示例3: actionPerformed

import java.awt.event.ActionEvent; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
	JButton b = (JButton) e.getSource();
	if (b.getName().equals("PAUSE")) {
		if (mgr != null)
			mgr.stop();
		setVisible(false);
		dispose();
	} else if (b.getName().equals("PREVIEW")) {
		if (file != null) {
			XDMUtil.open(file);
		}
	}
	if (b.getName().equals("BACKGROUND")) {
		setVisible(false);
	}
}
 
开发者ID:kmarius,项目名称:xdman,代码行数:17,代码来源:XDMDownloadWindow.java

示例4: actionPerformed

import java.awt.event.ActionEvent; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent event) {

    if (event.getSource() == buttonCancel) {
        setVisible(false);

    } else if (event.getSource() == buttonChoose) {
        lastReverse = selectedRelation;
        setVisible(false);

    } else if (event.getSource() == buttonNoReverse) {
        lastReverse = null;
        setVisible(false);
    }
}
 
开发者ID:CLARIN-PL,项目名称:WordnetLoom,代码行数:16,代码来源:ReverseRelationWindow.java

示例5: actionPerformed

import java.awt.event.ActionEvent; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
    Object o = e.getSource();
    if (ignoreEnableTrigger) {
        return;
    }
    if (o == langSelect) {
        languageSelected();
    } else if (o == contentPreview) {
        previewChanged();
    } else if (o == foldedSummary) {
        summaryChanged();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:FoldOptionsPanel.java

示例6: actionPerformed

import java.awt.event.ActionEvent; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
    if (e.getSource() == saveToFileButton) {
        JFileChooser fileChooser = getFileChooser();
        fileChooser.setCurrentDirectory(new File(saveToFileField.getText()).getParentFile());

        if (fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
            saveToFileField.setText(fileChooser.getSelectedFile().getAbsolutePath());
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:SnapshotCustomizer.java

示例7: actionPerformed

import java.awt.event.ActionEvent; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
	try {
		if (e.getSource() == loadButton) {
			levelEditView.setLevel(Level.load(new DataInputStream(ResourceStream.getResourceStream(tilesPath + nameField.getText().trim()))));
		}
		if (e.getSource() == saveButton) {
			levelEditView.getLevel().save(new DataOutputStream(new FileOutputStream(UserDir.getUserFile((tilesPath + nameField.getText().trim())))));
		}
	} catch (Exception ex) {
		JOptionPane.showMessageDialog(this, ex.toString(), "Failed to load/save", JOptionPane.ERROR_MESSAGE);
	}
}
 
开发者ID:CognitiveModeling,项目名称:BrainControl,代码行数:13,代码来源:LevelEditor.java

示例8: actionPerformed

import java.awt.event.ActionEvent; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent ev) {

        String s = ev.getActionCommand();

        if (s.equals("ConnectOk") || (ev.getSource() instanceof TextField)) {
            try {
                if (mURL.getText().indexOf('\u00AB') >= 0) {
                    throw new Exception("please specify db path");
                }

                mConnection = createConnection(mDriver.getText(),
                                               mURL.getText(),
                                               mUser.getText(),
                                               mPassword.getText());

                if (mName.getText() != null
                        && mName.getText().trim().length() != 0) {
                    ConnectionSetting newSetting =
                        new ConnectionSetting(mName.getText(),
                                              mDriver.getText(),
                                              mURL.getText(), mUser.getText(),
                                              mPassword.getText());

                    ConnectionDialogCommon.addToRecentConnectionSettings(
                        settings, newSetting);
                }

                dispose();
            } catch (java.io.IOException ioe) {
                dispose();
            } catch (Exception e) {
                e.printStackTrace();
                mError.setText(e.toString());
            }
        } else if (s.equals("ConnectCancel")) {
            dispose();
        }
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:39,代码来源:ConnectionDialog.java

示例9: actionPerformed

import java.awt.event.ActionEvent; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
    if(e.getSource()==this.mf.getjButton1()){
        this.mf.getjButton1().setEnabled(false);
        this.executors.execute(new SocketTCP(this.ph.getADDRESS(), this.ph.getPORT(), this.dm));
        this.cg.refreshCharts();
    }
}
 
开发者ID:ilofX,项目名称:StazioneMetereologica,代码行数:9,代码来源:ListenerBottoniMainFrame.java

示例10: actionPerformed

import java.awt.event.ActionEvent; //导入方法依赖的package包/类
@Override final public void actionPerformed(ActionEvent objPactionEvent) {
	final Object objLsourceObject = objPactionEvent.getSource();

	if (this.objGoneSidePrintIconRadioJButton.isSameAs(objLsourceObject)) {
		this.objGprintJDialog.getAttributes().add(Sides.ONE_SIDED);
	} else if (this.objGtumblePrintIconRadioJButton.isSameAs(objLsourceObject)) {
		this.objGprintJDialog.getAttributes().add(Sides.TUMBLE);
	} else if (this.objGduplexPrintIconRadioJButton.isSameAs(objLsourceObject)) {
		this.objGprintJDialog.getAttributes().add(Sides.DUPLEX);
	}
}
 
开发者ID:jugglemaster,项目名称:JuggleMasterPro,代码行数:12,代码来源:PrintSidesSubJPanel.java

示例11: getCheckinStatus

import java.awt.event.ActionEvent; //导入方法依赖的package包/类
private ActionListener getCheckinStatus() {
	final ActionListener listener = new ActionListener() {

		@Override
		public void actionPerformed(ActionEvent e) {
			AbstractButton abstractButton = (AbstractButton) e.getSource();
			boolean isSelected = abstractButton.getModel().isSelected();
			setEnableStatus(isSelected);
		}
	};
	return listener;
}
 
开发者ID:Coder-ACJHP,项目名称:Hotel-Properties-Management-System,代码行数:13,代码来源:CustomerForm.java

示例12: actionPerformed

import java.awt.event.ActionEvent; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
    ActiveBreakpoints ab = this.ab;
    if (ab == null || !ab.canDeactivateBreakpoints()) {
        return ;
    }
    JToggleButton button = (JToggleButton) e.getSource();
    final boolean active = !button.isSelected();
    ab.setBreakpointsActive(active);
    setTooltip(button, active, true);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:BreakpointsViewButtons.java

示例13: actionPerformed

import java.awt.event.ActionEvent; //导入方法依赖的package包/类
/**
 * Event management.
 * => exit the app if QUIT button is pressed, otherwise bubble the event to AppMain
 */
public void actionPerformed(ActionEvent evt) {
  if (evt.getSource() == quitBt) {
    dispose();
    System.exit(0);
  } else if (evt.getSource() == searchBt) {
    int result = fileChooser.showSaveDialog(this);
    if (result == JFileChooser.APPROVE_OPTION) {
      app.setSearchDirectory(fileChooser.getSelectedFile());
    }
  }
}
 
开发者ID:juliango202,项目名称:jijimaku,代码行数:16,代码来源:AppGui.java

示例14: actionPerformed

import java.awt.event.ActionEvent; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
    Object src = e.getSource();
    dialog.setVisible(false);
    if (panel.cbOpenInFavorites.isSelected()) {
        Utils.post(new Runnable() {
            @Override
            public void run () {
                try {
                    Favorites.getDefault().selectWithAddition(FileUtil.toFileObject(workingFolder));
                } catch (DataObjectNotFoundException ex) {
                    Logger.getLogger(ProjectOpener.class.getName()).log(Level.INFO, null, ex);
                }
            }
        });
    }
    if (panel.openButton.equals(src)) {
        // show project chooser
        if (numberOfProjects > 1) {
            selectAndOpenProjects(checkedOutProjects);
        } else {
            openProject(checkedOutProjects.get(null).iterator().next());
        }
    } else if (panel.createButton.equals(src)) {
        if (workingFolder.isDirectory()) {
            ProjectUtilities.newProjectWizard(workingFolder);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:ProjectOpener.java

示例15: actionPerformed

import java.awt.event.ActionEvent; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
	if (e.getSource() instanceof JCheckBox) {
		JCheckBox chkbx = (JCheckBox) e.getSource();
		String name = chkbx.getName();
		if (name.startsWith("overlay")) {
			missionControllTab.setOverlayActive(
					name.substring("overlay".length()),
					chkbx.isSelected());
		}
	}
}
 
开发者ID:CognitiveModeling,项目名称:BrainControl,代码行数:13,代码来源:MissionControllPanel.java


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