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


Java ProgressThread.start方法代码示例

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


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

示例1: updateAll

import com.rapidminer.gui.tools.ProgressThread; //导入方法依赖的package包/类
public void updateAll() {
    try {
        this.retrieveTableNames();
    } catch (SQLException var2) {
        SwingTools.showSimpleErrorMessage("db_connection_failed_simple", var2, new Object[0]);
        this.databaseHandler = null;
    }

    ProgressThread retrieveTablesThread = new ProgressThread("refreshing") {
        public void run() {
            this.getProgressListener().setTotal(100);
            this.getProgressListener().setCompleted(10);

            try {
                SQLQueryBuilder.this.updateAttributeNames();
            } finally {
                this.getProgressListener().complete();
            }

        }
    };
    retrieveTablesThread.start();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:24,代码来源:SQLQueryBuilder.java

示例2: loadTutorials

import com.rapidminer.gui.tools.ProgressThread; //导入方法依赖的package包/类
private void loadTutorials() {
    ProgressThread pThread = new ProgressThread("load_tutorials") {
        public void run() {
            final ArrayList tutorialGroups = new ArrayList(TutorialRegistry.INSTANCE.getAllTutorialGroups());
            Runnable updateTutorials = new Runnable() {
                public void run() {
                    if(TutorialCard.this.loadingIndicator != null) {
                        TutorialCard.this.remove(TutorialCard.this.loadingIndicator);
                        TutorialCard.this.loadingIndicator = null;
                    }

                    TutorialCard.this.add(TutorialCard.this.createTutorialSelector(tutorialGroups));
                    if(TutorialCard.this.isVisible()) {
                        TutorialCard.this.tutorialGroupList.requestFocusInWindow();
                    }

                }
            };
            SwingUtilities.invokeLater(updateTutorials);
        }
    };
    pThread.setIndeterminate(true);
    pThread.addDependency(new String[]{"load_tutorials"});
    pThread.start();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:26,代码来源:TutorialCard.java

示例3: overwriteProcess

import com.rapidminer.gui.tools.ProgressThread; //导入方法依赖的package包/类
private void overwriteProcess(final ProcessEntry processEntry) {
	if (SwingTools.showConfirmDialog("overwrite", ConfirmDialog.YES_NO_OPTION, processEntry.getLocation()) == ConfirmDialog.YES_OPTION) {
		ProgressThread storeProgressThread = new ProgressThread("store_process") {

			@Override
			public void run() {
				getProgressListener().setTotal(100);
				getProgressListener().setCompleted(10);
				try {
					Process process = RapidMinerGUI.getMainFrame().getProcess();
					process.setProcessLocation(new RepositoryProcessLocation(processEntry.getLocation()));
					processEntry.storeXML(process.getRootOperator().getXML(false));
					RapidMinerGUI.addToRecentFiles(process.getProcessLocation());
					RapidMinerGUI.getMainFrame().processHasBeenSaved();
				} catch (Exception e) {
					SwingTools.showSimpleErrorMessage("cannot_store_process_in_repository", e, processEntry.getName());
				} finally {
					getProgressListener().setCompleted(100);
					getProgressListener().complete();
				}
			}
		};
		storeProgressThread.start();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:26,代码来源:StoreProcessAction.java

示例4: showAsResult

import com.rapidminer.gui.tools.ProgressThread; //导入方法依赖的package包/类
/** Loads the data held by the given entry (in the background) and opens it as a result. */
public static void showAsResult(final IOObjectEntry data) {
	if (data == null) {
		throw new IllegalArgumentException("data entry must not be null");
	}
	final ProgressThread downloadProgressThread = new ProgressThread("download_from_repository") {

		@Override
		public void run() {
			try {
				ResultObject result = (ResultObject) data.retrieveData(this.getProgressListener());
				if (isCancelled()) {
					return;
				}
				result.setSource(data.getLocation().toString());
				RapidMinerGUI.getMainFrame().getResultDisplay().showResult(result);
			} catch (Exception e1) {
				SwingTools.showSimpleErrorMessage("cannot_fetch_data_from_repository", e1);
			}
		}
	};
	downloadProgressThread.start();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:24,代码来源:OpenAction.java

示例5: actionPerformed

import com.rapidminer.gui.tools.ProgressThread; //导入方法依赖的package包/类
@Override
public void actionPerformed(final Folder folder) {					
	ProgressThread openProgressThread = new ProgressThread("refreshing") {
		public void run() {
			getProgressListener().setTotal(100);
			getProgressListener().setCompleted(0);
			try {
				getProgressListener().setCompleted(50);
				folder.refresh();
			} catch (Exception e) {
				SwingTools.showSimpleErrorMessage("cannot_refresh_folder", e);
			} finally {
				getProgressListener().setCompleted(100);
			}
		}
	};
	openProgressThread.start();														
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:19,代码来源:RefreshRepositoryEntryAction.java

示例6: showAsResult

import com.rapidminer.gui.tools.ProgressThread; //导入方法依赖的package包/类
/** Loads the data held by the given entry (in the background) and opens it as a result. */
public static void showAsResult(final IOObjectEntry data) {
    if (data == null) {
        throw new IllegalArgumentException("data entry must not be null");
    }
    final ProgressThread downloadProgressThread = new ProgressThread("download_from_repository") {
        @Override
        public void run() {
            try {
                ResultObject result = (ResultObject)data.retrieveData(this.getProgressListener());
                if (isCancelled()) {
                	return;
                }
                result.setSource(data.getLocation().toString());
                RapidMinerGUI.getMainFrame().getResultDisplay().showResult(result);
            } catch (Exception e1) {
                SwingTools.showSimpleErrorMessage("cannot_fetch_data_from_repository", e1);
            }
        }
    };
    downloadProgressThread.start();
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:23,代码来源:OpenAction.java

示例7: retrieveColumnNames

import com.rapidminer.gui.tools.ProgressThread; //导入方法依赖的package包/类
/**
 * This method will retrieve the column Names of the given table and will cause an
 * update of the gui later on.
 */
private void retrieveColumnNames(final TableName tableName) {
	if (databaseHandler != null) {
		ProgressThread retrieveTablesThread = new ProgressThread("fetching_database_tables") {
			@Override
			public void run() {
				getProgressListener().setTotal(100);
				getProgressListener().setCompleted(10);
				try {
					List<ColumnIdentifier> attributeNames = cache.getAllColumnNames(databaseHandler.getDatabaseUrl(), databaseHandler, tableName);
					attributeNameMap.put(tableName, attributeNames);
					SwingUtilities.invokeLater(new Runnable() {
						@Override
						public void run() {
							updateAttributeNames();
						}
					});
				} catch (SQLException e) {
					// don't do anything: Convenient method does not work
				}
			}
		};
		retrieveTablesThread.start();
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:29,代码来源:SQLQueryBuilder.java

示例8: updateAll

import com.rapidminer.gui.tools.ProgressThread; //导入方法依赖的package包/类
/**
 * This method forces the {@link SQLQueryBuilder} to update its values.
 */
public void updateAll() {
	try {
		retrieveTableNames();
	} catch (SQLException e) {
		SwingTools.showSimpleErrorMessage("db_connection_failed_simple", e);
		this.databaseHandler = null;
	}
	ProgressThread retrieveTablesThread = new ProgressThread("refreshing") {
		@Override
		public void run() {
			getProgressListener().setTotal(100);
			getProgressListener().setCompleted(10);
			try {
				updateAttributeNames();
			} finally {
				getProgressListener().complete();
			}
		}
	};
	retrieveTablesThread.start();
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:25,代码来源:SQLQueryBuilder.java

示例9: actionPerformed

import com.rapidminer.gui.tools.ProgressThread; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
	final ProgressThread downloadProgressThread = new ProgressThread("download_from_repository") {
		public void run() {
			try {
				RepositoryLocation location = new RepositoryLocation(repositoryLocation);
				Entry entry = location.locateEntry();
				if (entry instanceof IOObjectEntry) {
					IOObjectEntry data = (IOObjectEntry) entry;
					ResultObject result = (ResultObject) data.retrieveData(this.getProgressListener());
					result.setSource(data.getLocation().toString());
					RapidMinerGUI.getMainFrame().getResultDisplay().showResult(result);
				} else {
					SwingTools.showSimpleErrorMessage("cannot_fetch_data_from_repository", "Not an IOObject.");
				}
			} catch (Exception e1) {
				SwingTools.showSimpleErrorMessage("cannot_fetch_data_from_repository", e1);
			}
		}
	};
	downloadProgressThread.start();
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:23,代码来源:SingleResultOverview.java

示例10: setupGUI

import com.rapidminer.gui.tools.ProgressThread; //导入方法依赖的package包/类
private void setupGUI() {
    this.panel.setLayout(new GridBagLayout());
    this.panel.setToolTipText(this.type.getDescription());
    this.comboBox.setToolTipText(this.type.getDescription());
    GridBagConstraints c = new GridBagConstraints();
    c.fill = 1;
    c.weighty = 1.0D;
    c.weightx = 1.0D;
    this.panel.add(this.comboBox, c);
    JButton button = new JButton(new ResourceAction(true, "clear_db_cache", new Object[0]) {
        private static final long serialVersionUID = 8510147303889637712L;

        {
            this.putValue("Name", "");
        }

        public void actionPerformed(ActionEvent e) {
            ProgressThread t = new ProgressThread("db_clear_cache") {
                public void run() {
                    TableMetaDataCache.getInstance().clearCache();
                    DatabaseTableValueCellEditor.this.model.lastURL = null;
                    DatabaseTableValueCellEditor.this.model.updateModel();
                }
            };
            t.start();
        }
    });
    button.setMargin(new Insets(0, 0, 0, 0));
    c.weightx = 0.0D;
    c.insets = new Insets(0, 5, 0, 0);
    this.panel.add(button, c);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:33,代码来源:DatabaseTableValueCellEditor.java

示例11: retrieveColumnNames

import com.rapidminer.gui.tools.ProgressThread; //导入方法依赖的package包/类
private void retrieveColumnNames(final TableName tableName) {
    if(this.databaseHandler != null) {
        ProgressThread retrieveTablesThread = new ProgressThread("fetching_database_tables") {
            public void run() {
                this.getProgressListener().setTotal(100);
                this.getProgressListener().setCompleted(10);
                synchronized(SQLQueryBuilder.this.databaseHandler) {
                    try {
                        if(!SQLQueryBuilder.this.databaseHandler.getConnection().isClosed()) {
                            List attributeNames = SQLQueryBuilder.this.cache.getAllColumnNames(SQLQueryBuilder.this.databaseHandler.getDatabaseUrl(), SQLQueryBuilder.this.databaseHandler, tableName);
                            SQLQueryBuilder.this.attributeNameMap.put(tableName, attributeNames);
                            SwingUtilities.invokeLater(new Runnable() {
                                public void run() {
                                    SQLQueryBuilder.this.updateAttributeNames();
                                }
                            });
                        }
                    } catch (SQLException var4) {
                        ;
                    }

                }
            }
        };
        retrieveTablesThread.start();
    }

}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:29,代码来源:SQLQueryBuilder.java

示例12: retrieveTableNames

import com.rapidminer.gui.tools.ProgressThread; //导入方法依赖的package包/类
private void retrieveTableNames() throws SQLException {
    if(this.databaseHandler != null) {
        ProgressThread retrieveTablesThread = new ProgressThread("fetching_database_tables") {
            public void run() {
                this.getProgressListener().setTotal(100);
                this.getProgressListener().setCompleted(10);

                try {
                    SQLQueryBuilder.this.attributeNameMap.clear();
                    synchronized(SQLQueryBuilder.this.databaseHandler) {
                        try {
                            if(SQLQueryBuilder.this.databaseHandler != null && !SQLQueryBuilder.this.databaseHandler.getConnection().isClosed()) {
                                Map e = SQLQueryBuilder.this.cache.getAllTableMetaData(SQLQueryBuilder.this.databaseHandler.getDatabaseUrl(), SQLQueryBuilder.this.databaseHandler, this.getProgressListener(), 10, 100);
                                SQLQueryBuilder.this.attributeNameMap.putAll(e);
                            }
                        } catch (SQLException var8) {
                            LogService.getRoot().log(Level.WARNING, "com.rapidminer.gui.properties.celleditors.value.SQLQueryValueCellEditor.connecting_to_database_error", var8);
                            return;
                        }
                    }

                    final TableName[] allNames = new TableName[SQLQueryBuilder.this.attributeNameMap.size()];
                    SQLQueryBuilder.this.attributeNameMap.keySet().toArray(allNames);
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            SQLQueryBuilder.this.tableList.removeAll();
                            SQLQueryBuilder.this.tableList.setListData(allNames);
                            SQLQueryBuilder.this.setVisibilityOfSelectionComponents(true);
                            SQLQueryBuilder.this.connectionStatus.setVisible(false);
                        }
                    });
                } finally {
                    this.getProgressListener().complete();
                }
            }
        };
        retrieveTablesThread.start();
    }

}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:41,代码来源:SQLQueryBuilder.java

示例13: testConnection

import com.rapidminer.gui.tools.ProgressThread; //导入方法依赖的package包/类
private void testConnection() {
    this.testLabel.setText(LOADING_TEXT);
    this.testLabel.setIcon(LOADING_ICON);
    ProgressThread t = new ProgressThread("test_database_connection") {
        public void run() {
            this.getProgressListener().setTotal(100);
            this.getProgressListener().setCompleted(10);

            try {
                ConnectionEntry exception = DatabaseSelectionView.this.manageConnectionsdialog.getSelectedEntry();
                if(exception == null) {
                    DatabaseSelectionView.this.setConnectionErrorText(DatabaseSelectionView.NO_SELECTION_MESSAGE);
                    DatabaseSelectionView.this.testLabel.setText(DatabaseSelectionView.NO_SELECTION_MESSAGE);
                    return;
                }

                DatabaseConnectionService.testConnection(exception);
                DatabaseSelectionView.this.setConnectionSuccessfulText();
            } catch (SQLException var5) {
                DatabaseSelectionView.this.setConnectionErrorText(var5.getLocalizedMessage());
            } finally {
                this.getProgressListener().complete();
            }

        }
    };
    t.start();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:29,代码来源:DatabaseSelectionView.java

示例14: updateDateFormat

import com.rapidminer.gui.tools.ProgressThread; //导入方法依赖的package包/类
/**
 * Updates date format for the date and reloads it.
 *
 * @param format
 *            the new date format
 */
private void updateDateFormat(SimpleDateFormat format) {
	DataImportWizardUtils.logStats(DataWizardEventType.DATE_FORMAT_CHANGED, format.toPattern());
	dataSetMetaData.setDateFormat(format);
	ProgressThread rereadThread = new ProgressThread("io.dataimport.step.data_column_configuration.update_date_format") {

		@Override
		public void run() {
			try {
				tableModel.reread(getProgressListener());
			} catch (final DataSetException e) {
				SwingTools.invokeLater(new Runnable() {

					@Override
					public void run() {
						showErrorNotification("io.dataimport.step.data_column_configuration.error_loading_data",
								e.getMessage());
					}
				});
				return;
			}
			SwingTools.invokeLater(new Runnable() {

				@Override
				public void run() {
					validator.setParsingErrors(tableModel.getParsingErrors());
					tableModel.fireTableDataChanged();
				}
			});

		}
	};

	rereadThread.start();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:41,代码来源:ConfigureDataView.java

示例15: performEnteringAction

import com.rapidminer.gui.tools.ProgressThread; //导入方法依赖的package包/类
@Override
protected boolean performEnteringAction(WizardStepDirection direction) {
	if (direction == WizardStepDirection.FORWARD) {
		ProgressThread thread = new ProgressThread("loading_data") {

			@Override
			public void run() {
				getProgressListener().setTotal(100);
				getProgressListener().setCompleted(10);
				try {
					final TableModel wrappedModel = state.getDataResultSetFactory().makePreviewTableModel(
							getProgressListener());
					SwingUtilities.invokeLater(new Runnable() {

						@Override
						public void run() {
							table.setModel(new AnnotationTableModel(wrappedModel, state.getTranslationConfiguration()
									.getAnnotationsMap()));
							table.getColumnModel().getColumn(0).setCellEditor(new AnnotationCellEditor());
						}
					});
				} catch (Exception e) {
					ImportWizardUtils.showErrorMessage(state.getDataResultSetFactory().getResourceName(), e.toString(),
							e);
				} finally {
					getProgressListener().complete();
				}
			}
		};
		loadingContentPane.init(thread);
		thread.start();
	}
	return true;

}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:36,代码来源:AnnotationDeclarationWizardStep.java


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