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


Java SwingTools类代码示例

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


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

示例1: handleFetchPackageNames

import com.rapidminer.gui.tools.SwingTools; //导入依赖的package包/类
public List<String> handleFetchPackageNames() {
    UpdateServerAccount account = MarketplaceUpdateManager.getUpdateServerAccount();
    if(!account.isLoggedIn()) {
        return new ArrayList();
    } else {
        AccountService accountService = null;

        try {
            accountService = MarketplaceUpdateManager.getAccountService();
        } catch (Exception var4) {
            SwingTools.showSimpleErrorMessage("failed_update_server", var4, new Object[]{MarketplaceUpdateManager.getBaseUrl()});
        }

        if (accountService != null) {
            return accountService.getLicensedProducts();
        }
        return Collections.emptyList();
    }
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:20,代码来源:LicencedPackageListModel.java

示例2: headerRowIndexUpdated

import com.rapidminer.gui.tools.SwingTools; //导入依赖的package包/类
@Override
public void headerRowIndexUpdated(final int newHeaderRowIndex) {
	updatingUI = true;

	SwingTools.invokeAndWait(new Runnable() {

		@Override
		public void run() {
			boolean hasHeaderRow = newHeaderRowIndex > ResultSetAdapter.NO_HEADER_ROW;
			int displayedHeaderRowIndex = hasHeaderRow ? newHeaderRowIndex + 1 : 1;
			headerRowSpinner.setModel(new SpinnerNumberModel(displayedHeaderRowIndex, 1, Integer.MAX_VALUE, 1));
			hasHeaderRowCheckBox.setSelected(hasHeaderRow);
			killCurrentBubbleWindow(headerRowSpinner);

			contentTable.revalidate();
			contentTable.repaint();
		}
	});

	updatingUI = false;

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

示例3: viewWillBecomeInvisible

import com.rapidminer.gui.tools.SwingTools; //导入依赖的package包/类
@Override
public void viewWillBecomeInvisible(WizardDirection direction) throws InvalidConfigurationException {
	FileDataSourceFactory<?> fileDataSourceFactory = getView().getFileDataSourceFactory();
	Path selectedLocation = getView().getSelectedLocation();

	LocalFileDataSource dataSource = wizard.getDataSource(LocalFileDataSource.class);
	boolean locationChanged = dataSource.getLocation() == null && selectedLocation != null
			|| dataSource.getLocation() != null && !dataSource.getLocation().equals(selectedLocation);

	FileDataSourceFactory<?> dsFileFactory = dataSource.getFileDataSourceFactory();
	boolean fileTypeChanged = dsFileFactory == null && fileDataSourceFactory != null || dsFileFactory != null
			&& !dsFileFactory.getDataSourceClass().equals(fileDataSourceFactory.getDataSourceClass());

	// update the data source location
	dataSource.setLocation(selectedLocation);

	// update the data source factory in case the location or file type has changed
	if (fileDataSourceFactory != null && (locationChanged || fileTypeChanged)) {
		updateFileDataSource(dataSource, fileDataSourceFactory, wizard, selectedLocation);
	}

	// if going on with the selected file store the last directory
	if (direction == WizardDirection.NEXT && selectedLocation != null) {
		SwingTools.storeLastDirectory(selectedLocation);
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:27,代码来源:LocalFileLocationWizardStep.java

示例4: createNameDialog

import com.rapidminer.gui.tools.SwingTools; //导入依赖的package包/类
private String createNameDialog(String oldName) {
	String newName = SwingTools.showInputDialog("plotter.configuration_dialog.color_scheme_dialog.rename", oldName);
	if (newName != null) {
		boolean success = currentColorSchemes.get(newName) == null;
		if (newName.equals(oldName)) {
			success = true;
		}
		if (!success) {
			SwingTools.showVerySimpleErrorMessage("cannot_rename_entry", oldName, newName);
			return oldName;
		}
		return newName;
	}
	return null;

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

示例5: valueChanged

import com.rapidminer.gui.tools.SwingTools; //导入依赖的package包/类
public void valueChanged(ListSelectionEvent e) {
    if(!e.getValueIsAdjusting()) {
        JList source = (JList)e.getSource();
        if(!source.isSelectionEmpty()) {
            if(!this.otherList.isSelectionEmpty()) {
                this.otherList.clearSelection();
            }

            PackageDescriptor desc = null;
            Object selectedValue = source.getSelectedValue();
            desc = (PackageDescriptor)selectedValue;

            try {
                ConfirmLicensesDialog.this.setLicensePaneContent(desc);
            } catch (Exception var6) {
                SwingTools.showSimpleErrorMessage("error_installing_update", var6, new Object[]{var6.getMessage()});
            }
        }
    }

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

示例6: getParameterTypes

import com.rapidminer.gui.tools.SwingTools; //导入依赖的package包/类
@Override
public List<ParameterType> getParameterTypes() {
	List<ParameterType> types = super.getParameterTypes();
	ParameterType type = new ParameterTypeLinkButton(PARAMETER_INSTALL_EXTENSION,
			I18N.getGUILabel("dummy.parameter.install_extension"), new ResourceAction("install_extension_dummy") {

				private static final long serialVersionUID = 1423879776955743834L;

				@Override
				public void actionPerformed(ActionEvent e) {
					try {
						UpdateManagerRegistry.INSTANCE.get().showUpdateDialog(false, getExtensionId());
					} catch (URISyntaxException | IOException e1) {
						SwingTools.showSimpleErrorMessage("dummy.marketplace_connection_error", e1);
					}
				}

			});
	type.setExpert(false);
	types.add(type);
	return types;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:23,代码来源:DummyOperator.java

示例7: setReplaces

import com.rapidminer.gui.tools.SwingTools; //导入依赖的package包/类
public void setReplaces(String replaces) {
	this.replaces = replaces;
	if (replaces != null) {
		installFix = new AbstractQuickFix(10, true, "install_extension", getExtensionName()) {

			@Override
			public void apply() {
				try {
					UpdateManagerRegistry.INSTANCE.get().showUpdateDialog(false, getExtensionId());
				} catch (URISyntaxException | IOException e1) {
					SwingTools.showSimpleErrorMessage("Unable to connect to the RapidMiner Marketplace.", e1);
				}
			}
		};
	} else {
		installFix = null;
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:19,代码来源:DummyOperator.java

示例8: getIconNameForType

import com.rapidminer.gui.tools.SwingTools; //导入依赖的package包/类
/**
 * Searches for a class with the given name and returns the path of the resource. Used for the
 * images of the ports' data types.
 *
 * @param type
 *            the class' name as String
 * @return the path of the resource of the corresponding icon.
 */
@SuppressWarnings("unchecked")
public static String getIconNameForType(String type) {
	String iconName;
	if (type == null || type.isEmpty()) {
		iconName = "plug.png";
	} else {
		Class<? extends IOObject> typeClass;
		try {
			typeClass = (Class<? extends IOObject>) Class.forName(type);
			iconName = RendererService.getIconName(typeClass);
			if (iconName == null) {
				iconName = "plug.png";
			}
		} catch (ClassNotFoundException e) {
			LogService.getRoot().finer("Failed to lookup class '" + type + "'. Reason: " + e.getLocalizedMessage());
			iconName = "plug.png";
		}
	}

	String path = SwingTools.getIconPath("24/" + iconName);
	return path;

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

示例9: update

import com.rapidminer.gui.tools.SwingTools; //导入依赖的package包/类
public void update(Observable o, Object arg) {
    if(o instanceof UpdatePackagesModel) {
        UpdatePackagesModel currentModel = (UpdatePackagesModel)o;
        if(arg != null && arg instanceof PackageDescriptor) {
            PackageDescriptor desc = (PackageDescriptor)arg;
            Object selectedObject = UpdatePanelTab.this.getPackageList().getSelectedValue();
            if(selectedObject instanceof PackageDescriptor) {
                PackageDescriptor selectedDescriptor = (PackageDescriptor)selectedObject;
                if(desc.getPackageId().equals(selectedDescriptor.getPackageId())) {
                    this.setSelected(currentModel.isSelectedForInstallation(desc));
                    if(this.isSelected()) {
                        this.setIcon(SwingTools.createIcon("16/checkbox.png"));
                    } else {
                        this.setIcon(SwingTools.createIcon("16/checkbox_unchecked.png"));
                    }
                }
            }

            UpdatePanelTab.this.listModel.updateView(desc);
        }
    }

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

示例10: openTemplate

import com.rapidminer.gui.tools.SwingTools; //导入依赖的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

示例11: AnnotationDeclarationWizardStep

import com.rapidminer.gui.tools.SwingTools; //导入依赖的package包/类
public AnnotationDeclarationWizardStep(WizardState state) {
	super("importwizard.annotations");
	this.state = state;
	ExtendedJTable extendedTable = new ExtendedJTable(false, false, false);
	extendedTable.setCellColorProvider(new CellColorProviderAlternating() {

		@Override
		public Color getCellColor(int row, int column) {
			if (column == 0) {
				return row % 2 == 0 ? Color.WHITE : SwingTools.LIGHTEST_YELLOW;
			} else {
				return super.getCellColor(row, column);
			}
		}
	});
	table = extendedTable;
	panel.add(new ExtendedJScrollPane(table), BorderLayout.CENTER);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:19,代码来源:AnnotationDeclarationWizardStep.java

示例12: overwriteProcess

import com.rapidminer.gui.tools.SwingTools; //导入依赖的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

示例13: actionPerformed

import com.rapidminer.gui.tools.SwingTools; //导入依赖的package包/类
@Override
public void actionPerformed(Entry entry) {
	// no renaming of repositores allowed, RepositoryConfigurationDialog is responsible for that
	if (entry instanceof Repository) {
		return;
	}
	String name = SwingTools.showRepositoryEntryInputDialog("file_chooser.rename", entry.getName(), entry.getName());
	if ((name != null) && !name.equals(entry.getName())) {
		boolean success = false;
		try {
			success = entry.rename(name);
		} catch (Exception e) {
			SwingTools.showSimpleErrorMessage("cannot_rename_entry", e, entry.getName(), name, e.getMessage());
			return;
		}
		if (!success) {
			SwingTools.showVerySimpleErrorMessage("cannot_rename_entry", entry.getName(), name);
		}
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:21,代码来源:RenameRepositoryEntryAction.java

示例14: openTutorial

import com.rapidminer.gui.tools.SwingTools; //导入依赖的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

示例15: saveOperatorDocBundle

import com.rapidminer.gui.tools.SwingTools; //导入依赖的package包/类
private static void saveOperatorDocBundle(File file) {
    try {
        Document document = DocumentBuilderFactory
                .newInstance()
                .newDocumentBuilder()
                .newDocument();

        document.setXmlVersion("1.0");
        document.setXmlStandalone(false);
        Attr attr = document.createAttribute("encoding");
        attr.setValue("UTF-8");

        Element operatorHelp = document.createElement("operatorHelp");
        for (OperatorDescription deac: getAllUserDefinedOperators()) {
            addOperatorDoc(document, operatorHelp, deac.getName(), deac.getKey());
        }
        document.appendChild(operatorHelp);

        XMLTools.stream(document, file, Charset.forName("UTF-8"));
    } catch (ParserConfigurationException | XMLException e) {
        SwingTools.showSimpleErrorMessage(ioErrorKey, e);
    }
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:24,代码来源:UserDefinedOperatorService.java


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