本文整理匯總了Java中com.rapidminer.RapidMiner.ExecutionMode類的典型用法代碼示例。如果您正苦於以下問題:Java ExecutionMode類的具體用法?Java ExecutionMode怎麽用?Java ExecutionMode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ExecutionMode類屬於com.rapidminer.RapidMiner包,在下文中一共展示了ExecutionMode類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: storeActiveLicenseProperties
import com.rapidminer.RapidMiner.ExecutionMode; //導入依賴的package包/類
/**
* Store active license properties. Requires RapidMiner to be running ad standalone GUI
* application.
*/
public static void storeActiveLicenseProperties(License activeLicense) {
// do nothing when RapidMiner is not executed as standalone GUI application
if (RapidMiner.getExecutionMode() != ExecutionMode.UI) {
return;
}
// load existing properties file
File licensePropertiesFile = FileSystemService.getUserConfigFile(LICENSE_PROPERTIES_PATH);
Properties licenseProperties = LicenseTools.loadLastActiveLicenseProperties();
// store properties necessary to identify the license
licenseProperties.setProperty(LAST_ACTIVE_LICENSE_PRODUCT_ID, activeLicense.getProductId());
licenseProperties.setProperty(LAST_ACTIVE_LICENSE_PRODUCT_EDITION, activeLicense.getProductEdition());
licenseProperties.setProperty(LAST_ACTIVE_LICENSE_PRECEDENCE, String.valueOf(activeLicense.getPrecedence()));
if (activeLicense.getExpirationDate() != null) {
String dateString = ISO_DATE_FORMATTER.get().format(activeLicense.getExpirationDate());
licenseProperties.setProperty(LAST_ACTIVE_LICENSE_EXPIRATION_DATE, dateString);
}
// store properties
try (FileOutputStream out = new FileOutputStream(licensePropertiesFile)) {
licenseProperties.store(out, "RapidMiner Studio License Properties");
} catch (IOException e) {
LogService.getRoot().log(Level.WARNING,
"com.rapidminer.gui.license.RMLicenseManagerListener.storing_properties_failed", e);
}
}
示例2: storeActiveLicenseProperties
import com.rapidminer.RapidMiner.ExecutionMode; //導入依賴的package包/類
/**
* Store active license properties. Requires RapidMiner to be running ad standalone GUI
* application.
*/
public static void storeActiveLicenseProperties(License activeLicense) {
// do nothing when RapidMiner is not executed as standalone GUI application
if (RapidMiner.getExecutionMode() != ExecutionMode.UI) {
return;
}
// load existing properties file
File licensePropertiesFile = FileSystemService.getUserConfigFile(LICENSE_PROPERTIES_PATH);
Properties licenseProperties = LicenseTools.loadLastActiveLicenseProperties();
// store properties necessary to identify the license
licenseProperties.setProperty(getEditionKey(activeLicense), activeLicense.getProductEdition());
licenseProperties.setProperty(getPrecedenceKey(activeLicense), String.valueOf(activeLicense.getPrecedence()));
if (activeLicense.getExpirationDate() != null) {
String dateString = ISO_DATE_FORMATTER.format(activeLicense.getExpirationDate());
licenseProperties.setProperty(getExpirationDateKey(activeLicense), dateString);
} else {
licenseProperties.remove(getExpirationDateKey(activeLicense));
}
// store properties
try (FileOutputStream out = new FileOutputStream(licensePropertiesFile)) {
licenseProperties.store(out, "RapidMiner Studio License Properties");
} catch (IOException e) {
LogService.getRoot().log(Level.WARNING,
"com.rapidminer.gui.license.RMLicenseManagerListener.storing_properties_failed", e);
}
}
示例3: main
import com.rapidminer.RapidMiner.ExecutionMode; //導入依賴的package包/類
/**
* !! Testing method only !!
* TODO: REMOVE
* @throws RepositoryException
* @throws MalformedRepositoryLocationException
*/
public static void main(String[] args) throws MalformedRepositoryLocationException, RepositoryException {
RapidMiner.setExecutionMode(ExecutionMode.UI);
try {
UIManager.setLookAndFeel(new RapidLookAndFeel());
} catch (Exception e) {
//LogService.getRoot().log(Level.WARNING, "Cannot setup rapid look and feel, using default.", e);
LogService.getRoot().log(Level.WARNING,
I18N.getMessage(LogService.getRoot().getResourceBundle(),
"com.rapidminer.gui.new_plotter_templates.TemplateChooser.setup_rapid_look_and_feel_error"),
e);
}
RapidMiner.init();
ExampleSet iris = (ExampleSet) ((IOObjectEntry)new RepositoryLocation("//Samples/data/Iris").locateEntry()).retrieveData(null);
final TemplateChooser chooser = new TemplateChooser(StyleProviderMode.SINGLE);
chooser.fireDataUpdated("iris", iris);
JFrame frame = new JFrame("New Plotter Templates");
JPanel containerPanel = new JPanel(new BorderLayout());
containerPanel.add(BorderLayout.EAST, chooser.getTemplateChooserControlPanel());
containerPanel.add(BorderLayout.CENTER, chooser.getTemplateChooserChartPanel());
containerPanel.add(BorderLayout.WEST, chooser.getTemplateChooserStyleProviderPanel());
frame.setContentPane(containerPanel);
frame.setLocation(200, 200);
frame.setSize(new Dimension(1200, 500));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
示例4: checkForUpdates
import com.rapidminer.RapidMiner.ExecutionMode; //導入依賴的package包/類
public static void checkForUpdates() {
String updateProperty = ParameterService.getParameterValue("rapidminer.update.check");
if(Tools.booleanValue(updateProperty, true)) {
if(RapidMiner.getExecutionMode() == ExecutionMode.WEBSTART) {
LogService.getRoot().config("com.rapid_i.deployment.update.client.UpdateManager.ignoring_update_check_webstart_mode");
return;
}
boolean check = true;
final Date lastCheckDate = loadLastUpdateCheckDate();
if(lastCheckDate != null) {
Calendar lastCheck = Calendar.getInstance();
lastCheck.setTime(lastCheckDate);
Calendar currentDate = Calendar.getInstance();
currentDate.add(6, -2);
if(!lastCheck.before(currentDate)) {
check = false;
LogService.getRoot().log(Level.CONFIG, "com.rapid_i.deployment.update.client.UpdateManager.ignoring_update_check_last_checkdate", lastCheckDate);
}
}
if(check) {
(new ProgressThread("check_for_updates") {
public void run() {
LogService.getRoot().info("com.rapid_i.deployment.update.client.UpdateManager.update_checking");
boolean updatesExist = false;
try {
String latestRMVersion = MarketplaceUpdateManager.getService().getLatestVersion("rapidminer-studio-6", MarketplaceUpdateManager.TARGET_PLATFORM.toString(), RapidMiner.getLongVersion());
updatesExist = latestRMVersion != null && !RapidMiner.getVersion().isAtLeast(new VersionNumber(latestRMVersion));
} catch (Exception var4) {
LogService.getRoot().log(Level.WARNING, I18N.getMessage(LogService.getRoot().getResourceBundle(), "com.rapid_i.deployment.update.client.UpdateManager.checking_for_updates_error", new Object[]{var4}), var4);
return;
}
MarketplaceUpdateManager.saveLastUpdateCheckDate();
if(updatesExist) {
UpdateConfirmDialog dialog = new UpdateConfirmDialog();
dialog.setVisible(true);
if(dialog.getReturnOption() == 0) {
if(MarketplaceUpdateManager.useOSXUpdateMechansim()) {
MarketplaceUpdateManager.openOSXDownloadURL();
} else {
UpdateDialog.showUpdateDialog(true, new String[0]);
}
}
} else {
LogService.getRoot().log(Level.INFO, "com.rapid_i.deployment.update.client.UpdateManager.no_updates_aviable", lastCheckDate);
}
}
}).start();
}
}
}
示例5: checkForUpdates
import com.rapidminer.RapidMiner.ExecutionMode; //導入依賴的package包/類
/** Checks whether the last update is at least 7 days ago, then checks whether there
* are any updates, and opens a dialog if desired by the user. */
public static void checkForUpdates() {
String updateProperty = ParameterService.getParameterValue(RapidMinerGUI.PROPERTY_RAPIDMINER_GUI_UPDATE_CHECK);
if (Tools.booleanValue(updateProperty, true)) {
if (RapidMiner.getExecutionMode() == ExecutionMode.WEBSTART) {
LogService.getRoot().config("com.rapid_i.deployment.update.client.UpdateManager.ignoring_update_check_webstart_mode");
return;
}
boolean check = true;
final Date lastCheckDate = loadLastUpdateCheckDate();
if (lastCheckDate != null) {
Calendar lastCheck = Calendar.getInstance();
lastCheck.setTime(lastCheckDate);
Calendar currentDate = Calendar.getInstance();
currentDate.add(Calendar.DAY_OF_YEAR, -2);
if (!lastCheck.before(currentDate)) {
check = false;
LogService.getRoot().log(Level.CONFIG, "com.rapid_i.deployment.update.client.UpdateManager.ignoring_update_check_last_checkdate", lastCheckDate);
}
}
if (check) {
new ProgressThread("check_for_updates") {
@Override
public void run() {
LogService.getRoot().info("com.rapid_i.deployment.update.client.UpdateManager.update_checking");
boolean updatesExist = false;
try {
updatesExist = !RapidMiner.getVersion().isAtLeast(new VersionNumber(getService().getLatestVersion(getRMPackageId(), TARGET_PLATFORM)));
} catch (Exception e) {
//LogService.getRoot().log(Level.WARNING, "Error checking for updates: "+e, e);
LogService.getRoot().log(Level.WARNING,
I18N.getMessage(LogService.getRoot().getResourceBundle(),
"com.rapid_i.deployment.update.client.UpdateManager.checking_for_updates_error",
e),
e);
return;
}
saveLastUpdateCheckDate();
if (updatesExist) {
if (SwingTools.showConfirmDialog("updates_exist", ConfirmDialog.YES_NO_OPTION) == ConfirmDialog.YES_OPTION) {
UpdateDialog.showUpdateDialog(true);
}
} else {
//LogService.getRoot().info("No updates since "+lastCheckDate+".");
LogService.getRoot().log(Level.INFO, "com.rapid_i.deployment.update.client.UpdateManager.no_updates_aviable", lastCheckDate);
}
}
}.start();
}
}
}
示例6: initAll
import com.rapidminer.RapidMiner.ExecutionMode; //導入依賴的package包/類
/**
* Initializes all plugins if {@link RapidMiner#PROPERTY_RAPIDMINER_INIT_PLUGINS} is set. Plugins are searched for
* in the directory specified by {@link RapidMiner#PROPERTY_RAPIDMINER_INIT_PLUGINS_LOCATION} or, if this is not
* set, in the RapidMiner/lib/plugins directory.
*/
public static void initAll() {
// only load managed extensions if execution modes indicates
if (RapidMiner.getExecutionMode().isLoadingManagedExtensions())
ManagedExtension.init();
String loadPluginsString = ParameterService.getParameterValue(RapidMiner.PROPERTY_RAPIDMINER_INIT_PLUGINS);
boolean loadPlugins = Tools.booleanValue(loadPluginsString, true);
SafeMode safeMode = RapidMinerGUI.getSafeMode();
boolean isSafeMode = false;
if (safeMode != null) {
isSafeMode = safeMode.isSafeMode();
}
if (loadPlugins && !isSafeMode) {
File webstartPluginDir;
if (RapidMiner.getExecutionMode() == ExecutionMode.WEBSTART) {
webstartPluginDir = updateWebstartPluginsCache();
} else {
webstartPluginDir = null;
}
File pluginDir = null;
String pluginDirString = ParameterService.getParameterValue(RapidMiner.PROPERTY_RAPIDMINER_INIT_PLUGINS_LOCATION);
if (pluginDirString != null && !pluginDirString.isEmpty()) {
pluginDir = new File(pluginDirString);
}
if (pluginDir == null) {
try {
pluginDir = getPluginLocation();
} catch (IOException e) {
LogService.getRoot().log(
Level.WARNING,
"com.rapidminer.tools.plugin.Plugin.no_properties_set",
new Object[] { RapidMiner.PROPERTY_RAPIDMINER_INIT_PLUGINS, Launcher.PROPERTY_RAPIDMINER_HOME });
}
}
if (webstartPluginDir != null) {
findAndRegisterPlugins(webstartPluginDir, true);
}
if (pluginDir != null) {
findAndRegisterPlugins(pluginDir, true);
}
registerPlugins(ManagedExtension.getActivePluginJars(), true);
registerAllPluginDescriptions();
finalizePluginLoading();
initPlugins();
} else {
LogService.getRoot().log(Level.INFO, "com.rapidminer.tools.plugin.Plugin.plugins_skipped");
}
}