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


Java ProgressThread类代码示例

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


ProgressThread类属于com.rapidminer.gui.tools包,在下文中一共展示了ProgressThread类的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: settingsChanged

import com.rapidminer.gui.tools.ProgressThread; //导入依赖的package包/类
private void settingsChanged() {
	ProgressThread loadingDataThread = new ProgressThread("loading_data") {

		@Override
		public void run() {
			try {
				final TableModel model = configuration.makePreviewTableModel(getProgressListener());
				SwingUtilities.invokeAndWait(new Runnable() {

					@Override
					public void run() {
						previewTable.setModel(model);
						errorTableModel.setErrors(configuration.getErrors());
					}
				});
			} catch (Exception e) {
				errorTableModel.setErrors(configuration.getErrors());
				ImportWizardUtils.showErrorMessage(configuration.getResourceName(), e.toString(), e);
			}
		}
	};

	loadingContentPane.init(loadingDataThread);
	updateQueue.executeBackgroundJob(loadingDataThread);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:26,代码来源:CSVSyntaxConfigurationWizardStep.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: 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

示例6: openTutorial

import com.rapidminer.gui.tools.ProgressThread; //导入依赖的package包/类
private void openTutorial(final Tutorial tutorial) {
    this.owner.dispose();
    if(RapidMinerGUI.getMainFrame().close()) {
        (new ProgressThread("open_tutorial") {
            public void run() {
                try {
                    GettingStartedDialog.logStats("tutorial_open", tutorial.getIdentifier());
                    MainFrame e = RapidMinerGUI.getMainFrame();
                    Process tutorialProcess = tutorial.makeProcess();
                    e.setOpenedProcess(tutorialProcess, false, (String)null);
                    e.getTutorialSelector().setSelectedTutorial(tutorial);
                    TutorialManager.INSTANCE.completedTutorial(tutorial.getIdentifier());
                    DockingTools.openDockable("tutorial_browser", (String)null, TutorialBrowser.POSITION);
                } catch (MalformedRepositoryLocationException | IOException | XMLException | RuntimeException var3) {
                    SwingTools.showSimpleErrorMessage("cannot_open_tutorial", var3, new Object[]{tutorial.getTitle(), var3.getMessage()});
                }

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

示例7: openTemplate

import com.rapidminer.gui.tools.ProgressThread; //导入依赖的package包/类
private void openTemplate() {
    this.owner.dispose();
    final Template template = (Template)this.getSelectedValue();
    if(template == Template.BLANK_PROCESS_TEMPLATE) {
        GettingStartedDialog.logStats("open_process", "new_process");
        RapidMinerGUI.getMainFrame().newProcess();
    } else {
        if(!RapidMinerGUI.getMainFrame().close()) {
            return;
        }

        (new ProgressThread("open_template") {
            public void run() {
                try {
                    Process e = template.makeProcess();
                    GettingStartedDialog.logStats("open_template", template.getName());
                    RapidMinerGUI.getMainFrame().setOpenedProcess(e, false, (String)null);
                } catch (MalformedRepositoryLocationException | IOException | XMLException | RuntimeException var2) {
                    SwingTools.showSimpleErrorMessage("cannot_open_template", var2, new Object[]{template.getTitle(), var2.getMessage()});
                }

            }
        }).start();
    }

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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: 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


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