本文整理汇总了Java中org.jdesktop.application.Task类的典型用法代码示例。如果您正苦于以下问题:Java Task类的具体用法?Java Task怎么用?Java Task使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Task类属于org.jdesktop.application包,在下文中一共展示了Task类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: redo
import org.jdesktop.application.Task; //导入依赖的package包/类
/**
* Redo last user (undone) action.
*
* @return the task that carries out additional processing
*/
public Task<Void, Void> redo ()
{
// Disabled for 5.0
return null;
// InterTask task = history.redo();
// Task<Void, Void> uTask = task.performRedo();
//
// sheet.getStub().setModified(true);
// sheet.getGlyphIndex().publish(null);
//
// Inter inter = task.getInter();
// sheet.getInterIndex().publish(inter.isDeleted() ? null : inter);
// editor.refresh();
//
// BookActions.getInstance().setUndoable(history.canUndo());
// BookActions.getInstance().setRedoable(history.canRedo());
//
// return uTask;
}
开发者ID:Audiveris,项目名称:audiveris,代码行数:26,代码来源:InterController.java
示例2: removeInter
import org.jdesktop.application.Task; //导入依赖的package包/类
/**
* Remove the provided inter (with its relations)
*
* @param inter the inter to remove
* @return the task that carries out additional processing
*/
public Task<Void, Void> removeInter (Inter inter)
{
// Disabled for 5.0
return null;
// logger.info("remove {}", inter);
//
// InterTask task = new RemovalTask(inter);
// history.add(task);
//
// Task<Void, Void> uTask = task.performDo();
//
// sheet.getStub().setModified(true);
// sheet.getGlyphIndex().publish(null);
// sheet.getInterIndex().publish(null);
// editor.refresh();
//
// BookActions.getInstance().setUndoable(history.canUndo());
// BookActions.getInstance().setRedoable(history.canRedo());
//
// return uTask;
}
开发者ID:Audiveris,项目名称:audiveris,代码行数:29,代码来源:InterController.java
示例3: undo
import org.jdesktop.application.Task; //导入依赖的package包/类
/**
* Undo last user action.
*
* @return the task that carries out additional processing
*/
public Task<Void, Void> undo ()
{
// Disabled for 5.0
return null;
// InterTask task = history.undo();
// Task<Void, Void> uTask = task.performUndo();
//
// sheet.getStub().setModified(true);
// sheet.getGlyphIndex().publish(null);
//
// Inter inter = task.getInter();
// sheet.getInterIndex().publish(inter.isDeleted() ? null : inter);
// editor.refresh();
//
// BookActions.getInstance().setUndoable(history.canUndo());
// BookActions.getInstance().setRedoable(history.canRedo());
//
// return uTask;
}
开发者ID:Audiveris,项目名称:audiveris,代码行数:26,代码来源:InterController.java
示例4: closeBook
import org.jdesktop.application.Task; //导入依赖的package包/类
/**
* Action that handles the closing of the currently selected book.
*
* @param e the event that triggered this action
* @return the task which will close the book
*/
@Action(enabledProperty = STUB_AVAILABLE)
public Task<Void, Void> closeBook (ActionEvent e)
{
Book book = StubsController.getCurrentBook();
if ((book != null) && checkStored(book)) {
// Pre-select the suitable "next" book tab
// TODO? should not do this (we are not on EDT). Don't use a task!
StubsController.getInstance().selectOtherBook(book);
// Now close the book (+ related tab)
return new CloseBookTask(book);
}
return null;
}
开发者ID:Audiveris,项目名称:audiveris,代码行数:23,代码来源:BookActions.java
示例5: exportBook
import org.jdesktop.application.Task; //导入依赖的package包/类
/**
* Export the currently selected book using MusicXML format
*
* @param e the event that triggered this action
* @return the task to launch in background
*/
@Action(enabledProperty = BOOK_IDLE)
public Task<Void, Void> exportBook (ActionEvent e)
{
final Book book = StubsController.getCurrentBook();
if (book == null) {
return null;
}
final Path exportPathSansExt = BookManager.getDefaultExportPathSansExt(book);
if (exportPathSansExt != null) {
//TODO: check/prompt for overwrite??? (perhaps several files)
return new ExportBookTask(book, exportPathSansExt);
} else {
return exportBookAs(e);
}
}
开发者ID:Audiveris,项目名称:audiveris,代码行数:25,代码来源:BookActions.java
示例6: invokeDefaultPlugin
import org.jdesktop.application.Task; //导入依赖的package包/类
/**
* Action to invoke the default score external editor
*
* @param e the event that triggered this action
*/
@Action(enabledProperty = STUB_IDLE)
public Task<Void, Void> invokeDefaultPlugin (ActionEvent e)
{
Plugin defaultPlugin = PluginManager.getInstance().getDefaultPlugin();
if (defaultPlugin == null) {
logger.warn("No default plugin defined");
return null;
}
// Current score export file
final Book book = StubsController.getCurrentBook();
if (book == null) {
return null;
} else {
return defaultPlugin.getTask(book);
}
}
开发者ID:Audiveris,项目名称:audiveris,代码行数:26,代码来源:BookActions.java
示例7: printBook
import org.jdesktop.application.Task; //导入依赖的package包/类
/**
* Print the currently selected book, as a PDF file
*
* @param e the event that triggered this action
* @return the task to launch in background
*/
@Action(enabledProperty = BOOK_IDLE)
public Task<Void, Void> printBook (ActionEvent e)
{
final Book book = StubsController.getCurrentBook();
if (book == null) {
return null;
}
final Path bookPrintPath = BookManager.getDefaultPrintPath(book);
if ((bookPrintPath != null) && confirmed(bookPrintPath)) {
return new PrintBookTask(book, bookPrintPath);
}
return printBookAs(e);
}
开发者ID:Audiveris,项目名称:audiveris,代码行数:24,代码来源:BookActions.java
示例8: printBookAs
import org.jdesktop.application.Task; //导入依赖的package包/类
/**
* Write the currently selected book, using PDF format, to a user-provided file.
*
* @param e the event that triggered this action
* @return the task to launch in background
*/
@Action(enabledProperty = BOOK_IDLE)
public Task<Void, Void> printBookAs (ActionEvent e)
{
final Book book = StubsController.getCurrentBook();
if (book == null) {
return null;
}
// Select target book print path
final Path bookPrintPath = UIUtil.pathChooser(
true,
OMR.gui.getFrame(),
BookManager.getDefaultPrintPath(book),
new OmrFileFilter(OMR.PDF_EXTENSION),
"Choose book print target");
if ((bookPrintPath == null) || !confirmed(bookPrintPath)) {
return null;
}
return new PrintBookTask(book, bookPrintPath);
}
开发者ID:Audiveris,项目名称:audiveris,代码行数:30,代码来源:BookActions.java
示例9: saveBook
import org.jdesktop.application.Task; //导入依赖的package包/类
/**
* Action to save the internals of the currently selected book.
*
* @param e the event that triggered this action
* @return the UI task to perform
*/
@Action(enabledProperty = BOOK_MODIFIED)
public Task<Void, Void> saveBook (ActionEvent e)
{
final Book book = StubsController.getCurrentBook();
if (book == null) {
return null;
}
final Path bookPath = BookManager.getDefaultSavePath(book);
if ((book.getBookPath() != null) && confirmed(bookPath)) {
return new StoreBookTask(book, bookPath);
}
return saveBookAs(e);
}
开发者ID:Audiveris,项目名称:audiveris,代码行数:24,代码来源:BookActions.java
示例10: saveBookAs
import org.jdesktop.application.Task; //导入依赖的package包/类
@Action(enabledProperty = STUB_AVAILABLE)
public Task<Void, Void> saveBookAs (ActionEvent e)
{
final Book book = StubsController.getCurrentBook();
if (book == null) {
return null;
}
// Let the user select a book output file
final Path defaultBookPath = BookManager.getDefaultSavePath(book);
final Path targetPath = selectBookPath(true, defaultBookPath);
final Path ownPath = book.getBookPath();
if ((targetPath != null)
&& (((ownPath != null) && ownPath.toAbsolutePath().equals(targetPath.toAbsolutePath()))
|| confirmed(targetPath))) {
return new StoreBookTask(book, targetPath);
}
return null;
}
开发者ID:Audiveris,项目名称:audiveris,代码行数:23,代码来源:BookActions.java
示例11: saveBookRepository
import org.jdesktop.application.Task; //导入依赖的package包/类
/**
* Action to save the separate repository of the currently selected book.
*
* @param e the event that triggered this action
* @return the UI task to perform
*/
@Action(enabledProperty = BOOK_MODIFIED)
public Task<Void, Void> saveBookRepository (ActionEvent e)
{
final Book book = StubsController.getCurrentBook();
if (book == null) {
return null;
}
if (book.hasAllocatedRepository()) {
SampleRepository repo = book.getSampleRepository();
if (repo.isModified()) {
repo.storeRepository();
}
}
return null;
}
开发者ID:Audiveris,项目名称:audiveris,代码行数:26,代码来源:BookActions.java
示例12: succeeded
import org.jdesktop.application.Task; //导入依赖的package包/类
@Override
protected void succeeded(Object resultObject) {
waitFrame.dispose();
String resultString = (String) resultObject;
if (resultString.equalsIgnoreCase("running")) {
// feedbackLabel.setText(java.util.ResourceBundle.getBundle("canreg/client/gui/resources/LoginInternalFrame").getString("SERVER_ALREADY_RUNNING."));
JOptionPane.showInternalMessageDialog(CanRegClientApp.getApplication().getMainFrame().getContentPane(), java.util.ResourceBundle.getBundle("canreg/client/gui/resources/LoginInternalFrame").getString("SERVER_ALREADY_RUNNING."), java.util.ResourceBundle.getBundle("canreg/client/gui/resources/LoginInternalFrame").getString("MESSAGE"), JOptionPane.INFORMATION_MESSAGE);
} else if (resultString.equalsIgnoreCase("stopped")) {
// feedbackLabel.setText(java.util.ResourceBundle.getBundle("canreg/client/gui/resources/LoginInternalFrame").getString("SERVER_FAILED_TO_START."));
JOptionPane.showInternalMessageDialog(CanRegClientApp.getApplication().getMainFrame().getContentPane(), java.util.ResourceBundle.getBundle("canreg/client/gui/resources/LoginInternalFrame").getString("SERVER_FAILED_TO_START."), java.util.ResourceBundle.getBundle("canreg/client/gui/resources/LoginInternalFrame").getString("MESSAGE"), JOptionPane.ERROR_MESSAGE);
} else if (resultString != null) {
// feedbackLabel.setText(java.util.ResourceBundle.getBundle("canreg/client/gui/resources/LoginInternalFrame").getString("SERVER_STARTED."));
CanRegClientApp.getApplication().setCanregServerRunningInThisThread(true);
JOptionPane.showInternalMessageDialog(CanRegClientApp.getApplication().getMainFrame().getContentPane(), java.util.ResourceBundle.getBundle("canreg/client/gui/resources/LoginInternalFrame").getString("SERVER_STARTED."), java.util.ResourceBundle.getBundle("canreg/client/gui/resources/LoginInternalFrame").getString("MESSAGE"), JOptionPane.INFORMATION_MESSAGE);
// launchServerButton.setEnabled(false);
// call restore from backup
Task restoreTask = restoreAction();
restoreTask.execute();
} else {
// feedbackLabel.setText(java.util.ResourceBundle.getBundle("canreg/client/gui/resources/LoginInternalFrame").getString("SERVER_FAILED_TO_START."));
JOptionPane.showInternalMessageDialog(CanRegClientApp.getApplication().getMainFrame().getContentPane(), java.util.ResourceBundle.getBundle("canreg/client/gui/resources/LoginInternalFrame").getString("SERVER_FAILED_TO_START."), java.util.ResourceBundle.getBundle("canreg/client/gui/resources/LoginInternalFrame").getString("ERROR"), JOptionPane.ERROR_MESSAGE);
}
}
开发者ID:IARC-CSU,项目名称:CanReg5,代码行数:24,代码来源:InstallNewSystemInternalFrame.java
示例13: actionPerformed
import org.jdesktop.application.Task; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
if ("refresh".equalsIgnoreCase(e.getActionCommand())) {
Task refreshTask = refresh();
refreshTask.execute();
} else if ("tableChanged".equalsIgnoreCase(e.getActionCommand())) {
String tableName = rangeFilterPanel.getSelectedTable();
variableChooserPanel.setTableName(tableName);
variableChooserPanel.setVariablesInTable(rangeFilterPanel.getArrayOfVariablesInSelectedTables());
variableChooserPanel.initPanel(dictionary);
resultPanel.setVisible(false);
// We can't add the source info if we don't have tumour info...
if (tableName.equalsIgnoreCase(Globals.SOURCE_TABLE_NAME)
|| tableName.equalsIgnoreCase(Globals.PATIENT_TABLE_NAME)
|| tableName.equalsIgnoreCase(Globals.SOURCE_AND_TUMOUR_AND_PATIENT_JOIN_TABLE_NAME)
|| tableName.equalsIgnoreCase(Globals.SOURCE_AND_TUMOUR_JOIN_TABLE_NAME)) {
exportSourceInformationCheckBox.setEnabled(false);
exportSourceInformationCheckBox.setSelected(false);
} else {
// disable the export source information tool...
exportSourceInformationCheckBox.setEnabled(true);
}
}
}
开发者ID:IARC-CSU,项目名称:CanReg5,代码行数:25,代码来源:ExportReportInternalFrame.java
示例14: importAction
import org.jdesktop.application.Task; //导入依赖的package包/类
/**
*
* @return
*/
@Action()
public Task importAction() {
// TODO: Add a handler for errors in the file structure...
localSettings.setProperty("import_path", path);
localSettings.writeSettings();
progressBar.setStringPainted(true);
importButton.setEnabled(false);
// this.dispose();
importTask = new ImportActionTask(org.jdesktop.application.Application.getInstance(canreg.client.CanRegClientApp.class));
importTask.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if ("progress".equals(evt.getPropertyName())) {
progressBar.setValue((Integer) evt.getNewValue());
progressBar.setString(evt.getNewValue().toString() + "%");
} else if ("finished".equals(evt.getPropertyName())) {
dispose();
}
}
});
return importTask;
}
开发者ID:IARC-CSU,项目名称:CanReg5,代码行数:27,代码来源:ImportView.java
示例15: startCalc
import org.jdesktop.application.Task; //导入依赖的package包/类
@Action
public Task startCalc() {
if (calcTask != null) {
((NeuGenLibTask) calcTask).getNGLib().getNet().destroy();
((NeuGenLibTask) calcTask).getNGLib().destroy();
net = null;
calcTask = null;
}
destroyVisualizeTasks();
disableButtons();
NeuGenLib.initParamData(initParamTable(), currentProjectType);
calcTask = new NeuGenLibTask(getApplication(), currentProjectType);
NeuGenLibTask.setInstance((NeuGenLibTask) calcTask);
importedData = false;
density = DensityVisualizationTask.Density.NET;
visual = VisualizationTask.Visualization.NET;
//logger.debug("startCalc: " + projectDirPath);
return calcTask;
}
开发者ID:NeuroBox3D,项目名称:NeuGen,代码行数:20,代码来源:NeuGenView.java
示例16: buscarPartes
import org.jdesktop.application.Task; //导入依赖的package包/类
@Action
public Task buscarPartes() {
alertasTexto.setText("");
if (!queryNumero.getText().isEmpty()) {
opcion=10;
} else {
opcion = 0;
if (checkFecha.isSelected()) {
opcion += 1;
if (chooserFecha.getDate() == null) {
alertasTexto.setText("Seleccione un fecha");
return null;
}
}
if (checkEmpleado.isSelected()) {
opcion += 2;
}
if (checkObra.isSelected()) {
opcion += 4;
}
}
return new BuscarPartesTask(org.jdesktop.application.Application.getInstance(zilleprojects.ZilleProjectsApp.class));
}
开发者ID:infoINGenieria,项目名称:zprojects,代码行数:24,代码来源:JDRemoverParte.java
示例17: asyncModifyBoundaries
import org.jdesktop.application.Task; //导入依赖的package包/类
/**
* Asynchronously perform a modification in systems boundaries
*
* @param modifiedLines the set of modified lines
* @return the task that carries out the processing
*/
public Task<Void, Void> asyncModifyBoundaries (Set<BrokenLine> modifiedLines)
{
List<BrokenLineContext> contexts = new ArrayList<>();
// Retrieve impacted systems
for (BrokenLine line : modifiedLines) {
int above = 0;
int below = 0;
for (SystemInfo system : sheet.getSystems()) {
SystemBoundary boundary = system.getBoundary();
if (boundary.getLimit(VerticalSide.BOTTOM) == line) {
above = system.getId();
} else if (boundary.getLimit(VerticalSide.TOP) == line) {
below = system.getId();
}
}
contexts.add(new BrokenLineContext(above, below, line));
}
return new BoundaryTask(sheet, contexts).launch(sheet);
}
开发者ID:jlpoolen,项目名称:libreveris,代码行数:31,代码来源:SymbolsController.java
示例18: agregarOperarios
import org.jdesktop.application.Task; //导入依赖的package包/类
@Action
public Task agregarOperarios() {
if (nombre.getText().isEmpty()) {
Error("El campo NOMBRE es obligatorio.");
return null;
}
opSelected = new Operario();
opSelected.setNombre(nombre.getText());
opSelected.setN_legajo(nlegajo.getText());
opSelected.setFuncion(((Funcion)funcionCombo.getSelectedItem()).getId());
opSelected.setObservaciones(observaciones.getText());
opSelected.setDesarraigo(desaCheck.isSelected());
opSelected.setCuil(cuil.getText());
opSelected.setVto_carnet(vto_carnet.getDate());
opSelected.setVto_psicofisico(vto_psicofisico.getDate());
opSelected.setVto_cargagral(vto_cargagral.getDate());
opSelected.setVto_cargapeligrosa(vto_cargapeligrosa.getDate());
opSelected.setVto_otros1(vto_otros1.getDate());
opSelected.setVto_otros2(vto_otros2.getDate());
opSelected.setVto_otros3(vto_otros3.getDate());
opSelected.setDescripcion_vto1(descripcion1.getText());
opSelected.setDescripcion_vto2(descripcion2.getText());
opSelected.setDescripcion_vto3(descripcion3.getText());
opSelected.setFecha_ingreso(dateIngreso.getDate());
return new AgregarOperariosTask(org.jdesktop.application.Application.getInstance(zilleprojects.ZilleProjectsApp.class));
}
开发者ID:infoINGenieria,项目名称:zprojects,代码行数:27,代码来源:JDEmpleadoGestion.java
示例19: storeScriptAs
import org.jdesktop.application.Task; //导入依赖的package包/类
@Action(enabledProperty = SHEET_AVAILABLE)
public Task<Void, Void> storeScriptAs (ActionEvent e)
{
final Score score = ScoreController.getCurrentScore();
if (score == null) {
return null;
}
// Let the user select a script output file
File scriptFile = UIUtil.fileChooser(
true,
Main.getGui().getFrame(),
getDefaultScriptFile(score),
new OmrFileFilter(
"Script files",
new String[]{ScriptManager.SCRIPT_EXTENSION}));
if (scriptFile != null) {
return new StoreScriptTask(score.getScript(), scriptFile);
} else {
return null;
}
}
开发者ID:jlpoolen,项目名称:libreveris,代码行数:25,代码来源:ScriptActions.java
示例20: GuardarParteMasivo
import org.jdesktop.application.Task; //导入依赖的package包/类
@Action
public Task GuardarParteMasivo() {
if(empleadoMasivo.getId()!=0 && fechaChoose.getDate()!=null){
if (OpcionPanel.YES_OPTION==
OpcionPanel.showConfirmDialog(null, "¿Desea continuar?", "Guardar", OpcionPanel.YES_NO_OPTION)) {
if(isHasta.isSelected() && fechaChoose.getDate().compareTo(hastaDateChoose.getDate()) >0){
OpcionPanel.showMessageDialog(null, "La fecha \"Hasta\" es anterior a \"Desde\"", "Error en las fechas!", OpcionPanel.ERROR_MESSAGE);
return null;
}
return new GuardarParteMasivoTask(getApplication());
}
}
return null;
}
开发者ID:infoINGenieria,项目名称:zprojects,代码行数:17,代码来源:ZilleProjectsView.java
注:本文中的org.jdesktop.application.Task类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论