|
From: <jan...@us...> - 2006-11-30 20:24:48
|
Revision: 487
http://svn.sourceforge.net/magicmap/?rev=487&view=rev
Author: jan_fride
Date: 2006-11-30 12:24:22 -0800 (Thu, 30 Nov 2006)
Log Message:
-----------
missing classes
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/NewMapDialog.java
Added Paths:
-----------
trunk/magicmapclient/src/net/sf/magicmap/plugin/action/UninstallPluginAction.java
trunk/magicmapclient/src/net/sf/magicmap/plugin/util/OperatingSystemInfo.java
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/NewMapDialog.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/NewMapDialog.java 2006-11-29 09:33:47 UTC (rev 486)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/NewMapDialog.java 2006-11-30 20:24:22 UTC (rev 487)
@@ -235,7 +235,7 @@
// w = Long.parseLong(width.getText());
// h = Long.parseLong(height.getText());
if (newvalue > 0 && w > 0 && h > 0) {
- // rHeight.setText(Long.toString((h * newvalue) / w));
+ // rHeight.setText(Long.getPath((h * newvalue) / w));
}
} catch (NumberFormatException e1) {
// rHeight.setText("");
@@ -251,7 +251,7 @@
// w = Long.parseLong(width.getText());
// h = Long.parseLong(height.getText());
if (newvalue > 0 && w > 0 && h > 0) {
- // rWidth.setText(Long.toString((w * newvalue) / h));
+ // rWidth.setText(Long.getPath((w * newvalue) / h));
}
} catch (NumberFormatException e1) {
// rWidth.setText("");
Added: trunk/magicmapclient/src/net/sf/magicmap/plugin/action/UninstallPluginAction.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/plugin/action/UninstallPluginAction.java (rev 0)
+++ trunk/magicmapclient/src/net/sf/magicmap/plugin/action/UninstallPluginAction.java 2006-11-30 20:24:22 UTC (rev 487)
@@ -0,0 +1,48 @@
+package net.sf.magicmap.plugin.action;
+
+import net.sf.magicmap.client.gui.utils.MagicAction;
+import net.sf.magicmap.client.gui.utils.GUIConstants;
+import net.sf.magicmap.plugin.PluginManager;
+import net.sf.magicmap.plugin.IPluginDescriptor;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ItemEvent;
+import java.io.IOException;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: Jan
+ * Date: 12.11.2006
+ * Time: 18:55:24
+ * To change this template use File | Settings | File Templates.
+ */
+public class UninstallPluginAction extends MagicAction {
+
+ private final PluginManager manager;
+ private IPluginDescriptor descriptor;
+
+ public UninstallPluginAction(PluginManager manager){
+ super ("Plugin deinstallieren", GUIConstants.ICON_DELETE,"Plugin deinstalieren");
+ this.manager = manager;
+ manager.addItemListener(this);
+ setEnabled(false);
+ }
+ public void actionPerformed(ActionEvent e) {
+ try {
+ manager.uninstallPlugin(descriptor);
+ } catch (IOException e1) {
+ e1.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ }
+
+ public void itemStateChanged(ItemEvent e) {
+ if (ItemEvent.SELECTED == e.getStateChange()){
+ setDescriptor((IPluginDescriptor) e.getItem());
+ }
+ }
+
+ public void setDescriptor(IPluginDescriptor descriptor) {
+ this.descriptor = descriptor;
+ setEnabled(descriptor != null && manager.isInstalled(descriptor));
+ }
+}
Added: trunk/magicmapclient/src/net/sf/magicmap/plugin/util/OperatingSystemInfo.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/plugin/util/OperatingSystemInfo.java (rev 0)
+++ trunk/magicmapclient/src/net/sf/magicmap/plugin/util/OperatingSystemInfo.java 2006-11-30 20:24:22 UTC (rev 487)
@@ -0,0 +1,54 @@
+package net.sf.magicmap.plugin.util;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: Jan
+ * Date: 09.11.2006
+ * Time: 17:45:46
+ * To change this template use File | Settings | File Templates.
+ */
+public final class OperatingSystemInfo {
+ public final String name;
+ public final String arch;
+ public final String version;
+
+ public OperatingSystemInfo(String name, String arch, String version){
+ this.name = name;
+ this.arch = arch;
+ this.version = version;
+ }
+ public boolean isCurrentOsSupported(){
+ return (name.equals(System.getProperty("os.system")) &&
+ arch.equals(System.getProperty("os.arch")));
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ OperatingSystemInfo that = (OperatingSystemInfo) o;
+
+ if (!arch.equals(that.arch)) return false;
+ if (!name.equals(that.name)) return false;
+ if (!version.equals(that.version)) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = name.hashCode();
+ result = 31 * result + arch.hashCode();
+ result = 31 * result + version.hashCode();
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "OperatingSystemInfo{" +
+ "name='" + name + '\'' +
+ ", arch='" + arch + '\'' +
+ ", version='" + version + '\'' +
+ '}';
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|