diff --git a/.gitignore b/.gitignore
index 655d22746..902fd564f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -76,3 +76,6 @@ hs_err_pid*
IAP CONSOLE/bin/de/ipk/ag_ba/Console.class
/.DS_Store
+
+make/zip/*.zip
+make/zip/IAP_*
diff --git a/Graffiti_Core/.classpath b/Graffiti_Core/.classpath
index d7a652125..16d8f6f56 100644
--- a/Graffiti_Core/.classpath
+++ b/Graffiti_Core/.classpath
@@ -1,18 +1,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Graffiti_Core/org/SystemAnalysis.java b/Graffiti_Core/org/SystemAnalysis.java
index a8429333e..964591f07 100644
--- a/Graffiti_Core/org/SystemAnalysis.java
+++ b/Graffiti_Core/org/SystemAnalysis.java
@@ -510,6 +510,7 @@ public static String getFileSeparator() {
public static boolean isRetina() {
if (isHeadless())
return false;
+ if (false) {
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
final GraphicsDevice device = env.getDefaultScreenDevice();
@@ -526,6 +527,7 @@ public static boolean isRetina() {
}
} catch (Exception ignore) {
}
+ }
return false;
}
diff --git a/Graffiti_lib/.classpath b/Graffiti_lib/.classpath
index b495b262a..cc45c217c 100644
--- a/Graffiti_lib/.classpath
+++ b/Graffiti_lib/.classpath
@@ -1,58 +1,59 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/IAP CONSOLE/bin/de/ipk/ag_ba/CommandLineStatusProvider.class b/IAP CONSOLE/bin/de/ipk/ag_ba/CommandLineStatusProvider.class
index 19b97633b..259750d5e 100644
Binary files a/IAP CONSOLE/bin/de/ipk/ag_ba/CommandLineStatusProvider.class and b/IAP CONSOLE/bin/de/ipk/ag_ba/CommandLineStatusProvider.class differ
diff --git a/IAP CONSOLE/bin/de/ipk/ag_ba/SplashScreenDontPrintProgress.class b/IAP CONSOLE/bin/de/ipk/ag_ba/SplashScreenDontPrintProgress.class
index 45ba6b3bc..6355cb88b 100644
Binary files a/IAP CONSOLE/bin/de/ipk/ag_ba/SplashScreenDontPrintProgress.class and b/IAP CONSOLE/bin/de/ipk/ag_ba/SplashScreenDontPrintProgress.class differ
diff --git a/IAP/.classpath b/IAP/.classpath
index ff2de5fb5..920098948 100644
--- a/IAP/.classpath
+++ b/IAP/.classpath
@@ -1,62 +1,57 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/IAP/ant-scripts/createIAPquick.xml b/IAP/ant-scripts/createIAPquick.xml
index aff37609c..1f021d1b6 100755
--- a/IAP/ant-scripts/createIAPquick.xml
+++ b/IAP/ant-scripts/createIAPquick.xml
@@ -3,9 +3,9 @@
-
+
-
+
@@ -53,7 +53,7 @@
-
+
@@ -79,7 +79,7 @@
-
+
@@ -121,7 +121,7 @@
-
+
diff --git a/IAP/src/de/ipk/ag_ba/commands/about/ActionAbout.java b/IAP/src/de/ipk/ag_ba/commands/about/ActionAbout.java
index 647d4e9a9..cebf8d65c 100644
--- a/IAP/src/de/ipk/ag_ba/commands/about/ActionAbout.java
+++ b/IAP/src/de/ipk/ag_ba/commands/about/ActionAbout.java
@@ -142,8 +142,8 @@ public ArrayList getResultNewActionSet() {
rr.add(new NavigationButton(new ActionAboutLicense("List of external library licenses"), guiSetting));
rr.add(new NavigationButton(new ActionFeedback("Send feedback mail"), guiSetting));
- rr.add(new NavigationButton(new ActionJavaFX("JavaFX Test"), guiSetting));
- rr.add(new NavigationButton(new ActionPLYVIS("PLY Visualization Tool"), guiSetting));
+ // rr.add(new NavigationButton(new ActionJavaFX("JavaFX Test"), guiSetting));
+ // rr.add(new NavigationButton(new ActionPLYVIS("PLY Visualization Tool"), guiSetting));
return rr;
}
diff --git a/IAP/src/de/ipk/ag_ba/gui/picture_gui/DataSetFileButton.java b/IAP/src/de/ipk/ag_ba/gui/picture_gui/DataSetFileButton.java
index 43d678f7c..af868e539 100644
--- a/IAP/src/de/ipk/ag_ba/gui/picture_gui/DataSetFileButton.java
+++ b/IAP/src/de/ipk/ag_ba/gui/picture_gui/DataSetFileButton.java
@@ -1,6 +1,6 @@
package de.ipk.ag_ba.gui.picture_gui;
-import iap.blocks.debug.BlShowThreeDColorHistogram;
+//import iap.blocks.debug.BlShowThreeDColorHistogram;
import iap.pipelines.ImageProcessorOptionsAndResults;
// import ij.io.FileInfoXYZ;
import ij.io.Opener;
@@ -591,6 +591,7 @@ public void actionPerformed(ActionEvent e) {
sn.add(debugShowSnapshot);
jp.add(sn);
+ /*
JMenu fxCube = new JMenu("Color Analysis");
fxCube.setIcon(IAPimages.getIcon("img/cube.png", 16, 16));
{
@@ -639,6 +640,7 @@ public void actionPerformed(ActionEvent e) {
}
jp.add(fxCube);
+ */
if (targetTreeNode.getExperiment().getIniIoProvider() != null) {
try {
@@ -1209,6 +1211,7 @@ void addDefaultCommands(final JPopupMenu myPopup) {
// myPopup.add(removeOneFromDatabaseCmd);
// myPopup.add(removeAllFromDatabaseCmd);
}
+ /*
myPopup.add(new JSeparator());
JMenuItem shcube = new JMenuItem("Show 3-D Histogram Cube");
shcube.setIcon(new ImageIcon(IAPimages.getImage("img/cube.png").getScaledInstance(16, 16,
@@ -1226,7 +1229,7 @@ void addDefaultCommands(final JPopupMenu myPopup) {
ErrorMsg.addErrorMessage(e1);
}
});
- myPopup.add(shcube);
+ myPopup.add(shcube);*/
// myPopup.add(debugPipelineTest);
@@ -1452,9 +1455,9 @@ public void actionPerformed(ActionEvent e) {
id.getURL());
if (addClockToImages)
fi = fi.io().canvas().drawClock(clockR, clockB, id, cbc, chc, ctc).getImage();
- if (viewMode == ImageViewMode.HISTOGRAM)
- BlShowThreeDColorHistogram.showHistogram(fi, null, id);
- else
+ //if (viewMode == ImageViewMode.HISTOGRAM)
+ // BlShowThreeDColorHistogram.showHistogram(fi, null, id);
+ //else
fi.show(id.getSubstanceName() + " // " + pre);
}
}
@@ -1476,9 +1479,9 @@ public void actionPerformed(ActionEvent e) {
id.getLabelURL());
if (addClockToImages)
fi = fi.io().canvas().drawClock(clockR, clockB, id, cbc, chc, ctc).getImage();
- if (viewMode == ImageViewMode.HISTOGRAM)
- BlShowThreeDColorHistogram.showHistogram(fi, null, id);
- else
+ //if (viewMode == ImageViewMode.HISTOGRAM)
+ // BlShowThreeDColorHistogram.showHistogram(fi, null, id);
+ //else
fi.show("Ref " + id.getSubstanceName() + " // " + pre);
}
}
@@ -1503,9 +1506,9 @@ public void actionPerformed(ActionEvent e) {
is.addImage(id.getQualityAnnotation() + " / " + id.getSubstanceName() + " / " + id.getParentSample().getTimeUnit() + " "
+ id.getParentSample().getTime(), fi);
else {
- if (viewMode == ImageViewMode.HISTOGRAM)
- BlShowThreeDColorHistogram.showHistogram(fi, null, id);
- else
+ //if (viewMode == ImageViewMode.HISTOGRAM)
+ // BlShowThreeDColorHistogram.showHistogram(fi, null, id);
+ //else
fi.show("Annotation " + id.getSubstanceName() + " // " + pre);
}
}
diff --git a/IAP/src/de/ipk/ag_ba/gui/picture_gui/ImageViewMode.java b/IAP/src/de/ipk/ag_ba/gui/picture_gui/ImageViewMode.java
index 85127b697..094ac6566 100644
--- a/IAP/src/de/ipk/ag_ba/gui/picture_gui/ImageViewMode.java
+++ b/IAP/src/de/ipk/ag_ba/gui/picture_gui/ImageViewMode.java
@@ -1,5 +1,5 @@
package de.ipk.ag_ba.gui.picture_gui;
public enum ImageViewMode {
- SHOW, TIMELINE, HISTOGRAM
+ SHOW, TIMELINE //, HISTOGRAM
}
diff --git a/IAP/src/de/ipk/ag_ba/gui/webstart/IAPmain.java b/IAP/src/de/ipk/ag_ba/gui/webstart/IAPmain.java
index b76b512aa..308a076cc 100755
--- a/IAP/src/de/ipk/ag_ba/gui/webstart/IAPmain.java
+++ b/IAP/src/de/ipk/ag_ba/gui/webstart/IAPmain.java
@@ -1,747 +1,747 @@
-/*******************************************************************************
- * Copyright (c) 2009 Image Analysis Group, IPK Gatersleben
- *******************************************************************************/
-package de.ipk.ag_ba.gui.webstart;
-
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.event.ActionListener;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.io.IOException;
-import java.lang.ref.WeakReference;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.WeakHashMap;
-
-import javax.swing.ImageIcon;
-import javax.swing.JApplet;
-import javax.swing.JComponent;
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-
-import org.ApplicationStatus;
-import org.ErrorMessageProcessor;
-import org.ErrorMsg;
-import org.ReleaseInfo;
-import org.StringManipulationTools;
-import org.SystemAnalysis;
-import org.SystemOptions;
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.log4j.PatternLayout;
-import org.graffiti.editor.GravistoService;
-import org.graffiti.editor.MainFrame;
-import org.graffiti.editor.MessageType;
-import org.graffiti.editor.SplashScreenInterface;
-import org.graffiti.managers.pluginmgr.PluginManagerException;
-import org.graffiti.options.GravistoPreferences;
-import org.graffiti.plugin.io.resources.ResourceIOManager;
-import org.graffiti.plugin.view.View;
-import org.graffiti.session.Session;
-
-import application.AnimateLogoIAP;
-import bsh.Interpreter;
-import de.ipk.ag_ba.datasources.http_folder.NavigationImage;
-import de.ipk.ag_ba.gui.IAPfeature;
-import de.ipk.ag_ba.gui.images.IAPimages;
-import de.ipk.ag_ba.gui.picture_gui.BackgroundThreadDispatcher;
-import de.ipk.ag_ba.image.structures.Image;
-import de.ipk.ag_ba.mongo.MongoDB;
-import de.ipk.ag_ba.mongo.SaveAsCsvDataProcessor;
-import de.ipk.ag_ba.mongo.SaveInDatabaseDataProcessor;
-import de.ipk.ag_ba.plugins.AbstractIAPplugin;
-import de.ipk.ag_ba.postgresql.LTftpHandler;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.helper.DBEgravistoHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.layout_control.dbe.ExperimentDataProcessingManager;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.webstart.DBEsplashScreen;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.webstart.GravistoMainHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.webstart.TextFile;
-import de.ipk_gatersleben.ag_nw.graffiti.services.task.BackgroundTaskHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.services.task.BackgroundTaskStatusProviderSupportingExternalCallImpl;
-import info.clearthought.layout.TableLayout;
-
-/**
- * @author klukas
- */
-public class IAPmain extends JApplet {
- private static final long serialVersionUID = 1L;
-
- static MainFrame mainFrame1;
-
- private static Runnable vantedDelayedRunnable;
-
- // static MainFrame mainFrame2;
-
- public void setAppletCloseListener(ActionListener l) {
- // empty
- }
-
- public void appletDragStarted() {
- final JFrame jf = (JFrame) ErrorMsg.findParentComponent(ReleaseInfo.getApplet(), JFrame.class);
- if (jf != null) {
- jf.setUndecorated(false);
- jf.setResizable(true);
- jf.setMaximizedBounds(null);
- jf.setTitle("Integrated Analysis Platform");
- jf.pack();
- jf.setSize(800, 600);
- } else
- System.out.println("Drag detected, but frame not found.");
- }
-
- static boolean myClassKnown = false;
-
- @Override
- public void init() {
- super.init();
- setRunMode(IAPrunMode.SWING_APPLET);
- }
-
- public static void main(String[] args) {
- main(args, null);
- }
-
- public static void main(String[] args, String[] addons) {
- long startmaintime = System.currentTimeMillis();
- for (String info : IAPmain.getMainInfoLines())
- System.out.println(info);
-
- setRunMode(IAPrunMode.SWING_MAIN);
-
- System.out.println(SystemAnalysis.getCurrentTime() + ">INFO: Initialize IAP start... (run-mode: " + getRunMode() + ")");
-
- boolean animate = SystemOptions.getInstance().getBoolean("IAP", "Animated Start-Logo", true);
- Runtime.Version version = Runtime.version();
- if (version.major() > 10)
- animate = false;
-
- final ProgressWindow progressWindow;
-
- progressWindow = animate ? new AnimateLogoIAP() : null;
-
- if (progressWindow != null)
- progressWindow.show(true);
-
- String title = SystemOptions.getInstance().getString("IAP", "window_title",
- "IAP - The Integrated Analysis Platform") + "";
-
- SystemOptions.getInstance().getString("IAP", "Result File Type", "png");
- SystemOptions.getInstance().getString("IAP", "Preview File Type", "png");
- SystemOptions.getInstance().getInteger("SYSTEM", "Issue GC Memory Usage Threshold Percent", 60);
- SystemOptions.getInstance().getInteger("SYSTEM", "Reduce Workload Memory Usage Threshold Percent", 70);
-
- JFrame jf = new JFrame(title);
- IAPmain iap = new IAPmain(addons, progressWindow);
- jf.add("Center", iap.getContentPane());
- jf.pack();
- try {
- java.awt.Image img = AbstractIAPplugin.getIAPicon().getImage();
- jf.setIconImage(img);
- if (SystemAnalysis.isMacRunning()) {
- Interpreter i = new Interpreter();
- i.set("img", img);
- i.eval("com.apple.eawt.Application.getApplication().setDockIconImage(img)");
- }
- } catch (Exception e) {
- ErrorMsg.addErrorMessage(e);
- }
- final WeakReference fr = new WeakReference(jf);
- jf.addWindowListener(new WindowListener() {
- @Override
- public void windowOpened(WindowEvent e) {
- if (progressWindow != null)
- progressWindow.hide();
- }
-
- @Override
- public void windowIconified(WindowEvent e) {
- }
-
- @Override
- public void windowDeiconified(WindowEvent e) {
- }
-
- @Override
- public void windowDeactivated(WindowEvent e) {
- }
-
- @Override
- public void windowClosing(WindowEvent e) {
- JFrame j = fr.get();
- if (j != null) {
-
- }
- }
-
- @Override
- public void windowClosed(WindowEvent e) {
- }
-
- @Override
- public void windowActivated(WindowEvent arg0) {
- }
- });
- if (startMaximized) {
- // jf.setExtendedState(jf.getExtendedState() | JFrame.MAXIMIZED_BOTH);
- Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
- jf.setBounds(0, 0, dim.width, dim.height);
- }
- if (startMaximized) {
- // jf.setExtendedState(jf.getExtendedState() | JFrame.MAXIMIZED_BOTH);
- Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
- jf.setBounds(0, 0, dim.width, dim.height);
- jf.setVisible(true);
- } else {
- Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
- jf.setSize((int) (screenDim.width * 0.75), (int) (screenDim.height * 0.75));
- jf.setLocation((screenDim.width - jf.getWidth()) / 2,
- (screenDim.height - jf.getHeight()) / 2);
- jf.setVisible(true);
- }
- long endmaintime = System.currentTimeMillis();
- SystemOptions.getInstance().setInteger("IAP", "FX//Last Startup Time", (int) (endmaintime - startmaintime));
- jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- SystemOptions.getInstance().addChangeListener("IAP", "window_title", new Runnable() {
- @Override
- public void run() {
- JFrame j = fr.get();
- if (j != null) {
- String newTitle = SystemOptions.getInstance().getString("IAP", "window_title", "IAP - The Integrated Analysis Platform");
- j.setTitle(newTitle + "");
- }
- }
- });
- }
-
- public IAPmain() {
- this(null, null);
- }
-
- public IAPmain(final String[] addons, ProgressWindow progressWindow) {
- if (getRunMode() == IAPrunMode.UNKNOWN)
- setRunMode(IAPrunMode.SWING_APPLET);
- if (getRunMode() == IAPrunMode.SWING_APPLET)
- ReleaseInfo.setRunningAsApplet(this);
-
- if (SystemOptions.getInstance().getBoolean("IAP", "Debug - System.Exit in case of error",
- IAPmain.getRunMode() == IAPrunMode.CLOUD_HOST_BATCH_MODE)) {
- ErrorMsg.setCustomErrorHandler(new ErrorMessageProcessor() {
- @Override
- public void reportError(Exception exception) {
- if (exception != null)
- exception.printStackTrace();
- IAPmain.errorCheck(exception.getMessage());
- }
-
- @Override
- public void reportError(String errorMessage) {
- if (errorMessage != null)
- System.err.println(errorMessage);
- IAPmain.errorCheck(errorMessage);
- }
- });
- }
-
- ErrorMsg.setRethrowErrorMessages(false);
-
- setupLogger();
-
- registerIOhandlers();
-
- GravistoMainHelper.setLookAndFeel();
-
- // construct and open the editor's main frame
- GravistoPreferences prefs = GravistoPreferences.userNodeForPackage(IAPmain.class);
-
- GravistoPreferences uiPrefs = prefs.node("ui");
- uiPrefs.put("showPluginManagerMenuOptions", getOptions().getBoolean("VANTED", "debug show plugin_manager_menu_options", false) + "");
- uiPrefs.put("showPluginMenu", getOptions().getBoolean("VANTED", "debug show plugin_menu", false) + "");
- JPanel statusPanel = new JPanel();
-
- mainFrame1 = new MainFrame(GravistoMainHelper.getPluginManager(), uiPrefs, statusPanel, true);
-
- try {
- mainFrame1.setIconImage(IAPimages.getImage("img/vanted1_0.png"));
- } catch (Exception e) {
- e.printStackTrace();
- ErrorMsg.addErrorMessage(e);
- }
-
- // mainFrame2 = new MainFrame(GravistoMainHelper.getNewPluginManager(), uiPrefs, statusPanel, true);
-
- setLayout(new TableLayout(new double[][] { { TableLayout.FILL }, { TableLayout.FILL } }));
-
- final BackgroundTaskStatusProviderSupportingExternalCallImpl myStatus = new BackgroundTaskStatusProviderSupportingExternalCallImpl(
- "", "");
-
- Thread t = new Thread() {
-
- @Override
- public void run() {
- // if (IAPmain.myClassKnown) {
- // System.out.println("Reload Classes, Problems may occur");
- // ErrorMsg.addErrorMessage("Reload Classes, Problems may occur");
- // }
- // IAPmain.myClassKnown = true;
- // System.out.println("Class Loader: " + InstanceLoader.getCurrentLoader().getClass().getCanonicalName());
- myAppletLoad(mainFrame1, myStatus, addons, progressWindow);
- // myAppletLoad(mainFrame2, myStatus);
- }
- };
- t.setName("Application Loader");
- t.setPriority(Thread.MIN_PRIORITY);
- t.start();
-
- JComponent advancedNavigation = IAPgui.getMainGUIcontent(myStatus, false, null);
- add(advancedNavigation, "0,0");
- setVisible(true);
- validate();
- repaint();
-
- }
-
- private void setupLogger() {
- Logger rootLogger = Logger.getRootLogger();
- if (!rootLogger.getAllAppenders().hasMoreElements()) {
- rootLogger.setLevel(Level.ERROR);
- rootLogger.addAppender(new ConsoleAppender(new PatternLayout("%-5p [%t]: %m%n")));
-
- Logger pkgLogger = rootLogger.getLoggerRepository().getLogger("com.mongodb");
- pkgLogger.setLevel(Level.ERROR);
- pkgLogger.addAppender(new ConsoleAppender(new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN)));
- }
- }
-
- private void registerIOhandlers() {
- GravistoService.setProxy();
- // ResourceIOManager.registerIOHandler(LoadedVolumeHandler.getInstance());
- // ResourceIOManager.registerIOHandler(LoadedImageHandler.getInstance());
- ResourceIOManager.registerIOHandler(new LTftpHandler());
- for (MongoDB m : MongoDB.getMongos())
- ResourceIOManager.registerIOHandler(m.getHandler());
-
- // IIORegistry registry = IIORegistry.getDefaultInstance();
- // registry.registerServiceProvider(new com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriterSpi());
- // registry.registerServiceProvider(new com.sun.media.imageioimpl.plugins.tiff.TIFFImageReaderSpi());
- }
-
- public void myAppletLoad(
- final MainFrame statusPanel,
- final BackgroundTaskStatusProviderSupportingExternalCallImpl myStatus,
- final String[] addons, ProgressWindow progressWindow) {
- String stS = "";
- String stE = "";
- DBEgravistoHelper.DBE_GRAVISTO_NAME_SHORT = "IAP";
- String name = stS + DBEgravistoHelper.DBE_GRAVISTO_NAME_SHORT + stE + " - " + stS + "V" + stE + "isualization and " + stS + "A" + stE
- + "nalysis of " + stS + "N" + stE + "e" + stS + "t" + stE + "works
containing " + stS + "E" + stE
- + "xperimental " + stS + "D" + stE + "ata";
- DBEgravistoHelper.DBE_GRAVISTO_VERSION = DBEgravistoHelper.DBE_GRAVISTO_NAME_SHORT + " V" + DBEgravistoHelper.DBE_GRAVISTO_VERSION_CODE;
- DBEgravistoHelper.DBE_GRAVISTO_NAME = stS + DBEgravistoHelper.DBE_GRAVISTO_NAME_SHORT + stE + " - " + stS + "I" + stE
- + "ntegrated " + stS + "A" + stE + "nalysis " + stS + "P" + stE + "latform
";
- DBEgravistoHelper.DBE_INFORMATIONSYSTEM_NAME = "Integrated Analysis Platform";
-
- DBEgravistoHelper.DBE_INFORMATIONSYSTEM_NAME = "";
-
- // AttributeHelper.setMacOSsettings(DBEgravistoHelper.DBE_GRAVISTO_NAME_SHORT);
-
- final JComponent result = new JPanel();
- result.setLayout(TableLayout.getLayout(TableLayout.FILL, TableLayout.FILL));
-
- String s = ""
- + "
Welcome to "
- + name
- + "!
"
- + ""
- + " In the Help menu you find a tutorial section which quickly gives an overview on the various "
- + "features of this application.
"
- + " Furthermore you will find [?] buttons throughout the system which point directly to topics of interest.
"
- + " If you experience problems or would like to suggest enhancements, feel free to use the "
- + "Send feedback command in the Help menu!
";
-
- ReleaseInfo.setHelpIntroductionText(s);
-
- // URL config,
- final SplashScreenInterface splashScreen = progressWindow != null ? progressWindow : new SplashScreenInterface() {
-
- private int max, val;
-
- @Override
- public void setVisible(boolean b) {
- }
-
- @Override
- public void setValue(int value) {
- this.val = value;
- double progress = val / (double) max * 100d;
- myStatus.setCurrentStatusValueFine(progress);
- }
-
- @Override
- public void setText(String text) {
- MainFrame.showMessage(text, MessageType.PERMANENT_INFO);
- if (SystemOptions.getInstance().getBoolean("IAP", "Debug-Print-Plugin-Loading-Infos", false))
- System.out.println(text);
- }
-
- @Override
- public void setMaximum(int maximum) {
- this.max = maximum;
- }
-
- @Override
- public void setInitialisationFinished() {
- MainFrame.showMessage("", MessageType.INFO);
- }
-
- @Override
- public int getValue() {
- return val;
- }
-
- @Override
- public int getMaximum() {
- return max;
- }
- };
-
- ClassLoader cl = this.getClass().getClassLoader();
-
- String path = // this.getClass().getPackage().getName()
- "de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.webstart".replace('.', '/');
- ImageIcon icon = new ImageIcon(cl.getResource(path + "/ipklogo16x16_5.png"));
- if (splashScreen instanceof DBEsplashScreen)
- ((DBEsplashScreen) splashScreen).setIconImage(icon.getImage());
- // splashScreen.setVisible(true);
-
- GravistoMainHelper.createApplicationSettingsFolder(splashScreen);
-
- splashScreen.setText("Read plugin information");
-
- URL r1 = cl.getResource("plugins1.txt");
- URL r2 = cl.getResource("plugins2.txt");
- URL r3 = cl.getResource("plugins3.txt");
- URL r4 = cl.getResource("plugins4.txt");
- URL r5 = cl.getResource("pluginsIAP.txt");
-
- URL rExcl = cl.getResource("plugins_exclude.txt");
-
- splashScreen.setText("Read plugin information...");
-
- final ArrayList locations = new ArrayList();
- try {
- locations.addAll(new TextFile(r1));
- locations.addAll(new TextFile(r2));
- locations.addAll(new TextFile(r3));
- locations.addAll(new TextFile(r4));
- locations.addAll(new TextFile(r5));
- locations.add("./MultimodalDataHandling.xml");
- // locations.add("./HIVE.xml");
-
- if (addons != null)
- for (String p : addons)
- if (p != null)
- locations.add("//" + p);
-
- locations.remove("");
-
- locations.removeIf(l -> l.contains("build.xml"));
-
- ArrayList locations_exclude = new ArrayList();
- locations_exclude.addAll(new TextFile(rExcl));
-
- for (Iterator it = locations_exclude.iterator(); it.hasNext();) {
- String remove = it.next();
- if (!locations.remove(remove)) {
- if (remove.startsWith("**")) {
- remove = remove.substring("**".length());
- ArrayList toRemove = new ArrayList<>();
- for (String loc : locations) {
- if (loc.endsWith(remove))
- toRemove.add(loc);
- }
- locations.removeAll(toRemove);
- } else {
- // windows compatibility remove also not exact matches
- for (Iterator itl = locations.iterator(); itl.hasNext();) {
- String loc = itl.next();
- remove = remove.toUpperCase();
- remove = StringManipulationTools.stringReplace(remove, "./", "");
- remove = StringManipulationTools.stringReplace(remove, "\"", "");
- remove = StringManipulationTools.stringReplace(remove, "/", "\\");
- remove = StringManipulationTools.stringReplace(remove, "\\", "");
- remove = StringManipulationTools.stringReplace(remove, " ", "");
- String loc2 = loc.toUpperCase();
- loc2 = StringManipulationTools.stringReplace(loc2, "\\", "");
- loc2 = StringManipulationTools.stringReplace(loc2, " ", "");
- if (loc2.indexOf(remove) >= 0) {
- locations.remove(loc);
- break;
- }
- }
- }
- }
- }
- splashScreen.setMaximum(locations.size() - 1);
- } catch (IOException e) {
- ErrorMsg.addErrorMessage(e.getLocalizedMessage());
- } catch (NullPointerException npe) {
- if (splashScreen != null)
- splashScreen.setVisible(false);
- System.err.println("Internal error: Plugin Description files could not be loaded.");
- System.err.println("-- Program needs to be stopped");
- System.err.println("EXIT in 10 seconds.");
- BackgroundThreadDispatcher.runInSeparateThread(() -> {
- try {
- Thread.sleep(10000);
- } catch (Exception e) {
- //
- }
- SystemAnalysis.exit(1);
- }, "System.exit in 60 seconds");
- JOptionPane.showMessageDialog(null, "ERROR: Plugin-Description files could not be loaded
"
- + "Program execution can not continue.
" + "The application needs to be closed (and will be closed in 10 sec.).
" +
- "
" +
- "Create description files by executing the script createfilelist.cmd from the console (Linux/Mac)
" +
- "or by executing createfilelist.bat directly from within Eclipse (works only on Windows).
" +
- "These scripts are stored and available within the 'make' project." +
- "");
- SystemAnalysis.exit(1);
- }
-
- final boolean onStartup = true; // IAPoptions.getInstance().getBoolean("VANTED", "load_plugins_on_startup", false);
- final boolean onDemand = false; // IAPoptions.getInstance().getBoolean("VANTED", "load_plugins_on_demand", true);
- // ArrayList remove = new ArrayList();
- // ArrayList importantForEditingSettingValues = new ArrayList();
- // for (String ss : locations) {
- // if (ss.endsWith("attributes\\defaults\\plugin.xml") || ss.contains("editcomponents\\defaults\\plugin.xml")) {
- // remove.add(ss);
- // System.out.println(ss);
- // importantForEditingSettingValues.add(ss);
- // }
- // }
- // try {
- // GravistoMainHelper.loadPlugins(statusPanel.getPluginManager(), importantForEditingSettingValues, splashScreen);
- // } catch (PluginManagerException pme) {
- // ErrorMsg.addErrorMessage(pme.getLocalizedMessage());
- // }
- // for (String r : remove)
- // locations.remove(r);
- if (onStartup) {
- try {
- splashScreen.setText("Load plugins...");
- GravistoMainHelper.loadPlugins(locations, splashScreen);
- } catch (PluginManagerException pme) {
- ErrorMsg.addErrorMessage(pme.getLocalizedMessage());
- }
- } else {
- vantedDelayedRunnable = new Runnable() {
- @Override
- public void run() {
- if (onDemand) {
- try {
- splashScreen.setText("Load plugins...");
- GravistoMainHelper.loadPlugins(locations, splashScreen);
- } catch (PluginManagerException pme) {
- ErrorMsg.addErrorMessage(pme.getLocalizedMessage());
- }
- }
- }
- };
- }
- ExperimentDataProcessingManager.addExperimentDataProcessor(new SaveInDatabaseDataProcessor());
- ExperimentDataProcessingManager.addExperimentDataProcessor(new SaveAsCsvDataProcessor());
-
- splashScreen.setText("Initialize GUI...");
- if (progressWindow == null)
- splashScreen.setVisible(false);
- splashScreen.setInitialisationFinished();
- ErrorMsg.setAppLoadingCompleted(ApplicationStatus.PROGRAM_LOADING_FINISHED);
- }
-
- public static void prepareVantedPlugins() {
- if (vantedDelayedRunnable != null) {
- vantedDelayedRunnable.run();
- vantedDelayedRunnable = null;
- }
- }
-
- public static JComponent showVANTED(boolean inline) {
-
- prepareVantedPlugins();
-
- // inline = false;
- // JFrame jf = (JFrame) ErrorMsg.findParentComponent(MainFrame.getInstance(), JFrame.class);
-
- // mainFrame2
- for (MainFrame jc : new MainFrame[] { mainFrame1 }) {
- JFrame jf = (JFrame) ErrorMsg.findParentComponent(jc, JFrame.class);
- if (jf != null && !jf.isVisible()) {
- if (inline) {
- MainFrame.getInstance().getViewManager().viewChanged(null);
- JComponent gui = jf.getRootPane();
- return gui;
- } else {
- jf.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
- MainFrame.doCloseApplicationOnWindowClose = false;
- jf.setVisible(true);
- MainFrame.getInstance().getViewManager().viewChanged(null);
- }
- } else {
- if (jf != null) {
- // jf.setVisible(false);
- // jf.setVisible(true);
- }
- }
- if (jf != null) {
- final JFrame jff = jf;
- BackgroundTaskHelper.executeLaterOnSwingTask(50, new Runnable() {
- @Override
- public void run() {
- jff.toFront();
- jff.requestFocusInWindow();
- Session s = MainFrame.getInstance().getActiveSession();
- if (s != null) {
- View targetView = s.getActiveView();
- if (targetView != null)
- MainFrame.getInstance().setActiveSession(s, targetView);
- }
- }
- });
- }
- }
- return null;
- }
-
- private static WeakHashMap cachedImages = new WeakHashMap();
-
- public static synchronized NavigationImage loadIcon(String name) {
- NavigationImage ni = cachedImages.get(name);
- if (ni != null)
- return ni;
- NavigationImage res = new NavigationImage(
- Image.getBufferedImageFromImage(GravistoService.loadIcon(IAPmain.class, name).getImage()), name);
- cachedImages.put(name, res);
- return res;
- }
-
- public static boolean isSettingEnabled(IAPfeature feature) {
- if (SystemAnalysis.isHeadless()) {
- // don't change these return values !!!
- // see
- switch (feature) {
- case REMOTE_EXECUTION:
- return getOptions().getBoolean("IAP", "grid_remote_execution", true);
- case TOMCAT_AUTOMATIC_HSM_BACKUP:
- return getOptions().getBoolean("Watch-Service", "Automatic Copy to Archive//enabled", false)
- && getOptions().getBoolean("ARCHIVE", "enabled", false);
- case DELETE_CLOUD_JOBS_AND_TEMP_DATA_UPON_CLOUD_START:
- return getOptions().getBoolean("IAP", "grid_delete_jobs_when_grid_node_becomes_active", false);
- }
- } else {
- // these may be changed for interactive applet version !!!
- switch (feature) {
- case REMOTE_EXECUTION:
- return getOptions().getBoolean("IAP", "grid_remote_execution", true);
- case TOMCAT_AUTOMATIC_HSM_BACKUP:
- return getOptions().getBoolean("Watch-Service", "Automatic Copy to Archive//enabled", false)
- && getOptions().getBoolean("ARCHIVE", "enabled", false);
- case DELETE_CLOUD_JOBS_AND_TEMP_DATA_UPON_CLOUD_START:
- return getOptions().getBoolean("IAP", "grid_delete_jobs_when_grid_node_becomes_active", false);
- }
- }
- return false;
- }
-
- private static SystemOptions getOptions() {
- return SystemOptions.getInstance();
- }
-
- private static IAPrunMode currentGuiMode = IAPrunMode.UNKNOWN;
-
- private static boolean startMaximized;
-
- public static IAPrunMode getRunMode() {
- return currentGuiMode;
- }
-
- public static void setRunMode(IAPrunMode currentGuiMode) {
- IAPmain.currentGuiMode = currentGuiMode;
- }
-
- public static ArrayList getMainInfoLines() {
- ArrayList res = new ArrayList();
- String line = "****************************************************";
- int l = line.length();
- res.add(line);
- res.add(fillLen("**", l));
- res.add(fillLen("*" + SystemOptions.getInstance().getString("IAP", "window_title",
- "IAP - The Integrated Analysis Platform") + "*", l));
- res.add(fillLen("*(V" + ReleaseInfo.IAP_VERSION_STRING + ")*", l));
- res.add(fillLen("**", l));
- res.add(fillLen("* - OPEN SOURCE - *", l));
- res.add(fillLen("**", l));
- res.add(fillLen("*-- Systems Biology Cloud Computing --*", l));
- res.add(fillLen("**", l));
- res.add(fillLen("*(c) 2015-2020 Dr. C. Klukas *", l));
- res.add(fillLen("*(c) 2010-2016 Research Group Image Analysis, IPK *", l));
- res.add(fillLen("**", l));
- res.add(line);
- res.add(fillLen("**", l));
- res.add(fillLenLA("* Design and main development: *", " ", l, 2));
- res.add(fillLenLA("* Dr. Christian Klukas *", " ", l, 2));
- res.add(fillLen("**", l));
- res.add(fillLenLA("* Contribution to pipeline development: *", " ", l, 2));
- res.add(fillLenLA("* Jean-Michel Pape *", " ", l, 2));
- res.add(fillLen("**", l));
- res.add(line);
- return res;
- }
-
- private static String fillLen(String string, int len) {
- while (string.length() < len) {
- string = string.substring(0, 1) + " " + string.substring(1);
- if (string.length() < len)
- string = string.substring(0, string.length() - 1) + " " + string.substring(string.length() - 1, string.length());
- }
- return string;
- }
-
- private static String fillLenLA(String string, String fill, int len, int retainLeft) {
- while (string.length() < len) {
- string = string.substring(0, string.length() - retainLeft) + fill + string.substring(string.length() - retainLeft, string.length());
- }
- return string;
- }
-
- public static void errorCheck(String errorMessage) {
- if (errorMessage != null && errorMessage.toUpperCase().startsWith("INFO:"))
- return;
- boolean errClose = SystemOptions.getInstance().getBoolean("IAP", "Debug - System.Exit in case of error (" + IAPmain.getRunMode() + ")",
- IAPmain.getRunMode() == IAPrunMode.CLOUD_HOST_BATCH_MODE);
- int errNum = SystemOptions.getInstance().getInteger(
- "IAP", "Debug - System.Exit return value in case of error", 1);
- if (errClose) {
- Thread.dumpStack();
- System.out.println(SystemAnalysis.getCurrentTime()
- + ">INFO: System.exit because of reported error ('Settings > IAP > Debug - System.Exit in case of error' is enabled)");
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- //
- }
- SystemAnalysis.exit(errNum);
- }
- }
-
- public static void setStartMaximized(boolean startMaximized) {
- IAPmain.startMaximized = startMaximized;
- }
-}
-
-// ------------------------------------------------------------------------------
-// end of file
-// ------------------------------------------------------------------------------
+/*******************************************************************************
+ * Copyright (c) 2009 Image Analysis Group, IPK Gatersleben
+ *******************************************************************************/
+package de.ipk.ag_ba.gui.webstart;
+
+import java.awt.Dimension;
+import java.awt.Toolkit;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import java.io.IOException;
+import java.lang.ref.WeakReference;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.WeakHashMap;
+
+import javax.swing.ImageIcon;
+import javax.swing.JApplet;
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+
+import org.ApplicationStatus;
+import org.ErrorMessageProcessor;
+import org.ErrorMsg;
+import org.ReleaseInfo;
+import org.StringManipulationTools;
+import org.SystemAnalysis;
+import org.SystemOptions;
+import org.apache.log4j.ConsoleAppender;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.log4j.PatternLayout;
+import org.graffiti.editor.GravistoService;
+import org.graffiti.editor.MainFrame;
+import org.graffiti.editor.MessageType;
+import org.graffiti.editor.SplashScreenInterface;
+import org.graffiti.managers.pluginmgr.PluginManagerException;
+import org.graffiti.options.GravistoPreferences;
+import org.graffiti.plugin.io.resources.ResourceIOManager;
+import org.graffiti.plugin.view.View;
+import org.graffiti.session.Session;
+
+//import application.AnimateLogoIAP;
+import bsh.Interpreter;
+import de.ipk.ag_ba.datasources.http_folder.NavigationImage;
+import de.ipk.ag_ba.gui.IAPfeature;
+import de.ipk.ag_ba.gui.images.IAPimages;
+import de.ipk.ag_ba.gui.picture_gui.BackgroundThreadDispatcher;
+import de.ipk.ag_ba.image.structures.Image;
+import de.ipk.ag_ba.mongo.MongoDB;
+import de.ipk.ag_ba.mongo.SaveAsCsvDataProcessor;
+import de.ipk.ag_ba.mongo.SaveInDatabaseDataProcessor;
+import de.ipk.ag_ba.plugins.AbstractIAPplugin;
+import de.ipk.ag_ba.postgresql.LTftpHandler;
+import de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.helper.DBEgravistoHelper;
+import de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.layout_control.dbe.ExperimentDataProcessingManager;
+import de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.webstart.DBEsplashScreen;
+import de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.webstart.GravistoMainHelper;
+import de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.webstart.TextFile;
+import de.ipk_gatersleben.ag_nw.graffiti.services.task.BackgroundTaskHelper;
+import de.ipk_gatersleben.ag_nw.graffiti.services.task.BackgroundTaskStatusProviderSupportingExternalCallImpl;
+import info.clearthought.layout.TableLayout;
+
+/**
+ * @author klukas
+ */
+public class IAPmain extends JApplet {
+ private static final long serialVersionUID = 1L;
+
+ static MainFrame mainFrame1;
+
+ private static Runnable vantedDelayedRunnable;
+
+ // static MainFrame mainFrame2;
+
+ public void setAppletCloseListener(ActionListener l) {
+ // empty
+ }
+
+ public void appletDragStarted() {
+ final JFrame jf = (JFrame) ErrorMsg.findParentComponent(ReleaseInfo.getApplet(), JFrame.class);
+ if (jf != null) {
+ jf.setUndecorated(false);
+ jf.setResizable(true);
+ jf.setMaximizedBounds(null);
+ jf.setTitle("Integrated Analysis Platform");
+ jf.pack();
+ jf.setSize(800, 600);
+ } else
+ System.out.println("Drag detected, but frame not found.");
+ }
+
+ static boolean myClassKnown = false;
+
+ @Override
+ public void init() {
+ super.init();
+ setRunMode(IAPrunMode.SWING_APPLET);
+ }
+
+ public static void main(String[] args) {
+ main(args, null);
+ }
+
+ public static void main(String[] args, String[] addons) {
+ long startmaintime = System.currentTimeMillis();
+ for (String info : IAPmain.getMainInfoLines())
+ System.out.println(info);
+
+ setRunMode(IAPrunMode.SWING_MAIN);
+
+ System.out.println(SystemAnalysis.getCurrentTime() + ">INFO: Initialize IAP start... (run-mode: " + getRunMode() + ")");
+
+ boolean animate = SystemOptions.getInstance().getBoolean("IAP", "Animated Start-Logo", true);
+ // Runtime.Version version = Runtime.version();
+ // if (version.major() > 10)
+ animate = false;
+
+ final ProgressWindow progressWindow;
+
+ progressWindow = null; // animate ? new AnimateLogoIAP() : null;
+
+ if (progressWindow != null)
+ progressWindow.show(true);
+
+ String title = SystemOptions.getInstance().getString("IAP", "window_title",
+ "IAP - The Integrated Analysis Platform") + "";
+
+ SystemOptions.getInstance().getString("IAP", "Result File Type", "png");
+ SystemOptions.getInstance().getString("IAP", "Preview File Type", "png");
+ SystemOptions.getInstance().getInteger("SYSTEM", "Issue GC Memory Usage Threshold Percent", 60);
+ SystemOptions.getInstance().getInteger("SYSTEM", "Reduce Workload Memory Usage Threshold Percent", 70);
+
+ JFrame jf = new JFrame(title);
+ IAPmain iap = new IAPmain(addons, progressWindow);
+ jf.add("Center", iap.getContentPane());
+ jf.pack();
+ try {
+ java.awt.Image img = AbstractIAPplugin.getIAPicon().getImage();
+ jf.setIconImage(img);
+ if (SystemAnalysis.isMacRunning()) {
+ Interpreter i = new Interpreter();
+ i.set("img", img);
+ i.eval("com.apple.eawt.Application.getApplication().setDockIconImage(img)");
+ }
+ } catch (Exception e) {
+ ErrorMsg.addErrorMessage(e);
+ }
+ final WeakReference fr = new WeakReference(jf);
+ jf.addWindowListener(new WindowListener() {
+ @Override
+ public void windowOpened(WindowEvent e) {
+ if (progressWindow != null)
+ progressWindow.hide();
+ }
+
+ @Override
+ public void windowIconified(WindowEvent e) {
+ }
+
+ @Override
+ public void windowDeiconified(WindowEvent e) {
+ }
+
+ @Override
+ public void windowDeactivated(WindowEvent e) {
+ }
+
+ @Override
+ public void windowClosing(WindowEvent e) {
+ JFrame j = fr.get();
+ if (j != null) {
+
+ }
+ }
+
+ @Override
+ public void windowClosed(WindowEvent e) {
+ }
+
+ @Override
+ public void windowActivated(WindowEvent arg0) {
+ }
+ });
+ if (startMaximized) {
+ // jf.setExtendedState(jf.getExtendedState() | JFrame.MAXIMIZED_BOTH);
+ Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
+ jf.setBounds(0, 0, dim.width, dim.height);
+ }
+ if (startMaximized) {
+ // jf.setExtendedState(jf.getExtendedState() | JFrame.MAXIMIZED_BOTH);
+ Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
+ jf.setBounds(0, 0, dim.width, dim.height);
+ jf.setVisible(true);
+ } else {
+ Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
+ jf.setSize((int) (screenDim.width * 0.75), (int) (screenDim.height * 0.75));
+ jf.setLocation((screenDim.width - jf.getWidth()) / 2,
+ (screenDim.height - jf.getHeight()) / 2);
+ jf.setVisible(true);
+ }
+ long endmaintime = System.currentTimeMillis();
+ SystemOptions.getInstance().setInteger("IAP", "FX//Last Startup Time", (int) (endmaintime - startmaintime));
+ jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ SystemOptions.getInstance().addChangeListener("IAP", "window_title", new Runnable() {
+ @Override
+ public void run() {
+ JFrame j = fr.get();
+ if (j != null) {
+ String newTitle = SystemOptions.getInstance().getString("IAP", "window_title", "IAP - The Integrated Analysis Platform");
+ j.setTitle(newTitle + "");
+ }
+ }
+ });
+ }
+
+ public IAPmain() {
+ this(null, null);
+ }
+
+ public IAPmain(final String[] addons, ProgressWindow progressWindow) {
+ if (getRunMode() == IAPrunMode.UNKNOWN)
+ setRunMode(IAPrunMode.SWING_APPLET);
+ if (getRunMode() == IAPrunMode.SWING_APPLET)
+ ReleaseInfo.setRunningAsApplet(this);
+
+ if (SystemOptions.getInstance().getBoolean("IAP", "Debug - System.Exit in case of error",
+ IAPmain.getRunMode() == IAPrunMode.CLOUD_HOST_BATCH_MODE)) {
+ ErrorMsg.setCustomErrorHandler(new ErrorMessageProcessor() {
+ @Override
+ public void reportError(Exception exception) {
+ if (exception != null)
+ exception.printStackTrace();
+ IAPmain.errorCheck(exception.getMessage());
+ }
+
+ @Override
+ public void reportError(String errorMessage) {
+ if (errorMessage != null)
+ System.err.println(errorMessage);
+ IAPmain.errorCheck(errorMessage);
+ }
+ });
+ }
+
+ ErrorMsg.setRethrowErrorMessages(false);
+
+ setupLogger();
+
+ registerIOhandlers();
+
+ GravistoMainHelper.setLookAndFeel();
+
+ // construct and open the editor's main frame
+ GravistoPreferences prefs = GravistoPreferences.userNodeForPackage(IAPmain.class);
+
+ GravistoPreferences uiPrefs = prefs.node("ui");
+ uiPrefs.put("showPluginManagerMenuOptions", getOptions().getBoolean("VANTED", "debug show plugin_manager_menu_options", false) + "");
+ uiPrefs.put("showPluginMenu", getOptions().getBoolean("VANTED", "debug show plugin_menu", false) + "");
+ JPanel statusPanel = new JPanel();
+
+ mainFrame1 = new MainFrame(GravistoMainHelper.getPluginManager(), uiPrefs, statusPanel, true);
+
+ try {
+ mainFrame1.setIconImage(IAPimages.getImage("img/vanted1_0.png"));
+ } catch (Exception e) {
+ e.printStackTrace();
+ ErrorMsg.addErrorMessage(e);
+ }
+
+ // mainFrame2 = new MainFrame(GravistoMainHelper.getNewPluginManager(), uiPrefs, statusPanel, true);
+
+ setLayout(new TableLayout(new double[][] { { TableLayout.FILL }, { TableLayout.FILL } }));
+
+ final BackgroundTaskStatusProviderSupportingExternalCallImpl myStatus = new BackgroundTaskStatusProviderSupportingExternalCallImpl(
+ "", "");
+
+ Thread t = new Thread() {
+
+ @Override
+ public void run() {
+ // if (IAPmain.myClassKnown) {
+ // System.out.println("Reload Classes, Problems may occur");
+ // ErrorMsg.addErrorMessage("Reload Classes, Problems may occur");
+ // }
+ // IAPmain.myClassKnown = true;
+ // System.out.println("Class Loader: " + InstanceLoader.getCurrentLoader().getClass().getCanonicalName());
+ myAppletLoad(mainFrame1, myStatus, addons, progressWindow);
+ // myAppletLoad(mainFrame2, myStatus);
+ }
+ };
+ t.setName("Application Loader");
+ t.setPriority(Thread.MIN_PRIORITY);
+ t.start();
+
+ JComponent advancedNavigation = IAPgui.getMainGUIcontent(myStatus, false, null);
+ add(advancedNavigation, "0,0");
+ setVisible(true);
+ validate();
+ repaint();
+
+ }
+
+ private void setupLogger() {
+ Logger rootLogger = Logger.getRootLogger();
+ if (!rootLogger.getAllAppenders().hasMoreElements()) {
+ rootLogger.setLevel(Level.ERROR);
+ rootLogger.addAppender(new ConsoleAppender(new PatternLayout("%-5p [%t]: %m%n")));
+
+ Logger pkgLogger = rootLogger.getLoggerRepository().getLogger("com.mongodb");
+ pkgLogger.setLevel(Level.ERROR);
+ pkgLogger.addAppender(new ConsoleAppender(new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN)));
+ }
+ }
+
+ private void registerIOhandlers() {
+ GravistoService.setProxy();
+ // ResourceIOManager.registerIOHandler(LoadedVolumeHandler.getInstance());
+ // ResourceIOManager.registerIOHandler(LoadedImageHandler.getInstance());
+ ResourceIOManager.registerIOHandler(new LTftpHandler());
+ for (MongoDB m : MongoDB.getMongos())
+ ResourceIOManager.registerIOHandler(m.getHandler());
+
+ // IIORegistry registry = IIORegistry.getDefaultInstance();
+ // registry.registerServiceProvider(new com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriterSpi());
+ // registry.registerServiceProvider(new com.sun.media.imageioimpl.plugins.tiff.TIFFImageReaderSpi());
+ }
+
+ public void myAppletLoad(
+ final MainFrame statusPanel,
+ final BackgroundTaskStatusProviderSupportingExternalCallImpl myStatus,
+ final String[] addons, ProgressWindow progressWindow) {
+ String stS = "";
+ String stE = "";
+ DBEgravistoHelper.DBE_GRAVISTO_NAME_SHORT = "IAP";
+ String name = stS + DBEgravistoHelper.DBE_GRAVISTO_NAME_SHORT + stE + " - " + stS + "V" + stE + "isualization and " + stS + "A" + stE
+ + "nalysis of " + stS + "N" + stE + "e" + stS + "t" + stE + "works
containing " + stS + "E" + stE
+ + "xperimental " + stS + "D" + stE + "ata";
+ DBEgravistoHelper.DBE_GRAVISTO_VERSION = DBEgravistoHelper.DBE_GRAVISTO_NAME_SHORT + " V" + DBEgravistoHelper.DBE_GRAVISTO_VERSION_CODE;
+ DBEgravistoHelper.DBE_GRAVISTO_NAME = stS + DBEgravistoHelper.DBE_GRAVISTO_NAME_SHORT + stE + " - " + stS + "I" + stE
+ + "ntegrated " + stS + "A" + stE + "nalysis " + stS + "P" + stE + "latform
";
+ DBEgravistoHelper.DBE_INFORMATIONSYSTEM_NAME = "Integrated Analysis Platform";
+
+ DBEgravistoHelper.DBE_INFORMATIONSYSTEM_NAME = "";
+
+ // AttributeHelper.setMacOSsettings(DBEgravistoHelper.DBE_GRAVISTO_NAME_SHORT);
+
+ final JComponent result = new JPanel();
+ result.setLayout(TableLayout.getLayout(TableLayout.FILL, TableLayout.FILL));
+
+ String s = ""
+ + "
Welcome to "
+ + name
+ + "!
"
+ + ""
+ + " In the Help menu you find a tutorial section which quickly gives an overview on the various "
+ + "features of this application.
"
+ + " Furthermore you will find [?] buttons throughout the system which point directly to topics of interest.
"
+ + " If you experience problems or would like to suggest enhancements, feel free to use the "
+ + "Send feedback command in the Help menu!
";
+
+ ReleaseInfo.setHelpIntroductionText(s);
+
+ // URL config,
+ final SplashScreenInterface splashScreen = progressWindow != null ? progressWindow : new SplashScreenInterface() {
+
+ private int max, val;
+
+ @Override
+ public void setVisible(boolean b) {
+ }
+
+ @Override
+ public void setValue(int value) {
+ this.val = value;
+ double progress = val / (double) max * 100d;
+ myStatus.setCurrentStatusValueFine(progress);
+ }
+
+ @Override
+ public void setText(String text) {
+ MainFrame.showMessage(text, MessageType.PERMANENT_INFO);
+ if (SystemOptions.getInstance().getBoolean("IAP", "Debug-Print-Plugin-Loading-Infos", false))
+ System.out.println(text);
+ }
+
+ @Override
+ public void setMaximum(int maximum) {
+ this.max = maximum;
+ }
+
+ @Override
+ public void setInitialisationFinished() {
+ MainFrame.showMessage("", MessageType.INFO);
+ }
+
+ @Override
+ public int getValue() {
+ return val;
+ }
+
+ @Override
+ public int getMaximum() {
+ return max;
+ }
+ };
+
+ ClassLoader cl = this.getClass().getClassLoader();
+
+ String path = // this.getClass().getPackage().getName()
+ "de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.webstart".replace('.', '/');
+ ImageIcon icon = new ImageIcon(cl.getResource(path + "/ipklogo16x16_5.png"));
+ if (splashScreen instanceof DBEsplashScreen)
+ ((DBEsplashScreen) splashScreen).setIconImage(icon.getImage());
+ // splashScreen.setVisible(true);
+
+ GravistoMainHelper.createApplicationSettingsFolder(splashScreen);
+
+ splashScreen.setText("Read plugin information");
+
+ URL r1 = cl.getResource("plugins1.txt");
+ URL r2 = cl.getResource("plugins2.txt");
+ URL r3 = cl.getResource("plugins3.txt");
+ URL r4 = cl.getResource("plugins4.txt");
+ URL r5 = cl.getResource("pluginsIAP.txt");
+
+ URL rExcl = cl.getResource("plugins_exclude.txt");
+
+ splashScreen.setText("Read plugin information...");
+
+ final ArrayList locations = new ArrayList();
+ try {
+ locations.addAll(new TextFile(r1));
+ locations.addAll(new TextFile(r2));
+ locations.addAll(new TextFile(r3));
+ locations.addAll(new TextFile(r4));
+ locations.addAll(new TextFile(r5));
+ locations.add("./MultimodalDataHandling.xml");
+ // locations.add("./HIVE.xml");
+
+ if (addons != null)
+ for (String p : addons)
+ if (p != null)
+ locations.add("//" + p);
+
+ locations.remove("");
+
+ locations.removeIf(l -> l.contains("build.xml"));
+
+ ArrayList locations_exclude = new ArrayList();
+ locations_exclude.addAll(new TextFile(rExcl));
+
+ for (Iterator it = locations_exclude.iterator(); it.hasNext();) {
+ String remove = it.next();
+ if (!locations.remove(remove)) {
+ if (remove.startsWith("**")) {
+ remove = remove.substring("**".length());
+ ArrayList toRemove = new ArrayList<>();
+ for (String loc : locations) {
+ if (loc.endsWith(remove))
+ toRemove.add(loc);
+ }
+ locations.removeAll(toRemove);
+ } else {
+ // windows compatibility remove also not exact matches
+ for (Iterator itl = locations.iterator(); itl.hasNext();) {
+ String loc = itl.next();
+ remove = remove.toUpperCase();
+ remove = StringManipulationTools.stringReplace(remove, "./", "");
+ remove = StringManipulationTools.stringReplace(remove, "\"", "");
+ remove = StringManipulationTools.stringReplace(remove, "/", "\\");
+ remove = StringManipulationTools.stringReplace(remove, "\\", "");
+ remove = StringManipulationTools.stringReplace(remove, " ", "");
+ String loc2 = loc.toUpperCase();
+ loc2 = StringManipulationTools.stringReplace(loc2, "\\", "");
+ loc2 = StringManipulationTools.stringReplace(loc2, " ", "");
+ if (loc2.indexOf(remove) >= 0) {
+ locations.remove(loc);
+ break;
+ }
+ }
+ }
+ }
+ }
+ splashScreen.setMaximum(locations.size() - 1);
+ } catch (IOException e) {
+ ErrorMsg.addErrorMessage(e.getLocalizedMessage());
+ } catch (NullPointerException npe) {
+ if (splashScreen != null)
+ splashScreen.setVisible(false);
+ System.err.println("Internal error: Plugin Description files could not be loaded.");
+ System.err.println("-- Program needs to be stopped");
+ System.err.println("EXIT in 10 seconds.");
+ BackgroundThreadDispatcher.runInSeparateThread(() -> {
+ try {
+ Thread.sleep(10000);
+ } catch (Exception e) {
+ //
+ }
+ SystemAnalysis.exit(1);
+ }, "System.exit in 60 seconds");
+ JOptionPane.showMessageDialog(null, "ERROR: Plugin-Description files could not be loaded
"
+ + "Program execution can not continue.
" + "The application needs to be closed (and will be closed in 10 sec.).
" +
+ "
" +
+ "Create description files by executing the script createfilelist.cmd from the console (Linux/Mac)
" +
+ "or by executing createfilelist.bat directly from within Eclipse (works only on Windows).
" +
+ "These scripts are stored and available within the 'make' project." +
+ "");
+ SystemAnalysis.exit(1);
+ }
+
+ final boolean onStartup = true; // IAPoptions.getInstance().getBoolean("VANTED", "load_plugins_on_startup", false);
+ final boolean onDemand = false; // IAPoptions.getInstance().getBoolean("VANTED", "load_plugins_on_demand", true);
+ // ArrayList remove = new ArrayList();
+ // ArrayList importantForEditingSettingValues = new ArrayList();
+ // for (String ss : locations) {
+ // if (ss.endsWith("attributes\\defaults\\plugin.xml") || ss.contains("editcomponents\\defaults\\plugin.xml")) {
+ // remove.add(ss);
+ // System.out.println(ss);
+ // importantForEditingSettingValues.add(ss);
+ // }
+ // }
+ // try {
+ // GravistoMainHelper.loadPlugins(statusPanel.getPluginManager(), importantForEditingSettingValues, splashScreen);
+ // } catch (PluginManagerException pme) {
+ // ErrorMsg.addErrorMessage(pme.getLocalizedMessage());
+ // }
+ // for (String r : remove)
+ // locations.remove(r);
+ if (onStartup) {
+ try {
+ splashScreen.setText("Load plugins...");
+ GravistoMainHelper.loadPlugins(locations, splashScreen);
+ } catch (PluginManagerException pme) {
+ ErrorMsg.addErrorMessage(pme.getLocalizedMessage());
+ }
+ } else {
+ vantedDelayedRunnable = new Runnable() {
+ @Override
+ public void run() {
+ if (onDemand) {
+ try {
+ splashScreen.setText("Load plugins...");
+ GravistoMainHelper.loadPlugins(locations, splashScreen);
+ } catch (PluginManagerException pme) {
+ ErrorMsg.addErrorMessage(pme.getLocalizedMessage());
+ }
+ }
+ }
+ };
+ }
+ ExperimentDataProcessingManager.addExperimentDataProcessor(new SaveInDatabaseDataProcessor());
+ ExperimentDataProcessingManager.addExperimentDataProcessor(new SaveAsCsvDataProcessor());
+
+ splashScreen.setText("Initialize GUI...");
+ if (progressWindow == null)
+ splashScreen.setVisible(false);
+ splashScreen.setInitialisationFinished();
+ ErrorMsg.setAppLoadingCompleted(ApplicationStatus.PROGRAM_LOADING_FINISHED);
+ }
+
+ public static void prepareVantedPlugins() {
+ if (vantedDelayedRunnable != null) {
+ vantedDelayedRunnable.run();
+ vantedDelayedRunnable = null;
+ }
+ }
+
+ public static JComponent showVANTED(boolean inline) {
+
+ prepareVantedPlugins();
+
+ // inline = false;
+ // JFrame jf = (JFrame) ErrorMsg.findParentComponent(MainFrame.getInstance(), JFrame.class);
+
+ // mainFrame2
+ for (MainFrame jc : new MainFrame[] { mainFrame1 }) {
+ JFrame jf = (JFrame) ErrorMsg.findParentComponent(jc, JFrame.class);
+ if (jf != null && !jf.isVisible()) {
+ if (inline) {
+ MainFrame.getInstance().getViewManager().viewChanged(null);
+ JComponent gui = jf.getRootPane();
+ return gui;
+ } else {
+ jf.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
+ MainFrame.doCloseApplicationOnWindowClose = false;
+ jf.setVisible(true);
+ MainFrame.getInstance().getViewManager().viewChanged(null);
+ }
+ } else {
+ if (jf != null) {
+ // jf.setVisible(false);
+ // jf.setVisible(true);
+ }
+ }
+ if (jf != null) {
+ final JFrame jff = jf;
+ BackgroundTaskHelper.executeLaterOnSwingTask(50, new Runnable() {
+ @Override
+ public void run() {
+ jff.toFront();
+ jff.requestFocusInWindow();
+ Session s = MainFrame.getInstance().getActiveSession();
+ if (s != null) {
+ View targetView = s.getActiveView();
+ if (targetView != null)
+ MainFrame.getInstance().setActiveSession(s, targetView);
+ }
+ }
+ });
+ }
+ }
+ return null;
+ }
+
+ private static WeakHashMap cachedImages = new WeakHashMap();
+
+ public static synchronized NavigationImage loadIcon(String name) {
+ NavigationImage ni = cachedImages.get(name);
+ if (ni != null)
+ return ni;
+ NavigationImage res = new NavigationImage(
+ Image.getBufferedImageFromImage(GravistoService.loadIcon(IAPmain.class, name).getImage()), name);
+ cachedImages.put(name, res);
+ return res;
+ }
+
+ public static boolean isSettingEnabled(IAPfeature feature) {
+ if (SystemAnalysis.isHeadless()) {
+ // don't change these return values !!!
+ // see
+ switch (feature) {
+ case REMOTE_EXECUTION:
+ return getOptions().getBoolean("IAP", "grid_remote_execution", true);
+ case TOMCAT_AUTOMATIC_HSM_BACKUP:
+ return getOptions().getBoolean("Watch-Service", "Automatic Copy to Archive//enabled", false)
+ && getOptions().getBoolean("ARCHIVE", "enabled", false);
+ case DELETE_CLOUD_JOBS_AND_TEMP_DATA_UPON_CLOUD_START:
+ return getOptions().getBoolean("IAP", "grid_delete_jobs_when_grid_node_becomes_active", false);
+ }
+ } else {
+ // these may be changed for interactive applet version !!!
+ switch (feature) {
+ case REMOTE_EXECUTION:
+ return getOptions().getBoolean("IAP", "grid_remote_execution", true);
+ case TOMCAT_AUTOMATIC_HSM_BACKUP:
+ return getOptions().getBoolean("Watch-Service", "Automatic Copy to Archive//enabled", false)
+ && getOptions().getBoolean("ARCHIVE", "enabled", false);
+ case DELETE_CLOUD_JOBS_AND_TEMP_DATA_UPON_CLOUD_START:
+ return getOptions().getBoolean("IAP", "grid_delete_jobs_when_grid_node_becomes_active", false);
+ }
+ }
+ return false;
+ }
+
+ private static SystemOptions getOptions() {
+ return SystemOptions.getInstance();
+ }
+
+ private static IAPrunMode currentGuiMode = IAPrunMode.UNKNOWN;
+
+ private static boolean startMaximized;
+
+ public static IAPrunMode getRunMode() {
+ return currentGuiMode;
+ }
+
+ public static void setRunMode(IAPrunMode currentGuiMode) {
+ IAPmain.currentGuiMode = currentGuiMode;
+ }
+
+ public static ArrayList getMainInfoLines() {
+ ArrayList res = new ArrayList();
+ String line = "****************************************************";
+ int l = line.length();
+ res.add(line);
+ res.add(fillLen("**", l));
+ res.add(fillLen("*" + SystemOptions.getInstance().getString("IAP", "window_title",
+ "IAP - The Integrated Analysis Platform") + "*", l));
+ res.add(fillLen("*(V" + ReleaseInfo.IAP_VERSION_STRING + ")*", l));
+ res.add(fillLen("**", l));
+ res.add(fillLen("* - OPEN SOURCE - *", l));
+ res.add(fillLen("**", l));
+ res.add(fillLen("*-- Systems Biology Cloud Computing --*", l));
+ res.add(fillLen("**", l));
+ res.add(fillLen("*(c) 2015-2020 Dr. C. Klukas *", l));
+ res.add(fillLen("*(c) 2010-2016 Research Group Image Analysis, IPK *", l));
+ res.add(fillLen("**", l));
+ res.add(line);
+ res.add(fillLen("**", l));
+ res.add(fillLenLA("* Design and main development: *", " ", l, 2));
+ res.add(fillLenLA("* Dr. Christian Klukas *", " ", l, 2));
+ res.add(fillLen("**", l));
+ res.add(fillLenLA("* Contribution to pipeline development: *", " ", l, 2));
+ res.add(fillLenLA("* Jean-Michel Pape *", " ", l, 2));
+ res.add(fillLen("**", l));
+ res.add(line);
+ return res;
+ }
+
+ private static String fillLen(String string, int len) {
+ while (string.length() < len) {
+ string = string.substring(0, 1) + " " + string.substring(1);
+ if (string.length() < len)
+ string = string.substring(0, string.length() - 1) + " " + string.substring(string.length() - 1, string.length());
+ }
+ return string;
+ }
+
+ private static String fillLenLA(String string, String fill, int len, int retainLeft) {
+ while (string.length() < len) {
+ string = string.substring(0, string.length() - retainLeft) + fill + string.substring(string.length() - retainLeft, string.length());
+ }
+ return string;
+ }
+
+ public static void errorCheck(String errorMessage) {
+ if (errorMessage != null && errorMessage.toUpperCase().startsWith("INFO:"))
+ return;
+ boolean errClose = SystemOptions.getInstance().getBoolean("IAP", "Debug - System.Exit in case of error (" + IAPmain.getRunMode() + ")",
+ IAPmain.getRunMode() == IAPrunMode.CLOUD_HOST_BATCH_MODE);
+ int errNum = SystemOptions.getInstance().getInteger(
+ "IAP", "Debug - System.Exit return value in case of error", 1);
+ if (errClose) {
+ Thread.dumpStack();
+ System.out.println(SystemAnalysis.getCurrentTime()
+ + ">INFO: System.exit because of reported error ('Settings > IAP > Debug - System.Exit in case of error' is enabled)");
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ //
+ }
+ SystemAnalysis.exit(errNum);
+ }
+ }
+
+ public static void setStartMaximized(boolean startMaximized) {
+ IAPmain.startMaximized = startMaximized;
+ }
+}
+
+// ------------------------------------------------------------------------------
+// end of file
+// ------------------------------------------------------------------------------
diff --git a/IAP/src/de/ipk/ag_ba/plugins/pipelines/PluginIAPanalyisTemplates.java b/IAP/src/de/ipk/ag_ba/plugins/pipelines/PluginIAPanalyisTemplates.java
index 05b346a3e..0668ccae8 100644
--- a/IAP/src/de/ipk/ag_ba/plugins/pipelines/PluginIAPanalyisTemplates.java
+++ b/IAP/src/de/ipk/ag_ba/plugins/pipelines/PluginIAPanalyisTemplates.java
@@ -24,7 +24,7 @@
import iap.blocks.debug.BlFilterImagesByTopOrSide;
import iap.blocks.debug.BlRunExternalShellCommand;
import iap.blocks.debug.BlShowIntermediateImages;
-import iap.blocks.debug.BlShowThreeDColorHistogram;
+//import iap.blocks.debug.BlShowThreeDColorHistogram;
import iap.blocks.extraction.BlCalcAreas;
import iap.blocks.extraction.BlCalcCOG;
import iap.blocks.extraction.BlCalcColorHistograms;
@@ -178,7 +178,7 @@ public ImageAnalysisBlock[] getImageAnalysisBlocks() {
new BlFlowerDetectionAndFeatureExtraction(),
new BlCalcTextureFeatures(),
new BlCalcColorfeatures(),
- new BlShowThreeDColorHistogram(),
+ //new BlShowThreeDColorHistogram(),
new BlFilterImagesByDate(),
new BlFilterImagesByCondition(),
new BlShowIntermediateImages(),
diff --git a/IPK-Plugins/.classpath b/IPK-Plugins/.classpath
index cd3a2400b..8c0c2ea9f 100644
--- a/IPK-Plugins/.classpath
+++ b/IPK-Plugins/.classpath
@@ -1,62 +1,62 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/IPK-Plugins/build/classes/plugins4.txt b/IPK-Plugins/build/classes/plugins4.txt
index 6677c3fbd..14e7065d3 100644
--- a/IPK-Plugins/build/classes/plugins4.txt
+++ b/IPK-Plugins/build/classes/plugins4.txt
@@ -1,90 +1,90 @@
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\addons\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\algorithms\davidtest\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\algorithms\graph_generation\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\algorithms\hamming_distance\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\algorithms\inverse_graph\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\algorithms\lines_as_substances\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\algorithms\naive_pattern_finder\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\algorithms\ratioview\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\algorithms\som\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\editcomponents\chart_colors\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\editcomponents\chart_settings\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\editcomponents\cluster_colors\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\editcomponents\compound_image\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\editcomponents\font_label_color\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\editcomponents\font_label_settings\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\editcomponents\font_label_style\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\editcomponents\font_settings\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\editcomponents\kegg\kegg_type\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\editcomponents\label_alignment\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\editcomponents\url_attribute\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\editcomponents\xml_attribute\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\gui\dbe\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\gui\editing_tools\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\gui\editing_tools\url_attribute_context_commands\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\gui\enhanced_attribute_editors\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\gui\fast_view\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\gui\info_dialog\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\gui\info_dialog_cluster_analysis\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\gui\info_dialog_dbe\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\gui\ipk_graffitiview\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\gui\kegg_bar\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\gui\layout_control\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\gui\layout_control\pluginClusterTabs.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\gui\rotate\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\gui\set_background_color\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\gui\startlayout\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\gui\zoomfit\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\ios\exporters\biopax\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\ios\exporters\metatool\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\ios\exporters\xwg_wilma\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\ios\importers\biopax\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\ios\importers\kegg_xml\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\ios\importers\kgml\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\ios\importers\pajek\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\ios\importers\petri_ina_pnt\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\ios\importers\text_list\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\ios\importers\xgmml\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\apply_from_graph\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\circle\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\connected_components\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\copy_pattern_layout\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\expand_no_overlapp\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\expand_reduce_space\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\fd_edge_routing\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\fish_eye\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\graph_to_origin_mover\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\grid\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\grid_placement\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\no_overlapp_as_tim\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\pattern_springembedder\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\pattern_springembedder_no_cache\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\radial_tree\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\random\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\resize_and_grid_layout\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\rt_tree\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\shortest_path\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\springembedder_1\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\swig_cola\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\tree_jung\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\layouters\tree_simple\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\misc\add_attributes\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\misc\graph_cleanup\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\misc\invert_selection\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\misc\ko_tree\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\misc\label_editing\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\misc\link_visualization_legend\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\misc\pathway_references\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\misc\print\printer\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\misc\process_alternative_ids\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\misc\scripting\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\de\ipk_gatersleben\ag_nw\graffiti\plugins\misc\svg_exporter\plugin.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\vanted_feature\FeatureAnalysisCommands.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\vanted_feature\FeatureClustering.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\vanted_feature\FeatureDataMapping.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\vanted_feature\FeatureExtendedFileFormatSupport.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\vanted_feature\FeatureHierarchies.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\vanted_feature\FeatureMacroRecording.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\vanted_feature\FeatureMetaCrop.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\vanted_feature\FeatureSBGN.xml
-C:\Users\Christian Klukas\git\IAP\IPK-Plugins\build\classes\vanted_feature\FeatureStatistics.xml
+./vanted_feature/FeatureMacroRecording.xml
+./vanted_feature/FeatureClustering.xml
+./vanted_feature/FeatureStatistics.xml
+./vanted_feature/FeatureExtendedFileFormatSupport.xml
+./vanted_feature/FeatureDataMapping.xml
+./vanted_feature/FeatureMetaCrop.xml
+./vanted_feature/FeatureHierarchies.xml
+./vanted_feature/FeatureSBGN.xml
+./vanted_feature/FeatureAnalysisCommands.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/editcomponents/font_label_settings/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/editcomponents/chart_settings/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/editcomponents/kegg/kegg_type/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/editcomponents/font_label_style/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/editcomponents/xml_attribute/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/editcomponents/compound_image/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/editcomponents/chart_colors/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/editcomponents/font_settings/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/editcomponents/url_attribute/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/editcomponents/cluster_colors/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/editcomponents/label_alignment/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/editcomponents/font_label_color/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/addons/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/misc/print/printer/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/misc/label_editing/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/misc/add_attributes/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/misc/scripting/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/misc/svg_exporter/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/misc/invert_selection/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/misc/graph_cleanup/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/misc/process_alternative_ids/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/misc/ko_tree/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/misc/pathway_references/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/misc/link_visualization_legend/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/graph_to_origin_mover/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/connected_components/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/radial_tree/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/tree_jung/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/no_overlapp_as_tim/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/copy_pattern_layout/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/pattern_springembedder_no_cache/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/pattern_springembedder/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/shortest_path/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/apply_from_graph/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/rt_tree/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/tree_simple/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/grid_placement/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/swig_cola/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/resize_and_grid_layout/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/fd_edge_routing/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/expand_reduce_space/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/circle/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/fish_eye/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/expand_no_overlapp/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/random/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/springembedder_1/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/layouters/grid/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/gui/editing_tools/url_attribute_context_commands/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/gui/editing_tools/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/gui/enhanced_attribute_editors/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/gui/zoomfit/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/gui/layout_control/pluginClusterTabs.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/gui/layout_control/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/gui/fast_view/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/gui/dbe/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/gui/info_dialog/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/gui/set_background_color/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/gui/ipk_graffitiview/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/gui/info_dialog_dbe/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/gui/info_dialog_cluster_analysis/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/gui/startlayout/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/gui/kegg_bar/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/gui/rotate/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/petri_ina_pnt/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/pajek/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/kgml/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/text_list/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/xgmml/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/biopax/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/kegg_xml/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/metatool/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/biopax/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/xwg_wilma/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/algorithms/naive_pattern_finder/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/algorithms/ratioview/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/algorithms/davidtest/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/algorithms/lines_as_substances/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/algorithms/som/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/algorithms/inverse_graph/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/algorithms/hamming_distance/plugin.xml
+./de/ipk_gatersleben/ag_nw/graffiti/plugins/algorithms/graph_generation/plugin.xml
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Compartment_Writer.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Compartment_Writer.java
deleted file mode 100644
index 0553f85f0..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Compartment_Writer.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * This class writes a Compartment of a model
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml;
-
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.Compartment;
-import org.sbml.jsbml.Model;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLCompartment;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLCompartmentHelper;
-
-public class SBML_Compartment_Writer extends SBML_SBase_Writer {
-
- /**
- * Adds a compartment and its attributes to the model.
- *
- * @param model the compartments will be added to this model
- * @param g contains the values for the export
- * @param headline indicates where the information should be read from
- * @param internHeadline the intern representation of headline
- */
- public void addCompartment(Model model, Graph g, String internHeadline, SBMLCompartmentHelper compartmentHelperObject) {
- SBMLCompartment compartmentHelper = compartmentHelperObject.addCompartment(g, internHeadline);
- Compartment compartment = model.createCompartment();
- addSBaseAttributes(compartment, g, internHeadline);
-
- if (compartmentHelper.isSetID()) {
- String id = compartmentHelper.getID();
- if (Compartment.isValidId(id, compartment.getLevel(), compartment.getVersion())) {
- compartment.setId(compartmentHelper.getID());
- }
- }
- if (compartmentHelper.isSetName()) {
- compartment.setName(compartmentHelper.getName());
- }
- if (compartmentHelper.isSetSpatialDimensions()) {
- compartment.setSpatialDimensions(compartmentHelper.getSpatialDimensions());
- }
- if (compartmentHelper.isSetSize()) {
- compartment.setSize(compartmentHelper.getSize());
- }
- if (compartmentHelper.isSetUnits()) {
- compartment.setUnits(compartmentHelper.getUnits());
- }
- if (compartmentHelper.isSetConstant()) {
- compartment.setConstant(compartmentHelper.getConstant());
- }
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Constraint_Writer.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Constraint_Writer.java
deleted file mode 100644
index 454444e9d..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Constraint_Writer.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * This class sets the Constraint attributes
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml;
-
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.ASTNode;
-import org.sbml.jsbml.Constraint;
-import org.sbml.jsbml.Model;
-import org.sbml.jsbml.text.parser.ParseException;
-import org.sbml.jsbml.xml.XMLNode;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLConstraint;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLConstraintHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_Constraint_Writer extends SBML_SBase_Writer {
-
- /**
- * Adds a constraint and its variables to the model
- *
- * @param g
- * contains the values for the export
- * @param model
- * the constraint will be added to this model
- * @param headline
- * indicates where the information should be read from
- * @param niceID
- * intern representation of headline
- */
- public void addConstraint(Graph g, Model model, String internHeadline,
- SBMLConstraintHelper constraintHelperObject) {
- SBMLConstraint constraintHelper = constraintHelperObject.addConstraint(
- g, internHeadline);
- Constraint constraint = model.createConstraint();
- addSBaseAttributes(constraint, g, internHeadline);
- if (constraintHelper.isSetMessage()) {
- String message = constraintHelper.getMessage();
- if (null != message) {
- message = ""
- + message + "
";
- XMLNode xmlMessage = new XMLNode(message);
- constraint.setMessage(message);
- }
- }
- if (constraintHelper.isSetFunction()) {
- String constraintFormula = constraintHelper.getFunction();
- if (!SBML_Constants.EMPTY.equals(constraintFormula)) {
- try {
- constraint.setMath(ASTNode.parseFormula(constraintFormula));
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Event_Writer.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Event_Writer.java
deleted file mode 100644
index f9a5457e7..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Event_Writer.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * This class sets the attributes of Events
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml;
-
-import org.AttributeHelper;
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.ASTNode;
-import org.sbml.jsbml.Delay;
-import org.sbml.jsbml.Event;
-import org.sbml.jsbml.EventAssignment;
-import org.sbml.jsbml.Model;
-import org.sbml.jsbml.Priority;
-import org.sbml.jsbml.Trigger;
-import org.sbml.jsbml.text.parser.ParseException;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLEventAssignmentHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLEventHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_Event_Writer extends SBML_SBase_Writer {
-
- /**
- * Adds an event to the model
- *
- * @param g
- * contains the data
- * @param model
- * the data will be added to this model
- * @param headline
- * indicates where the information will be written from
- * @param internHeadline
- * intern representation of headline
- */
- public void addEvent(Graph g, Model model, String internHeadline) {
- SBMLEventHelper eventHelper = new SBMLEventHelper(g, internHeadline);
- Event event = model.createEvent();
- addSBaseAttributes(event, g, internHeadline);
- if (eventHelper.isSetID()) {
- String id = eventHelper.getID();
- if (Event.isValidId(id, event.getLevel(), event.getVersion())) {
- event.setId(eventHelper.getID());
- }
- }
- if (eventHelper.isSetName()) {
- event.setName(eventHelper.getName());
- }
- if (eventHelper.isSetUseValuesFromTriggerTime()) {
- event.setUseValuesFromTriggerTime(eventHelper
- .getUseValuesFromTriggerTime());
- }
-
- // Trigger must be set
- Trigger trigger = event.createTrigger();
- if (eventHelper.isSetTriggerFunction()) {
- try {
- trigger.setMath(ASTNode.parseFormula(eventHelper
- .getTriggerFunction()));
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
- if (eventHelper.isSetInitialValue()) {
- trigger.setInitialValue(eventHelper.getInitialValue());
- }
- if (eventHelper.isSetPersistent()) {
- trigger.setPersistent(eventHelper.getPersistent());
- }
-
- if (eventHelper.isSetPriorityFunction()) {
- Priority priority = event.createPriority();
- try {
- priority.setMath(ASTNode.parseFormula(eventHelper
- .getPriorityFunction()));
- } catch (ParseException e) {
- e.printStackTrace();
- }
- addSBaseAttributes(priority, g, internHeadline);
- }
-
- if (eventHelper.isSetDelayFunction()) {
- Delay delay = event.createDelay();
- try {
- delay.setMath(ASTNode.parseFormula(eventHelper
- .getDelayFunction()));
- } catch (ParseException e) {
- e.printStackTrace();
- }
- addSBaseAttributes(delay, g, internHeadline);
- }
-
- String eventAssignmentVariable = "";
- int eventAssignmentCount = 1;
- // while(event.getNumEventAssignments() <= eventAssignmentCount){
- while (AttributeHelper.hasAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.VARIABLE).toString())) {
-
- SBMLEventAssignmentHelper eaHelper = eventHelper
- .addEventAssignment(g, internHeadline, eventAssignmentCount);
- if (eaHelper.isSetVariable()) {
- eventAssignmentVariable = eaHelper.getVariable();
- }
- if ((!SBML_Constants.EMPTY.equals(eventAssignmentVariable))
- && null != eventAssignmentVariable) {
- EventAssignment eventAssignment = event.createEventAssignment();
- addSBaseAttributes(eventAssignment, g, internHeadline);
-
- eventAssignment.setVariable(eventAssignmentVariable);
- if (eaHelper.isSetFunction()) {
- try {
- eventAssignment.setMath(ASTNode.parseFormula(eaHelper
- .getFunction()));
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
- }
- ++eventAssignmentCount;
- eventAssignmentVariable = "";
- }
- }
-
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_FunctionDefinition_Writer.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_FunctionDefinition_Writer.java
deleted file mode 100644
index 7d7a55f2d..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_FunctionDefinition_Writer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * This class writes function definitions
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml;
-
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.FunctionDefinition;
-import org.sbml.jsbml.Model;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLFunctionDefinition;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLFunctionDefinitionHelper;
-
-public class SBML_FunctionDefinition_Writer extends SBML_SBase_Writer {
-
- /**
- * Adds a function definition and its variables to the model
- *
- * @param model the function definition will be added to this model
- * @param g contains the values for the export
- * @param headline indicates where the information should be read from
- */
- public void addFunctionDefinition(Model model, Graph g, String internHeadline, SBMLFunctionDefinitionHelper
- functionDefinitionHelperObject) {
- SBMLFunctionDefinition functionDefinitionHelper = functionDefinitionHelperObject.addFunctionDefinition(g, internHeadline);
- FunctionDefinition functionDefinition = model.createFunctionDefinition();
- addSBaseAttributes(functionDefinition, g, internHeadline);
- if (functionDefinitionHelper.isSetID()) {
- functionDefinition.setId(functionDefinitionHelper.getID());
- }
- if (functionDefinitionHelper.isSetName()) {
- functionDefinition.setName(functionDefinitionHelper.getName());
- }
- if (functionDefinitionHelper.isSetFunction()) {
- functionDefinition.setMath(functionDefinitionHelper.getFunction());
- }
- /*
- * if(functionDefinitionHelper.isSetFunction()){
- * String formel = (String)getAttribute(g, internHeadline, SBML_Constants.FUNCTION_DEFINITION_FUNCTION);
- * try{
- * ASTNode h = ASTNode.parseFormula(formel);//"lambda("+formel+")");
- * //ASTNode math = (ASTNode)getAttribute(g, niceID, headline+ATT+"ASTNode Math");
- * //functionDefinition.setMath(math);
- * functionDefinition.setMath(h);
- * }catch(ParseException e){e.printStackTrace();}
- * }
- */
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_InitialAssignment_Writer.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_InitialAssignment_Writer.java
deleted file mode 100644
index c9eba7ec7..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_InitialAssignment_Writer.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * This class set the InitialAssignment attributes
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml;
-
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.ASTNode;
-import org.sbml.jsbml.InitialAssignment;
-import org.sbml.jsbml.Model;
-import org.sbml.jsbml.text.parser.ParseException;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLInitialAssignment;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLInitialAssignmentHelper;
-
-public class SBML_InitialAssignment_Writer extends SBML_SBase_Writer {
-
- /**
- * Adds an initial assignment and its variables to the model
- *
- * @param g contains the values for the export
- * @param model the initial assignments will be added to this model
- * @param headline indicates where the information should be read from
- * @param internHeadline intern representation of headline
- */
- public void addInitialAssignment(Graph g, Model model, String internHeadline, SBMLInitialAssignmentHelper iaHelperObject) {
- InitialAssignment initialAssignment = model.createInitialAssignment();
- SBMLInitialAssignment iaHelper = iaHelperObject.addInitialAssignment(g, internHeadline);
- addSBaseAttributes(initialAssignment, g, internHeadline);
- if (iaHelper.isSetSymbol()) {
- initialAssignment.setVariable(iaHelper.getSymbol());
- }
- if (iaHelper.isSetFunction()) {
- try {
- initialAssignment.setMath(ASTNode.parseFormula(iaHelper.getFunction()));
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Model_Writer.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Model_Writer.java
deleted file mode 100644
index 3999992d9..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Model_Writer.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * This class sets the attributes of Model
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml;
-
-import org.AttributeHelper;
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.Model;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_Model_Writer extends SBML_SBase_Writer {
-
- /**
- * Add attributes to the model. The ID has already been set when it exists
- *
- * @param model
- * has the attribute which will be set
- * @param g
- * contains the values for the export
- */
- public void addModel(Model model, Graph g) {
- addSBaseAttributes(model, g);
- // String id = (String)getAttribute(g, SBML_Constants.SBML_MODEL,
- // "SBML Model"+ATT+"ID");
- // if(id.length()>0)
- // model.setId(id);
-
- /*
- * if(AttributeHelper.hasAttribute(annotationNode, "SBML",
- * "modelannotation")){ Annotation anno =
- * (Annotation)AttributeHelper.getAttributeValue(annotationNode, "SBML",
- * "modelannotation", SBML_Constants.EMPTY, null);
- * model.setAnnotation(anno); }
- */
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_NAME)) {
- String name = (String) getAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_NAME);
- if (name.length() > 0)
- model.setName(name);
- }
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_ID)) {
- String id = (String) getAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_ID);
- if (id.length() > 0)
- model.setId(id);
- }
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.SUBSTANCE_UNITS)) {
- String substranceUnits = (String) getAttribute(g,
- SBML_Constants.SBML, SBML_Constants.SUBSTANCE_UNITS);
- if (substranceUnits.length() > 0)
- model.setSubstanceUnits(substranceUnits);
- }
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.TIME_UNITS)) {
- String timeUnits = (String) getAttribute(g, SBML_Constants.SBML,
- SBML_Constants.TIME_UNITS);
- if (timeUnits.length() > 0)
- model.setTimeUnits(timeUnits);
- }
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.VOLUME_UNITS)) {
- String volumeUnits = (String) getAttribute(g, SBML_Constants.SBML,
- SBML_Constants.VOLUME_UNITS);
- if (volumeUnits.length() > 0)
- model.setVolumeUnits(volumeUnits);
- }
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.AREA_UNITS)) {
- String areaUnits = (String) getAttribute(g, SBML_Constants.SBML,
- SBML_Constants.AREA_UNITS);
- if (areaUnits.length() > 0)
- model.setAreaUnits(areaUnits);
- }
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.LENGTH_UNITS)) {
- String lengthUnits = (String) getAttribute(g, SBML_Constants.SBML,
- SBML_Constants.LENGTH_UNITS);
- if (lengthUnits.length() > 0)
- model.setLengthUnits(lengthUnits);
- }
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.EXTENT_UNITS)) {
- String extentUnits = (String) getAttribute(g, SBML_Constants.SBML,
- SBML_Constants.EXTENT_UNITS);
- if (extentUnits.length() > 0)
- model.setExtentUnits(extentUnits);
- }
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.CONVERSION_FACTOR)) {
- String conversionFactor = (String) getAttribute(g,
- SBML_Constants.SBML, SBML_Constants.CONVERSION_FACTOR);
- if (conversionFactor.length() > 0)
- model.setConversionFactor(conversionFactor);
- }
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Parameter_Writer.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Parameter_Writer.java
deleted file mode 100644
index 25aaa7802..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Parameter_Writer.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * This class set the Parameter attributes
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml;
-
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.Model;
-import org.sbml.jsbml.Parameter;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLParameter;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLParameterHelper;
-
-public class SBML_Parameter_Writer extends SBML_SBase_Writer {
-
- /**
- * Adds a parameter and its variables to the model
- *
- * @param g contains the values for the export
- * @param model the parameters will be added to this model
- * @param headline indicates where the information should be read from
- * @param interHeadline intern representation of headline
- */
- public void addParameter(Graph g, Model model, String interHeadline, SBMLParameterHelper parameterHelperObject) {
- SBMLParameter parameterHelper = parameterHelperObject.addParameter(g, interHeadline);
- Parameter parameter = model.createParameter();
- addSBaseAttributes(parameter, g, interHeadline);
- if (parameterHelper.isSetID()) {
- String id = parameterHelper.getID();
- if (Parameter.isValidId(id, parameter.getLevel(), parameter.getVersion())) {
- parameter.setId(parameterHelper.getID());
- }
-
- }
- if (parameterHelper.isSetName()) {
- parameter.setName(parameterHelper.getName());
- }
- if (parameterHelper.isSetValue()) {
- parameter.setValue(parameterHelper.getValue());
- }
- if (parameterHelper.isSetUnits()) {
- parameter.setUnits(parameterHelper.getUnits());
- }
- if (parameterHelper.isSetConstant()) {
- parameter.setConstant(parameterHelper.getConstant());
- }
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Reaction_Writer.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Reaction_Writer.java
deleted file mode 100644
index 7187a3e8a..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Reaction_Writer.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/**
- * This class sets the attributes of Reactions
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.regex.Pattern;
-
-import org.AttributeHelper;
-import org.graffiti.graph.Edge;
-import org.graffiti.graph.Graph;
-import org.graffiti.graph.Node;
-import org.sbml.jsbml.ASTNode;
-import org.sbml.jsbml.KineticLaw;
-import org.sbml.jsbml.LocalParameter;
-import org.sbml.jsbml.Model;
-import org.sbml.jsbml.ModifierSpeciesReference;
-import org.sbml.jsbml.Reaction;
-import org.sbml.jsbml.SpeciesReference;
-import org.sbml.jsbml.text.parser.ParseException;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.KineticLawHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLLocalParameter;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLReactionHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_Reaction_Writer extends SBML_SBase_Writer {
-
- int localParameterCount = 1;
-
- /**
- * This method adds the reactions to a model
- *
- * @param g
- * contains the required data
- * @param model
- * the data will be added to this model
- */
- public void addReactions(Graph g, Model model) {
- Iterator itNodes = g.getNodesIterator();
- SBMLReactionHelper reactionHelper = new SBMLReactionHelper(g);
- while (itNodes.hasNext()) {
- Node node = (Node) itNodes.next();
- if (AttributeHelper.getSBMLrole(node).equals("reaction")) {
- Reaction reaction = model.createReaction();
-
- addSBaseAttributes(reaction, node);
-
- if (reactionHelper.isSetID(node)) {
- String id = reactionHelper.getID(node);
- if (Reaction.isValidId(id, reaction.getLevel(),
- reaction.getVersion())) {
- reaction.setId(reactionHelper.getID(node));
- }
- }
- if (reactionHelper.isSetName(node)) {
- reaction.setName(reactionHelper.getName(node));
- }
- if (reactionHelper.isSetReversible(node)) {
- System.out.println("Reaction: " + reactionHelper.getID(node));
- reaction.setReversible(reactionHelper.getReversible(node));
- }
- if (reactionHelper.isSetFast(node)) {
- reaction.setFast(reactionHelper.getFast(node));
- }
- if (reactionHelper.isSetCompartment(node)) {
- reaction.setCompartment(reactionHelper.getCompartment(node));
- }
-
- Iterator itEdges = node.getEdgesIterator();
- while (itEdges.hasNext()) {
- Edge edge = itEdges.next();
- if (AttributeHelper.getSBMLrole(edge).equals("reactant")) {
-
- SpeciesReference reactant = new SpeciesReference(
- model.getLevel(), model.getVersion());
- if (reactionHelper.isSetConstant(edge)) {
- reactant.setConstant(reactionHelper
- .getConstant(edge));
- }
- if (reactionHelper.isSetStoichiometry(edge)) {
- reactant.setStoichiometry(Double
- .parseDouble(reactionHelper
- .getStoichiometry(edge)));
- }
- if (reactionHelper.isSetID(edge)) {
- reactant.setId(reactionHelper.getID(edge));
- }
- if (reactionHelper.isSetName(edge)) {
- reactant.setName(reactionHelper.getName(edge));
- }
- if (reactionHelper.isSetSpecies(edge)) {
- reactant.setSpecies(reactionHelper.getSpecies(edge));
- }
-
- reaction.addReactant(reactant);
- addSBaseAttributes(reactant, edge, SBML_Constants.SBML);
- }
-
- if (AttributeHelper.getSBMLrole(edge).equals("product")) {
-
- SpeciesReference product = new SpeciesReference(
- model.getLevel(), model.getVersion());
- if (reactionHelper.isSetConstant(edge)) {
- product.setConstant(reactionHelper
- .getConstant(edge));
- }
- if (reactionHelper.isSetStoichiometry(edge)) {
- product.setStoichiometry(Double
- .parseDouble(reactionHelper
- .getStoichiometry(edge)));
- }
- if (reactionHelper.isSetID(edge)) {
- product.setId(reactionHelper.getID(edge));
- }
- if (reactionHelper.isSetName(edge)) {
- product.setName(reactionHelper.getName(edge));
- }
- if (reactionHelper.isSetSpecies(edge)) {
- String[] list = reactionHelper.getSpecies(edge)
- .split(Pattern.quote("/"));
- product.setSpecies(list[0].trim());
- }
-
- reaction.addProduct(product);
-
- addSBaseAttributes(product, edge, SBML_Constants.SBML);
- // productCount++;
- }
-
- if (AttributeHelper.getSBMLrole(edge).equals("modifier")) {
- ModifierSpeciesReference modifier = new ModifierSpeciesReference(
- model.getLevel(), model.getVersion());
-
- if (reactionHelper.isSetID(edge)) {
- modifier.setId(reactionHelper.getID(edge));
- }
- if (reactionHelper.isSetName(edge)) {
- modifier.setName(reactionHelper.getName(edge));
- }
- if (reactionHelper.isSetSpecies(edge)) {
- String[] list = reactionHelper.getSpecies(edge)
- .split(Pattern.quote("/"));
- modifier.setSpecies(list[0].trim());
- }
-
- reaction.addModifier(modifier);
-
- addSBaseAttributes(modifier, edge, SBML_Constants.SBML);
- }
- }
-
- ArrayList kineticLawList = headlineHelper(node,
- SBML_Constants.SBML_KINETIC_LAW);
- // kineticLawList has size 1 or 0
- if (kineticLawList.size() > 0) {
- KineticLaw kineticLaw = reaction.createKineticLaw();
- KineticLawHelper kineticLawHelper = new KineticLawHelper(g, reactionHelper.getReactionClones());
- addSBaseAttributes(kineticLaw, node);
-
- if (kineticLawHelper.isSetFunction(node)) {
- try {
- kineticLaw.setMath(ASTNode
- .parseFormula(kineticLawHelper
- .getFunction(node)));
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
-
- while (AttributeHelper.hasAttribute(
- node,
- SBML_Constants.SBML_KINETIC_LAW,
- new StringBuffer(SBML_Constants.LOCAL_PARAMETER)
- .append(localParameterCount)
- .append(SBML_Constants.LOCAL_PARAMETER_ID)
- .toString())) {
-
- LocalParameter localParameter = null;
- SBMLLocalParameter localParameterHelper = kineticLawHelper
- .addLocalParameter(g, localParameterCount);
- if (localParameterHelper.isSetID(node)) {
- localParameter = new LocalParameter(
- localParameterHelper.getID(node),
- model.getLevel(), model.getVersion());
- } else {
- localParameter = new LocalParameter();
- }
-
- if (localParameterHelper.isSetName(node)) {
- localParameter.setName(localParameterHelper
- .getName(node));
- }
- if (localParameterHelper.isSetValue(node)) {
- localParameter.setValue(localParameterHelper
- .getValue(node));
- }
- if (localParameterHelper.isSetUnits(node)) {
- localParameter.setUnits(localParameterHelper
- .getUnits(node));
- }
- kineticLaw.addLocalParameter(localParameter);
- addSBaseAttributes(localParameter, node);
-
- localParameterCount++;
- }
- localParameterCount = 1;
- }
- }
- }
- }
- // }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Rule_Writer.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Rule_Writer.java
deleted file mode 100644
index ab511bf18..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Rule_Writer.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/**
- * This class sets the attributes of Rule
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.ASTNode;
-import org.sbml.jsbml.AlgebraicRule;
-import org.sbml.jsbml.AssignmentRule;
-import org.sbml.jsbml.Model;
-import org.sbml.jsbml.RateRule;
-import org.sbml.jsbml.text.parser.ParseException;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLAlgebraicRule;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLAssignmentRule;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLRateRule;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLRuleHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_Rule_Writer extends SBML_SBase_Writer {
-
- /**
- * Controls the processing of rules
- *
- * @param g
- * contains the values for the export
- * @param model
- * the rules will be added to this model
- */
- public void addRules(Graph g, Model model) {
- SBMLRuleHelper ruleHelperObject = new SBMLRuleHelper();
- ArrayList assignmentRules = headlineHelper(g,
- SBML_Constants.SBML_ASSIGNMENT_RULE);
- if (assignmentRules.size() > 0) {
- Iterator itAssignmentRules = assignmentRules.iterator();
- int assignmentRuleCount = 1;
- while (itAssignmentRules.hasNext()) {
- String assignmentRuleHeadline = (String) itAssignmentRules
- .next();
- // String presentedHeadline = "SBML Assignment Rule " +
- // assignmentRuleCount;
- addAssignmentRule(g, model, assignmentRuleHeadline,
- ruleHelperObject);
- assignmentRuleCount++;
- }
- }
-
- ArrayList algebraicRules = headlineHelper(g,
- SBML_Constants.SBML_ALGEBRAIC_RULE);
- if (algebraicRules.size() > 0) {
- Iterator itAlgebraicRules = algebraicRules.iterator();
- int algebraicRuleCount = 1;
- while (itAlgebraicRules.hasNext()) {
- String algebraicRuleHeadline = (String) itAlgebraicRules.next();
- // String presentedHeadline = "SBML Algebraic Rule " +
- // algebraicRuleCount;
- addAlgebraicRule(g, model, algebraicRuleHeadline,
- ruleHelperObject);
- algebraicRuleCount++;
- }
- }
-
- ArrayList rateRules = headlineHelper(g,
- SBML_Constants.SBML_RATE_RULE);
- if (rateRules.size() > 0) {
- Iterator itRateRules = rateRules.iterator();
- int rateRuleCount = 1;
- while (itRateRules.hasNext()) {
- String rateRuleHeadline = (String) itRateRules.next();
- // String presentedHeadline = "SBML Rate Rule " + rateRuleCount;
- addRateRules(g, model, rateRuleHeadline, ruleHelperObject);
- rateRuleCount++;
- }
- }
- }
-
- /**
- * Adds an algebraic rule and its variables to the model
- *
- * @param g
- * contains the values for the export
- * @param model
- * the algebraic rule will be added to this model
- * @param headline
- * indicates where the information should be read from
- * @niceID intern representation of headline
- */
- private void addAlgebraicRule(Graph g, Model model, String internHeadline,
- SBMLRuleHelper ruleHelperObject) {
- SBMLAlgebraicRule algebraicRuleHelper = ruleHelperObject
- .addAlgebraicRule(g, internHeadline);
- AlgebraicRule algebraicRule = (AlgebraicRule) model
- .createAlgebraicRule();
- addSBaseAttributes(algebraicRule, g, internHeadline);
- if (algebraicRuleHelper.isSetFunction()) {
- try {
- algebraicRule.setMath(ASTNode.parseFormula(algebraicRuleHelper
- .getFunction()));
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
-
- /*
- * if(AttributeHelper.hasAttribute(annotationNode, "SBML",
- * "algebraic"+algebraicRuleCount+"annotation")){ Annotation anno =
- * (Annotation)AttributeHelper.getAttributeValue(annotationNode, "SBML",
- * "algebraic"+algebraicRuleCount+"annotation", SBML_Constants.EMPTY,
- * null); algebraicRule.setAnnotation(anno); }
- */
- }
-
- /**
- * Adds an assignment rule and its variables to the model
- *
- * @param g
- * contains the values for the export
- * @param model
- * the assignment rule will be added to this model
- * @param interHeadline
- * indicates where the information should be read from
- * @niceID intern representation of headline
- */
- private void addAssignmentRule(Graph g, Model model, String internHeadline,
- SBMLRuleHelper ruleHelperObject) {
- SBMLAssignmentRule assignmentRuleHelper = ruleHelperObject
- .addAssignmentRule(g, internHeadline);
- AssignmentRule assignmentRule = (AssignmentRule) model
- .createAssignmentRule();
- addSBaseAttributes(assignmentRule, g, internHeadline);
- if (assignmentRuleHelper.isSetVariable()) {
- assignmentRule.setVariable(assignmentRuleHelper.getVariable());
- }
- if (assignmentRuleHelper.isSetFunction()) {
- try {
- assignmentRule.setMath(ASTNode
- .parseFormula(assignmentRuleHelper.getFunction()));
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
-
- /*
- * if(AttributeHelper.hasAttribute(annotationNode, "SBML",
- * "assignmet"+assignmentRuleCount+"annotation")){ Annotation anno =
- * (Annotation)AttributeHelper.getAttributeValue(annotationNode, "SBML",
- * "assignmet"+assignmentRuleCount+"annotation", SBML_Constants.EMPTY,
- * null); assignmentRule.setAnnotation(anno); }
- */
-
- }
-
- /**
- * Adds a rate rule and its variables to the model
- *
- * @param g
- * contains the values for the export
- * @param model
- * the rate rule will be added to this model
- * @param internHeadline
- * indicates where the information should be read from
- * @niceID intern representation of headline
- */
- private void addRateRules(Graph g, Model model, String internHeadline,
- SBMLRuleHelper ruleHelperObject) {
- SBMLRateRule rateRuleHelper = ruleHelperObject.addRateRule(g,
- internHeadline);
- RateRule rateRule = (RateRule) model.createRateRule();
- addSBaseAttributes(rateRule, g, internHeadline);
- if (rateRuleHelper.isSetVariable()) {
- rateRule.setVariable(rateRuleHelper.getVariable());
- }
- if (rateRuleHelper.isSetFunction()) {
- try {
- rateRule.setMath(ASTNode.parseFormula(rateRuleHelper
- .getFunction()));
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
-
- /*
- * if(AttributeHelper.hasAttribute(annotationNode, "SBML",
- * "rate"+RateRuleCount+"annotation")){ Annotation anno =
- * (Annotation)AttributeHelper.getAttributeValue(annotationNode, "SBML",
- * "rate"+RateRuleCount+"annotation", SBML_Constants.EMPTY, null);
- * rateRule.setAnnotation(anno); }
- */
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_SBML_Writer.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_SBML_Writer.java
deleted file mode 100644
index fb7af8e72..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_SBML_Writer.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/**
- * This class sets the attributes of SBML
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.swing.JOptionPane;
-import javax.xml.stream.XMLStreamException;
-
-import org.AttributeHelper;
-import org.ErrorMsg;
-import org.graffiti.graph.Graph;
-import org.graffiti.graph.Node;
-import org.sbml.jsbml.Model;
-import org.sbml.jsbml.SBMLDocument;
-import org.sbml.jsbml.SBMLErrorLog;
-import org.sbml.jsbml.SBMLException;
-import org.sbml.jsbml.SBMLWriter;
-import org.sbml.jsbml.ext.layout.ExtendedLayoutModel;
-import org.sbml.jsbml.ext.layout.Layout;
-import org.sbml.jsbml.validator.SBMLValidator.CHECK_CATEGORY;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLCompartmentHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLConstraintHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLFunctionDefinitionHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLInitialAssignmentHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLParameterHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLSpeciesHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_XML_ReaderWriterPlugin;
-@SuppressWarnings("unused")
-public class SBML_SBML_Writer extends SBML_SBase_Writer {
- private Model _model;
-
- /**
- * Processes the reading in an model
- *
- * @param stream
- * the data will be written into this stream
- * @param g
- * contains the data
- */
- public void addSBML(OutputStream stream, Graph g) {
- SBML_Constants.init();
- PrintStream ps = null;
- try {
- ps = new PrintStream(stream, false, "iso-8859-1");
- } catch (UnsupportedEncodingException e1) {
- e1.printStackTrace();
- }
- SBMLWriter writer = new SBMLWriter();
- int level = 0;
- int version = 1;
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.LEVEL)) {
- level = (Integer) AttributeHelper.getAttributeValue(g,
- SBML_Constants.SBML, SBML_Constants.LEVEL, null, null);
- }
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.VERSION)) {
- version = (Integer) getAttribute(g, SBML_Constants.SBML,
- SBML_Constants.VERSION);
- }
- // L3V1 is the current spec
- if (level < 3) {
- level = 3;
- version = 1;
- }
- SBMLDocument doc = new SBMLDocument(level, version);
- addSBaseAttributes(doc, g);
-
- _model = null;
-
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_ID)) {
- _model = doc.createModel((String) getAttribute(g,
- SBML_Constants.SBML, SBML_Constants.MODEL_ID));
- } else {
- _model = doc.createModel();
- }
-
- SBML_Model_Writer writeModel = new SBML_Model_Writer();
- writeModel.addModel(_model, g);
-
- ArrayList functionDefinitions = headlineHelper(g,
- SBML_Constants.SBML_FUNCTION_DEFINITION);
- if (functionDefinitions.size() > 0) {
- Iterator itFunctionDefinitions = functionDefinitions
- .iterator();
- int i = 1;
- SBMLFunctionDefinitionHelper functionDefinitionHelper = new SBMLFunctionDefinitionHelper();
- while (itFunctionDefinitions.hasNext()) {
- String functionDefinitionHeadline = (String) itFunctionDefinitions
- .next();
- SBML_FunctionDefinition_Writer writeFunctionDefinition = new SBML_FunctionDefinition_Writer();
- writeFunctionDefinition.addFunctionDefinition(_model, g,
- functionDefinitionHeadline, functionDefinitionHelper);
- i++;
- }
- }
-
- ArrayList unitDefinitions = headlineHelper(g,
- SBML_Constants.SBML_UNIT_DEFINITION);
- if (unitDefinitions.size() > 0) {
- Iterator itUnitDefinition = unitDefinitions.iterator();
- int i = 1;
- while (itUnitDefinition.hasNext()) {
- String unitDefinition = (String) itUnitDefinition.next();
- // String presentedHeadline = "SBML Unit Definition "+i;
- // SBML_Constants.put(ATT+unitDefinition, presentedHeadline);
- SBML_UnitDefinition_Writer writeUnitDefinition = new SBML_UnitDefinition_Writer();
- writeUnitDefinition.addUnitDefinition(_model, g, unitDefinition);
- i++;
- }
- }
-
- ArrayList compartments = headlineHelper(g,
- SBML_Constants.SBML_COMPARTMENT);
- if (compartments.size() > 0) {
- SBMLCompartmentHelper compartmentHelperObject = new SBMLCompartmentHelper();
- Iterator itCompartments = compartments.iterator();
- int i = 1;
- while (itCompartments.hasNext()) {
- String compartmentHeadline = itCompartments.next();
- SBML_Compartment_Writer writeCompartmentDefinition = new SBML_Compartment_Writer();
- writeCompartmentDefinition.addCompartment(_model, g,
- compartmentHeadline, compartmentHelperObject);
- i++;
- }
- }
-
- SBML_Species_Writer writeSpeciesDefinition = new SBML_Species_Writer();
- writeSpeciesDefinition.addSpecies(_model, g);
- createExtendedLayoutModel(g);
- writeSpeciesDefinition.addSpeciesGlyph(_model, g);
-
- ArrayList parameters = headlineHelper(g,
- SBML_Constants.SBML_PARAMETER);
- if (parameters.size() > 0) {
- Iterator itParameters = parameters.iterator();
- int i = 1;
- SBMLParameterHelper parameterHelperObject = new SBMLParameterHelper();
- while (itParameters.hasNext()) {
- String parameterHeadline = itParameters.next();
- // String presentedHeadline = "SBML Parameter "+i;
- SBML_Parameter_Writer writeParameter = new SBML_Parameter_Writer();
- writeParameter.addParameter(g, _model, parameterHeadline,
- parameterHelperObject);
- i++;
- }
- }
-
- ArrayList initialAssignments = headlineHelper(g,
- SBML_Constants.SBML_INITIAL_ASSIGNMENT);
- if (initialAssignments.size() > 0) {
- Iterator itInitialAssignments = initialAssignments
- .iterator();
- int i = 1;
- SBMLInitialAssignmentHelper iaHelperObject = new SBMLInitialAssignmentHelper();
- while (itInitialAssignments.hasNext()) {
- String initialAssignmentHeadline = (String) itInitialAssignments
- .next();
- // String presentedHeadline = "SBML Initial Assignment " + i;
- SBML_InitialAssignment_Writer writeInitialAssignment = new SBML_InitialAssignment_Writer();
- writeInitialAssignment.addInitialAssignment(g, _model,
- initialAssignmentHeadline, iaHelperObject);
- i++;
- }
- }
-
- SBML_Rule_Writer writeRuleDefinition = new SBML_Rule_Writer();
- writeRuleDefinition.addRules(g, _model);
-
- ArrayList constraints = headlineHelper(g,
- SBML_Constants.SBML_CONSTRAINT);
- if (constraints.size() > 0) {
- Iterator itConstraints = constraints.iterator();
- SBMLConstraintHelper constraintHelperObject = new SBMLConstraintHelper();
- int i = 1;
- while (itConstraints.hasNext()) {
- String constraintHeadline = (String) itConstraints.next();
- // String presentedHeadline = "SBML Constraint " + i;
- SBML_Constraint_Writer writeConstraint = new SBML_Constraint_Writer();
- writeConstraint.addConstraint(g, _model, constraintHeadline,
- constraintHelperObject);
- i++;
- }
- }
-
- SBML_Reaction_Writer writeReaction = new SBML_Reaction_Writer();
- writeReaction.addReactions(g, _model);
-
- ArrayList events = headlineHelper(g, SBML_Constants.SBML_EVENT);
- if (events.size() > 0) {
- Iterator itEvents = events.iterator();
- int i = 1;
- while (itEvents.hasNext()) {
- String eventHeadline = (String) itEvents.next();
- // String presentedHeadline = "SBML Event " + i;
- SBML_Event_Writer writeEvent = new SBML_Event_Writer();
- writeEvent.addEvent(g, _model, eventHeadline);
- i++;
- }
- }
-
- int eventCount = _model.getNumEvents();
-
- boolean write = false;
- try {
- URL url = new URL("http://sbml.org/Facilities/Validator/");
- URLConnection connection = url.openConnection();
- InputStream is = null;
- try {
- is = connection.getInputStream();
- } catch (Exception e) {
- ErrorMsg.addErrorMessage("No internet connection. Can not validate document.");
- /*
- * JOptionPane .showMessageDialog(null,
- * "No internet connection. Can not validate document before saving."
- * );
- */
- write = true;
- }
- if (null != is) {
- int validate = 1;
- if (!SBML_XML_ReaderWriterPlugin.isTestintMode)
- validate = JOptionPane
- .showConfirmDialog(
- null,
- "Do you want to validate the SBML file against the Level 3 Version 1 specification?");
- if (validate == 0) {
-
- doc.setConsistencyChecks(
- CHECK_CATEGORY.GENERAL_CONSISTENCY, true);
- doc.setConsistencyChecks(
- CHECK_CATEGORY.IDENTIFIER_CONSISTENCY, true);
- doc.setConsistencyChecks(CHECK_CATEGORY.UNITS_CONSISTENCY,
- true);
- doc.setConsistencyChecks(CHECK_CATEGORY.MATHML_CONSISTENCY,
- true);
- doc.setConsistencyChecks(CHECK_CATEGORY.MODELING_PRACTICE,
- true);
- doc.setConsistencyChecks(CHECK_CATEGORY.SBO_CONSISTENCY,
- true);
- doc.setConsistencyChecks(
- CHECK_CATEGORY.OVERDETERMINED_MODEL, true);
-
- int numberOfErrors = doc.checkConsistency();
- if (numberOfErrors > 0) {
- SBMLErrorLog errorLog = doc.getListOfErrors();
- for (int i = 0; i < numberOfErrors; i++) {
- ErrorMsg.addErrorMessage(errorLog.getError(i));
- }
- }
- if (numberOfErrors > 0) {
- int load = JOptionPane
- .showConfirmDialog(null,
- "The online validator detected mistakes in the file. Save anyway?");
- if (load == 0) {
- write = true;
- }
- }
- if (numberOfErrors == 0) {
- write = true;
- }
- }
- if (validate == 1) {
- write = true;
- }
- } else {
- write = true;
- JOptionPane.showMessageDialog(null,
- "Online validation not possible.");
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- try {
- writer.write(doc, ps);
- } catch (XMLStreamException e) {
- e.printStackTrace();
- } catch (SBMLException e) {
- e.printStackTrace();
- }
- ps.flush();
- ps.close();
- }
-
- private void createExtendedLayoutModel(Graph g) {
- ExtendedLayoutModel extendedLayoutModel = new ExtendedLayoutModel(_model);
- _model.addExtension(SBMLHelper.SBML_LAYOUT_EXTENSION_NAMESPACE, extendedLayoutModel);
- SBMLSpeciesHelper speciesHelper = new SBMLSpeciesHelper(g);
- List nodeList = speciesHelper.getSpeciesNodes();
- Iterator itSpeicesNodes = nodeList.iterator();
- Set allLayoutIDs = new HashSet();
- while (itSpeicesNodes.hasNext()) {
- Node speicesNode = itSpeicesNodes.next();
- String layoutID = (String) AttributeHelper.getAttributeValue(speicesNode, SBML_Constants.SBML, SBML_Constants.SBML_LAYOUT_ID, null, null);
- if (allLayoutIDs.add(layoutID)) {
- Layout layout = extendedLayoutModel.createLayout();
- layout.setId(layoutID);
- System.out.println("in create extended layout model: " + layoutID);
- }
- }
-
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_SBase_Writer.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_SBase_Writer.java
deleted file mode 100644
index 9ed394f17..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_SBase_Writer.java
+++ /dev/null
@@ -1,1229 +0,0 @@
-/**
- * This class writes the SBase Attributes
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import org.AttributeHelper;
-import org.graffiti.attributes.Attribute;
-import org.graffiti.graph.Edge;
-import org.graffiti.graph.Graph;
-import org.graffiti.graph.GraphElement;
-import org.graffiti.graph.Node;
-import org.sbml.jsbml.AbstractSBase;
-import org.sbml.jsbml.Annotation;
-import org.sbml.jsbml.Compartment;
-import org.sbml.jsbml.Constraint;
-import org.sbml.jsbml.Delay;
-import org.sbml.jsbml.Event;
-import org.sbml.jsbml.EventAssignment;
-import org.sbml.jsbml.FunctionDefinition;
-import org.sbml.jsbml.InitialAssignment;
-import org.sbml.jsbml.KineticLaw;
-import org.sbml.jsbml.LocalParameter;
-import org.sbml.jsbml.Model;
-import org.sbml.jsbml.Parameter;
-import org.sbml.jsbml.Priority;
-import org.sbml.jsbml.Reaction;
-import org.sbml.jsbml.Rule;
-import org.sbml.jsbml.SBMLDocument;
-import org.sbml.jsbml.SimpleSpeciesReference;
-import org.sbml.jsbml.Species;
-import org.sbml.jsbml.Unit;
-import org.sbml.jsbml.UnitDefinition;
-import org.sbml.jsbml.xml.XMLNode;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_SBase_Writer {
-
- /**
- * Saves the number of the current Unit
- */
- int sBaseAttributeUnitCount = 1;
-
- /**
- * Saves the number of the current EventAssignment
- */
- int SBaseAttributeFromEACount = 1;
-
- /**
- * Saves the number of the current local parameter
- */
- private int localParameterCount = 1;
-
- /**
- * To make the code shorter
- */
- public final String ATT = AttributeHelper.attributeSeparator;
-
- private HashMap nameSpaceCollector = new HashMap();
-
- /**
- * This Method helps processing the attributes with a variable headline
- * inherited by SBase
- *
- * @param sbase
- * has the attribute which will be set
- * @param g
- * contains the values for the export
- * @param headline
- * indicates where the information should be read from
- * @param intern
- * representation of headline
- */
- public void addSBaseAttributes(AbstractSBase sbase, Graph g, String niceID) {
- if (sbase instanceof org.sbml.jsbml.Priority) {
- addSBaseAttributeFromPriority((Priority) sbase, g, niceID);
- }
- if (sbase instanceof org.sbml.jsbml.Delay) {
- addSBaseAttributeFromDelay((Delay) sbase, g, niceID);
- }
- if (sbase instanceof org.sbml.jsbml.EventAssignment) {
- addSBaseAttributeFromEventAssignment((EventAssignment) sbase, g,
- niceID);
- }
- if (sbase instanceof org.sbml.jsbml.Unit) {
- addSBaseAttributeFromUnit((Unit) sbase, g, niceID);
- }
- if (sbase instanceof org.sbml.jsbml.FunctionDefinition) {
- addSBaseAttributesFromFunctionDefinition(
- (FunctionDefinition) sbase, g, niceID);
- }
- if (sbase instanceof org.sbml.jsbml.UnitDefinition) {
- addSBaseAttributesFromUnitDefinition((UnitDefinition) sbase, g,
- niceID);
- }
- if (sbase instanceof org.sbml.jsbml.Compartment) {
- addSBaseAttributesFromCompartment((Compartment) sbase, g, niceID);
- }
- if (sbase instanceof org.sbml.jsbml.Parameter) {
- addSBaseAttributesFromParameter((Parameter) sbase, g, niceID);
- }
- if (sbase instanceof org.sbml.jsbml.InitialAssignment) {
- addSBaseAttributesFromInitialAssignmnet((InitialAssignment) sbase,
- g, niceID);
- }
- if (sbase instanceof org.sbml.jsbml.Rule) {
- addSBaseAttributesFromRule((Rule) sbase, g, niceID);
- }
- if (sbase instanceof org.sbml.jsbml.Constraint) {
- addSBaseAttributesFromConstraint((Constraint) sbase, g, niceID);
- }
- if (sbase instanceof org.sbml.jsbml.Event) {
- addSBaseAttributesFromEvent((Event) sbase, g, niceID);
- }
- }
-
- public void addSBaseAttributes(AbstractSBase sbase, Graph g) {
- if (sbase instanceof SBMLDocument) {
- // Processing the name spaces
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.NAMESPACE)) {
- String globalNamespaces = (String) getAttribute(g,
- SBML_Constants.SBML, SBML_Constants.NAMESPACE);
- if (!SBML_Constants.EMPTY.equals(globalNamespaces)) {
- String[] globalNamespacesArr = globalNamespaces.split(" ");
- String namespaceName;
- String prefix = SBML_Constants.EMPTY;
- String uri;
- String postfix = null;
- for (int i = 0; i < globalNamespacesArr.length; i++) {
- if (globalNamespacesArr[i].contains(":")) {
- prefix = globalNamespacesArr[i].split(":")[0];
- if (prefix.equals("xmlns")) {
- prefix = SBML_Constants.EMPTY;
- }
- postfix = globalNamespacesArr[i].split(":")[1];
- }
- if (null == postfix) {
- postfix = globalNamespacesArr[i];
- }
- uri = globalNamespacesArr[i].split("=")[1].replaceAll(
- "\"", SBML_Constants.EMPTY);
- namespaceName = globalNamespacesArr[i].split("=")[0];
- ((SBMLDocument) sbase).addNamespace(namespaceName,
- prefix, uri);
- nameSpaceCollector.put(prefix + ":" + namespaceName,
- uri);
- }
- }
- }
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.SBML_NOTES)) {
- XMLNode notes = (XMLNode) getAttribute(g, SBML_Constants.SBML,
- SBML_Constants.SBML_NOTES);
- if (!SBML_Constants.EMPTY.equals(notes)) {
- sbase.setNotes(notes);
- }
- }
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.SBML_META_ID)) {
- String metaid = (String) getAttribute(g, SBML_Constants.SBML,
- SBML_Constants.SBML_META_ID);
- if (!SBML_Constants.EMPTY.equals(metaid)) {
- sbase.setMetaId(metaid);
- }
- }
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.SBML_SBOTERM)) {
- String sboterm = (String) getAttribute(g, SBML_Constants.SBML,
- SBML_Constants.SBML_SBOTERM);
- if (!SBML_Constants.EMPTY.equals(sboterm)) {
- sbase.setSBOTerm(sboterm);
- }
- }
- addAnnotation(sbase, g, null, SBML_Constants.SBML,
- SBML_Constants.SBML_ANNOTATION,
- SBML_Constants.SBML_NON_RDF_ANNOTATION, true);
- }
- if (sbase instanceof Model) {
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_NOTES)) {
- XMLNode notes = (XMLNode) getAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_NOTES);
- if (!SBML_Constants.EMPTY.equals(notes)) {
- sbase.setNotes(notes);
- }
- }
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_META_ID)) {
- String metaid = (String) getAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_META_ID);
- if (!SBML_Constants.EMPTY.equals(metaid)) {
- sbase.setMetaId(metaid);
- }
- }
- if (AttributeHelper.hasAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_SBOTERM)) {
- String sboterm = (String) getAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_SBOTERM);
- if (!SBML_Constants.EMPTY.equals(sboterm)) {
- sbase.setSBOTerm(sboterm);
- }
- }
- addAnnotation(sbase, g, null, SBML_Constants.SBML,
- SBML_Constants.MODEL_ANNOTATION,
- SBML_Constants.MODEL_NON_RDF_ANNOTATION, true);
- }
- }
-
- // gIsSet is true if g is used und not element
- private void addAnnotation(AbstractSBase sbase, Graph g,
- GraphElement element, String headline, String rdfAttributeName,
- String nonRDFAttributeName, Boolean gIsSet) {
- if (gIsSet) {
- Annotation annotation = null;
- if (AttributeHelper.hasAttribute(g, headline, rdfAttributeName)) {
- annotation = (Annotation) getAttribute(g, headline,
- rdfAttributeName);
-
- }
- if (AttributeHelper.hasAttribute(g, headline, nonRDFAttributeName)) {
- if (annotation == null) {
- annotation = new Annotation();
- }
- annotation.appendNoRDFAnnotation((String) getAttribute(g,
- headline, nonRDFAttributeName));
- Map namespaces = sbase.getSBMLDocument()
- .getSBMLDocumentNamespaces();
- Set> namespacesEntrySet = namespaces
- .entrySet();
- for (Entry entry : namespacesEntrySet) {
- String key = entry.getKey();
- String prefix = "xmlns";
- String namespaceName = SBML_Constants.EMPTY;
- if (key.contains(":")) {
- prefix = key.split(":")[0];
- namespaceName = key.split(":")[1];
- } else {
- namespaceName = key;
- }
- if (annotation.getNonRDFannotation().contains(
- "<" + namespaceName + ":")) {
- annotation.addAnnotationNamespace(namespaceName,
- prefix, entry.getValue());
- }
- }
- }
- if (null != annotation) {
- if (annotation.isSetNonRDFannotation()) {
- if (annotation.getNonRDFannotation().contains(" namespaces;
- if (!(sbase instanceof SBMLDocument)
- && (!(sbase instanceof SimpleSpeciesReference))) {
- namespaces = sbase.getSBMLDocument()
- .getSBMLDocumentNamespaces();
-
- } else
- if (sbase instanceof SimpleSpeciesReference) {
- namespaces = nameSpaceCollector;
- } else {
- namespaces = ((SBMLDocument) sbase)
- .getSBMLDocumentNamespaces();
- }
- if (null != namespaces) {
- Set> namespacesEntrySet = namespaces
- .entrySet();
- for (Entry entry : namespacesEntrySet) {
- String key = entry.getKey();
- String prefix = "xmlns";
- String namespaceName = SBML_Constants.EMPTY;
- if (key.contains(":")) {
- prefix = key.split(":")[0];
- namespaceName = key.split(":")[1];
- } else {
- namespaceName = key;
- }
- if (annotation.getNonRDFannotation().contains(
- "<" + namespaceName + ":")) {
- annotation.addAnnotationNamespace(namespaceName,
- prefix, entry.getValue());
- }
- }
- }
- if (null != annotation) {
- if (annotation.getNonRDFannotation().contains(" headlineHelper(Graph g, String pattern) {
- Map rr = g.getAttributes().getCollection();
- if (rr != null) {
- Set> entries = rr.entrySet();
- Iterator> itEntries = entries.iterator();
- ArrayList result = new ArrayList();
- while (itEntries.hasNext()) {
- Map.Entry entry = (Map.Entry) itEntries
- .next();
- if (entry.getKey().startsWith(pattern)) {
- result.add(entry.getKey());
- }
- }
- return result;
- } else
- return new ArrayList();
- }
-
- /**
- * Method returns all headlines in the node tab which begin with a certain
- * pattern
- *
- * @param g
- * contains the values for the export
- * @param pattern
- * is the headline to be found
- * @return all headlines with the required beginning
- */
- public ArrayList headlineHelper(Node n, String pattern) {
- Map rr = n.getAttributes().getCollection();
- if (rr != null) {
- Set> entries = rr.entrySet();
- Iterator> itEntries = entries.iterator();
- ArrayList result = new ArrayList();
- while (itEntries.hasNext()) {
- Map.Entry entry = (Map.Entry) itEntries
- .next();
- if (entry.getKey().startsWith(pattern)) {
- result.add(entry.getKey());
- }
- }
- return result;
- } else
- return new ArrayList();
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Species_Writer.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Species_Writer.java
deleted file mode 100644
index 363a093f3..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_Species_Writer.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * This class writes the Species object
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.AttributeHelper;
-import org.ErrorMsg;
-import org.graffiti.graph.Graph;
-import org.graffiti.graph.Node;
-import org.sbml.jsbml.Model;
-import org.sbml.jsbml.Species;
-import org.sbml.jsbml.ext.layout.ExtendedLayoutModel;
-import org.sbml.jsbml.ext.layout.Layout;
-import org.sbml.jsbml.ext.layout.SpeciesGlyph;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLSpeciesHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_Species_Writer extends SBML_SBase_Writer {
-
- /**
- * Provides helpful methods
- */
- SBMLSpeciesHelper speciesHelper;
-
- /**
- * Adds a species and its variables to the model
- *
- * @param g
- * contains the values for the export
- * @param model
- * the species will be added to this model
- */
- public void addSpecies(Model model, Graph g) {
- speciesHelper = new SBMLSpeciesHelper(g);
- List nodeList = speciesHelper.getSpeciesNodes();
- Iterator nodeIt = nodeList.iterator();
- Set speciesIds = new HashSet();
- while (nodeIt.hasNext()) {
- Node speciesNode = nodeIt.next();
- Species species = model.createSpecies();
- if (speciesHelper.isSetID(speciesNode)) {
- String id = speciesHelper.getID(speciesNode);
- if (!speciesIds.contains(id)) {
- addSBaseAttributes(species, speciesNode);
- speciesIds.add(id);
- if (Species.isValidId(id, species.getLevel(),
- species.getVersion()))
- {
- species.setId(id);
- }
-
- if (speciesHelper.isSetName(speciesNode)) {
- species.setName(speciesHelper.getName(speciesNode));
- }
- if (speciesHelper.isSetCompartment(speciesNode)) {
- species.setCompartment(speciesHelper
- .getCompartment(speciesNode));
- }
- if (speciesHelper.isSetInitialAmount(speciesNode)) {
- species.setInitialAmount(speciesHelper
- .getInitialAmount(speciesNode));
- }
- if (speciesHelper.isSetInitialConcentration(speciesNode)) {
- species.setInitialConcentration(speciesHelper
- .getInitialConcentration(speciesNode));
- }
- if (speciesHelper.isSetSubstanceUnits(speciesNode)) {
- species.setSubstanceUnits(speciesHelper
- .getSubstanceUnits(speciesNode));
- }
- if (speciesHelper.isSetHasOnlySubstanceUnits(speciesNode)) {
- species.setHasOnlySubstanceUnits(speciesHelper
- .getHasOnlySubstanceUnits(speciesNode));
- }
- if (speciesHelper.isSetBoundaryCondition(speciesNode)) {
- species.setBoundaryCondition(speciesHelper
- .getBoundaryCondition(speciesNode));
- }
- if (speciesHelper.isSetConstant(speciesNode)) {
- species.setConstant(speciesHelper.getConstant(speciesNode));
- }
- if (speciesHelper.isSetConversionFactor(speciesNode)) {
- species.setConversionFactor(speciesHelper
- .getConversionFactor(speciesNode));
- }
- }
- }
- /*
- * if(AttributeHelper.hasAttribute(annotationNode, "SBML", "species"
- * +species.getId()+"annotation")){ Annotation anno =
- * (Annotation)AttributeHelper.getAttributeValue(annotationNode,
- * "SBML", "species" +species.getId()+"annotation",
- * SBML_Constants.EMPTY, null); species.setAnnotation(anno); }
- */
- }
- }
-
- public void addSpeciesGlyph(Model model, Graph g) {
- speciesHelper = new SBMLSpeciesHelper(g);
- List nodeList = speciesHelper.getSpeciesNodes();
- Iterator nodeIt = nodeList.iterator();
- ExtendedLayoutModel layoutModel = (ExtendedLayoutModel) model.getExtension(SBMLHelper.SBML_LAYOUT_EXTENSION_NAMESPACE);
- if(layoutModel == null)
- return;
- while (nodeIt.hasNext()) {
- Node node = nodeIt.next();
- String layoutID = (String) AttributeHelper.getAttributeValue(node, SBML_Constants.SBML, SBML_Constants.SBML_LAYOUT_ID, null, null);
- for (Layout layout : layoutModel.getListOfLayouts()) {
- if (layoutID != null && layoutID.equals(layout.getId())) {
- System.out.println("layout id in addSpeciesGlyph: " + layout.getId());
- if (speciesHelper.isSetID(node)) {
- String speciesID = speciesHelper.getID(node);
- double x = AttributeHelper.getPositionX(node);
- double y = AttributeHelper.getPositionY(node);
- double width = AttributeHelper.getWidth(node);
- double height = AttributeHelper.getHeight(node);
- SpeciesGlyph speciesGlyph = layout.createSpeciesGlyph(speciesID);
- speciesGlyph.createBoundingBox(width, height, 1, x, y, 0);
- } else {
- ErrorMsg
- .addErrorMessage("Species id must be set! The Node will not be exported to the SBML-Layout-Model.");
- }
- }
- }
- }
- }
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_UnitDefinition_Writer.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_UnitDefinition_Writer.java
deleted file mode 100644
index 96b6b693b..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_UnitDefinition_Writer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * This class writes the SBase attributes of UnitDefinition
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml;
-
-import java.util.regex.Pattern;
-
-import org.AttributeHelper;
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.Model;
-import org.sbml.jsbml.Unit;
-import org.sbml.jsbml.Unit.Kind;
-import org.sbml.jsbml.UnitDefinition;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_UnitDefinition_Writer extends SBML_SBase_Writer{
-
- /**
- * Adds an unit definition and its variables to the model
- * @param model the unit definition will be added to this model
- * @param g contains the values for the export
- * @param headline indicates where the information should be read from
- * @param intern representation of headline
- */
- public void addUnitDefinition(Model model, Graph g, String niceID) {
- UnitDefinition unitDefinition = model.createUnitDefinition();
- addSBaseAttributes(unitDefinition, g, niceID);
- if(AttributeHelper.hasAttribute(g, niceID, new StringBuffer(niceID).append(SBML_Constants.UNIT_DEFINITION_ID).toString())){
- String id = (String) getAttribute(g, niceID,new StringBuffer(niceID).append(SBML_Constants.UNIT_DEFINITION_ID).toString());
- if (!SBML_Constants.EMPTY.equals(id) && UnitDefinition.isValidId(id, unitDefinition.getLevel(), unitDefinition.getVersion())) {
- unitDefinition.setId(id);
- }
- }
- if(AttributeHelper.hasAttribute(g, niceID,new StringBuffer(niceID).append(SBML_Constants.UNIT_DEFINITION_NAME).toString())){
- String name = (String) getAttribute(g, niceID,new StringBuffer(niceID).append(SBML_Constants.UNIT_DEFINITION_NAME).toString());
- if (!SBML_Constants.EMPTY.equals(name)) {
- unitDefinition.setName(name);
- }
- }
-
-
- String subUnit = "";
- int unitCount = 1;
- Unit unit = null;
- while (AttributeHelper.hasAttribute(g, niceID, new StringBuffer(niceID).append(SBML_Constants.SUB_UNIT).
- append(unitCount).append(SBML_Constants.UNDERLINE).toString())){
- subUnit = (String) getAttribute(g, niceID,new StringBuffer(niceID).append(SBML_Constants.SUB_UNIT).
- append(unitCount).append(SBML_Constants.UNDERLINE).toString());
- unit = unitDefinition.createUnit();
- addSBaseAttributes(unit, g, niceID);
- String[] subUnitArray = subUnit.split(Pattern.quote(")"));
- String exponent = subUnitArray[1].replace("^", "");
- String[] subUnitArray2 = subUnitArray[0].split("\\*");
- String multiplier = subUnitArray2[0].replace("(", "");
- String[] subUnitArray3 = subUnitArray2[1].split("\\^");
- String scale = subUnitArray3[1];
- String kind = subUnitArray2[2];
- unit.setExponent(Double.parseDouble(exponent.trim()));
- unit.setMultiplier(Double.parseDouble(multiplier.trim()));
- unit.setScale(Integer.parseInt(scale.trim()));
- unit.setKind(Kind.valueOf(kind.trim().toUpperCase()));
- ++unitCount;
- subUnit = "";
- }
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_XML_Writer.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_XML_Writer.java
deleted file mode 100644
index edb1b5072..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_XML_Writer.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003-2007 Network Analysis Group, IPK Gatersleben
- *******************************************************************************/
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-
-import org.graffiti.graph.Graph;
-import org.graffiti.plugin.io.AbstractOutputSerializer;
-import org.graffiti.plugin.io.OutputSerializer;
-import org.graffiti.plugin.io.SupportsWriterOutput;
-
-public class SBML_XML_Writer extends AbstractOutputSerializer implements OutputSerializer, SupportsWriterOutput {
-
- /**
- * Constructor
- */
- public SBML_XML_Writer() {
- super();
- }
-
- /**
- * Implemented method of interface InputSerializer.java
- */
- public void write(Writer writer, Graph g) {
- }
-
- /**
- * Return the file extension that can be read in.
- * Implemented method of interface InputSerializer.java
- */
- public String[] getExtensions() {
- return new String[] { ".sbml" };
- }
-
- /**
- * returns the file type description.
- * Implemented method of interface InputSerializer.java
- */
- public String[] getFileTypeDescriptions() {
- return new String[] { "SBML" };
- }
-
- /**
- * starts the reading in of the model
- *
- * @param stream
- * contains the model
- * @param g
- * the data will be read into this data structure
- */
- public void write(OutputStream stream, Graph g) throws IOException {
- SBML_SBML_Writer writeSBML = new SBML_SBML_Writer();
- writeSBML.addSBML(stream, g);
- }
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_XML_WriterPlugin.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_XML_WriterPlugin.java
deleted file mode 100644
index 4e3bf57f4..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/SBML_XML_WriterPlugin.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Plant Bioinformatics Group, IPK Gatersleben
- *******************************************************************************/
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml;
-
-import org.graffiti.plugin.io.OutputSerializer;
-
-import de.ipk_gatersleben.ag_nw.graffiti.IPK_PluginAdapter;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLNodesNiceIdHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-/**
- * DOCUMENT ME!
- *
- * @author Dagmar Kutz, Matthias Klapperstück
- */
-public class SBML_XML_WriterPlugin extends IPK_PluginAdapter
-{
- public SBML_XML_WriterPlugin() {
-
- super();
- SBMLNodesNiceIdHelper.initNiceIds();
- SBML_Constants.init();
- this.outputSerializers = new OutputSerializer[] {
- new SBML_XML_Writer()
- };
-
- }
-
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/plugin.xml b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/plugin.xml
deleted file mode 100644
index 0f26f4c7a..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/exporters/sbml/plugin.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
- Dagmar Kutz, Matthias Klapperstück
- SBML-XML-Writer
-
-
- SBML-XML-Writer
- de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml.SBML_XML_WriterPlugin
- 1.0.0
- mailto:klapper@ipk-gatersleben.de
-
-
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/ConstantsName.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/ConstantsName.java
deleted file mode 100644
index f125e4ebf..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/ConstantsName.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml;
-
-public class ConstantsName {
- public static final String SBMLSUBSTANCEUNITS = "sbml_substanceUnits";
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Compartment_Reader.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Compartment_Reader.java
deleted file mode 100644
index 9b6d7f8ed..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Compartment_Reader.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/**
- * This class reads in Compartments
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml;
-
-import java.util.Iterator;
-
-import org.ErrorMsg;
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.Compartment;
-import org.sbml.jsbml.ListOf;
-import org.sbml.jsbml.xml.XMLNode;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLCompartment;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLCompartmentHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_Compartment_Reader {
-
- /**
- * Method reads in compartments and is called from class
- * SBML_XML_Reader.java
- *
- * @param compartmentList
- * contains the compartments for the import
- * @param g
- * the data structure for reading in the information
- */
- public void addCompartment(ListOf compartmentList, Graph g) {
- Iterator itComp = compartmentList.iterator();
- int compartmentCount = 1;
- SBMLCompartmentHelper compartmentHelperObject = new SBMLCompartmentHelper();
- Compartment compartment;
- String name;
- String id;
- Double spatialDimensions;
- Double size;
- String units;
- Boolean constant;
- String metaID;
- String sboTerm;
- String outside;
- XMLNode notesObj;
- String notes;
- String internHeadline;
- String presentedHeadline;
- while (itComp.hasNext()) {
- compartment = itComp.next();
- name = compartment.getName();
- id = compartment.getId();
- spatialDimensions = compartment.getSpatialDimensions();
- size = compartment.getSize();
- units = compartment.getUnits();
- constant = compartment.getConstant();
- metaID = compartment.getMetaId();
- sboTerm = compartment.getSBOTermID();
- outside = compartment.getOutside();
- notesObj = compartment.getNotes();
- notes = compartment.getNotesString();
- internHeadline = new StringBuffer(SBML_Constants.SBML_COMPARTMENT)
- .append(id).toString();
- presentedHeadline = SBML_Constants.EMPTY;
- if (compartment.isSetName()) {
- presentedHeadline = new StringBuffer(
- SBML_Constants.COMARTMENT_HEADLINE).append(name)
- .toString();
- } else if (compartment.isSetId()) {
- presentedHeadline = new StringBuffer(
- SBML_Constants.COMARTMENT_HEADLINE).append(id)
- .toString();
- } else {
- presentedHeadline = new StringBuffer(
- SBML_Constants.COMARTMENT_HEADLINE).append(
- compartmentCount).toString();
- }
- if (size.equals(Double.NaN) && compartment.isSetSize()) {
- ErrorMsg.addErrorMessage("Attribute size of "
- + presentedHeadline + " is not a valid double value.");
- }
- SBMLCompartment compartmentHelper = compartmentHelperObject
- .addCompartment(g, internHeadline, presentedHeadline);
-
- if (compartment.isSetId()
- && Compartment.isValidId(id, compartment.getLevel(),
- compartment.getVersion())) {
- compartmentHelper.setID(id);
- }
- if (compartment.isSetName() && (name != SBML_Constants.EMPTY)) {
- compartmentHelper.setName(name);
- }
- if (compartment.isSetSpatialDimensions()) {
- compartmentHelper.setSpatialDimensions(spatialDimensions);
- }
- if (compartment.isSetSize()) {
- compartmentHelper.setSize(size);
- }
- if (compartment.isSetUnits()) {
- compartmentHelper.setUnits(units);
- }
- if (compartment.isSetConstant()) {
- compartmentHelper.setConstant(constant);
- }
- if (compartment.isSetMetaId()) {
- compartmentHelper.setMetaID(metaID);
- }
- if (compartment.isSetSBOTerm()) {
- compartmentHelper.setSBOTerm(sboTerm);
- }
- if (compartment.isSetOutside()) {
- compartmentHelper.setOutside(outside);
- }
- if (compartment.isSetNotes()) {
- compartmentHelper.setNotes(notes, notesObj);
- }
- if (compartment.isSetAnnotation()) {
- if (compartment.getAnnotation().isSetRDFannotation()) {
- compartmentHelper
- .setAnnotation(compartment.getAnnotation());
- }
- if (compartment.getAnnotation().isSetNonRDFannotation()) {
- compartmentHelper.setNonRDFAnnotation(compartment
- .getAnnotation().getNonRDFannotation());
- }
- }
-
- compartmentCount++;
- }
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Constraint_Reader.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Constraint_Reader.java
deleted file mode 100644
index fdcde02fa..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Constraint_Reader.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * This class reads in Constraints
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml;
-
-import java.util.Iterator;
-
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.Constraint;
-import org.sbml.jsbml.ListOf;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLConstraint;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLConstraintHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_Constraint_Reader extends SBML_SBase_Reader {
-
- /**
- * Method reads in constraints and is called from class SBML_XML_Reader.java
- *
- * @param listOfConstraints
- * contains the constraints for the import
- * @param g
- * the data structure for reading in the information
- */
- public void addConstraint(ListOf listOfConstraints, Graph g) {
- int constraintCount = 1;
- SBMLConstraintHelper constraintHelperObject = new SBMLConstraintHelper();
- Iterator itConstraint = listOfConstraints.iterator();
- while (itConstraint.hasNext()) {
- Constraint constraint = itConstraint.next();
-
- String internHeadline = new StringBuffer(
- SBML_Constants.SBML_CONSTRAINT).append(constraintCount)
- .toString();
- String presentedHeadline = new StringBuffer("SBML Constraint ")
- .append(constraintCount).toString();
- // initConstraintNideIDs(internHeadline, presentedHeadline);
- SBMLConstraint constraintHelper = constraintHelperObject
- .addConstraint(g, internHeadline, presentedHeadline);
-
- String metaID = constraint.getMetaId();
- String sboTerm = constraint.getSBOTermID();
- String mathFormula = "";
- if (constraint.isSetMath()) {
- if (null != constraint.getMath()) {
- mathFormula = constraint.getMath().toString();
- }
- }
- String message = "";
- if (constraint.isSetMessage()) {
- message = removeTagFromString(constraint.getMessageString());
- constraintHelper.setMessage(message);
- }
- if (constraint.isSetSBOTerm()) {
- constraintHelper.setSBOTerm(sboTerm);
- }
- if (constraint.isSetMetaId()) {
- constraintHelper.setMetaId(metaID);
- }
- if (constraint.isSetNotes()) {
- constraintHelper.setNotes(constraint.getNotesString(),
- constraint.getNotes());
- }
- if (constraint.isSetAnnotation()) {
- if (constraint.getAnnotation().isSetRDFannotation()) {
- constraintHelper.setAnnotation(constraint.getAnnotation());
- }
- if (constraint.getAnnotation().isSetNonRDFannotation()) {
- constraintHelper.setNonRDFAnnotation(constraint
- .getAnnotation().getNonRDFannotation());
- }
- }
- if (constraint.isSetMath()) {
- constraintHelper.setFunction(mathFormula);
- }
-
- constraintCount++;
- }
- }
-
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Event_Reader.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Event_Reader.java
deleted file mode 100644
index e92711997..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Event_Reader.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/**
- * This class reads in Events
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.Delay;
-import org.sbml.jsbml.Event;
-import org.sbml.jsbml.EventAssignment;
-import org.sbml.jsbml.Priority;
-import org.sbml.jsbml.SBMLException;
-import org.sbml.jsbml.Trigger;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLEventAssignmentHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLEventHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_Event_Reader extends SBML_SBase_Reader {
-
- /**
- * Adds an events to the graph tab
- *
- * @param eventList
- * contains the events of the model
- * @param g
- * is the data structure for reading in the information
- */
- public void addEvents(List eventList, Graph g) {
- Iterator itEvent = eventList.iterator();
- int eventCount = 1;
- while (itEvent.hasNext()) {
- Event event = itEvent.next();
-
- String internHeadline = new StringBuffer(SBML_Constants.SBML_EVENT)
- .append(eventCount).toString();
- String presentedHeadline = new StringBuffer("SBML Event ").append(
- eventCount).toString();
-
- SBMLEventHelper eventHelper = new SBMLEventHelper(g,
- internHeadline, presentedHeadline);
-
- String eventID = event.getId();
- String eventName = event.getName();
- Boolean useValuesFromTriggerTime = false;
- if (event.isSetUseValuesFromTriggerTime()) {
- useValuesFromTriggerTime = event.getUseValuesFromTriggerTime();
- }
- Trigger trigger = event.getTrigger();
- String triggerFormula = "";
- try {
- if (trigger.isSetMath()) {
- if (null != trigger.getMath()) {
- triggerFormula = trigger.getMath().toFormula();
- }
- }
- } catch (SBMLException e) {
- e.printStackTrace();
- }
-
- Boolean triggerInitialValue = false;
- Boolean triggerPersistent = false;
- try {
- if (trigger.isSetInitialValue())
- triggerInitialValue = trigger.getInitialValue();
- if (trigger.isSetPersistent())
- triggerPersistent = trigger.getPersistent();
- } catch (Exception e1) {
- e1.printStackTrace();
- }
-
- // Boolean triggerInitialValue = trigger.getInitialValue();
- // Boolean triggerPersistent = trigger.getPersistent();
-
- String prioritySBOTerm = "";
- String priorityMetaID = "";
- String priorityFormula = "";
- if (event.isSetPriority()) {
- Priority priority = event.getPriority();
- if (priority.isSetMetaId()) {
- priorityMetaID = priority.getMetaId();
- }
- if (priority.isSetSBOTerm()) {
- prioritySBOTerm = priority.getSBOTermID();
- }
- if (priority.isSetAnnotation()) {
- if (priority.getAnnotation().isSetRDFannotation()) {
- eventHelper.setPriorityAnnotation(priority
- .getAnnotation());
- }
- if (priority.getAnnotation().isSetNonRDFannotation()) {
- eventHelper.setPriorityNonRDFAnnotation(priority
- .getAnnotation().getNonRDFannotation());
- }
- }
-
- if (priority.isSetNotes()) {
- eventHelper.setPriorityNotes(priority.getNotesString(),
- priority.getNotes());
- }
- // addNotes(priority.getNotes(), priority.getNotesString(),g,
- // internHeadline, new StringBuffer(internHeadline).
- // append(SBML_Constants.PRIORITY_NOTES).toString());
- try {
- if (priority.isSetMath()) {
- if (null != priority.getMath()) {
- priorityFormula = priority.getMath().toFormula();
- }
- }
- } catch (SBMLException e) {
- e.printStackTrace();
- }
- }
-
- String delayMetaID = "";
- String delaySBOTerm = "";
- String delayFormula = "";
- if (event.isSetDelay()) {
- Delay delay = event.getDelay();
- if (delay.isSetMetaId()) {
- delayMetaID = delay.getMetaId();
- }
- if (delay.isSetSBOTerm()) {
- delaySBOTerm = delay.getSBOTermID();
- }
-
- if (delay.isSetAnnotation()) {
- if (delay.getAnnotation().isSetRDFannotation()) {
- eventHelper.setdelayAnnotation(delay.getAnnotation());
- }
- if (delay.getAnnotation().isSetNonRDFannotation()) {
- eventHelper.setdelayNonRDFAnnotation(delay
- .getAnnotation().getNonRDFannotation());
- }
- }
-
- // addNotes(delay.getNotes(), delay.getNotesString(),g,
- // internHeadline, new StringBuffer(internHeadline).
- // append(SBML_Constants.DELAY_NOTES).toString());
-
- if (delay.isSetNotes()) {
- eventHelper.setDelayNotes(delay.getNotesString(),
- delay.getNotes());
- }
- try {
- if (delay.isSetMath()) {
- if (null != delay.getMath()) {
- delayFormula = delay.getMath().toFormula();
- }
- }
- } catch (SBMLException e) {
- e.printStackTrace();
- }
- }
- if (event.isSetId()
- && Event.isValidId(eventID, event.getLevel(),
- event.getVersion())) {
- eventHelper.setID(eventID);
- }
- if (event.isSetName()) {
- eventHelper.setName(eventName);
- }
- if (event.isSetMetaId()) {
- eventHelper.setMetaID(event.getMetaId());
- }
- if (event.isSetSBOTerm()) {
- eventHelper.setSBOTerm(event.getSBOTermID());
- }
- if (event.isSetAnnotation()) {
- if (event.getAnnotation().isSetRDFannotation()) {
- eventHelper.setAnnotation(event.getAnnotation());
- }
- if (event.getAnnotation().isSetNonRDFannotation()) {
- eventHelper.setNonRDFAnnotation(event.getAnnotation()
- .getNonRDFannotation());
- }
- }
- if (event.isSetUseValuesFromTriggerTime()) {
- eventHelper
- .setUseValuesFromTriggerTime(useValuesFromTriggerTime);
- }
- if (event.isSetNotes()) {
- eventHelper.setNotes(event.getNotesString(), event.getNotes());
- }
- if (trigger.isSetInitialValue()) {
- eventHelper.setInitialValue(triggerInitialValue);
- }
- if (trigger.isSetPersistent()) {
- eventHelper.setPersistent(triggerPersistent);
- }
- if (trigger.isSetMath()) {
- eventHelper.setTriggerFunction(triggerFormula);
- }
- if (!priorityFormula.equals("")) {
- eventHelper.setPriorityFunction(priorityFormula);
- }
- if (!priorityMetaID.equals("")) {
- eventHelper.setPriorityMetaID(priorityMetaID);
- }
- if (!prioritySBOTerm.equals("")) {
- eventHelper.setPrioritySBOTerm(prioritySBOTerm);
- }
- if (!delayFormula.equals("")) {
- eventHelper.setDelayFunction(delayFormula);
- }
- if (!delayMetaID.equals("")) {
- eventHelper.setDelayMetaID(delayMetaID);
- }
- if (!delaySBOTerm.equals("")) {
- eventHelper.setDelaySBOTerm(delaySBOTerm);
- }
-
- List listEventAssignment = event
- .getListOfEventAssignments();
- Iterator itEventAssignment = listEventAssignment
- .iterator();
- int eventAssignmentCount = 1;
- while (itEventAssignment.hasNext()) {
- EventAssignment eventAssignment = itEventAssignment.next();
- SBMLEventAssignmentHelper eaHelper = eventHelper
- .addEventAssignment(g, internHeadline,
- presentedHeadline, eventAssignmentCount);
-
- // initEventAssignmentNideIDs(presentedHeadline, internHeadline,
- // eventAssignmentCount);
- /*
- * String keyEAVariable =
- * SBML_Constants.addToNiceIdList(presentedHeadline,
- * "Event Assignment " + eventAssignmentCount + " Variable");
- * String keyEAMetaId =
- * SBML_Constants.addToNiceIdList(presentedHeadline,
- * "Event Assignment " + eventAssignmentCount + " Meta ID");
- * String keyEASBOTerm =
- * SBML_Constants.addToNiceIdList(presentedHeadline,
- * "Event Assignment " + eventAssignmentCount + " SBOTerm");
- * String keyEAToolTip =
- * SBML_Constants.addToNiceIdList(presentedHeadline,
- * "Event Assignment " + eventAssignmentCount + " ToolTip");
- * String keyEAFormula =
- * SBML_Constants.addToNiceIdList(presentedHeadline,
- * "Event Assignment " + eventAssignmentCount + " Formula");
- */
-
- String variable = eventAssignment.getVariable();
- String eventAssignmentFormula = "";
- try {
- if (eventAssignment.isSetMath()) {
- if (null != eventAssignment.getMath()) {
- eventAssignmentFormula = eventAssignment.getMath()
- .toFormula();
- }
- }
- } catch (SBMLException e) {
- e.printStackTrace();
- }
-
- if (eventAssignment.isSetVariable()) {
- eaHelper.setVariable(variable);
- }
- if (eventAssignment.isSetMath()) {
- eaHelper.setFunction(eventAssignmentFormula);
- }
- if (eventAssignment.isSetMetaId()) {
- eaHelper.setMetaID(eventAssignment.getMetaId());
- }
- if (eventAssignment.isSetSBOTerm()) {
- eaHelper.setSBOTerm(eventAssignment.getSBOTermID());
- }
-
- if (eventAssignment.isSetAnnotation()) {
- if (eventAssignment.getAnnotation().isSetRDFannotation()) {
- eaHelper.setAnnotation(eventAssignment.getAnnotation());
- }
- if (eventAssignment.getAnnotation().isSetNonRDFannotation()) {
- eaHelper.setNonRDFAnnotation(eventAssignment
- .getAnnotation().getNonRDFannotation());
- }
- }
- if (eventAssignment.isSetNotes()) {
- eaHelper.setNotes(eventAssignment.getNotesString(),
- eventAssignment.getNotes());
- }
-
- eventAssignmentCount++;
- }
-
- eventCount++;
- }
- }
-
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_FunctionDefinition_Reader.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_FunctionDefinition_Reader.java
deleted file mode 100644
index 54e354634..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_FunctionDefinition_Reader.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * This class reads in FunctionDefinitions
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml;
-
-import java.util.Iterator;
-
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.ASTNode;
-import org.sbml.jsbml.FunctionDefinition;
-import org.sbml.jsbml.ListOf;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLFunctionDefinition;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLFunctionDefinitionHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_FunctionDefinition_Reader {
-
- /**
- * Method reads in function definitions and is called from class SBML_XML_Reader.java
- *
- * @param functionDefinitionList contains the function definitions for the import
- * @param g the data structure for reading in the information
- */
- public void addFunktionDefinition(ListOf functionDefinitionList, Graph g) {
- Iterator itFunctionDefinition = functionDefinitionList.iterator();
- int functionCount = 1;
- SBMLFunctionDefinitionHelper functionDefinitionHelperObject = new SBMLFunctionDefinitionHelper();
- while (itFunctionDefinition.hasNext()) {
- try {
- FunctionDefinition functionDefinition = itFunctionDefinition.next();
- String internHeadline = new StringBuffer(SBML_Constants.SBML_FUNCTION_DEFINITION).append(functionCount).toString();
- String presentedHeadline = new StringBuffer("SBML Function Definition ").append(functionCount).toString();
- SBMLFunctionDefinition functionDefinitionHelper = functionDefinitionHelperObject.
- addFunctionDefinition(g, internHeadline, presentedHeadline);
- String functionID = functionDefinition.getId();
- String functionName = functionDefinition.getName();
- String sboTerm = functionDefinition.getSBOTermID();
- String metaID = functionDefinition.getMetaId();
-
- if (functionDefinition.isSetId()) {
- functionDefinitionHelper.setID(functionID);
- }
- if (functionDefinition.isSetMath()) {
- ASTNode math = functionDefinition.getMath();
- functionDefinitionHelper.setFunction(math.toString());
- }
- if (functionDefinition.isSetName()) {
- functionDefinitionHelper.setName(functionName);
- }
- if (functionDefinition.isSetSBOTerm()) {
- functionDefinitionHelper.setSBOTerm(sboTerm);
- }
- if (functionDefinition.isSetMetaId()) {
- functionDefinitionHelper.setMetaID(metaID);
- }
- if (functionDefinition.isSetNotes()) {
- functionDefinitionHelper.setNotes(functionDefinition.getNotesString(), functionDefinition.getNotes());
- }
- if (functionDefinition.isSetAnnotation()) {
- if (functionDefinition.getAnnotation().isSetRDFannotation()) {
- functionDefinitionHelper.setAnnotation(functionDefinition.getAnnotation());
- }
- if (functionDefinition.getAnnotation().isSetNonRDFannotation()) {
- if (functionDefinition.getAnnotation().isSetNonRDFannotation()) {
- functionDefinitionHelper.setNonRDFAnnotation(functionDefinition.getAnnotation().getNonRDFannotation());
- }
- }
- }
-
- functionCount++;
- } catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_InitialAssignment_Reader.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_InitialAssignment_Reader.java
deleted file mode 100644
index ceb2657bb..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_InitialAssignment_Reader.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/**
- * This class reads in InitialAssignments
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml;
-
-import java.util.Iterator;
-
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.ASTNode;
-import org.sbml.jsbml.InitialAssignment;
-import org.sbml.jsbml.ListOf;
-import org.sbml.jsbml.SBMLException;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLInitialAssignment;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLInitialAssignmentHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_InitialAssignment_Reader {
-
- /**
- * Method reads in initial assignments and is called from class
- * SBML_XML_Reader.java
- *
- * @param initialAssignmentList
- * contains the initial assignments for the import
- * @param g
- * the data structure for reading in the information
- */
- public void addInitialAssignments(
- ListOf initialAssignmentList, Graph g) {
- Iterator itInitialAssignment = initialAssignmentList
- .iterator();
- int countInitialAssignment = 1;
- SBMLInitialAssignmentHelper initialAssignmentHelperObject = new SBMLInitialAssignmentHelper();
- while (itInitialAssignment.hasNext()) {
- InitialAssignment initialAssignment = itInitialAssignment.next();
-
- String internHeadline = new StringBuffer(
- SBML_Constants.SBML_INITIAL_ASSIGNMENT).append(
- countInitialAssignment).toString();
- String presentedHeadline = new StringBuffer(
- "SBML Initial Assignment ").append(countInitialAssignment)
- .toString();
- SBMLInitialAssignment initialAssignmentHelper = initialAssignmentHelperObject
- .addInitialAssignment(g, internHeadline, presentedHeadline);
- // initInitialAssignmentNideIDs(internHeadline, presentedHeadline);
-
- /*
- * String presentedHeadline = "SBML Initial Assignment " +
- * countInitialAssignment; String internHeadline =
- * getNiceHeadline(presentedHeadline);
- * SBML_Constants.put(internHeadline, presentedHeadline);
- */
-
- /*
- * String keySymbol =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "Symbol");
- * String keyMetaId =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "Meta ID");
- * String keySBOTerm =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "SBOTerm");
- * String keyToolTip =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "ToolTip");
- * String keyFunction =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "Function");
- */
-
- String formula = "";
- try {
- if (initialAssignment.isSetMath()) {
- ASTNode mathTree = initialAssignment.getMath();
- formula = mathTree.toFormula();
- }
- } catch (SBMLException e) {
- }
- // addNotes(initialAssignment.getNotes(),
- // initialAssignment.getNotesString(),g, internHeadline, new
- // StringBuffer(internHeadline).append(SBML_Constants.NOTES).toString());
- String sboTerm = initialAssignment.getSBOTermID();
- String metaID = initialAssignment.getMetaId();
- // method getSymbol is for compatibility with libSBML only -
- // deprecated
- String symbol = initialAssignment.getVariable();
-
- if (initialAssignment.isSetSBOTerm()) {
- initialAssignmentHelper.setSBOTerm(sboTerm);
- }
- if (initialAssignment.isSetMetaId()) {
- initialAssignmentHelper.setMetaID(metaID);
- }
- if (initialAssignment.isSetSymbol()) {
- initialAssignmentHelper.setSymbol(symbol);
- }
- if (initialAssignment.isSetMath()) {
- initialAssignmentHelper.setFunction(formula);
- }
- if (initialAssignment.isSetNotes()) {
- initialAssignmentHelper.setNotes(
- initialAssignment.getNotesString(),
- initialAssignment.getNotes());
- }
- if (initialAssignment.isSetAnnotation()) {
- if (initialAssignment.getAnnotation().isSetRDFannotation()) {
- initialAssignmentHelper.setAnnotation(initialAssignment
- .getAnnotation());
- }
- if (initialAssignment.getAnnotation().isSetNonRDFannotation()) {
- initialAssignmentHelper
- .setNonRDFAnnotation(initialAssignment
- .getAnnotation().getNonRDFannotation());
- }
- }
-
- countInitialAssignment++;
- }
- }
-
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Model_Reader.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Model_Reader.java
deleted file mode 100644
index d9978f0fc..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Model_Reader.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/**
- * This class reads in the Model tag
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml;
-
-import java.awt.Point;
-import java.awt.geom.Point2D;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import org.AttributeHelper;
-import org.PositionGridGenerator;
-import org.apache.log4j.Logger;
-import org.graffiti.graph.Edge;
-import org.graffiti.graph.Graph;
-import org.graffiti.graph.Node;
-import org.sbml.jsbml.Compartment;
-import org.sbml.jsbml.ListOf;
-import org.sbml.jsbml.Model;
-import org.sbml.jsbml.Reaction;
-import org.sbml.jsbml.SBMLDocument;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.editcomponents.cluster_colors.ClusterColorAttribute;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.editing_tools.script_helper.NodeHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLReactionHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLSpeciesHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-import de.ipk_gatersleben.ag_nw.graffiti.services.task.BackgroundTaskStatusProviderSupportingExternalCallImpl;
-
-public class SBML_Model_Reader extends SBML_SBase_Reader {
-
- static Logger logger = Logger.getLogger(SBML_Model_Reader.class);
-
- /**
- * Passes the import on to other classes
- *
- * @param document
- * contains the model for the import
- * @param g
- * the data structure for reading in the information
- */
- public void controlImport(SBMLDocument document, Graph g,
- BackgroundTaskStatusProviderSupportingExternalCallImpl status) {
- if (document.isSetModel()) {
-
- Model model = document.getModel();
- String modelID = "";
- if (model.isSetId()) {
- if (Model.isValidId(model.getId(), document.getLevel(),
- document.getVersion())) {
- modelID = model.getId();
- }
- }
- PositionGridGenerator pgg = new PositionGridGenerator(100, 100,
- 1000);
-
- addModel(model, g);
-
- if (model.isSetListOfFunctionDefinitions()) {
- SBML_FunctionDefinition_Reader readFunctionDef = new SBML_FunctionDefinition_Reader();
- readFunctionDef.addFunktionDefinition(
- model.getListOfFunctionDefinitions(), g);
- }
-
- if (model.isSetListOfUnitDefinitions()) {
- SBML_UnitDefinition_Reader readUnitDef = new SBML_UnitDefinition_Reader();
- readUnitDef.addUnitDefinitions(
- model.getListOfUnitDefinitions(), g);
- }
-
- if (model.isSetListOfCompartments()) {
- SBML_Compartment_Reader readCompartment = new SBML_Compartment_Reader();
- readCompartment
- .addCompartment(model.getListOfCompartments(), g);
- }
- status.setCurrentStatusText1("create species list");
- status.setCurrentStatusValue(40);
-
- SBMLSpeciesHelper speciesHelper = null;
- if (model.isSetListOfSpecies()) {
- speciesHelper = new SBMLSpeciesHelper(g);
- SBML_Species_Reader readSpecies = new SBML_Species_Reader();
- readSpecies.addSpecies(g, model.getListOfSpecies(), pgg, speciesHelper);
- }
- if (model.isSetListOfParameters()) {
- SBML_Parameter_Reader readParameter = new SBML_Parameter_Reader();
- readParameter.addParameter(model.getListOfParameters(), g);
- }
- if (model.isSetListOfInitialAssignments()) {
- SBML_InitialAssignment_Reader readInitialAssignment = new SBML_InitialAssignment_Reader();
- readInitialAssignment.addInitialAssignments(
- model.getListOfInitialAssignments(), g);
- }
-
- if (model.isSetListOfRules()) {
- SBML_Rule_Reader readRule = new SBML_Rule_Reader();
- readRule.addRule(model.getListOfRules(), g);
- }
-
- if (model.isSetListOfConstraints()) {
- SBML_Constraint_Reader readConstraint = new SBML_Constraint_Reader();
- readConstraint.addConstraint(model.getListOfConstraints(), g);
- }
-
- status.setCurrentStatusText1("create reaction list");
- status.setCurrentStatusValue(80);
-
- SBMLReactionHelper reactionHelper = null;;
- if (model.isSetListOfReactions()) {
- reactionHelper = new SBMLReactionHelper(g);
- SBML_Reaction_Reader readReaction = new SBML_Reaction_Reader();
- readReaction.addReactions(g, model.getListOfReactions(),
- modelID, pgg, reactionHelper);
- }
-
- if (model.isSetListOfEvents()) {
- SBML_Event_Reader readEvent = new SBML_Event_Reader();
- readEvent.addEvents(model.getListOfEvents(), g);
- }
-
- // sets background-color for compartments
- AttributeHelper.setAttribute(
- g,
- "",
- ClusterColorAttribute.attributeName,
- ClusterColorAttribute.getDefaultValue(document.getModel()
- .getListOfCompartments().size()));
- AttributeHelper.setAttribute(g, "", "background_coloring",
- new Boolean(true));
-
- ListOf liste = model.getListOfCompartments();
- for (Compartment compartment : liste) {
- if (!compartment.isSetName()) {
- AttributeHelper.deleteAttribute(
- g,
- new StringBuffer(SBML_Constants.SBML_COMPARTMENT)
- .append(compartment.getId()).toString(),
- new StringBuffer(SBML_Constants.SBML_COMPARTMENT)
- .append(compartment.getId())
- .append(SBML_Constants.COMPARTMENT_NAME)
- .toString());
- }
- }
- if (SBML_Constants.isLayoutActive) {
- addAdditionalEdges(g, model, speciesHelper, reactionHelper);
- computeReactionNodePosition(g);
- }
- }
- }
-
- private List getListOfReactions(String speciesID, Model model) {
- List reactionList = model.getListOfReactions();
- List newReactionList = new ArrayList();
- for (Reaction reaction : reactionList) {
- if (reaction.hasReactant(model.getSpecies(speciesID)) || reaction.hasProduct(model.getSpecies(speciesID))
- || reaction.hasModifier(model.getSpecies(speciesID))) {
- newReactionList.add(reaction);
- }
- }
- return newReactionList;
- }
-
- private List getPointList(List nodeList) {
- List pointList = new ArrayList();
- for (Node node : nodeList) {
- NodeHelper nodeHelper = new NodeHelper(node);
- pointList.add(nodeHelper.getPosition());
- }
- return pointList;
- }
-
- private Edge getEdge(Node reactionNode, String speciesID) {
- Node speciesNode = null;
- Iterator itNeighbors = reactionNode.getNeighborsIterator();
- while (itNeighbors.hasNext()) {
- Node neighbor = itNeighbors.next();
- if (SBMLHelper.getSpeciesID(neighbor).equals(speciesID)) {
- speciesNode = neighbor;
- }
- }
- Iterator edgeIt = reactionNode.getEdgesIterator();
- while (edgeIt.hasNext()) {
- Edge edge = edgeIt.next();
- if ((edge.getSource() == speciesNode && edge.getTarget() == reactionNode) || (edge.getSource() == reactionNode && edge.getTarget() == speciesNode)) {
- return edge;
- }
- }
- return null;
- }
-
- private void addAdditionalEdges(Graph g, Model model, SBMLSpeciesHelper speciesHelper, SBMLReactionHelper reactionHelper) {
- Map> speciesCloneList = speciesHelper.getSpeicesClones();
- Set>> speciesClonesEntrySet = speciesCloneList.entrySet();
- Iterator>> speciesClonesEntrySetIt = speciesClonesEntrySet.iterator();
- while (speciesClonesEntrySetIt.hasNext()) {
- Entry> speciesCloneEntry = speciesClonesEntrySetIt.next();
- if (speciesCloneEntry.getValue().size() > 1) {
- List reactionList = getListOfReactions(speciesCloneEntry.getKey(), model);
- if (reactionList.size() > 1) {
-
- Node species = null;
- for (Node node : speciesCloneEntry.getValue()) {
- if (node.getEdges().size() > 0) {
- species = node;
- }
- break;
- }
-
- for (Reaction reaction : reactionList) {
- Node reactionNode = SBMLHelper.getReactionNode(g, reaction.getId());
- NodeHelper reactionNodeHelper = new NodeHelper(reactionNode);
- Point2D positionReaction = reactionNodeHelper.getPosition();
- Double min = Double.POSITIVE_INFINITY;
- Node minSpeciesNode = null;
- for (Node speciesNode : speciesCloneEntry.getValue()) {
- NodeHelper speciesNodeHelper = new NodeHelper(speciesNode);
- Point2D speciesPosition = speciesNodeHelper.getPosition();
- Double difference = positionReaction.distance(speciesPosition);
- if (difference < min) {
- min = difference;
- minSpeciesNode = speciesNode;
- }
- }
- Edge edge = getEdge(reactionNode, speciesCloneEntry.getKey());
- if (AttributeHelper.getSBMLrole(edge.getSource()).equals(SBML_Constants.SPECIES)) {
- edge.setSource(minSpeciesNode);
- }
- else if (AttributeHelper.getSBMLrole(edge.getTarget()).equals(SBML_Constants.SPECIES)) {
- edge.setTarget(minSpeciesNode);
- }
- }
- }
- }
- }
- }
-
- /**
- * Reads in the model
- *
- * @param model
- * contains the model for the import
- * @param g
- * the data structure for reading in the information
- */
- private void addModel(Model model, Graph g) {
- String modelID = model.getId();
- String modelName = model.getName();
- String substanceUnits = model.getSubstanceUnits();
- String timeUnits = model.getTimeUnits();
- String volumeUnits = model.getVolumeUnits();
- String areaUnits = model.getAreaUnits();
- String lenghtUnits = model.getLengthUnits();
- String extendUnits = model.getExtentUnits();
- String conversionFactor = model.getConversionFactor();
- String metaID = model.getMetaId();
- String sboTerm = model.getSBOTermID();
-
- if (model.isSetNotes()) {
- addNotes(model.getNotes(), model.getNotesString(), g,
- SBML_Constants.SBML, SBML_Constants.MODEL_NOTES);
- }
- if (model.isSetId()) {
- if (!modelID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_ID, modelID);
- }
- }
- if (!modelName.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_NAME, modelName);
- }
-
- if (model.getLevel() == 3 && model.getVersion() == 1) {
- if (model.isSetSubstanceUnits()) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.SUBSTANCE_UNITS, substanceUnits);
- }
- if (model.isSetTimeUnits()) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.TIME_UNITS, timeUnits);
- }
- if (model.isSetVolumeUnits()) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.VOLUME_UNITS, volumeUnits);
- }
- if (!areaUnits.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.AREA_UNITS, areaUnits);
- }
- if (model.isSetLengthUnits()) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.LENGTH_UNITS, lenghtUnits);
- }
- if (model.isSetExtentUnits()) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.EXTENT_UNITS, extendUnits);
- }
- if (!conversionFactor.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.CONVERSION_FACTOR, conversionFactor);
- }
- }
-
- if (!metaID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_META_ID, metaID);
- }
- if (!sboTerm.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_SBOTERM, sboTerm);
- }
- if (model.isSetAnnotation()) {
- if (model.getAnnotation().isSetRDFannotation()) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_ANNOTATION, model.getAnnotation());
- }
- if (model.getAnnotation().isSetNonRDFannotation()) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.MODEL_NON_RDF_ANNOTATION, model
- .getAnnotation().getNonRDFannotation());
- }
- }
- }
-
- /**
- * iterates over all speices of every reaction and set the reaction position to the average position of all their speices nodes.
- */
- private void computeReactionNodePosition(Graph g) {
- for (Node reaction : SBMLHelper.getReactionNodes(g)) {
- if (!SBMLHelper.isSetLayoutID(g, reaction)) {
- Set reactionNeighbours = reaction.getNeighbors();
- if (reactionNeighbours.size() > 0) {
- Point2D newReactionPosition = new Point();
- newReactionPosition.setLocation(1d, 1d);
- for (Node species : reactionNeighbours) {
- double newXPosition = (AttributeHelper.getPosition(species).getX() + newReactionPosition.getX()) / 2d;
- double newYPosition = (AttributeHelper.getPosition(species).getY() + newReactionPosition.getY()) / 2d;
- newReactionPosition.setLocation(newXPosition, newYPosition);
-// System.out.println("process reaction: " + SBMLHelper.getReactionID(reaction) + " new position: " + newXPosition + ", " + newYPosition
-// );
- }
- AttributeHelper.setPosition(reaction, newReactionPosition);
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Parameter_Reader.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Parameter_Reader.java
deleted file mode 100644
index dd3ec3715..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Parameter_Reader.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * This class reads in Parameters
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml;
-
-import java.util.Iterator;
-
-import org.ErrorMsg;
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.ListOf;
-import org.sbml.jsbml.Parameter;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLParameter;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLParameterHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_Parameter_Reader {
-
- /**
- * Method reads in parameter and is called from class SBML_XML_Reader.java
- *
- * @param parameterList
- * contains the parameter for the import
- * @param g
- * the data structure for reading in the information
- */
- public void addParameter(ListOf parameterList, Graph g) {
- Iterator itParameter = parameterList.iterator();
- int parameterCount = 1;
- SBMLParameterHelper parameterHelperObject = new SBMLParameterHelper();
- while (itParameter.hasNext()) {
- Parameter parameter = itParameter.next();
-
- String internHeadline = new StringBuffer(
- SBML_Constants.SBML_PARAMETER).append(parameterCount)
- .toString();
- String presentedHeadline = new StringBuffer("SBML Parameter ")
- .append(parameterCount).toString();
-
- SBMLParameter parameterHelper = parameterHelperObject.addParameter(
- g, internHeadline, presentedHeadline);
-
- String parameterID = parameter.getId();
- String parameterName = parameter.getName();
- Double parameterValue = parameter.getValue();
-
- // in BIOMD0000000012.xml from BioModels.org this error message would be shown
- // nevertheless the model is valid
- // so this message is not necessary
- // if (parameterValue.equals(Double.NaN)) {
- // ErrorMsg.addErrorMessage("Attribute value of parameter "
- // + parameterCount + " with the id " + parameterID
- // + " is not a valid double value.");
- // }
-
- String parameterUnits = parameter.getUnits();
- Boolean parameterConstant = parameter.isConstant();
- String metaID = parameter.getMetaId();
- String sboTerm = parameter.getSBOTermID();
- if (parameter.isSetId()
- && Parameter.isValidId(parameterID, parameter.getLevel(),
- parameter.getVersion())) {
- parameterHelper.setID(parameterID);
- }
- if (!Parameter.isValidId(parameterID, parameter.getLevel(),
- parameter.getVersion())) {
- ErrorMsg.addErrorMessage("ID of parameter " + parameterCount
- + " is not valid.");
- }
- if (parameter.isSetName()) {
- parameterHelper.setName(parameterName);
- }
- if (parameter.isSetValue()) {
- parameterHelper.setValue(parameterValue);
- }
- if (parameter.isSetUnits()) {
- parameterHelper.setUnits(parameterUnits);
- }
- if (parameter.isSetConstant()) {
- parameterHelper.setConstant(parameterConstant);
- }
- if (parameter.isSetMetaId()) {
- parameterHelper.setMetaID(metaID);
- }
- if (parameter.isSetSBOTerm()) {
- parameterHelper.setSBOTerm(sboTerm);
- }
- if (parameter.isSetNotes()) {
- parameterHelper.setNotes(parameter.getNotesString(),
- parameter.getNotes());
- }
- if (parameter.isSetAnnotation()) {
- if (parameter.getAnnotation().isSetRDFannotation()) {
- parameterHelper.setAnnotation(parameter.getAnnotation());
- }
- if (parameter.getAnnotation().isSetNonRDFannotation()) {
- parameterHelper.setNonRDFAnnotation(parameter
- .getAnnotation().getNonRDFannotation());
- }
- }
- parameterCount++;
- }
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Reaction_Reader.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Reaction_Reader.java
deleted file mode 100644
index 4a0180db1..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Reaction_Reader.java
+++ /dev/null
@@ -1,651 +0,0 @@
-/**
- * This class reads in Reactions
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml;
-
-import java.awt.Color;
-import java.util.Iterator;
-import java.util.List;
-
-import org.AlignmentSetting;
-import org.AttributeHelper;
-import org.ErrorMsg;
-import org.PositionGridGenerator;
-import org.graffiti.graph.Edge;
-import org.graffiti.graph.Graph;
-import org.graffiti.graph.Node;
-import org.sbml.jsbml.KineticLaw;
-import org.sbml.jsbml.ListOf;
-import org.sbml.jsbml.LocalParameter;
-import org.sbml.jsbml.ModifierSpeciesReference;
-import org.sbml.jsbml.Reaction;
-import org.sbml.jsbml.SBMLException;
-import org.sbml.jsbml.SimpleSpeciesReference;
-import org.sbml.jsbml.SpeciesReference;
-import org.sbml.jsbml.ext.layout.BoundingBox;
-import org.sbml.jsbml.ext.layout.Dimensions;
-import org.sbml.jsbml.ext.layout.ExtendedLayoutModel;
-import org.sbml.jsbml.ext.layout.Layout;
-import org.sbml.jsbml.ext.layout.Point;
-import org.sbml.jsbml.ext.layout.ReactionGlyph;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.KineticLawHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLLocalParameter;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLReactionHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLSpeciesHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_Reaction_Reader {
-
- /**
- * Method reads in function definitions and is called from class
- * SBML_XML_Reader.java. Add reaction nodes and edges to the graph
- *
- * @param g
- * the data structure for reading in the information
- * @param reactionList
- * contains the reactions for the import
- * @param modelID
- * is the id of the current model
- * @param pgg
- * is needed for drawing the graph
- */
- public void addReactions(Graph g, ListOf reactionList,
- String modelID, PositionGridGenerator pgg, SBMLReactionHelper reactionhelper) {
- SBMLReactionHelper reactionHelper = reactionhelper;
- String reactionID;
- String reactionName;
- Boolean reversible;
- String compartment;
- String sboTerm;
- String metaID;
- Boolean fast;
- Node reactionNode;
- ListOf reactants;
- ListOf products;
- ListOf modifiers;
- String metaID2;
- String sboTerm2;
- String kineticFormula;
- KineticLaw kineticLaw;
- KineticLawHelper kineticLawHelper;
- List listLocalParameter;
- Iterator itLP;
- int countLocalParameter;
- LocalParameter localParameter;
- String internAttributeName;
- String presentedAttributeName;
- SBMLLocalParameter localParameterHelper;
- String id = SBML_Constants.EMPTY;
- String name;
- Double value;
- String unit;
- for (Reaction reaction : reactionList) {
- reactionID = reaction.getId();
- reactionName = reaction.getName();
- // reversible = false;
- // if (reaction.isSetReversible()) {
- reversible = reaction.getReversible();
- // }
- fast = reaction.getFast();
- compartment = reaction.getCompartment();
- sboTerm = reaction.getSBOTermID();
- metaID = reaction.getMetaId();
-
- // Determines the label of the reaction node
- /*
- * String ex = null; if(!(reactionName == "")){ ex = reactionName; }
- * else{ ex = reactionID; }
- */
- reactionNode = g.addNode();
- AttributeHelper.setAttribute(reactionNode, SBML_Constants.SBML,
- SBML_Constants.SBML_ROLE, SBML_Constants.ROLE_REACTION);
-
- // CAUTION working with level 3 or higher CAUTION
- reactionHelper
- .setLabel(reactionNode, reactionName, reactionID, pgg);
- // setAttributes(reactionNode, Color.white, ex,
- // pgg.getNextPosition(), 8);
- AttributeHelper.setBorderWidth(reactionNode, 1d);
- // NodeTools.setClusterID(reactionNode, compartment);
- if (reaction.isSetCompartment()) {
- reactionHelper.setCompartment(reactionNode, compartment);
- }
- if (reaction.isSetId()
- && Reaction.isValidId(reactionID, reaction.getLevel(),
- reaction.getVersion())) {
- reactionHelper.setID(reactionNode, reactionID);
- }
- // if(reaction.isSetReversible()){
- reactionHelper.setReversible(reactionNode, reversible);
- // }
- if (reaction.isSetFast()) {
- reactionHelper.setFast(reactionNode, fast);
- }
- if (reaction.isSetSBOTerm()) {
- reactionHelper.setSBOTerm(reactionNode, sboTerm);
- }
- if (reaction.isSetMetaId()) {
- reactionHelper.setMetaID(reactionNode, metaID);
- }
- if (reaction.isSetNotes()) {
- reactionHelper.setNotes(reactionNode,
- reaction.getNotesString(), reaction.getNotes());
- }
-
- if (reaction.isSetAnnotation()) {
- if (reaction.getAnnotation().isSetRDFannotation()) {
- reactionHelper.setAnnotation(reactionNode,
- reaction.getAnnotation());
- }
- if (reaction.getAnnotation().isSetNonRDFannotation()) {
- reactionHelper.setNonRDFAnnotation(reactionNode, reaction
- .getAnnotation().getNonRDFannotation());
- }
- }
-
- // Adds the edges between reactant node and reaction node
- reactants = reaction.getListOfReactants();
- addReactants(g, reactants, reactionID, modelID, reactionNode,
- reaction.getReversible(), reactionHelper);
-
- // Adds the edges between product node and reaction node
- products = reaction.getListOfProducts();
- addProducts(g, products, reactionID, modelID, reactionNode,
- reaction.getReversible(), reactionHelper);
-
- // Adds the edges between modifier node and reaction node
- modifiers = reaction.getListOfModifiers();
- addModifier(g, modifiers, reactionNode, reactionHelper, reactionID);
-
- if (reaction.isSetKineticLaw()) {
- kineticLaw = reaction.getKineticLaw();
- kineticLawHelper = new KineticLawHelper(g, reactionHelper.getReactionClones());
- metaID2 = kineticLaw.getMetaId();
- sboTerm2 = kineticLaw.getSBOTermID();
- kineticFormula = "";
- try {
- if (kineticLaw.isSetMath()) {
- if (null != kineticLaw.getMath()) {
- kineticFormula = kineticLaw.getMath().toFormula();
- }
- }
- } catch (SBMLException e) {
- e.printStackTrace();
- }
-
- if (kineticLaw.isSetMath()) {
- kineticLawHelper.setFunction(reactionNode, kineticFormula);
- }
- if (kineticLaw.isSetSBOTerm()) {
- kineticLawHelper.setSBOTerm(reactionNode, sboTerm2);
- }
- if (kineticLaw.isSetMetaId()) {
- kineticLawHelper.setMetaId(reactionNode, metaID2);
- }
- if (kineticLaw.isSetNotes()) {
- kineticLawHelper.setNotes(reactionNode,
- kineticLaw.getNotesString(), kineticLaw.getNotes());
- }
- if (kineticLaw.isSetAnnotation()) {
- if (kineticLaw.getAnnotation().isSetRDFannotation()) {
- kineticLawHelper.setAnnotation(reactionNode,
- kineticLaw.getAnnotation());
- }
- if (kineticLaw.getAnnotation().isSetNonRDFannotation()) {
- kineticLawHelper.setNonRDFAnnotation(reactionNode,
- kineticLaw.getAnnotation()
- .getNonRDFannotation());
- }
- }
-
- // Two ways to read in a Local Parameter. One way is deprecated.
- if (kineticLaw.isSetListOfLocalParameters()
- || kineticLaw.isSetListOfParameters()) {
- listLocalParameter = null;
- if (reaction.getModel().getLevel() == 3
- && reaction.getModel().getVersion() == 1) {
- if (kineticLaw.isSetListOfLocalParameters()) {
- listLocalParameter = kineticLaw
- .getListOfLocalParameters();
- }
- } else {
- if (kineticLaw.isSetListOfParameters()) {
- listLocalParameter = kineticLaw
- .getListOfParameters();
- }
- }
- /*
- * if(kineticLaw.isSetListOfParameters()){
- * listLocalParameter = kineticLaw.getListOfParameters(); }
- * else if(kineticLaw.isSetListOfLocalParameters()){
- * listLocalParameter =
- * kineticLaw.getListOfLocalParameters(); }
- */
-
- itLP = listLocalParameter.iterator();
- countLocalParameter = 1;
- while (itLP.hasNext()) {
- localParameter = itLP.next();
- internAttributeName = new StringBuffer(
- SBML_Constants.LOCAL_PARAMETER).append(
- countLocalParameter).toString();
- presentedAttributeName = new StringBuffer(
- SBML_Constants.LOCALPARAMETER_HEADLINE).append(
- countLocalParameter).toString();
-
- localParameterHelper = kineticLawHelper
- .addLocalParemeter(g, presentedAttributeName,
- internAttributeName);
-
- id = localParameter.getId();
- name = localParameter.getName();
- value = localParameter.getValue();
- if (value.equals(Double.NaN)) {
- ErrorMsg.addErrorMessage("Attribute value of reaction "
- + reactionID
- + " "
- + presentedAttributeName
- + " is not a valid double value.");
- }
- unit = localParameter.getUnits();
-
- if (localParameter.isSetId()) {
- localParameterHelper.setID(reactionNode, id);
- }
- if (localParameter.isSetName()) {
- localParameterHelper.setName(reactionNode, name);
- }
- if (localParameter.isSetValue()) {
- localParameterHelper.setValue(reactionNode, value);
- }
- if (localParameter.isSetUnits()) {
- localParameterHelper.setUnits(reactionNode, unit);
- }
- if (localParameter.isSetMetaId()) {
- localParameterHelper.setMetaID(reactionNode,
- localParameter.getMetaId());
- }
- if (localParameter.isSetSBOTerm()) {
- localParameterHelper.setSBOTerm(reactionNode,
- localParameter.getSBOTermID());
- }
- if (localParameter.isSetNotes()) {
- localParameterHelper.setNotes(reactionNode,
- localParameter.getNotesString(),
- localParameter.getNotes());
- }
- if (localParameter.isSetAnnotation()) {
- if (localParameter.getAnnotation()
- .isSetRDFannotation()) {
- localParameterHelper.setAnnotation(
- reactionNode,
- localParameter.getAnnotation());
- }
- if (localParameter.getAnnotation()
- .isSetNonRDFannotation()) {
- localParameterHelper.setNonRDFAnnotation(
- reactionNode, localParameter
- .getAnnotation()
- .getNonRDFannotation());
- }
- }
-
- countLocalParameter++;
- }
-
- }
- }
-
- AttributeHelper.setLabel(AttributeHelper.getLabels(reactionNode)
- .size(), reactionNode, reactionID, null,
- AlignmentSetting.HIDDEN.toGMLstring());
-
- if (SBML_Constants.isLayoutActive) {
- processLayoutInformation(g, reaction, reactionHelper, reactionNode);
- }
-
- }
- }
-
- private void processLayoutInformation(Graph g, Reaction reaction, SBMLReactionHelper reactionHelper, Node reactionNode) {
- ExtendedLayoutModel layoutModel = (ExtendedLayoutModel) reaction.getModel().getExtension(SBMLHelper.SBML_LAYOUT_EXTENSION_NAMESPACE);
- if (layoutModel != null) {
-
- Layout layout = layoutModel.getListOfLayouts().iterator().next();
- ListOf currentReactionGlyphs = new ListOf();
- currentReactionGlyphs.setLevel(layout.getLevel());
- currentReactionGlyphs.setVersion(layout.getVersion());
- Iterator reactionGlyphListIt = layout.getListOfReactionGlyphs().iterator();
- String reactionID = reaction.getId();
- while (reactionGlyphListIt.hasNext()) {
- ReactionGlyph nextReactionGlyph = reactionGlyphListIt.next();
- if (nextReactionGlyph.getReaction().equals(reactionID)) {
- currentReactionGlyphs.add(nextReactionGlyph);
- }
- }
- // for (int i = 0; i < currentReactionGlyphs.size(); i++) {
- for (int i = 0; i < 1; i++) {
- ReactionGlyph reactionGlyph = currentReactionGlyphs.get(i);
- if (i == 0) {
- reactionHelper.addReactionCloneToList(reactionID, reactionNode);
- }
- if (i >= 1) {
- Node reactionNodeClone = g.addNodeCopy(reactionNode);
- reactionHelper.addReactionCloneToList(reactionID, reactionNodeClone);
- reactionNode = reactionNodeClone;
- }
-
- AttributeHelper.setSize(reactionNode, 40, 40);
- BoundingBox boundingBox = null;
- if (reactionGlyph != null)
- boundingBox = reactionGlyph.getBoundingBox();
- if (boundingBox != null) {
- Dimensions dimensions = boundingBox.getDimensions();
- if (dimensions != null) {
- double width = dimensions.getWidth();
- double height = dimensions.getHeight();
- AttributeHelper.setSize(reactionNode, width, height);
-
- if (reactionGlyph.isSetLayoutId()) {
- String layoutId = reactionGlyph.getLayoutId();
- AttributeHelper.setAttribute(reactionNode, SBML_Constants.SBML, SBML_Constants.SBML_LAYOUT_ID, layoutId);
- }
- else {
- AttributeHelper.setAttribute(reactionNode, SBML_Constants.SBML, SBML_Constants.SBML_LAYOUT_ID, SBML_Constants.EMPTY);
- }
-
- } else
- {
- AttributeHelper.setSize(reactionNode, 34, 34);
-// System.out.println("reaction id '" + reactionID + "' has no width/height information.");
- }
- Point position = boundingBox.getPosition();
- if (position != null) {
- double x = position.getX();
- double y = position.getY();
- AttributeHelper.setPosition(reactionNode, x, y);
- String layoutId = reactionGlyph.getLayoutId();
- AttributeHelper.setAttribute(reactionNode, SBML_Constants.SBML, SBML_Constants.SBML_LAYOUT_ID, layoutId);
- } else {
- System.out.println("species id '" + reactionID + "' has no x/y information.");
- }
- }
- }
- }
- }
-
- /**
- * The method reads in reactants, products and modifiers. It is called from
- * the method addReactions
- *
- * @param simpleRef
- * the reactant, product or modifier object for the import
- * @param Edge
- * is the reaction node in the graph
- * @param presentedHeadline
- * is visible for the user
- * @param internHeadline
- * intern representation of the headline
- */
- private void setSimpleSpeciesReferences(SimpleSpeciesReference simpleRef,
- Edge edge, String headline, SBMLReactionHelper reactionHelper) {
- /*
- * String keySpecies = SBML_Constants.addToNiceIdList(presentedHeadline,
- * "Species"); String keySpeciesReferenceID =
- * SBML_Constants.addToNiceIdList(presentedHeadline,
- * "Species Reference ID"); String keySpeciesReferenceName =
- * SBML_Constants.addToNiceIdList(presentedHeadline,
- * "Species Reference Name"); String keyMetaId =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "Meta ID"); String
- * keySBOTerm = SBML_Constants.addToNiceIdList(presentedHeadline,
- * "SBOTerm"); String keyToolTip =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "ToolTip");
- */
-
- if (simpleRef instanceof org.sbml.jsbml.SpeciesReference) {
- /*
- * String keyStoichiometry =
- * SBML_Constants.addToNiceIdList(presentedHeadline,
- * "Stoichiometry"); String keyConstant =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "Constant");
- */
- if (((SpeciesReference) simpleRef).isSetStoichiometry()) {
- reactionHelper.setStoichiometry(edge,
- ((SpeciesReference) simpleRef).getStoichiometry());
- }
- if (((SpeciesReference) simpleRef).isSetConstant()) {
- reactionHelper.setConstant(edge,
- ((SpeciesReference) simpleRef).getConstant());
- }
- }
- if (simpleRef.isSetSpecies()) {
- reactionHelper.setSpecies(edge, simpleRef.getSpecies());
- }
- if (simpleRef.isSetId()) {
- reactionHelper.setID(edge, simpleRef.getId());
- }
- if (simpleRef.isSetName()) {
- reactionHelper.setName(edge, simpleRef.getName());
- }
- if (AttributeHelper.getSBMLrole(edge).equals(
- SBML_Constants.ROLE_REACTANT)) {
- if (simpleRef.isSetMetaId()) {
- reactionHelper.setMetaIDReactant(edge, simpleRef.getMetaId());
- }
- if (simpleRef.isSetSBOTerm()) {
- reactionHelper.setSBOTermReactant(edge,
- simpleRef.getSBOTermID());
- }
- if (simpleRef.isSetNotes()) {
- reactionHelper.setNotesReactant(edge,
- simpleRef.getNotesString(), simpleRef.getNotes());
- }
- if (simpleRef.isSetAnnotation()) {
- if (simpleRef.getAnnotation().isSetRDFannotation()) {
- reactionHelper.setAnnotationReactant(edge,
- simpleRef.getAnnotation());
- }
- if (simpleRef.getAnnotation().isSetNonRDFannotation()) {
- reactionHelper.setNonRDFAnnotationReactant(edge, simpleRef
- .getAnnotation().getNonRDFannotation());
- }
- }
- }
- if (AttributeHelper.getSBMLrole(edge).equals(
- SBML_Constants.ROLE_PRODUCT)) {
- if (simpleRef.isSetMetaId()) {
- reactionHelper.setMetaIDProduct(edge, simpleRef.getMetaId());
- }
- if (simpleRef.isSetSBOTerm()) {
- reactionHelper
- .setSBOTermProduct(edge, simpleRef.getSBOTermID());
- }
- if (simpleRef.isSetNotes()) {
- reactionHelper.setNotesProduct(edge,
- simpleRef.getNotesString(), simpleRef.getNotes());
- }
- if (simpleRef.isSetAnnotation()) {
- if (simpleRef.getAnnotation().isSetRDFannotation()) {
- reactionHelper.setAnnotationProduct(edge,
- simpleRef.getAnnotation());
- }
- if (simpleRef.getAnnotation().isSetNonRDFannotation()) {
- reactionHelper.setNonRDFAnnotationProduct(edge, simpleRef
- .getAnnotation().getNonRDFannotation());
- }
- }
- }
- if (AttributeHelper.getSBMLrole(edge).equals(
- SBML_Constants.ROLE_MODIFIER)) {
- if (simpleRef.isSetMetaId()) {
- reactionHelper.setMetaIDModifier(edge, simpleRef.getMetaId());
- }
- if (simpleRef.isSetSBOTerm()) {
- reactionHelper.setSBOTermModifier(edge,
- simpleRef.getSBOTermID());
- }
- if (simpleRef.isSetNotes()) {
- reactionHelper.setNotesModifier(edge,
- simpleRef.getNotesString(), simpleRef.getNotes());
- }
- if (simpleRef.isSetAnnotation()) {
- if (simpleRef.getAnnotation().isSetRDFannotation()) {
- reactionHelper.setAnnotationModifier(edge,
- simpleRef.getAnnotation());
- }
- if (simpleRef.getAnnotation().isSetNonRDFannotation()) {
- reactionHelper.setNonRDFAnnotationModifier(edge, simpleRef
- .getAnnotation().getNonRDFannotation());
- }
- }
- }
- }
-
- /**
- * Adds an edge between an reaction node and a reactant
- *
- * @param g
- * is the data structure for reading in the information.
- * @param molecules
- * contains the reactants of the reaction
- * @param reactionID
- * contains the reaction ID
- * @param modelID
- * contains the model ID
- * @param reactionNode
- * is the reaction node in the graph
- * @param reversible
- * indicates if the reaction is reversible
- */
- private void addReactants(Graph g, ListOf molecules,
- String reactionID, String modelID, Node reactionNode,
- boolean reversible, SBMLReactionHelper reactionHelper) {
- Iterator it = molecules.iterator();
- String stoichiometry;
- SpeciesReference ref;
- Edge newReactionEdge;
- Node reactantNode;
- while (it.hasNext()) {
- ref = it.next();
- reactantNode = SBMLSpeciesHelper.getSpeciesNode(ref.getSpecies());
- stoichiometry = Double.toString(ref.getStoichiometry());
- if (ref.getStoichiometry() == Double.NaN) {
- ErrorMsg.addErrorMessage("Attribute stochiometry of reaction "
- + reactionID + " species " + ref.getSpecies()
- + " is not a valid double value.");
- }
- newReactionEdge = g.addEdge(reactantNode, reactionNode, true,
- AttributeHelper.getDefaultGraphicsAttributeForEdge(
- Color.BLACK, Color.BLACK, true));
- reactionHelper.addReactantCloneToList(reactionID, ref.getSpecies(), newReactionEdge);
-// System.out.println("In Reaction Reader: " + reactionID + " " + ref.getSpecies());
- if (reversible) {
- AttributeHelper.setArrowtail(newReactionEdge, true);
- }
-
- AttributeHelper.setLabel(newReactionEdge, stoichiometry);
- AttributeHelper.setAttribute(newReactionEdge, SBML_Constants.SBML,
- SBML_Constants.SBML_ROLE, SBML_Constants.ROLE_REACTANT);
- // AttributeHelper.setAttribute(newReactionEdge, SBML_Constants.SBML,
- // SBML_Constants.REVERSIBLE, reversible);
- AttributeHelper.setAttribute(newReactionEdge, SBML_Constants.SBML,
- SBML_Constants.STOICHIOMETRY, stoichiometry);
- setSimpleSpeciesReferences(ref, newReactionEdge,
- SBML_Constants.SBML, reactionHelper);
- }
- }
-
- /**
- * Adds an edge between an reaction node and a product
- *
- * @param g
- * is the data structure for reading in the information
- * @param molecules
- * contains the products of the reaction
- * @param reactionID
- * contains the reaction ID
- * @param modelID
- * contains the model ID
- * @param reactionNode
- * is the reaction node in the graph
- * @param reversible
- * indicates if the reaction is reversible
- */
- private void addProducts(Graph g, ListOf molecules,
- String reactionID, String modelID, Node reactionNode,
- boolean reversible, SBMLReactionHelper reactionHelper) {
- Iterator it = molecules.iterator();
- Edge newReactionEdge;
- String stoichiometry;
- String label;
- Node productNode;
- SpeciesReference ref;
- while (it.hasNext()) {
- ref = it.next();
- productNode = SBMLSpeciesHelper.getSpeciesNode(ref.getSpecies());
- stoichiometry = Double.toString(ref.getStoichiometry());
- label = stoichiometry;
-
- newReactionEdge = g.addEdge(reactionNode, productNode, true,
- AttributeHelper.getDefaultGraphicsAttributeForEdge(
- Color.BLACK, Color.BLACK, true));
- reactionHelper.addProductCloneToList(reactionID, ref.getSpecies(), newReactionEdge);
-
- if (reversible) {
- AttributeHelper.setArrowtail(newReactionEdge, true);
- }
- if (ref.getStoichiometry() == Double.NaN) {
- ErrorMsg.addErrorMessage("Attribute stochiometry of reaction "
- + reactionID + " species " + ref.getSpecies()
- + " is not a valid double value.");
- }
-
- AttributeHelper.setLabel(newReactionEdge, label);
- AttributeHelper.setAttribute(newReactionEdge, SBML_Constants.SBML,
- SBML_Constants.SBML_ROLE, SBML_Constants.ROLE_PRODUCT);
- // AttributeHelper.setAttribute(newReactionEdge, SBML_Constants.SBML,
- // SBML_Constants.REVERSIBLE, reversible);
- AttributeHelper.setAttribute(newReactionEdge, SBML_Constants.SBML,
- SBML_Constants.STOICHIOMETRY, stoichiometry);
- setSimpleSpeciesReferences(ref, newReactionEdge,
- SBML_Constants.SBML, reactionHelper);
- }
- }
-
- /**
- * Adds an edge between an reaction node and a modifier
- *
- * @param g
- * is the data structure for reading in the information.
- * @param molecules
- * contains the modifiers of the reaction.
- * @param reactionNode
- * is the node that will be connected with the modifier
- */
- private void addModifier(Graph g,
- ListOf molecules, Node reactionNode,
- SBMLReactionHelper reactionHelper, String reactionID) {
- Iterator it = molecules.iterator();
- Edge reactionEdge;
- ModifierSpeciesReference ref;
- Node modifierNode;
- while (it.hasNext()) {
- ref = it.next();
- modifierNode = SBMLSpeciesHelper.getSpeciesNode(ref.getSpecies());
- reactionEdge = g.addEdge(modifierNode, reactionNode, false,
- AttributeHelper.getDefaultGraphicsAttributeForEdge(
- Color.DARK_GRAY, Color.DARK_GRAY, true));
-
- AttributeHelper.setAttribute(reactionEdge, SBML_Constants.SBML,
- SBML_Constants.SBML_ROLE, SBML_Constants.ROLE_MODIFIER);
- reactionHelper.addModifierCloneToList(reactionID, ref.getSpecies(), reactionEdge);
- AttributeHelper.setDashInfo(reactionEdge, 5, 5);
- AttributeHelper.setBorderWidth(reactionEdge, 1d);
- setSimpleSpeciesReferences(ref, reactionEdge, SBML_Constants.SBML,
- reactionHelper);
- }
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Rule_Reader.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Rule_Reader.java
deleted file mode 100644
index 1e6706c0b..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Rule_Reader.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/**
- * This class reads in Rules
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml;
-
-import java.util.Iterator;
-
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.AlgebraicRule;
-import org.sbml.jsbml.AssignmentRule;
-import org.sbml.jsbml.ListOf;
-import org.sbml.jsbml.RateRule;
-import org.sbml.jsbml.Rule;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLAlgebraicRule;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLAssignmentRule;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLRateRule;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLRuleHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_Rule_Reader {
-
- /**
- * Method reads in rules and is called from class SBML_XML_Reader.java
- *
- * @param listOfRules
- * contains the rules for the import
- * @param g
- * the data structure for reading in the information
- */
- public void addRule(ListOf listOfRules, Graph g) {
- Iterator itRule = listOfRules.iterator();
- int rateCount = 1;
- int assignmentCount = 1;
- int algebraicCount = 1;
- SBMLRuleHelper ruleHelperObject = new SBMLRuleHelper();
- while (itRule.hasNext()) {
- Rule rule = itRule.next();
- String metaID = rule.getMetaId();
- String sboTerm = rule.getSBOTermID();
-
- String math = "";
- try {
- if (rule.isSetMath()) {
- if (null != rule.getMath()) {
- math = rule.getMath().toFormula();
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- String variable = "";
- if (rule.isAssignment()) {
- AssignmentRule assignment = (AssignmentRule) rule;
-
- String internHeadline = new StringBuffer(
- SBML_Constants.SBML_ASSIGNMENT_RULE).append(
- assignmentCount).toString();
- String presentedHeadline = new StringBuffer(
- "SBML Assignment Rule ").append(assignmentCount)
- .toString();
- SBMLAssignmentRule assignmentRuleHelper = ruleHelperObject
- .addAssignmentRule(g, internHeadline, presentedHeadline);
- // initAssignmnetNiceIDs(internHeadline, presentedHeadline);
-
- /*
- * String presentedHeadline = "SBML Assignment Rule " +
- * assignmentCount; String internHeadline =
- * getNiceHeadline(presentedHeadline);
- * SBML_Constants.put(internHeadline, presentedHeadline);
- */
-
- /*
- * String keyVariable =
- * SBML_Constants.addToNiceIdList(presentedHeadline,
- * "Variable"); String keyFormula =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "Formula");
- * String keyMetaId =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "Meta ID");
- * String keySBOTerm =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "SBOTerm");
- * String keyToolTip =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "ToolTip");
- */
-
- variable = assignment.getVariable();
- if (assignment.isSetMetaId()) {
- assignmentRuleHelper.setMetaID(metaID);
- }
- if (assignment.isSetSBOTerm()) {
- assignmentRuleHelper.setSBOTerm(sboTerm);
- }
- if (assignment.isSetMath()) {
- assignmentRuleHelper.setFunction(math);
- }
- if (assignment.isSetVariable()) {
- assignmentRuleHelper.setVariable(variable);
- }
- if (assignment.isSetNotes()) {
- assignmentRuleHelper.setNotes(rule.getNotesString(),
- rule.getNotes());
- }
- if (assignment.isSetAnnotation()) {
- if (assignment.getAnnotation().isSetRDFannotation()) {
- assignmentRuleHelper.setAnnotation(assignment
- .getAnnotation());
- }
- if (assignment.getAnnotation().isSetNonRDFannotation()) {
- assignmentRuleHelper.setNonRDFAnnotation(assignment
- .getAnnotation().getNonRDFannotation());
- }
- }
-
- assignmentCount++;
- }
- if (rule.isAlgebraic()) {
- AlgebraicRule algebraic = (AlgebraicRule) rule;
-
- String internHeadline = new StringBuffer(
- SBML_Constants.SBML_ALGEBRAIC_RULE).append(
- algebraicCount).toString();
- String presentedHeadline = new StringBuffer(
- "SBML Algebraic Rule ").append(algebraicCount)
- .toString();
-
- SBMLAlgebraicRule algebraicRuleHelper = ruleHelperObject
- .addAlgebraicRule(g, internHeadline, presentedHeadline);
- // initAlgebraicNiceIDs(internHeadline, presentedHeadline);
-
- /*
- * String presentedHeadline = "SBML Algebraic Rule " +
- * algebraicCount; String internHeadline =
- * getNiceHeadline(presentedHeadline);
- * SBML_Constants.put(internHeadline, presentedHeadline);
- * String keyFormula =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "Formula");
- * String keyMetaId =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "Meta ID");
- * String keySBOTerm =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "SBOTerm");
- * String keyToolTip =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "ToolTip");
- */
-
- if (algebraic.isSetMetaId()) {
- algebraicRuleHelper.setMetaID(metaID);
- }
- if (algebraic.isSetSBOTerm()) {
- algebraicRuleHelper.setSBOTerm(sboTerm);
- }
- if (algebraic.isSetMath()) {
- algebraicRuleHelper.setFunction(math);
- }
- if (algebraic.isSetNotes()) {
- algebraicRuleHelper.setNotes(rule.getNotesString(),
- rule.getNotes());
- }
- if (algebraic.isSetAnnotation()) {
- if (algebraic.getAnnotation().isSetRDFannotation()) {
- algebraicRuleHelper.setAnnotation(algebraic
- .getAnnotation());
- }
- if (algebraic.getAnnotation().isSetNonRDFannotation()) {
- algebraicRuleHelper.setNonRDFAnnotation(algebraic
- .getAnnotation().getNonRDFannotation());
- }
- }
-
- algebraicCount++;
- }
- if (rule.isRate()) {
- RateRule rate = (RateRule) rule;
-
- String internHeadline = new StringBuffer(
- SBML_Constants.SBML_RATE_RULE).append(rateCount)
- .toString();
- String presentedHeadline = new StringBuffer("SBML Rate Rule ")
- .append(rateCount).toString();
- SBMLRateRule rateRuleHelper = ruleHelperObject.addRateRule(g,
- internHeadline, presentedHeadline);
- // initRateNiceIDs(internHeadline, presentedHeadline);
-
- /*
- * String presentedHeadline = "SBML Rate Rule " + rateCount;
- * String internHeadline = getNiceHeadline(presentedHeadline);
- * SBML_Constants.put(internHeadline, presentedHeadline);
- * String keyVariable =
- * SBML_Constants.addToNiceIdList(presentedHeadline,
- * "Variable"); String keyFormula =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "Formula");
- * String keyMetaId =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "Meta ID");
- * String keySBOTerm =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "SBOTerm");
- * String keyToolTip =
- * SBML_Constants.addToNiceIdList(presentedHeadline, "ToolTip");
- */
-
- variable = rate.getVariable();
- if (rate.isSetMetaId()) {
- rateRuleHelper.setMetaID(metaID);
- }
- if (rate.isSetSBOTerm()) {
- rateRuleHelper.setSBOTerm(sboTerm);
- }
- if (rate.isSetMath()) {
- rateRuleHelper.setFunction(math);
- }
- if (rate.isSetVariable()) {
- rateRuleHelper.setVariable(variable);
- }
- if (rate.isSetNotes()) {
- rateRuleHelper.setNotes(rule.getNotesString(),
- rule.getNotes());
- }
- if (rate.isSetAnnotation()) {
- if (rate.getAnnotation().isSetRDFannotation()) {
- rateRuleHelper.setAnnotation(rate.getAnnotation());
- }
- if (rate.getAnnotation().isSetNonRDFannotation()) {
- rateRuleHelper.setNonRDFAnnotation(rate.getAnnotation()
- .getNonRDFannotation());
- }
- }
-
- rateCount++;
- }
- }
- }
-
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_SBML_Reader.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_SBML_Reader.java
deleted file mode 100644
index 089ac2e42..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_SBML_Reader.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * This class reads in the SBML Tag
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml;
-
-import java.util.HashMap;
-
-import org.AttributeHelper;
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.SBMLDocument;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_SBML_Reader extends SBML_SBase_Reader {
-
- /**
- * Method reads in the model tag information and is called from class
- * SBML_XML_Reader.java
- *
- * @param document
- * contains the model for the import
- * @param g
- * the data structure for reading in the information
- */
- public void addSBML(SBMLDocument document, Graph g) {
- SBML_Constants.init();
- namespaceCollector = new HashMap();
- addNamespaces(document.getSBMLDocumentNamespaces(), g,
- SBML_Constants.SBML, SBML_Constants.NAMESPACE);
-
- int level = document.getLevel();
- int version = document.getVersion();
- String metaID = document.getMetaId();
- String sboTerm = document.getSBOTermID();
-
- if (document.isSetNotes()) {
- addNotes(document.getNotes(), document.getNotesString(), g,
- SBML_Constants.SBML, SBML_Constants.SBML_NOTES);
- }
- if (!metaID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.SBML_META_ID, metaID);
- }
- if (!sboTerm.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.SBML_SBOTERM, sboTerm);
- }
-
- if (document.isSetAnnotation()) {
- if (document.getAnnotation().isSetRDFannotation()) {
- if (null != document.getAnnotation()) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.SBML_ANNOTATION,
- document.getAnnotation());
- }
- }
- if (document.getAnnotation().isSetNonRDFannotation()) {
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.SBML_NON_RDF_ANNOTATION, document
- .getAnnotation().getNonRDFannotation());
-
- }
- }
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.LEVEL, level);
- AttributeHelper.setAttribute(g, SBML_Constants.SBML,
- SBML_Constants.VERSION, version);
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_SBase_Reader.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_SBase_Reader.java
deleted file mode 100644
index 527d66e60..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_SBase_Reader.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/**
- * Reads in Attributes from the class SBase. All other components of the
- * model inherit from this class
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml;
-
-import java.awt.Color;
-import java.awt.geom.Point2D;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.AttributeHelper;
-import org.graffiti.graph.Edge;
-import org.graffiti.graph.Graph;
-import org.graffiti.graph.Node;
-import org.sbml.jsbml.xml.XMLNamespaces;
-import org.sbml.jsbml.xml.XMLNode;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_SBase_Reader {
-
- /**
- * To make the code shorter
- */
- public static final String ATT = AttributeHelper.attributeSeparator;
-
- /**
- * Stores the namespaces which already has been added to the graph tab
- */
- public static HashMap namespaceCollector;
-
- /**
- * This method processes an string with xhtml content
- *
- * @param xhtml
- * @return
- */
- public static String removeTagFromString(String xhtml) {
- String content = xhtml.replace("\n", "").replace("\t", "").trim();
- // Replace anything between script or style tags
- // A regular expression to match anything in between <>
- // Reads as: Match a "<"
- // Match one or more characters that are not ">"
- // Match "<";
- String tagregex = "<[^>]*>";
- Pattern p2 = Pattern.compile(tagregex);
- Matcher m2 = p2.matcher(content);
- // Replace any matches with nothing
- content = m2.replaceAll("");
- return content.trim();
- }
-
- /**
- * Method transforms an presented headline into an intern headline
- *
- * @param presentedHeadline
- * is visible for the user
- * @return
- */
- public String getNiceHeadline(String presentedHeadline) {
- return presentedHeadline.replaceAll(" ", "_").toLowerCase();
- }
-
- public void addNotes(XMLNode notesObject, String notesString, Edge e,
- String path, String notesName) {
- // addNamespaces(notesObject, g, "sbml", "sbml_namespaces");
- if ((null != notesString)
- && !(SBML_Constants.EMPTY.equals(notesString))) {
- // String notes = removeTagFromString(notesString);
- // AttributeHelper.setAttribute(g, path, path+"_"+notesName, notes);
- // AttributeHelper.setAttribute(e, path, notesName, notes);
- AttributeHelper.setAttribute(e, path, notesName, notesObject);
- }
- }
-
- /**
- * This method adds notes to the current object in the graph tab
- *
- * @param notesObject
- * contains the notes in XML Node form
- * @param notesString
- * contains the notes as a String
- * @param g
- * is the data structure for reading in the information
- * @param path
- * intern representation where to add the notes
- * @param notesName
- * contains the presented headline and the presented attribute
- * name
- */
- public void addNotes(XMLNode notesObject, String notesString, Graph g,
- String path, String notesName) {
- addNamespaces(notesObject, g, "sbml", "sbml_namespaces");
- // if ((null != notesString)
- // && !(SBML_Constants.EMPTY.equals(notesString))) {
- // String notes = removeTagFromString(notesString);
- // AttributeHelper.setAttribute(g, path, path+"_"+notesName, notes);
- AttributeHelper.setAttribute(g, path, notesName, notesObject);
- // }
- }
-
- /**
- * This method adds notes to the current object in the node tab
- *
- * @param notesObject
- * contains the notes in XML Node form
- * @param notesString
- * contains the notes as a String
- * @param node
- * is the data structure for reading in the information
- * @param path
- * intern representation where to add the notes
- * @param notesName
- * contains the presented headline and the presented attribute
- * name
- */
- public void addNotes(XMLNode notesObject, String notesString, Node node,
- String path, String notesName) {
- addNamespaces(notesObject, node, path, notesName + " Namespace");
- if ((null != notesString)
- && !(SBML_Constants.EMPTY.equals(notesString))) {
- // String notes = removeTagFromString(notesString);
- // AttributeHelper.setAttribute(node, path, notesName, notes);
- AttributeHelper.setAttribute(node, path, notesName, notesObject);
- }
- }
-
- /**
- * Method helps to set Attributes
- * Creates nodes with 20, 20 height/width
- * @param node
- * the current node
- * @param color
- * the aimed color
- * @param label
- * label of the node
- * @param point
- * coordinates of the node
- * @param size_multiplier
- * determines the size of the node
- */
- public void setAttributes(Node node, Color color, String label,
- Point2D point, int size_multiplier) {
- AttributeHelper.setDefaultGraphicsAttribute(node, point);
- AttributeHelper.setLabel(node, label);
- AttributeHelper.setSize(node, 20d/*label.length() * size_multiplier*/, 20d);
- AttributeHelper.setFillColor(node, color);
- }
-
- /**
- * Adds the namespaces of an XMLNode to the graph tab
- *
- * @param node
- * contains the namespaces
- * @param g
- * the graph that should be imported
- */
- public static void addNamespaces(XMLNode node, Graph g, String path,
- String attribute) {
- if (node != null) {
- if (!(node.isNamespacesEmpty())) {
- XMLNamespaces ns = node.getNamespaces();
- String namespacesList = "";
- String namespaceAttribute = (String) AttributeHelper
- .getAttributeValue(g, path, attribute, null, null);
- if (namespaceAttribute != null) {
- namespacesList = namespaceAttribute;
- }
- if (null != ns) {
- for (int i = 0; i < ns.getLength(); i++) {
- if (!(namespaceCollector.containsKey(ns.getPrefix(i)))) {
- namespacesList += ns.getPrefix(i) + "=\""
- + ns.getURI(i) + "\"";
- namespaceCollector.put(ns.getPrefix(i),
- "=\"" + ns.getURI(i) + "\"");
- }
- }
- }
- AttributeHelper
- .setAttribute(g, path, attribute, namespacesList);
- }
- }
- }
-
- /**
- * Adds the namespaces of an XMLNode to the graph tab
- *
- * @param node
- * contains the namespaces
- * @param g
- * the graph that should be imported
- */
- private void addNamespaces(XMLNode node, Node n, String path,
- String attribute) {
- if (node != null) {
- if (!(node.isNamespacesEmpty())) {
- XMLNamespaces ns = node.getNamespaces();
- String namespacesList = "";
- String namespaceAttribute = (String) AttributeHelper
- .getAttributeValue(n, path, attribute, null, null);
- if (namespaceAttribute != null) {
- namespacesList = namespaceAttribute;
- }
- if (null != ns) {
- for (int i = 0; i < ns.getLength(); i++) {
- namespacesList += ns.getPrefix(i) + "=\""
- + ns.getURI(i) + "\"";
- }
- }
- AttributeHelper
- .setAttribute(n, path, attribute, namespacesList);
- }
- }
- }
-
- /**
- * Adds a map of namespaces (namespace, URL) to the graph tab.
- *
- * @param namespaces
- * contains the namespaces and the URLs
- * @param g
- * the graph that should be imported
- */
- public void addNamespaces(Map namespaces, Graph g,
- String path, String attribute) {
- if (namespaces != null) {
- String namespacesList = "";
- String namespaceAttribute = (String) AttributeHelper
- .getAttributeValue(g, path, attribute, null, null);
- if (namespaceAttribute != null) {
- namespacesList = namespaceAttribute;
- }
- Set> entries = namespaces.entrySet();
- for (Iterator> iterator = entries.iterator(); iterator
- .hasNext();) {
- Entry entry = (Entry) iterator
- .next();
- if (!(namespaceCollector.containsKey(entry.getKey()))
- && entry.getKey().contains(":")) {
- namespacesList += (entry.getKey() + "=\""
- + entry.getValue() + "\" ");
- namespaceCollector.put(entry.getKey(),
- "=\"" + entry.getValue() + "\" ");
- }
- }
- if (!namespacesList.isEmpty()) {
- AttributeHelper
- .setAttribute(g, path, attribute, namespacesList);
- }
- }
- /*
- * else { AttributeHelper.setAttribute(g, path, attribute, ""); }
- */
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Species_Reader.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Species_Reader.java
deleted file mode 100644
index 3769bbf0a..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_Species_Reader.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/**
- * This class reads in Species
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.TreeMap;
-
-import org.AttributeHelper;
-import org.ErrorMsg;
-import org.PositionGridGenerator;
-import org.graffiti.attributes.Attribute;
-import org.graffiti.attributes.CollectionAttribute;
-import org.graffiti.attributes.HashMapAttribute;
-import org.graffiti.graph.Graph;
-import org.graffiti.graph.Node;
-import org.sbml.jsbml.ListOf;
-import org.sbml.jsbml.Species;
-import org.sbml.jsbml.ext.layout.BoundingBox;
-import org.sbml.jsbml.ext.layout.Dimensions;
-import org.sbml.jsbml.ext.layout.ExtendedLayoutModel;
-import org.sbml.jsbml.ext.layout.Layout;
-import org.sbml.jsbml.ext.layout.Point;
-import org.sbml.jsbml.ext.layout.SpeciesGlyph;
-import org.sbml.jsbml.xml.XMLNode;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLSpeciesHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_Species_Reader {
-
- /**
- * Provides useful methods
- */
- SBMLSpeciesHelper speciesHelper;
-
- /**
- * reads in species and is called from class SBML_XML_Reader.java. The
- * method adds species to the graph and to the node tab
- *
- * @param g
- * the data structure for reading in the information
- * @param speciesList
- * contains the species for the import
- * @param pgg
- * is needed for drawing the graph
- */
- public void addSpecies(Graph g, ListOf speciesList,
- PositionGridGenerator pgg, SBMLSpeciesHelper specieshelper) {
- if (!speciesList.isEmpty()) {
- speciesHelper = specieshelper;
- Iterator itSpecies = speciesList.iterator();
- Node speciesNode;
- Species speciesJSBML;
- String id;
- String name;
- String compartment;
- Double initialAmount;
- Double initialConcentration;
- String substanceUnits;
- Boolean hasOnlySubstanceUnits;
- Boolean boundaryCondition;
- Boolean constant;
- String conversionFactor;
- String metaID;
- XMLNode notesObj;
- String notes;
- Integer charge;
- String sboTerm;
-
- while (itSpecies.hasNext()) {
- speciesJSBML = itSpecies.next();
- speciesNode = g.addNode();
- id = speciesJSBML.getId();
- name = speciesJSBML.getName();
- speciesHelper.setLabel(speciesNode, name, id, pgg);
- AttributeHelper.setAttribute(speciesNode, SBML_Constants.SBML,
- SBML_Constants.SBML_ROLE, SBML_Constants.ROLE_SPECIES);
- AttributeHelper.setShapeEllipse(speciesNode);
- AttributeHelper.setBorderWidth(speciesNode, 1d);
- compartment = speciesJSBML.getCompartment();
- initialAmount = speciesJSBML.getInitialAmount();
- if (initialAmount.equals(Double.NaN)) {
- ErrorMsg.addErrorMessage("Attribute initialAmount of species "
- + id
- + " is not a valid double value or it is coexistent with the initialConcentration value.");
- }
- initialConcentration = speciesJSBML.getInitialConcentration();
- if (initialConcentration.equals(Double.NaN)
- && !(speciesJSBML.isSetInitialAmount())) {
- ErrorMsg.addErrorMessage("Attribute initialConcentration of species "
- + id
- + " is not a valid double value or it is coexistent with the initialAmount value.");
- }
- substanceUnits = speciesJSBML.getSubstanceUnits();
- hasOnlySubstanceUnits = speciesJSBML.getHasOnlySubstanceUnits();
- boundaryCondition = speciesJSBML.getBoundaryCondition();
- constant = speciesJSBML.getConstant();
- conversionFactor = speciesJSBML.getConversionFactor();
- metaID = speciesJSBML.getMetaId();
- sboTerm = speciesJSBML.getSBOTermID();
- notesObj = speciesJSBML.getNotes();
- notes = speciesJSBML.getNotesString();
- charge = speciesJSBML.getCharge();
-
- if (speciesJSBML.isSetId()
- && Species.isValidId(id, speciesJSBML.getLevel(),
- speciesJSBML.getVersion())) {
- speciesHelper.setID(speciesNode, id);
- speciesHelper.setHiddenLabel(speciesNode, id);
- }
- if (speciesJSBML.isSetCompartment()) {
- speciesHelper.setCompartment(speciesNode, compartment);
- }
- if (speciesJSBML.isSetInitialAmount()) {
- speciesHelper.setInitialAmount(speciesNode, initialAmount);
- }
- if (speciesJSBML.isSetInitialConcentration()) {
- speciesHelper.setInitialConcentration(speciesNode,
- initialConcentration);
- }
- if (speciesJSBML.isSetSubstanceUnits()) {
- speciesHelper
- .setSubstanceUnits(speciesNode, substanceUnits);
- }
- if (speciesJSBML.isSetHasOnlySubstanceUnits()) {
- speciesHelper.setHasOnlySubstanceUnits(speciesNode,
- hasOnlySubstanceUnits);
- }
-// if (speciesJSBML.isSetBoundaryCondition()) {
- speciesHelper.setBoundaryConsition(speciesNode,
- boundaryCondition);
-// }
- if (speciesJSBML.isSetConstant()) {
- speciesHelper.setConstant(speciesNode, constant);
- }
- if (speciesJSBML.isSetConversionFactor()) {
- speciesHelper.setConversionFactor(speciesNode,
- conversionFactor);
- }
- if (speciesJSBML.isSetMetaId()) {
- speciesHelper.setMetaID(speciesNode, metaID);
- }
- if (speciesJSBML.isSetSBOTerm()) {
- speciesHelper.setSBOTerm(speciesNode, sboTerm);
- }
- if (speciesJSBML.isSetNotes()) {
- speciesHelper.setNotes(speciesNode, notes, notesObj);
- }
- if (speciesJSBML.isSetAnnotation()) {
- if (speciesJSBML.getAnnotation().isSetRDFannotation()) {
- speciesHelper.setAnnotation(speciesNode,
- speciesJSBML.getAnnotation());
- }
- if (speciesJSBML.getAnnotation().isSetNonRDFannotation()) {
- speciesHelper.setNonRDFAnnotation(speciesNode,
- speciesJSBML.getAnnotation()
- .getNonRDFannotation());
- }
- }
- if (speciesJSBML.isSetCharge()) {
- speciesHelper.setCharge(speciesNode, charge);
- }
- if (speciesJSBML.isSetCompartment()) {
- speciesHelper.setCompartmentName(speciesNode);
- }
- if (SBML_Constants.isLayoutActive) {
- processLayoutInformation(g, speciesJSBML, speciesNode);
- }
- }
- }
- }
-
- private void processLayoutInformation(Graph g, Species speciesJSBML, Node speciesNode) {
- String id = speciesJSBML.getId();
- ExtendedLayoutModel layoutModel = (ExtendedLayoutModel) speciesJSBML.getModel().getExtension(SBMLHelper.SBML_LAYOUT_EXTENSION_NAMESPACE);
- if (layoutModel != null) {
- Layout layout = layoutModel.getListOfLayouts().iterator().next();
- ListOf currentSpeciesGlyphs = new ListOf();
- currentSpeciesGlyphs.setLevel(layout.getLevel());
- currentSpeciesGlyphs.setVersion(layout.getVersion());
- Iterator speciesGlyphListIt = layout.getListOfSpeciesGlyphs().iterator();
- while (speciesGlyphListIt.hasNext()) {
- SpeciesGlyph nextSpeciesGlyph = speciesGlyphListIt.next();
- if (nextSpeciesGlyph.getSpecies().equals(id)) {
- nextSpeciesGlyph.setVersion(1);
- currentSpeciesGlyphs.add(nextSpeciesGlyph);
-
- }
- }
- for (int i = 0; i < currentSpeciesGlyphs.size(); i++) {
- SpeciesGlyph speciesGlyph = currentSpeciesGlyphs.get(i);
-
- if (i == 0) {
- speciesHelper.addCloneToList(id, speciesNode);
- }
- if (i >= 1) {
- Node speciesNodeClone = g.addNodeCopy(speciesNode);
- speciesHelper.addCloneToList(id, speciesNodeClone);
- speciesNode = speciesNodeClone;
- }
-
- AttributeHelper.setSize(speciesNode, 27, 27);
- // SpeciesGlyph speciesGlyph = speciesGlyphs.get(i);
- BoundingBox boundingBox = speciesGlyph.getBoundingBox();
- if (boundingBox != null) {
- Dimensions dimensions = boundingBox.getDimensions();
- if (dimensions != null) {
- double width = dimensions.getWidth();
- double height = dimensions.getHeight();
- AttributeHelper.setSize(speciesNode, width, height);
-
- if (speciesGlyph.isSetLayoutId()) {
- String layoutId = speciesGlyph.getLayoutId();
- AttributeHelper.setAttribute(speciesNode, SBML_Constants.SBML, SBML_Constants.SBML_LAYOUT_ID, layoutId);
- }
- else {
- AttributeHelper.setAttribute(speciesNode, SBML_Constants.SBML, SBML_Constants.SBML_LAYOUT_ID, SBML_Constants.EMPTY);
- }
- } else
- {
- AttributeHelper.setSize(speciesNode, 27, 27);
- }
- Point position = boundingBox.getPosition();
- if (position != null) {
- double x = position.getX();
- double y = position.getY();
- AttributeHelper.setPosition(speciesNode, x, y);
- String layoutId = speciesGlyph.getLayoutId();
- AttributeHelper.setAttribute(speciesNode, SBML_Constants.SBML, SBML_Constants.SBML_LAYOUT_ID, layoutId);
- }
- }
- }
- }
-
- }
-
- private void printAllSBMLAttributes(Node species) {
- CollectionAttribute collection = species.getAttributes();
- Map map = collection.getCollection();
- for (Entry entry : map.entrySet()) {
- Attribute attr = entry.getValue();
- HashMapAttribute attrHashMap = (HashMapAttribute) attr;
- TreeMap collectionAttr = (TreeMap) attr.getValue();
- for (Entry entryAttr : collectionAttr.entrySet()) {
-
- String[] attrSeparates = entryAttr.getValue().getPath().split("\\" + Attribute.SEPARATOR);
- for (String name : attrSeparates) {
- }
-
- }
- }
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_UnitDefinition_Reader.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_UnitDefinition_Reader.java
deleted file mode 100644
index 39264d032..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_UnitDefinition_Reader.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/**
- * This class reads in UnitDefinitions
- */
-
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.ErrorMsg;
-import org.graffiti.graph.Graph;
-import org.sbml.jsbml.ListOf;
-import org.sbml.jsbml.Unit;
-import org.sbml.jsbml.UnitDefinition;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLUnit;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLUnitDefinition;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLUnitDefinitionHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-public class SBML_UnitDefinition_Reader {
-
- /**
- * Method reads in unit definitions and is called from class
- * SBML_XML_Reader.java
- *
- * @param unitDefinitionList
- * contains the unit definitions for the import
- * @param g
- * the data structure for reading in the information
- */
- public void addUnitDefinitions(ListOf unitDefinitionList,
- Graph g) {
- Iterator itUnitDefinition = unitDefinitionList
- .iterator();
- int unitCount = 1;
- SBMLUnitDefinitionHelper unitDefinitionHelperObject = new SBMLUnitDefinitionHelper();
- while (itUnitDefinition.hasNext()) {
- int subUnitCount = 1;
- UnitDefinition unitDefinition = itUnitDefinition.next();
- String internHeadline = new StringBuffer(
- SBML_Constants.SBML_UNIT_DEFINITION).append(unitCount)
- .toString();
- String presentedHeadline = new StringBuffer("SBML Unit Definition ")
- .append(unitCount).toString();
- SBMLUnitDefinition unitDefinitionHelper = unitDefinitionHelperObject
- .addUnitDefinition(g, internHeadline, presentedHeadline);
-
- String unitDefinitionID = unitDefinition.getId();
- String unitDefinitionName = unitDefinition.getName();
- String unitDefinitionSBOTerm = "";
- if (unitDefinition.isSetSBOTerm()) {
- unitDefinitionSBOTerm = unitDefinition.getSBOTermID();
- }
- String unitDefinitionMetaID = "";
- if (unitDefinition.isSetMetaId()) {
- unitDefinitionMetaID = unitDefinition.getMetaId();
- }
-
- if (unitDefinition.isSetNotes()) {
- unitDefinitionHelper.setNotes(unitDefinition.getNotesString(),
- unitDefinition.getNotes());
- }
- if (unitDefinition.isSetId()
- && UnitDefinition.isValidId(unitDefinitionID,
- unitDefinition.getLevel(),
- unitDefinition.getVersion())) {
- ;
- unitDefinitionHelper.setID(unitDefinitionID);
- }
- if (unitDefinition.isSetName()) {
- unitDefinitionHelper.setName(unitDefinitionName);
- }
- if (unitDefinition.isSetMetaId()) {
- unitDefinitionHelper.setMetaID(unitDefinitionMetaID);
- }
- if (unitDefinition.isSetSBOTerm()) {
- unitDefinitionHelper.setSBOTerm(unitDefinitionSBOTerm);
- }
- if (unitDefinition.isSetAnnotation()) {
- if (unitDefinition.getAnnotation().isSetRDFannotation()) {
- unitDefinitionHelper.setAnnotation(unitDefinition
- .getAnnotation());
- }
- if (unitDefinition.getAnnotation().isSetNonRDFannotation()) {
- unitDefinitionHelper.setNonRDFAnnotation(unitDefinition
- .getAnnotation().getNonRDFannotation());
- }
- }
- // The sub units are collected in this list
- List ListOfSubUnits = new ArrayList();
- if (unitDefinition.isSetListOfUnits()) {
- List unitList = unitDefinition.getListOfUnits();
- Iterator itUnit = unitList.iterator();
- SBMLUnit unitHelper = null;
- while (itUnit.hasNext()) {
- unitHelper = unitDefinitionHelper.addUnit(subUnitCount);
- Unit unit = itUnit.next();
- int scale = unit.getScale();
- Double exponent = unit.getExponent();
- if (exponent.equals(Double.NaN)) {
- ErrorMsg.addErrorMessage("Attribute exponent of unit definition "
- + unitCount
- + " sub unit "
- + subUnitCount
- + " with the id "
- + unitDefinitionID
- + " is not a valid double value.");
- }
- Double multiplier = unit.getMultiplier();
- if (multiplier.equals(Double.NaN)) {
- ErrorMsg.addErrorMessage("Attribute multiplier of unit definition "
- + unitCount
- + " sub unit "
- + subUnitCount
- + " with the id "
- + unitDefinitionID
- + " is not a valid double value.");
- }
- String kind = unit.getKind().getName();
- String composedSubUnit = "(" + multiplier + " * 10^"
- + scale + " * " + kind + ")^" + exponent;
-
- unitHelper.setComposedSubUnit(composedSubUnit);
- if (unit.isSetMetaId()) {
- unitHelper.setMetaID(unit.getMetaId());
- }
- if (unit.isSetSBOTerm()) {
- unitHelper.setSBOTerm(unit.getSBOTermID());
- }
- if (unit.isSetNotes()) {
- unitHelper.setNotes(unit.getNotesString(),
- unit.getNotes());
- }
- if (unit.isSetAnnotation()) {
- if (unit.getAnnotation().isSetRDFannotation()) {
- unitHelper.setAnnotation(unit.getAnnotation());
- }
- if (unit.getAnnotation().isSetNonRDFannotation()) {
- unitHelper.setNonRDFAnnotation(unit.getAnnotation()
- .getNonRDFannotation());
- }
- }
- ListOfSubUnits.add(composedSubUnit);
-
- subUnitCount++;
- }
- String composedUnit = "";
- int size = ListOfSubUnits.size();
- int count = 0;
- Iterator itSubUnits = ListOfSubUnits.iterator();
- while (itSubUnits.hasNext()) {
- String subUnit = itSubUnits.next();
- composedUnit = composedUnit + subUnit;
- count++;
- if (count < size) {
- composedUnit = composedUnit + " * ";
- }
- }
- unitHelper.setComposedUnit(composedUnit);
- }
-
- unitCount++;
- }
-
- }
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_XML_Reader.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_XML_Reader.java
deleted file mode 100644
index 0b3b69cfa..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_XML_Reader.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/**
- * This class reads in SBML files
- */
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml;
-
-import java.io.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.io.Reader;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.List;
-
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.xml.stream.XMLStreamException;
-
-import org.ErrorMsg;
-import org.apache.log4j.Logger;
-import org.graffiti.editor.GravistoService;
-import org.graffiti.editor.MainFrame;
-import org.graffiti.graph.Graph;
-import org.graffiti.plugin.io.AbstractInputSerializer;
-import org.jdom.Document;
-import org.jdom.JDOMException;
-import org.jdom.input.SAXBuilder;
-import org.sbml.jsbml.SBMLDocument;
-import org.sbml.jsbml.SBMLError;
-import org.sbml.jsbml.SBMLErrorLog;
-import org.sbml.jsbml.SBMLReader;
-import org.sbml.jsbml.validator.SBMLValidator.CHECK_CATEGORY;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_XML_ReaderWriterPlugin;
-import de.ipk_gatersleben.ag_nw.graffiti.services.task.BackgroundTaskGUIprovider;
-import de.ipk_gatersleben.ag_nw.graffiti.services.task.BackgroundTaskPanelEntry;
-import de.ipk_gatersleben.ag_nw.graffiti.services.task.BackgroundTaskStatusProviderSupportingExternalCallImpl;
-
-public class SBML_XML_Reader extends AbstractInputSerializer {
-
- static Logger logger = Logger.getLogger(SBML_XML_Reader.class);
-
- public SBML_XML_Reader() {
- // System.out.println("SBML_XML_Reader with layout constructor");
- }
-
- /**
- * Method controls the import of the SBML document.
- *
- * @param document
- * contains the data to be imported.
- * @param g
- * is the data structure for reading in the information.
- */
-
- public void read(final SBMLDocument document, Graph g,
- BackgroundTaskStatusProviderSupportingExternalCallImpl status) {
-
- try {
-
- boolean readIn = false;
- URL url = new URL("http://sbml.org/Facilities/Validator/");
- URLConnection connection = url.openConnection();
- InputStream is = null;
- try {
- is = connection.getInputStream();
- } catch (Exception e) {
- // ErrorMsg.addErrorMessage("No internet connection");
- readIn = true;
- /*
- * JOptionPane.showMessageDialog(null,
- * "Online validation not possible.");
- */
- }
-
- if (null != is) {
-
- int validate = 1;
- if (!SBML_XML_ReaderWriterPlugin.isTestintMode)
- validate = JOptionPane
- .showConfirmDialog(
- null,
- "Do you want to validate the SBML file against the Level 3 Version 1 specification?");
- if (validate == 0) {
-
- document.setConsistencyChecks(
- CHECK_CATEGORY.GENERAL_CONSISTENCY, true);
- document.setConsistencyChecks(
- CHECK_CATEGORY.IDENTIFIER_CONSISTENCY, true);
- document.setConsistencyChecks(
- CHECK_CATEGORY.UNITS_CONSISTENCY, true);
- document.setConsistencyChecks(
- CHECK_CATEGORY.MATHML_CONSISTENCY, true);
- document.setConsistencyChecks(
- CHECK_CATEGORY.MODELING_PRACTICE, true);
- document.setConsistencyChecks(
- CHECK_CATEGORY.SBO_CONSISTENCY, true);
- document.setConsistencyChecks(
- CHECK_CATEGORY.OVERDETERMINED_MODEL, true);
-
- int numberOfErrors = document.checkConsistency();
- if (numberOfErrors > 0) {
- SBMLErrorLog errorLog = document.getListOfErrors();
- for (int i = 0; i < numberOfErrors; i++) {
- ErrorMsg.addErrorMessage(errorLog.getError(i));
- }
- }
- if (numberOfErrors > 0) {
- int load = JOptionPane
- .showConfirmDialog(null,
- "The online validator detected mistakes in the file. Load anyway?");
- if (load == 0) {
- readIn = true;
- }
- }
- if (numberOfErrors == 0) {
- readIn = true;
- }
- }
- if (validate == 1) {
- readIn = true;
- }
- } else {
- readIn = true;
- JOptionPane.showMessageDialog(null,
- "Online validation not possible.");
- }
-
- // to indicate an possible Exception - for example
- // NullPointerException
-
- if (readIn) {
- SBML_SBML_Reader readSBML = new SBML_SBML_Reader();
- readSBML.addSBML(document, g);
- SBML_Model_Reader readModel = new SBML_Model_Reader();
- readModel.controlImport(document, g, status);
- SBMLErrorLog errors = document.getListOfErrors();
- List validationErrors = errors.getValidationErrors();
- for (SBMLError sbmlError : validationErrors) {
- ErrorMsg.addErrorMessage(sbmlError.getMessage() + ": at "
- + sbmlError.getLocation().toString()
- + "\n near by: " + sbmlError.getExcerpt());
- }
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- ErrorMsg.addErrorMessage(e.getMessage());
- }
- }
-
- public void read(final Reader reader, final Graph g) throws Exception {
- long starttime = System.currentTimeMillis();
-
- final BackgroundTaskStatusProviderSupportingExternalCallImpl status = new BackgroundTaskStatusProviderSupportingExternalCallImpl(
- "Load SBML", "");
- final BackgroundTaskGUIprovider taskWindow;
- taskWindow = new BackgroundTaskPanelEntry(false);
- taskWindow.setStatusProvider(status, "SBML Loader",
- "loading from reader");
-
- final MainFrame mf = GravistoService.getInstance().getMainFrame();
- if (mf != null)
- mf.addStatusPanel((JPanel) taskWindow);
-
- try {
-
- status.setCurrentStatusText2("Please wait. This may take a few moments.");
-
- SAXBuilder builder = new SAXBuilder();
- Document document;
-
- SBMLDocument sbmlDocument;
-
- document = builder.build(reader);
- if (status.wantsToStop()) {
- logger.debug("aborting load");
- taskWindow.setTaskFinished(true, 0);
- return;
- }
- SBMLReader sbmlReader = new SBMLReader();
- status.setCurrentStatusText1("loading SBML document");
- status.setCurrentStatusValue(30);
- try {
- logger.info("start parsing sbml documet (Reader)");
- sbmlDocument = sbmlReader.readSBMLFromString(document
- .toString());
-
- if (sbmlDocument != null) {
- if (status.wantsToStop()) {
- logger.debug("aborting load");
- taskWindow.setTaskFinished(true, 0);
- return;
- }
- status.setCurrentStatusText1("creating SBML graph");
- status.setCurrentStatusValue(60);
- read(sbmlDocument, g, status);
- if (status.wantsToStop()) {
- logger.debug("aborting load");
- taskWindow.setTaskFinished(true, 0);
- return;
- }
- status.setCurrentStatusText1("adding graph to window");
- status.setCurrentStatusValue(90);
-
- status.setCurrentStatusText1("building graph");
- } else {
- ErrorMsg
- .addErrorMessage("Document can not be loaded. Check the document manually with the online validator (http://sbml.org/Facilities/Validator/).");
- }
- } catch (XMLStreamException e) {
- ErrorMsg.addErrorMessage(e);
- }
- } catch (JDOMException e) {
- ErrorMsg.addErrorMessage(e);
- } catch (IOException e) {
- ErrorMsg.addErrorMessage(e);
- } catch (Exception e) {
- ErrorMsg.addErrorMessage(e);
- }
- long endtime = System.currentTimeMillis();
- taskWindow.setTaskFinished(true, endtime - starttime);
-
- }
-
- public void read(final InputStream in, final Graph g) throws IOException {
-
- long starttime = System.currentTimeMillis();
-
- final BackgroundTaskStatusProviderSupportingExternalCallImpl status = new BackgroundTaskStatusProviderSupportingExternalCallImpl(
- "Load SBML", "");
- final BackgroundTaskGUIprovider taskWindow;
- taskWindow = new BackgroundTaskPanelEntry(false);
- taskWindow.setStatusProvider(status, "SBML Loader",
- "loading from stream");
-
- final MainFrame mf = GravistoService.getInstance().getMainFrame();
- if (mf != null)
- mf.addStatusPanel((JPanel) taskWindow);
-
- try {
- status.setCurrentStatusText2("Please wait. This may take a few moments.");
-
- SBMLReader reader = new SBMLReader();
- SBMLDocument document = null;
- status.setCurrentStatusText1("loading SBML document");
- status.setCurrentStatusValue(30);
- logger.info("start parsing sbml documet (InputStream)");
- document = reader.readSBMLFromStream(in);
- if (document != null) {
- if (status.wantsToStop()) {
- logger.debug("aborting load");
- taskWindow.setTaskFinished(true, 0);
- return;
- }
- read(document, g, status);
- if (status.wantsToStop()) {
- logger.debug("aborting load");
- taskWindow.setTaskFinished(true, 0);
- return;
- }
- logger.debug("done reading graph");
- status.setCurrentStatusText1("adding graph to window");
- status.setCurrentStatusValue(100);
- } else {
- logger.info("the sbml document is not valid.");
- ErrorMsg
- .addErrorMessage("Document can not be loaded. Check the document manually with the online validator (http://sbml.org/Facilities/Validator/).");
- }
- } catch (XMLStreamException error) {
-
- ErrorMsg.addErrorMessage(error);
-
- logger.error(error.getMessage());
- try {
- error.printStackTrace(new PrintWriter("stack_trace.txt"));
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- error.printStackTrace();
- }
- try {
- in.close();
- } catch (IOException e) {
- e.printStackTrace();
- ErrorMsg.addErrorMessage(e);
- }
- long endtime = System.currentTimeMillis();
- taskWindow.setTaskFinished(true, endtime - starttime);
-
- }
-
- @Override
- public boolean validFor(InputStream reader) {
- return validSBML(reader);
- }
-
- Boolean validSBML(InputStream in) {
- InputStreamReader reader = new InputStreamReader(in);
-
- BufferedReader bufferedReader = new BufferedReader(reader);
- StringBuffer finalString = new StringBuffer();
- try {
- while (bufferedReader.ready()) {
- finalString = finalString.append(bufferedReader.readLine());
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- String content = finalString.toString();
- content = content.trim();
- try {
- reader.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- try {
- bufferedReader.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- if (content.contains("sbml") && content.contains("model")
- && content.contains("version") && content.contains("level")) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Implemented method of interface InputSerializer.java Returns the
- * extension of files that can be read in with the SBML importer
- */
- public String[] getExtensions() {
-
- String[] ext = new String[] { ".sbml", ".xml" };
- return ext;
- }
-
- /**
- * Implemented method of interface InputSerializer.java Returns the
- * description of the input format
- */
- public String[] getFileTypeDescriptions() {
- String[] desc = new String[] { "SBML", "SBML" };
- return desc;
- }
-
-}
\ No newline at end of file
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_XML_ReaderPlugin.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_XML_ReaderPlugin.java
deleted file mode 100644
index a858fa02e..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/SBML_XML_ReaderPlugin.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Plant Bioinformatics Group, IPK Gatersleben
- *******************************************************************************/
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml;
-
-import org.graffiti.plugin.io.InputSerializer;
-
-import de.ipk_gatersleben.ag_nw.graffiti.IPK_PluginAdapter;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBMLNodesNiceIdHelper;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml.SBML_Constants;
-
-/**
- * DOCUMENT ME!
- *
- * @author Dagmar Kutz, Matthias Klapperstück
- */
-public class SBML_XML_ReaderPlugin extends IPK_PluginAdapter {
-
- public SBML_XML_ReaderPlugin() {
-
- super();
- SBMLNodesNiceIdHelper.initNiceIds();
- SBML_Constants.init();
- this.inputSerializers = new InputSerializer[] {
- new SBML_XML_Reader()
- };
-
- }
-
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/plugin.xml b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/plugin.xml
deleted file mode 100644
index ba390122d..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/importers/sbml/plugin.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
- Dagmar Kutz, Matthias Klapperstück
- SBML-XML-Reader
-
-
- SBML-XML-Reader
- de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml.SBML_XML_ReaderPlugin
- 1.0.0
- mailto:klapper@ipk-gatersleben.de
-
-
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/KineticLawHelper.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/KineticLawHelper.java
deleted file mode 100644
index 54e2ebaee..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/KineticLawHelper.java
+++ /dev/null
@@ -1,507 +0,0 @@
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.AttributeHelper;
-import org.BackgroundTaskStatusProviderSupportingExternalCall;
-import org.graffiti.attributes.Attributable;
-import org.graffiti.event.AttributeEvent;
-import org.graffiti.event.AttributeListener;
-import org.graffiti.event.ListenerManager;
-import org.graffiti.event.TransactionEvent;
-import org.graffiti.graph.Graph;
-import org.graffiti.graph.Node;
-import org.sbml.jsbml.Annotation;
-import org.sbml.jsbml.xml.XMLNode;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml.SBML_SBase_Writer;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml.SBML_SBase_Reader;
-
-public class KineticLawHelper implements AttributeListener {
-
- Graph g;
-
- /**
- * Provides necessary methods
- */
- SBML_SBase_Writer attWriter;
-
- Map> _reactionClones;
-
- /**
- * Provides necessary methods
- */
- SBML_SBase_Reader attReader;
-
- List localParameterList;
-
- /**
- * Constructor. Initializes the graph
- *
- * @param g
- * the graph where the information is read from
- */
- public KineticLawHelper(Graph g, Map> reactionClones) {
- this.g = g;
- attWriter = new SBML_SBase_Writer();
- attReader = new SBML_SBase_Reader();
- _reactionClones = reactionClones;
- localParameterList = new ArrayList();
- initKineticLawNideIDs();
- ListenerManager listenerManager = g.getListenerManager();
- listenerManager.addAllTimeAttributeListener(this);
- }
-
- public SBMLLocalParameter addLocalParemeter(Graph g,
- String presentedAttributeName, String internAttributeName) {
- SBMLLocalParameter localParameter = new SBMLLocalParameter(g,
- presentedAttributeName, internAttributeName);
- localParameterList.add(localParameter);
- return localParameter;
- }
-
- public SBMLLocalParameter addLocalParameter(Graph g, int localParameterCount) {
- SBMLLocalParameter localParameter = new SBMLLocalParameter(g,
- localParameterCount);
- localParameterList.add(localParameter);
- return localParameter;
- }
-
- public void setMetaId(Node reactionNode, String metaID) {
- if (!metaID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(reactionNode,
- SBML_Constants.SBML_KINETIC_LAW,
- SBML_Constants.KINETIC_LAW_META_ID, metaID);
- }
- }
-
- public Boolean isSetMetaID(Node reactionNode) {
- if (AttributeHelper.hasAttribute(reactionNode, SBML_Constants.SBML_KINETIC_LAW,
- SBML_Constants.KINETIC_LAW_META_ID)) {
- return true;
- } else {
- return false;
- }
- }
-
- public String getMetaID(Node reactionNode) {
- if (isSetMetaID(reactionNode)) {
- return (String) attWriter.getAttribute(reactionNode,
- SBML_Constants.SBML_KINETIC_LAW, SBML_Constants.KINETIC_LAW_META_ID);
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- public void deleteMetaID(Node reactionNode) {
- if (isSetMetaID(reactionNode)) {
- AttributeHelper.deleteAttribute(reactionNode, SBML_Constants.SBML_KINETIC_LAW, SBML_Constants.KINETIC_LAW_META_ID);
- }
- }
-
- public void setSBOTerm(Node reactionNode, String sboTerm) {
- if (!sboTerm.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(reactionNode,
- SBML_Constants.SBML_KINETIC_LAW,
- SBML_Constants.KINETIC_LAW_SBOTERM, sboTerm);
- }
- }
-
- public String getSBOTerm(Node reactionNode) {
- if (isSetSBOTerm(reactionNode)) {
- return (String) attWriter.getAttribute(reactionNode,
- SBML_Constants.SBML_KINETIC_LAW, SBML_Constants.KINETIC_LAW_SBOTERM);
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- public void deleteSBOTerm(Node reactionNode) {
- if (isSetSBOTerm(reactionNode)) {
- AttributeHelper.deleteAttribute(reactionNode, SBML_Constants.SBML_KINETIC_LAW, SBML_Constants.KINETIC_LAW_SBOTERM);
- }
- }
-
- public Boolean isSetSBOTerm(Node reactionNode) {
- if (AttributeHelper.hasAttribute(reactionNode, SBML_Constants.SBML_KINETIC_LAW,
- SBML_Constants.KINETIC_LAW_SBOTERM)) {
- return true;
- } else {
- return false;
- }
- }
-
- public void setAnnotation(Node reactionNode, Annotation annotation) {
- AttributeHelper.setAttribute(reactionNode,
- SBML_Constants.SBML_KINETIC_LAW,
- SBML_Constants.KINETIC_LAW_ANNOTATION, annotation);
- }
-
- public Boolean isSetAnnotation(Node reactionNode) {
- if (AttributeHelper.hasAttribute(reactionNode, SBML_Constants.SBML_KINETIC_LAW,
- SBML_Constants.KINETIC_LAW_ANNOTATION)) {
- return true;
- } else {
- return false;
- }
- }
-
- public void deleteAnnotation(Node reactionNode) {
- if (isSetAnnotation(reactionNode)) {
- AttributeHelper.deleteAttribute(reactionNode, SBML_Constants.SBML_KINETIC_LAW, SBML_Constants.KINETIC_LAW_ANNOTATION);
- }
- }
-
- public Annotation getAnnotation(Node reactionNode) {
- if (isSetAnnotation(reactionNode)) {
- return (Annotation) attWriter.getAttribute(reactionNode,
- SBML_Constants.SBML_KINETIC_LAW, SBML_Constants.KINETIC_LAW_ANNOTATION);
- } else {
- return null;
- }
- }
-
- public void setNonRDFAnnotation(Node reactionNode, String nonRDFAnnotation) {
- AttributeHelper
- .setAttribute(reactionNode, SBML_Constants.SBML_KINETIC_LAW,
- SBML_Constants.KINETIC_LAW_NON_RDF_ANNOTATION,
- nonRDFAnnotation);
- }
-
- public Boolean isSetNonRDFAnnotation(Node reactionNode) {
- if (AttributeHelper.hasAttribute(reactionNode, SBML_Constants.SBML_KINETIC_LAW,
- SBML_Constants.KINETIC_LAW_NON_RDF_ANNOTATION)) {
- return true;
- } else {
- return false;
- }
- }
-
- public void deleteNonRDFAnnotation(Node reactionNode) {
- if (isSetNonRDFAnnotation(reactionNode)) {
- AttributeHelper.deleteAttribute(reactionNode, SBML_Constants.SBML_KINETIC_LAW, SBML_Constants.KINETIC_LAW_NON_RDF_ANNOTATION);
- }
- }
-
- public String getNonRDFAnnotation(Node reactionNode) {
- if (isSetNonRDFAnnotation(reactionNode)) {
- return (String) attWriter.getAttribute(reactionNode,
- SBML_Constants.SBML_KINETIC_LAW, SBML_Constants.KINETIC_LAW_NON_RDF_ANNOTATION);
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- public void setFunction(Node reactionNode, String function) {
- if (!function.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(reactionNode,
- SBML_Constants.SBML_KINETIC_LAW,
- SBML_Constants.KINETIC_LAW_FUNCTION, function);
- }
- }
-
- public void setNotes(Node reactionNode, String notes, XMLNode notesObj) {
- if (!notes.equals(SBML_Constants.EMPTY)) {
- attReader.addNotes(notesObj, notes, reactionNode,
- SBML_Constants.SBML_KINETIC_LAW,
- SBML_Constants.KINETIC_LAW_NOTES);
- }
- }
-
- public Boolean isSetNotes(Node reactionNode) {
- if (AttributeHelper.hasAttribute(reactionNode, SBML_Constants.SBML_KINETIC_LAW,
- SBML_Constants.KINETIC_LAW_NOTES)) {
- return true;
- } else {
- return false;
- }
- }
-
- public XMLNode getNotes(Node reactionNode) {
- if (isSetNotes(reactionNode)) {
- return (XMLNode) attWriter.getAttribute(reactionNode,
- SBML_Constants.SBML_KINETIC_LAW, SBML_Constants.KINETIC_LAW_NOTES);
- } else {
- return null;
- }
- }
-
- public void deleteNotes(Node reactionNode) {
- if (isSetNotes(reactionNode)) {
- AttributeHelper.deleteAttribute(reactionNode, SBML_Constants.SBML_KINETIC_LAW, SBML_Constants.KINETIC_LAW_NOTES);
- }
- }
-
- public Boolean isSetFunction(Node reactionNode) {
- if (AttributeHelper.hasAttribute(reactionNode,
- SBML_Constants.SBML_KINETIC_LAW,
- SBML_Constants.KINETIC_LAW_FUNCTION)) {
- return true;
- } else {
- return false;
- }
- }
-
- public String getFunction(Node reactionNode) {
- if (isSetFunction(reactionNode)) {
- return (String) attWriter.getAttribute(reactionNode,
- SBML_Constants.SBML_KINETIC_LAW,
- SBML_Constants.KINETIC_LAW_FUNCTION);
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- private void initKineticLawNideIDs() {
- AttributeHelper.setNiceId(SBML_Constants.KINETIC_LAW_NOTES,
- "SBML Kinetic Law: Notes");
- AttributeHelper.setNiceId(SBML_Constants.KINETIC_LAW_META_ID,
- "SBML Kinetic Law: Meta ID");
- AttributeHelper.setNiceId(SBML_Constants.KINETIC_LAW_SBOTERM,
- "SBML Kinetic Law: SBOTerm");
- AttributeHelper.setNiceId(SBML_Constants.KINETIC_LAW_FUNCTION,
- "SBML Kinetic Law: Function");
- }
-
- @Override
- public void transactionFinished(TransactionEvent e, BackgroundTaskStatusProviderSupportingExternalCall status) {
-
- }
-
- @Override
- public void transactionStarted(TransactionEvent e) {
-
- }
-
- @Override
- public void postAttributeAdded(AttributeEvent e) {
-
- }
-
- @Override
- public void postAttributeChanged(AttributeEvent e) {
- Attributable attributeable = e.getAttributeable();
- if (attributeable instanceof Node) {
- if (SBML_Constants.ROLE_REACTION.equals(AttributeHelper.getSBMLrole((Node) attributeable))) {
- Node reactionNode = (Node) attributeable;
- propagateChanges(reactionNode, e.getAttribute().getName(), e.getAttribute().getValue());
- }
- }
- }
-
- private void propagateChanges(Node reactionNode, String attributeName, Object newValue) {
- String reactionId = SBMLHelper.getReactionID(reactionNode);
- List reactionNodes = _reactionClones.get(reactionId);
- if (reactionNodes == null) {
- reactionNodes = new ArrayList();
- }
- for (Node node : reactionNodes) {
-
- if (newValue instanceof String && SBMLHelper.isKineticLawFunction(reactionNode)) {
- String function = (String) newValue;
- if (attributeName.equals(SBML_Constants.KINETIC_LAW_FUNCTION) && function.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.deleteAttribute(node, SBML_Constants.SBML_KINETIC_LAW, SBML_Constants.KINETIC_LAW_FUNCTION);
- } else if (attributeName.equals(SBML_Constants.KINETIC_LAW_FUNCTION) && !SBMLHelper.getKineticLawFunction(node).equals(function)) {
- setFunction(node, function);
- continue;
- }
- }
- if (newValue instanceof String && isSetMetaID(reactionNode)) {
- String metaID = (String) newValue;
- if (attributeName.equals(SBML_Constants.KINETIC_LAW_META_ID) && metaID.equals(SBML_Constants.EMPTY)) {
- deleteMetaID(node);
- } else if (attributeName.equals(SBML_Constants.KINETIC_LAW_META_ID) && !getMetaID(node).equals(metaID)) {
- setMetaId(node, metaID);
- continue;
- }
- }
- if (newValue instanceof String && isSetSBOTerm(reactionNode)) {
- String sboTerm = (String) newValue;
- if (attributeName.equals(SBML_Constants.KINETIC_LAW_SBOTERM) && sboTerm.equals(SBML_Constants.EMPTY)) {
- deleteSBOTerm(node);
- } else if (attributeName.equals(SBML_Constants.KINETIC_LAW_SBOTERM) && !getSBOTerm(node).equals(sboTerm)) {
- setSBOTerm(node, sboTerm);
- continue;
- }
- }
-
- if (newValue instanceof XMLNode && isSetNotes(reactionNode)) {
- XMLNode notes = (XMLNode) newValue;
- if (attributeName.equals(SBML_Constants.KINETIC_LAW_NOTES) && notes.equals(SBML_Constants.EMPTY)) {
- deleteNotes(node);
- } else if (attributeName.equals(SBML_Constants.KINETIC_LAW_NOTES) && !getNotes(node).equals(notes)) {
- setNotes(node, notes.toString(), notes);
- continue;
- }
- }
- if (newValue instanceof Annotation && isSetAnnotation(reactionNode)) {
- Annotation annotation = (Annotation) newValue;
- if (attributeName.equals(SBML_Constants.KINETIC_LAW_ANNOTATION) && annotation.equals(SBML_Constants.EMPTY)) {
- deleteAnnotation(node);
- } else if (attributeName.equals(SBML_Constants.KINETIC_LAW_ANNOTATION) && !getAnnotation(node).equals(annotation)) {
- setAnnotation(node, annotation);
- continue;
- }
- }
-
- if (newValue instanceof String && isSetNonRDFAnnotation(reactionNode)) {
- String annotation = (String) newValue;
- if (attributeName.equals(SBML_Constants.KINETIC_LAW_NON_RDF_ANNOTATION) && annotation.equals(SBML_Constants.EMPTY)) {
- deleteNonRDFAnnotation(node);
- } else if (attributeName.equals(SBML_Constants.KINETIC_LAW_NON_RDF_ANNOTATION) && !getNonRDFAnnotation(node).equals(annotation)) {
- setNonRDFAnnotation(node, annotation);
- continue;
- }
- }
-
- Iterator localParameterIt = localParameterList.iterator();
- int count = 1;
- while (localParameterIt.hasNext()) {
- SBMLLocalParameter localParameter = localParameterIt.next();
- if (newValue instanceof String && SBMLHelper.isLocalParameterID(reactionNode, count)) {
- String localParameterName = SBML_Constants.LOCAL_PARAMETER + count + SBML_Constants.LOCAL_PARAMETER_ID;
-
- String id = (String) newValue;
- if (id.equals(SBML_Constants.EMPTY)) {
- SBMLHelper.deleteLocalParameterID(node, id);
- }
- else if (attributeName.equals(localParameterName) && !SBMLHelper.getLocalParameterID(node, count).equals(id)) {
- localParameter.setID(node, id);
- continue;
- }
- }
- if (newValue instanceof String && SBMLHelper.isLocalParameterName(reactionNode, count)) {
- String localParameterName = SBML_Constants.LOCAL_PARAMETER + count + SBML_Constants.LOCAL_PARAMETER_NAME;
-
- String name = (String) newValue;
- if (name.equals(SBML_Constants.EMPTY)) {
- SBMLHelper.deleteLocalParameterName(node, SBMLHelper.getLocalParameterID(node, count));
- }
- else if (attributeName.equals(localParameterName) && !SBMLHelper.getLocalParameterName(node, count).equals(name)) {
- localParameter.setName(node, name);
- continue;
- }
-
- }
- if (newValue instanceof Double && SBMLHelper.isLocalParameterValue(reactionNode, count)) {
- String localParameterName = SBML_Constants.LOCAL_PARAMETER + count + SBML_Constants.LOCAL_PARAMETER_VALUE;
-
- Double value = (Double) newValue;
- if (value.equals(SBML_Constants.EMPTY)) {
- SBMLHelper.deleteLocalParameterValue(node, SBMLHelper.getLocalParameterID(node, count));
- }
- else if (attributeName.equals(localParameterName) && !SBMLHelper.getLocalParameterValue(node, count).equals(value)) {
- localParameter.setValue(node, value);
- continue;
- }
-
- }
- if (newValue instanceof String && SBMLHelper.isLocalParameterUnits(reactionNode, count)) {
- String localParameterName = SBML_Constants.LOCAL_PARAMETER + count + SBML_Constants.LOCAL_PARAMETER_UNITS;
-
- String units = (String) newValue;
- if (units.equals(SBML_Constants.EMPTY)) {
- SBMLHelper.deleteLocalParameterUnits(node, SBMLHelper.getLocalParameterID(node, count));
- }
- else if (attributeName.equals(localParameterName) && !SBMLHelper.getLocalParameterUnits(node, count).equals(units)) {
- localParameter.setUnits(node, units);
- continue;
- }
-
- }
- if (newValue instanceof String && localParameter.isSetMetaID(reactionNode)) {
- String localParameterMetaID = SBML_Constants.LOCAL_PARAMETER + count + SBML_Constants.META_ID;
-
- String metaId = (String) newValue;
- if (attributeName.equals(localParameterMetaID) && metaId.equals(SBML_Constants.EMPTY)) {
- localParameter.deleteMetaID(node);
- }
- else if (attributeName.equals(localParameterMetaID) && !getMetaID(node).equals(metaId)) {
- localParameter.setMetaID(node, metaId);
- continue;
- }
-
- }
- if (newValue instanceof String && localParameter.isSetSBOTerm(reactionNode)) {
- String localParameterSBOTerm = SBML_Constants.LOCAL_PARAMETER + count + SBML_Constants.SBOTERM;
-
- String sboTerm = (String) newValue;
- String oldValue = getSBOTerm(node);
- if (attributeName.equals(localParameterSBOTerm) && sboTerm.equals(SBML_Constants.EMPTY)) {
- localParameter.deleteSBOTerm(node);
- }
- else if (attributeName.equals(localParameterSBOTerm) && !oldValue.equals(sboTerm)) {
- localParameter.setSBOTerm(node, sboTerm);
- continue;
- }
- }
-
- if (newValue instanceof XMLNode && localParameter.isSetNotes(reactionNode)) {
- String localParameterNote = SBML_Constants.LOCAL_PARAMETER + count + SBML_Constants.NOTES;
-
- XMLNode notes = (XMLNode) newValue;
- XMLNode notesOld = getNotes(node);
- if (attributeName.equals(localParameterNote) && notes.equals(SBML_Constants.EMPTY)) {
- localParameter.deleteNotes(node);
- }
- else if (attributeName.equals(localParameterNote) && !notesOld.equals(notes)) {
- localParameter.setNotes(node, notes.toString(), notes);
- continue;
- }
- }
-
- if (newValue instanceof Annotation && localParameter.isSetAnnotation(reactionNode)) {
- String localParameterAnnotation = SBML_Constants.LOCAL_PARAMETER + count + SBML_Constants.ANNOTATION;
-
- Annotation annotation = (Annotation) newValue;
- Annotation oldAnnotation = getAnnotation(node);
- if (attributeName.equals(localParameterAnnotation) && annotation.equals(SBML_Constants.EMPTY)) {
- localParameter.deleteAnnotation(node);
- }
- else if (attributeName.equals(localParameterAnnotation) && !oldAnnotation.equals(annotation)) {
- localParameter.setAnnotation(node, annotation);
- continue;
- }
- }
-
- if (newValue instanceof String && localParameter.isSetNonRDFAnnotation(reactionNode)) {
- String localParameterAnnotation = SBML_Constants.LOCAL_PARAMETER + count + SBML_Constants.NON_RDF_ANNOTATION;
-
- String annotation = (String) newValue;
- String oldAnnotation = getNonRDFAnnotation(node);
- if (attributeName.equals(localParameterAnnotation) && annotation.equals(SBML_Constants.EMPTY)) {
- localParameter.deleteNonRDFAnnotation(node);
- }
- else if (attributeName.equals(localParameterAnnotation) && !oldAnnotation.equals(annotation)) {
- localParameter.setNonRDFAnnotation(node, annotation);
- continue;
- }
- }
- count++;
- }
- }
- }
-
- @Override
- public void postAttributeRemoved(AttributeEvent e) {
-
- }
-
- @Override
- public void preAttributeAdded(AttributeEvent e) {
-
- }
-
- @Override
- public void preAttributeChanged(AttributeEvent e) {
-
- }
-
- @Override
- public void preAttributeRemoved(AttributeEvent e) {
-
- }
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/ReactionIDSpeciesIDWrapper.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/ReactionIDSpeciesIDWrapper.java
deleted file mode 100644
index 0a44ecc58..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/ReactionIDSpeciesIDWrapper.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml;
-
-public class ReactionIDSpeciesIDWrapper {
- private String _reactionID;
- private String _speciesID;
-
- public ReactionIDSpeciesIDWrapper(String reactionID, String speciesID) {
- super();
- _reactionID = reactionID;
- _speciesID = speciesID;
- }
-
- public String getReactionID() {
- return _reactionID;
- }
-
- public void setReactionID(String _reactionID) {
- this._reactionID = _reactionID;
- }
-
- public String getSpeciesID() {
- return _speciesID;
- }
-
- public void setSpeciesID(String _speciesID) {
- this._speciesID = _speciesID;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((_reactionID == null) ? 0 : _reactionID.hashCode());
- result = prime * result + ((_speciesID == null) ? 0 : _speciesID.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- ReactionIDSpeciesIDWrapper other = (ReactionIDSpeciesIDWrapper) obj;
- if (_reactionID == null) {
- if (other._reactionID != null)
- return false;
- } else if (!_reactionID.equals(other._reactionID))
- return false;
- if (_speciesID == null) {
- if (other._speciesID != null)
- return false;
- } else if (!_speciesID.equals(other._speciesID))
- return false;
- return true;
- }
-
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLAlgebraicRule.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLAlgebraicRule.java
deleted file mode 100644
index c984642e4..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLAlgebraicRule.java
+++ /dev/null
@@ -1,161 +0,0 @@
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml;
-
-import java.util.Collection;
-import java.util.HashSet;
-
-import org.AttributeHelper;
-import org.graffiti.graph.Graph;
-import org.graffiti.plugins.inspectors.defaults.DefaultEditPanel;
-import org.sbml.jsbml.Annotation;
-import org.sbml.jsbml.xml.XMLNode;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml.SBML_SBase_Writer;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml.SBML_SBase_Reader;
-
-public class SBMLAlgebraicRule {
-
- /**
- * Intern graph object
- */
- Graph g;
-
- /**
- * Provides necessary methods
- */
- SBML_SBase_Writer attWriter;
-
- /**
- * Provides necessary methods
- */
- SBML_SBase_Reader attReader;
-
- /**
- * intern representation of the headline
- */
- String internHeadline;
-
- /**
- * The user will see the headline this way
- */
- String presentedHeadline;
-
- /**
- * The hidden algebraic rule attributes are stored here
- */
- HashSet discardedRowIDs;
-
- public SBMLAlgebraicRule(Graph g, String internHeadline,
- String presentedHeadline) {
- this.g = g;
- attWriter = new SBML_SBase_Writer();
- attReader = new SBML_SBase_Reader();
- this.presentedHeadline = presentedHeadline;
- this.internHeadline = internHeadline;
- initAlgebraicNiceIDs();
-
- Collection colDiscardedRowIDs = DefaultEditPanel
- .getDiscardedRowIDs();
- discardedRowIDs = new HashSet(colDiscardedRowIDs);
- DefaultEditPanel.setDiscardedRowIDs(discardedRowIDs);
- }
-
- public SBMLAlgebraicRule(Graph g, String internHeadline) {
- this.g = g;
- attWriter = new SBML_SBase_Writer();
- attReader = new SBML_SBase_Reader();
- this.internHeadline = internHeadline;
- }
-
- public void setMetaID(String metaID) {
- if (!metaID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.META_ID).toString(),
- metaID);
- }
- }
-
- public void setSBOTerm(String sboTerm) {
- if (!sboTerm.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.SBOTERM).toString(),
- sboTerm);
- }
- }
-
- public void setAnnotation(Annotation annotation) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.ANNOTATION).toString(),
- annotation);
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.ANNOTATION).toString());
- }
-
- public void setNonRDFAnnotation(String nonRDFAnnotation) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.NON_RDF_ANNOTATION)
- .toString(), nonRDFAnnotation);
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.NON_RDF_ANNOTATION).toString());
- }
-
- public void setNotes(String notes, XMLNode notesObj) {
- if (!notes.equals(SBML_Constants.EMPTY)) {
- attReader.addNotes(
- notesObj,
- notes,
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.NOTES).toString());
- }
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.NOTES).toString());
- }
-
- public void setFunction(String function) {
- if (!function.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.ALGEBRAIC_FUNCTION)
- .toString(), function);
- }
- }
-
- public Boolean isSetFunction() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.FUNCTION).toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public String getFunction() {
- if (isSetFunction()) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- private void initAlgebraicNiceIDs() {
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.ALGEBRAIC_FUNCTION).toString(),
- presentedHeadline + ": Function");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.META_ID)
- .toString(), presentedHeadline + ": Meta ID");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.NOTES)
- .toString(), presentedHeadline + ": Notes");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.SBOTERM)
- .toString(), presentedHeadline + ": SBOTerm");
-
- }
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLAssignmentRule.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLAssignmentRule.java
deleted file mode 100644
index cb64f1ecc..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLAssignmentRule.java
+++ /dev/null
@@ -1,198 +0,0 @@
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml;
-
-import java.util.Collection;
-import java.util.HashSet;
-
-import org.AttributeHelper;
-import org.graffiti.graph.Graph;
-import org.graffiti.plugins.inspectors.defaults.DefaultEditPanel;
-import org.sbml.jsbml.Annotation;
-import org.sbml.jsbml.xml.XMLNode;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml.SBML_SBase_Writer;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml.SBML_SBase_Reader;
-
-public class SBMLAssignmentRule {
-
- /**
- * Intern graph object
- */
- Graph g;
-
- /**
- * Provides necessary methods
- */
- SBML_SBase_Writer attWriter;
-
- /**
- * Provides necessary methods
- */
- SBML_SBase_Reader attReader;
-
- /**
- * intern representation of the headline
- */
- String internHeadline;
-
- /**
- * The user will see the headline this way
- */
- String presentedHeadline;
-
- /**
- * The hidden assignmentRule attributes are stored here
- */
- HashSet discardedRowIDs;
-
- public SBMLAssignmentRule(Graph g, String internHeadline,
- String presentedHeadline) {
- this.g = g;
- attWriter = new SBML_SBase_Writer();
- attReader = new SBML_SBase_Reader();
- this.presentedHeadline = presentedHeadline;
- this.internHeadline = internHeadline;
- initAssignmnetNiceIDs();
-
- Collection colDiscardedRowIDs = DefaultEditPanel
- .getDiscardedRowIDs();
- discardedRowIDs = new HashSet(colDiscardedRowIDs);
- DefaultEditPanel.setDiscardedRowIDs(discardedRowIDs);
- }
-
- public SBMLAssignmentRule(Graph g, String internHeadline) {
- this.g = g;
- attWriter = new SBML_SBase_Writer();
- attReader = new SBML_SBase_Reader();
- this.internHeadline = internHeadline;
- }
-
- public void setMetaID(String metaID) {
- if (!metaID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.META_ID).toString(),
- metaID);
- }
- }
-
- public void setSBOTerm(String sboTerm) {
- if (!sboTerm.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.SBOTERM).toString(),
- sboTerm);
- }
- }
-
- public void setAnnotation(Annotation annotation) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.ANNOTATION).toString(),
- annotation);
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.ANNOTATION).toString());
- }
-
- public void setNonRDFAnnotation(String nonRDFAnnotation) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.NON_RDF_ANNOTATION)
- .toString(), nonRDFAnnotation);
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.NON_RDF_ANNOTATION).toString());
- }
-
- public void setNotes(String notes, XMLNode notesObj) {
- if (!notes.equals(SBML_Constants.EMPTY)) {
- attReader.addNotes(
- notesObj,
- notes,
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.NOTES).toString());
- }
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.NOTES).toString());
- }
-
- public void setFunction(String function) {
- if (!function.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.ASSIGNMENT_FUNCTION)
- .toString(), function);
- }
- }
-
- public void setVariable(String variable) {
- if (!variable.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.ASSIGNMENT_VARIABLE)
- .toString(), variable);
- }
- }
-
- public Boolean isSetVariable() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.ASSIGNMENT_VARIABLE)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public Boolean isSetFunction() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.ASSIGNMENT_FUNCTION)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public String getVariable() {
- if (isSetVariable()) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.ASSIGNMENT_VARIABLE).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- public String getFunction() {
- if (isSetFunction()) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.ASSIGNMENT_FUNCTION).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- private void initAssignmnetNiceIDs() {
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.ASSIGNMENT_VARIABLE).toString(),
- presentedHeadline + ": Variable");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.ASSIGNMENT_FUNCTION).toString(),
- presentedHeadline + ": Function");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.META_ID)
- .toString(), presentedHeadline + ": Meta ID");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.NOTES)
- .toString(), presentedHeadline + ": Notes");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.SBOTERM)
- .toString(), presentedHeadline + ": SBOTerm");
-
- }
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLCompartment.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLCompartment.java
deleted file mode 100644
index dc4908063..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLCompartment.java
+++ /dev/null
@@ -1,393 +0,0 @@
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml;
-
-import java.util.Collection;
-import java.util.HashSet;
-
-import org.AttributeHelper;
-import org.graffiti.graph.Graph;
-import org.graffiti.plugins.inspectors.defaults.DefaultEditPanel;
-import org.sbml.jsbml.Annotation;
-import org.sbml.jsbml.Compartment;
-import org.sbml.jsbml.xml.XMLNode;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml.SBML_SBase_Writer;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml.SBML_SBase_Reader;
-
-@SuppressWarnings("unused")
-public class SBMLCompartment {
-
- /**
- * Intern graph object
- */
- Graph g;
-
- /**
- * Provides necessary methods
- */
- SBML_SBase_Writer attWriter;
-
- /**
- * Provides necessary methods
- */
- SBML_SBase_Reader attReader;
-
- /**
- * intern representation of the headline
- */
- String internHeadline;
-
- /**
- * The user will see the headline this way
- */
- String presentedHeadline;
-
- /**
- * The hidden compartment attributes are stored here
- */
- HashSet discardedRowIDs;
-
- /**
- * Constructor. Initializes the graph. Use in SBML_Compartment_Reader.java
- *
- * @param g
- * the graph where the information is read from
- */
- public SBMLCompartment(Graph g, String internHeadline,
- String presentedHeadline) {
- this.g = g;
- attWriter = new SBML_SBase_Writer();
- attReader = new SBML_SBase_Reader();
- this.presentedHeadline = presentedHeadline;
- this.internHeadline = internHeadline;
- initCompartmentNideIDs();
-
- Collection colDiscardedRowIDs = DefaultEditPanel
- .getDiscardedRowIDs();
- discardedRowIDs = new HashSet(colDiscardedRowIDs);
- DefaultEditPanel.setDiscardedRowIDs(discardedRowIDs);
- }
-
- /**
- * Constructor. Initializes the graph. Use in SBML_Compartmetn_Writer.java
- *
- * @param g
- * the graph where the information is read from
- * @param internHeadline
- * the intern headline of the current Compartment
- */
- public SBMLCompartment(Graph g, String internHeadline) {
- this.g = g;
- attWriter = new SBML_SBase_Writer();
- attReader = new SBML_SBase_Reader();
- this.internHeadline = internHeadline;
- }
-
- public void countCompartments() {
- int i = 0;
-
- }
-
- public Compartment getCompartment() {
- Compartment comartment = new Compartment();
- comartment.setId(getID());
- comartment.setName(getName());
- comartment.setSpatialDimensions(getSpatialDimensions());
- comartment.setSize(getSize());
- comartment.setUnits(getUnits());
- comartment.setConstant(getConstant());
- return comartment;
- }
-
- public Boolean isSetID() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.COMPARTMENT_ID)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public String getID() {
- if (isSetID()) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.COMPARTMENT_ID).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- public void setID(String id) {
- if (!id.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.COMPARTMENT_ID)
- .toString(), id);
- }
- }
-
- public void setName(String name) {
- if (!name.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.COMPARTMENT_NAME)
- .toString(), name);
- }
- }
-
- public Boolean isSetName() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.COMPARTMENT_NAME)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public String getName() {
- if (isSetName()) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.COMPARTMENT_NAME).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- public void setSpatialDimensions(Double spatialDimensions) {
- if (!spatialDimensions.equals(null)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.SPATIAL_DIMENSIONS)
- .toString(), spatialDimensions);
- }
- }
-
- public Boolean isSetSpatialDimensions() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.SPATIAL_DIMENSIONS)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public Double getSpatialDimensions() {
- if (isSetSpatialDimensions()) {
- return (Double) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.SPATIAL_DIMENSIONS).toString());
- } else {
- return null;
- }
- }
-
- public void setSize(Double size) {
- if (!size.equals(null)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.SIZE).toString(),
- Double.toString(size));
- }
- }
-
- public Boolean isSetSize() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.SIZE).toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public Double getSize() {
- if (isSetSize()) {
- return Double.parseDouble((String) attWriter.getAttribute(g,
- internHeadline,
- new StringBuffer(internHeadline)
- .append(SBML_Constants.SIZE).toString()));
- } else {
- return null;
- }
- }
-
- public void setUnits(String units) {
- if (!units.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.UNITS).toString(),
- units);
- }
- }
-
- public Boolean isSetUnits() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.UNITS).toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public String getUnits() {
- if (isSetUnits()) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.UNITS).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- public void setConstant(Boolean constant) {
- if (!constant.equals(null)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.CONSTANT).toString(),
- constant);
- }
- }
-
- public Boolean isSetConstant() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.CONSTANT).toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public Boolean getConstant() {
- if (isSetConstant()) {
- return (Boolean) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.CONSTANT).toString());
- } else {
- return null;
- }
- }
-
- public void setMetaID(String metaID) {
- if (!metaID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.META_ID).toString(),
- metaID);
- }
- }
-
- public void setSBOTerm(String sboTerm) {
- if (!sboTerm.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.SBOTERM).toString(),
- sboTerm);
- }
- }
-
- public void setOutside(String outside) {
- if (!outside.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.OUTSIDE).toString(),
- outside);
- }
- }
-
- public void setNotes(String notes, XMLNode notesObj) {
- if (!notes.equals(SBML_Constants.EMPTY)) {
- attReader.addNotes(
- notesObj,
- notes,
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.NOTES).toString());
- }
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.NOTES).toString());
- }
-
- public void setAnnotation(Annotation annotation) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.ANNOTATION).toString(),
- annotation);
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.ANNOTATION).toString());
- }
-
- public void setNonRDFAnnotation(String nonRDFAnnotation) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.NON_RDF_ANNOTATION)
- .toString(), nonRDFAnnotation);
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.NON_RDF_ANNOTATION).toString());
- }
-
- /**
- * Sets the nice id
- */
- private void initCompartmentNideIDs() {
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.COMPARTMENT_ID).toString(),
- presentedHeadline + ": ID");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.COMPARTMENT_NAME).toString(),
- presentedHeadline + ": Name");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.SPATIAL_DIMENSIONS).toString(),
- presentedHeadline + ": Spatial Dimensions");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.SIZE)
- .toString(), presentedHeadline + ": Size");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.UNITS)
- .toString(), presentedHeadline + ": Units");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline)
- .append(SBML_Constants.CONSTANT).toString(),
- presentedHeadline + ": Constant");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.OUTSIDE)
- .toString(), presentedHeadline + ": Outside");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.META_ID)
- .toString(), presentedHeadline + ": Meta ID");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.NOTES)
- .toString(), presentedHeadline + ": Notes");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.SBOTERM)
- .toString(), presentedHeadline + ": SBOTerm");
- }
-
-}
-
-/*
- * if(AttributeHelper.hasAttribute(g, internHeadline, new
- * StringBuffer(internHeadline
- * ).append(SBML_Constants.SPATIAL_DIMENSIONS).toString())){ Object spDim =
- * (Object)getAttribute(g, internHeadline, new
- * StringBuffer(internHeadline).append
- * (SBML_Constants.SPATIAL_DIMENSIONS).toString()); if(spDim instanceof Double){
- * compartment.setSpatialDimensions((Double)spDim); } }
- */
-/*
- * if(AttributeHelper.hasAttribute(g, internHeadline,new
- * StringBuffer(internHeadline).append(SBML_Constants.SIZE).toString())){ try{
- * Double size = Double.parseDouble((String)getAttribute(g, internHeadline,new
- * StringBuffer(internHeadline). append(SBML_Constants.SIZE).toString()));
- * compartment.setSize(size); }catch(NumberFormatException e){
- *
- * } }
- */
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLCompartmentHelper.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLCompartmentHelper.java
deleted file mode 100644
index 31f82e9bc..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLCompartmentHelper.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.graffiti.graph.Graph;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml.SBML_SBase_Writer;
-
-public class SBMLCompartmentHelper {
-
- /**
- * Stores the SBMLCompartment objects
- */
- List compartmentList;
-
- public SBMLCompartmentHelper(){
- compartmentList = new ArrayList();
- }
-
- public SBMLCompartment addCompartment(Graph g, String internHeadline){
- SBMLCompartment compartment = new SBMLCompartment(g, internHeadline);
- compartmentList.add(compartment);
- return compartment;
- }
-
- public SBMLCompartment addCompartment(Graph g, String internHeadline, String presentedHeadline){
- SBMLCompartment compartment = new SBMLCompartment(g, internHeadline, presentedHeadline);
- compartmentList.add(compartment);
- return compartment;
- }
-
- public List getCompartmentHeadlines(Graph g){
- SBML_SBase_Writer writer = new SBML_SBase_Writer();
- return writer.headlineHelper(g, SBML_Constants.SBML_COMPARTMENT);
- }
-
- public List addCompartments(Graph g, List internHeadlines){
- List returnList = new ArrayList();
- Iterator internHeadlineIt = internHeadlines.iterator();
- while(internHeadlineIt.hasNext()){
- returnList.add(addCompartment(g, internHeadlineIt.next()));
- }
- return returnList;
- }
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLConstraint.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLConstraint.java
deleted file mode 100644
index a3367d076..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLConstraint.java
+++ /dev/null
@@ -1,195 +0,0 @@
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml;
-
-import java.util.Collection;
-import java.util.HashSet;
-
-import org.AttributeHelper;
-import org.graffiti.graph.Graph;
-import org.graffiti.plugins.inspectors.defaults.DefaultEditPanel;
-import org.sbml.jsbml.Annotation;
-import org.sbml.jsbml.xml.XMLNode;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml.SBML_SBase_Writer;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml.SBML_SBase_Reader;
-
-public class SBMLConstraint {
-
- /**
- * Intern graph object
- */
- Graph g;
-
- /**
- * Provides necessary methods
- */
- SBML_SBase_Writer attWriter;
-
- /**
- * Provides necessary methods
- */
- SBML_SBase_Reader attReader;
-
- /**
- * intern representation of the headline
- */
- String internHeadline;
-
- /**
- * The user will see the headline this way
- */
- String presentedHeadline;
-
- /**
- * The hidden constraint attributes are stored here
- */
- HashSet discardedRowIDs;
-
- public SBMLConstraint(Graph g, String internHeadline,
- String presentedHeadline) {
- this.g = g;
- attWriter = new SBML_SBase_Writer();
- attReader = new SBML_SBase_Reader();
- this.presentedHeadline = presentedHeadline;
- this.internHeadline = internHeadline;
- initConstraintNideIDs();
-
- Collection colDiscardedRowIDs = DefaultEditPanel
- .getDiscardedRowIDs();
- discardedRowIDs = new HashSet(colDiscardedRowIDs);
- DefaultEditPanel.setDiscardedRowIDs(discardedRowIDs);
- }
-
- public SBMLConstraint(Graph g, String internHeadline) {
- this.g = g;
- attWriter = new SBML_SBase_Writer();
- attReader = new SBML_SBase_Reader();
- this.internHeadline = internHeadline;
- }
-
- public void setSBOTerm(String sboTerm) {
- if (!sboTerm.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.SBOTERM).toString(),
- sboTerm);
- }
- }
-
- public void setAnnotation(Annotation annotation) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.ANNOTATION).toString(),
- annotation);
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.ANNOTATION).toString());
- }
-
- public void setNonRDFAnnotation(String nonRDFAnnotation) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.NON_RDF_ANNOTATION)
- .toString(), nonRDFAnnotation);
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.NON_RDF_ANNOTATION).toString());
- }
-
- public void setMetaId(String metaID) {
- if (!metaID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.META_ID).toString(),
- metaID);
- }
- }
-
- public void setNotes(String notes, XMLNode notesObj) {
- if (!notes.equals(SBML_Constants.EMPTY)) {
- attReader.addNotes(
- notesObj,
- notes,
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.NOTES).toString());
- }
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.NOTES).toString());
- }
-
- public void setMessage(String message) {
- if (!message.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.MESSAGE).toString(),
- message);
- }
- }
-
- public void setFunction(String function) {
- if (!function.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.CONSTRAINT)
- .toString(), function);
- }
- }
-
- public Boolean isSetFunction() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.CONSTRAINT).toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public Boolean isSetMessage() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.MESSAGE).toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public String getFunction() {
- if (isSetFunction()) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.CONSTRAINT).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- public String getMessage() {
- if (isSetMessage()) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.MESSAGE).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- private void initConstraintNideIDs() {
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.CONSTRAINT).toString(),
- presentedHeadline + ": Constraint");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.MESSAGE)
- .toString(), presentedHeadline + ": Message");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.META_ID)
- .toString(), presentedHeadline + ": Meta ID");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.NOTES)
- .toString(), presentedHeadline + ": Notes");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.SBOTERM)
- .toString(), presentedHeadline + ": SBOTerm");
-
- }
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLConstraintHelper.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLConstraintHelper.java
deleted file mode 100644
index 373a1b6cd..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLConstraintHelper.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.graffiti.graph.Graph;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml.SBML_SBase_Writer;
-
-public class SBMLConstraintHelper {
-
- /**
- * Stores the SBMLConstraint objects
- */
- List constraintList;
-
- public SBMLConstraintHelper() {
- constraintList = new ArrayList();
- }
-
- public SBMLConstraint addConstraint(Graph g, String internHeadline) {
- SBMLConstraint constraint = new SBMLConstraint(g, internHeadline);
- constraintList.add(constraint);
- return constraint;
- }
-
- public SBMLConstraint addConstraint(Graph g, String internHeadline,
- String presentedHeadline) {
- SBMLConstraint constraint = new SBMLConstraint(g, internHeadline,
- presentedHeadline);
- constraintList.add(constraint);
- return constraint;
- }
-
- public List getConstraintHeadlines(Graph g) {
- SBML_SBase_Writer writer = new SBML_SBase_Writer();
- return writer.headlineHelper(g, SBML_Constants.SBML_CONSTRAINT);
- }
-
- public List addConstraints(Graph g,
- List internHeadlines) {
- List returnList = new ArrayList();
- Iterator internHeadlineIt = internHeadlines.iterator();
- while (internHeadlineIt.hasNext()) {
- returnList.add(addConstraint(g, internHeadlineIt.next()));
- }
- return returnList;
- }
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLEventAssignmentHelper.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLEventAssignmentHelper.java
deleted file mode 100644
index a6df6b2a2..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLEventAssignmentHelper.java
+++ /dev/null
@@ -1,267 +0,0 @@
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml;
-
-import java.util.Collection;
-import java.util.HashSet;
-
-import org.AttributeHelper;
-import org.graffiti.graph.Graph;
-import org.graffiti.plugins.inspectors.defaults.DefaultEditPanel;
-import org.sbml.jsbml.Annotation;
-import org.sbml.jsbml.xml.XMLNode;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml.SBML_SBase_Writer;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml.SBML_SBase_Reader;
-
-public class SBMLEventAssignmentHelper {
-
- /**
- * Intern graph object
- */
- Graph g;
-
- /**
- * Provides necessary methods
- */
- SBML_SBase_Writer attWriter;
-
- /**
- * Provides necessary methods
- */
- SBML_SBase_Reader attReader;
-
- /**
- * intern representation of the headline
- */
- String internHeadline = SBML_Constants.EMPTY;
-
- /**
- * The user will see the headline this way
- */
- String presentedHeadline;
-
- int eventAssignmentCount;
-
- /**
- * The hidden event attributes are stored here
- */
- HashSet discardedRowIDs;
-
- public SBMLEventAssignmentHelper(Graph g, String internHeadline,
- String presentedHeadline, int eventAssignmentCount) {
- this.g = g;
- attWriter = new SBML_SBase_Writer();
- attReader = new SBML_SBase_Reader();
- this.presentedHeadline = presentedHeadline;
- this.internHeadline = internHeadline;
- this.eventAssignmentCount = eventAssignmentCount;
- initEventAssignmentNideIDs(eventAssignmentCount);
-
- Collection colDiscardedRowIDs = DefaultEditPanel
- .getDiscardedRowIDs();
- discardedRowIDs = new HashSet(colDiscardedRowIDs);
- DefaultEditPanel.setDiscardedRowIDs(discardedRowIDs);
- }
-
- public SBMLEventAssignmentHelper(Graph g, String internHeadline,
- int eventAssignmentCount) {
- this.g = g;
- attWriter = new SBML_SBase_Writer();
- attReader = new SBML_SBase_Reader();
- this.eventAssignmentCount = eventAssignmentCount;
- this.internHeadline = internHeadline;
- }
-
- public void setVariable(String variable) {
- if (!variable.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.VARIABLE).toString(),
- variable);
- }
- }
-
- public Boolean isSetVariable() {
- if (AttributeHelper.hasAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.VARIABLE).toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public void setFunction(String function) {
- if (!function.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.FUNCTION).toString(),
- function);
- }
- }
-
- public void setMetaID(String metaID) {
- if (!metaID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.META_ID).toString(), metaID);
- }
- }
-
- public void setSBOTerm(String sboTerm) {
- if (!sboTerm.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.SBOTERM).toString(), sboTerm);
- }
- }
-
- public void setAnnotation(Annotation annotation) {
- AttributeHelper.setAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.ANNOTATION).toString(),
- annotation);
-
- discardedRowIDs.add(new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount).append(SBML_Constants.ANNOTATION)
- .toString());
- }
-
- public void setNonRDFAnnotation(String nonRDFAnnotation) {
- AttributeHelper.setAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.NON_RDF_ANNOTATION).toString(),
- nonRDFAnnotation);
-
- discardedRowIDs.add(new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.NON_RDF_ANNOTATION).toString());
- }
-
- public void setNotes(String notes, XMLNode notesObj) {
- if (!notes.equals(SBML_Constants.EMPTY)) {
- attReader.addNotes(
- notesObj,
- notes,
- g,
- internHeadline,
- new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.NOTES).toString());
- }
-
- discardedRowIDs.add(new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount).append(SBML_Constants.NOTES)
- .toString());
- }
-
- public Boolean isSetFunction() {
- if (AttributeHelper.hasAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.FUNCTION).toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public String getVariable() {
- if (isSetVariable()) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.VARIABLE).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- public String getFunction() {
- if (isSetFunction()) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.FUNCTION).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- private void initEventAssignmentNideIDs(int eventAssignmentCount) {
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.VARIABLE).toString(),
- presentedHeadline + ": Event Assignment "
- + eventAssignmentCount + " Variable");
-
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.FUNCTION).toString(),
- presentedHeadline + ": Event Assignment "
- + eventAssignmentCount + " Function");
-
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.META_ID).toString(),
- presentedHeadline + ": Event Assignment "
- + eventAssignmentCount + " Meta ID");
-
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.SBOTERM).toString(),
- presentedHeadline + ": Event Assignment "
- + eventAssignmentCount + " SBOTerm");
-
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ASSIGNMENT)
- .append(eventAssignmentCount)
- .append(SBML_Constants.NOTES).toString(),
- presentedHeadline + ": Event Assignment "
- + eventAssignmentCount + " Notes");
-
- }
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLEventHelper.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLEventHelper.java
deleted file mode 100644
index b01055655..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLEventHelper.java
+++ /dev/null
@@ -1,557 +0,0 @@
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-
-import org.AttributeHelper;
-import org.graffiti.graph.Graph;
-import org.graffiti.plugins.inspectors.defaults.DefaultEditPanel;
-import org.sbml.jsbml.Annotation;
-import org.sbml.jsbml.xml.XMLNode;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml.SBML_SBase_Writer;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml.SBML_SBase_Reader;
-
-public class SBMLEventHelper {
-
- /**
- * Intern graph object
- */
- Graph g;
-
- /**
- * Provides necessary methods
- */
- SBML_SBase_Writer attWriter;
-
- /**
- * Provides necessary methods
- */
- SBML_SBase_Reader attReader;
-
- /**
- * intern representation of the headline
- */
- String internHeadline;
-
- /**
- * The user will see the headline this way
- */
- String presentedHeadline;
-
- List eaHelperList;
-
- /**
- * The hidden event attributes are stored here
- */
- HashSet discardedRowIDs;
-
- public SBMLEventHelper(Graph g, String internHeadline,
- String presentedHeadline) {
- this.g = g;
- attWriter = new SBML_SBase_Writer();
- attReader = new SBML_SBase_Reader();
- this.presentedHeadline = presentedHeadline;
- this.internHeadline = internHeadline;
- eaHelperList = new ArrayList();
- initEventNideIDs();
-
- Collection colDiscardedRowIDs = DefaultEditPanel
- .getDiscardedRowIDs();
- discardedRowIDs = new HashSet(colDiscardedRowIDs);
- DefaultEditPanel.setDiscardedRowIDs(discardedRowIDs);
- }
-
- public SBMLEventHelper(Graph g, String internHeadline) {
- this.g = g;
- attWriter = new SBML_SBase_Writer();
- attReader = new SBML_SBase_Reader();
- this.internHeadline = internHeadline;
- eaHelperList = new ArrayList();
- }
-
- public SBMLEventAssignmentHelper addEventAssignment(Graph g,
- String internHeadline, String presentedHeadline,
- int eventAssignmentCount) {
- SBMLEventAssignmentHelper eaHelper = new SBMLEventAssignmentHelper(g,
- internHeadline, presentedHeadline, eventAssignmentCount);
- eaHelperList.add(eaHelper);
- return eaHelper;
- }
-
- public SBMLEventAssignmentHelper addEventAssignment(Graph g,
- String internHeadline, int eaCount) {
- SBMLEventAssignmentHelper eaHelper = new SBMLEventAssignmentHelper(g,
- internHeadline, eaCount);
- eaHelperList.add(eaHelper);
- return eaHelper;
- }
-
- public void setUseValuesFromTriggerTime(Boolean useValuesFromTriggerTime) {
- if (!useValuesFromTriggerTime.equals(null)) {
- AttributeHelper.setAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.USE_VALUES_FROM_TRIGGER_TIME)
- .toString(), useValuesFromTriggerTime);
- }
- }
-
- public void setID(String ID) {
- if (!ID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.EVENT_ID).toString(),
- ID);
- }
- }
-
- public void setName(String name) {
- if (!name.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.EVENT_NAME)
- .toString(), name);
- }
- }
-
- public void setMetaID(String metaID) {
- if (!metaID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.META_ID).toString(),
- metaID);
- }
- }
-
- public void setSBOTerm(String sboTerm) {
- if (!sboTerm.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.SBOTERM).toString(),
- sboTerm);
- }
- }
-
- public void setAnnotation(Annotation annotation) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.ANNOTATION).toString(),
- annotation);
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.ANNOTATION).toString());
- }
-
- public void setNonRDFAnnotation(String nonRDFAnnotation) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.NON_RDF_ANNOTATION)
- .toString(), nonRDFAnnotation);
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.NON_RDF_ANNOTATION).toString());
- }
-
- public void setNotes(String notes, XMLNode notesObj) {
- if (!notes.equals(SBML_Constants.EMPTY)) {
- attReader.addNotes(
- notesObj,
- notes,
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.NOTES).toString());
- }
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.NOTES).toString());
- }
-
- public Boolean isSetName() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.EVENT_NAME).toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public Boolean isSetID() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.EVENT_ID).toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public Boolean isSetUseValuesFromTriggerTime() {
- if (AttributeHelper
- .hasAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.USE_VALUES_FROM_TRIGGER_TIME)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public String getID() {
- if (isSetID()) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.EVENT_ID).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- public String getName() {
- if (isSetName()) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.EVENT_NAME).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- public Boolean getUseValuesFromTriggerTime() {
- if (isSetUseValuesFromTriggerTime()) {
- return (Boolean) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.USE_VALUES_FROM_TRIGGER_TIME)
- .toString());
- } else {
- return null;
- }
- }
-
- public void setInitialValue(Boolean initialValue) {
- if (!initialValue.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.INITIAL_VALUE)
- .toString(), initialValue);
- }
- }
-
- public void setPersistent(Boolean persistent) {
- if (!persistent.equals(null)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.PERSISTENT)
- .toString(), persistent);
- }
- }
-
- public void setTriggerFunction(String function) {
- if (!function.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.TRIGGER_FUNCTION)
- .toString(), function);
- }
- }
-
- public Boolean isSetTriggerFunction() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.TRIGGER_FUNCTION)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public Boolean isSetInitialValue() {
- if (AttributeHelper
- .hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.INITIAL_VALUE)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public Boolean isSetPersistent() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.PERSISTENT).toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public String getTriggerFunction() {
- if (isSetTriggerFunction()) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.TRIGGER_FUNCTION).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- public Boolean getInitialValue() {
- if (isSetInitialValue()) {
- return (Boolean) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.INITIAL_VALUE).toString());
- } else {
- return null;
- }
- }
-
- public Boolean getPersistent() {
- if (isSetPersistent()) {
- return (Boolean) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.PERSISTENT).toString());
- } else {
- return null;
- }
- }
-
- public void setPriorityFunction(String function) {
- if (!function.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.PRIORITY_FUNCTION)
- .toString(), function);
- }
- }
-
- public void setPriorityMetaID(String metaID) {
- if (!metaID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.PRIORITY_META_ID)
- .toString(), metaID);
- }
- }
-
- public void setPrioritySBOTerm(String sboTerm) {
- if (!sboTerm.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.PRIORITY_SBOTERM)
- .toString(), sboTerm);
- }
- }
-
- public void setPriorityAnnotation(Annotation annotation) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.PRIORITY_ANNOTATION)
- .toString(), annotation);
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.PRIORITY_ANNOTATION).toString());
- }
-
- public void setPriorityNonRDFAnnotation(String nonRDFAnnotation) {
- AttributeHelper.setAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.PRIORITY_NON_RDF_ANNOTATION).toString(),
- nonRDFAnnotation);
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.PRIORITY_NON_RDF_ANNOTATION).toString());
- }
-
- public void setPriorityNotes(String notes, XMLNode notesObj) {
- if (!notes.equals(SBML_Constants.EMPTY)) {
- attReader.addNotes(
- notesObj,
- notes,
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.PRIORITY_NOTES).toString());
- }
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.PRIORITY_NOTES).toString());
- }
-
- public Boolean isSetPriorityFunction() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.PRIORITY_FUNCTION)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public String getPriorityFunction() {
- if (isSetPriorityFunction()) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.PRIORITY_FUNCTION).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- public void setDelayFunction(String function) {
- if (!function.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.DELAY_FUNCTION)
- .toString(), function);
- }
- }
-
- public void setDelayMetaID(String metaID) {
- if (!metaID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.DELAY_META_ID)
- .toString(), metaID);
- }
- }
-
- public void setdelayAnnotation(Annotation annotation) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.DELAY_ANNOTATION)
- .toString(), annotation);
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.DELAY_ANNOTATION).toString());
- }
-
- public void setdelayNonRDFAnnotation(String nonRDFAnnotation) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.DELAY_NON_RDF_ANNOTATION)
- .toString(), nonRDFAnnotation);
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.DELAY_NON_RDF_ANNOTATION).toString());
- }
-
- public void setDelaySBOTerm(String sboTerm) {
- if (!sboTerm.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.DELAY_SBOTERM)
- .toString(), sboTerm);
- }
- }
-
- public void setDelayNotes(String notes, XMLNode notesObj) {
- if (!notes.equals(SBML_Constants.EMPTY)) {
- attReader.addNotes(
- notesObj,
- notes,
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.DELAY_NOTES).toString());
- }
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.DELAY_NOTES).toString());
- }
-
- public Boolean isSetDelayFunction() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.DELAY_FUNCTION)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public String getDelayFunction() {
- if (isSetDelayFunction()) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.DELAY_FUNCTION).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- private void initEventNideIDs() {
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline)
- .append(SBML_Constants.EVENT_ID).toString(),
- presentedHeadline + ": ID");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.EVENT_NAME).toString(),
- presentedHeadline + ": Name");
- AttributeHelper
- .setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.USE_VALUES_FROM_TRIGGER_TIME)
- .toString(), presentedHeadline
- + ": UseValuesFromTriggerTime");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.META_ID)
- .toString(), presentedHeadline + ": Meta ID");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.NOTES)
- .toString(), presentedHeadline + ": Notes");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.SBOTERM)
- .toString(), presentedHeadline + ": SBOTerm");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.INITIAL_VALUE).toString(),
- presentedHeadline + ": Trigger Initial Value");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.PERSISTENT).toString(),
- presentedHeadline + ": Trigger Persistent");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.TRIGGER_FUNCTION).toString(),
- presentedHeadline + ": Trigger Function");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.PRIORITY_META_ID).toString(),
- presentedHeadline + ": Priority Meta ID");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.PRIORITY_NOTES).toString(),
- presentedHeadline + ": Priority Notes");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.PRIORITY_SBOTERM).toString(),
- presentedHeadline + ": Priority SBOTerm");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.PRIORITY_FUNCTION).toString(),
- presentedHeadline + ": Priority Function");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.DELAY_META_ID).toString(),
- presentedHeadline + ": Delay Meta ID");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.DELAY_NOTES).toString(),
- presentedHeadline + ": Delay Notes");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.DELAY_SBOTERM).toString(),
- presentedHeadline + ": Delay SBOTerm");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.DELAY_FUNCTION).toString(),
- presentedHeadline + ": Delay Function");
- }
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLFunctionDefinition.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLFunctionDefinition.java
deleted file mode 100644
index 090d907fb..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLFunctionDefinition.java
+++ /dev/null
@@ -1,271 +0,0 @@
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml;
-
-import java.util.Collection;
-import java.util.HashSet;
-
-import org.AttributeHelper;
-import org.graffiti.graph.Graph;
-import org.graffiti.plugins.inspectors.defaults.DefaultEditPanel;
-import org.sbml.jsbml.ASTNode;
-import org.sbml.jsbml.Annotation;
-import org.sbml.jsbml.text.parser.ParseException;
-import org.sbml.jsbml.xml.XMLNode;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml.SBML_SBase_Writer;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml.SBML_SBase_Reader;
-
-public class SBMLFunctionDefinition {
-
- /**
- * Intern graph object
- */
- Graph g;
-
- /**
- * Provides necessary methods
- */
- SBML_SBase_Writer attWriter;
-
- /**
- * Provides necessary methods
- */
- SBML_SBase_Reader attReader;
-
- /**
- * intern representation of the headline
- */
- String internHeadline;
-
- /**
- * The user will see the headline this way
- */
- String presentedHeadline;
-
- /**
- * The hidden function definition attributes are stored here
- */
- HashSet discardedRowIDs;
-
- /**
- * Constructor. Initializes the graph. Use in
- * SBML_FunctionDefinition_Reader.java
- *
- * @param g
- * the graph where the information is read from
- */
- public SBMLFunctionDefinition(Graph g, String internHeadline,
- String presentedHeadline) {
- this.g = g;
- attWriter = new SBML_SBase_Writer();
- attReader = new SBML_SBase_Reader();
- this.presentedHeadline = presentedHeadline;
- this.internHeadline = internHeadline;
- initFunctionDefinitionNideIDs();
-
- Collection colDiscardedRowIDs = DefaultEditPanel
- .getDiscardedRowIDs();
- discardedRowIDs = new HashSet(colDiscardedRowIDs);
- DefaultEditPanel.setDiscardedRowIDs(discardedRowIDs);
- }
-
- /**
- * Constructor. Initializes the graph. Use in
- * SBML_FunctionDefinition_Writer.java
- *
- * @param g
- * the graph where the information is read from
- * @param internHeadline
- * the intern headline of the current Compartment
- */
- public SBMLFunctionDefinition(Graph g, String internHeadline) {
- this.g = g;
- attWriter = new SBML_SBase_Writer();
- attReader = new SBML_SBase_Reader();
- this.internHeadline = internHeadline;
- }
-
- public Boolean isSetID() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.FUNCTION_DEFINITION_ID)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public Boolean isSetName() {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.FUNCTION_DEFINITION_NAME)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public Boolean isSetFunction() {
- if (AttributeHelper
- .hasAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_FUNCTION)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- public String getID() {
- if (isSetID()) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_ID).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- public String getName() {
- if (isSetName()) {
- return (String) attWriter
- .getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_NAME)
- .toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- public ASTNode getFunction() {
- if (isSetFunction()) {
- try {
- return ASTNode.parseFormula((String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_FUNCTION)
- .toString()));
- } catch (ParseException e) {
- e.printStackTrace();
- return null;
- }
- } else {
- return null;
- }
- }
-
- public void setName(String name) {
- if (!name.equals(SBML_Constants.EMPTY)) {
- AttributeHelper
- .setAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_NAME)
- .toString(), name);
-
- }
- }
-
- public void setFunction(String function) {
- if (!function.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_FUNCTION)
- .toString(), function);
- }
- }
-
- public void setID(String ID) {
- if (!ID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_ID).toString(),
- ID);
- }
- }
-
- public void setNotes(String notes, XMLNode notesObj) {
- if (!notes.equals(SBML_Constants.EMPTY)) {
- attReader.addNotes(
- notesObj,
- notes,
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.NOTES).toString());
- }
- discardedRowIDs.add(internHeadline + "_notes");
- }
-
- public void setMetaID(String metaID) {
- if (!metaID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.META_ID).toString(),
- metaID);
- }
- }
-
- public void setAnnotation(Annotation annotation) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.ANNOTATION).toString(),
- annotation);
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.ANNOTATION).toString());
- }
-
- public void setNonRDFAnnotation(String nonRDFAnnotation) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.NON_RDF_ANNOTATION)
- .toString(), nonRDFAnnotation);
-
- discardedRowIDs.add(new StringBuffer(internHeadline).append(
- SBML_Constants.NON_RDF_ANNOTATION).toString());
- }
-
- public void setSBOTerm(String sboTerm) {
- if (!sboTerm.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.SBOTERM).toString(),
- sboTerm);
- }
- }
-
- private void initFunctionDefinitionNideIDs() {
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.META_ID)
- .toString(), presentedHeadline + ": Meta ID");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.NOTES)
- .toString(), presentedHeadline + ": Notes");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(SBML_Constants.SBOTERM)
- .toString(), presentedHeadline + ": SBOTerm");
- AttributeHelper
- .setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_FUNCTION)
- .toString(), presentedHeadline + ": Function");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_ID).toString(),
- presentedHeadline + ": ID");
- AttributeHelper.setNiceId(
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_NAME).toString(),
- presentedHeadline + ": Name");
- }
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLFunctionDefinitionHelper.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLFunctionDefinitionHelper.java
deleted file mode 100644
index 491d6ede3..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLFunctionDefinitionHelper.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.graffiti.graph.Graph;
-
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml.SBML_SBase_Writer;
-
-public class SBMLFunctionDefinitionHelper {
-
- /**
- * Stores the SBMLFunctionDefinition objects
- */
- List functionDefinitionList;
-
- public SBMLFunctionDefinitionHelper(){
- functionDefinitionList = new ArrayList();
- }
-
- public SBMLFunctionDefinition addFunctionDefinition(Graph g, String internHeadline){
- SBMLFunctionDefinition functionDefinition = new SBMLFunctionDefinition(g, internHeadline);
- functionDefinitionList.add(functionDefinition);
- return functionDefinition;
- }
-
- public SBMLFunctionDefinition addFunctionDefinition(Graph g, String internHeadline, String presentedHeadline){
- SBMLFunctionDefinition functionDefinition = new SBMLFunctionDefinition(g, internHeadline, presentedHeadline);
- functionDefinitionList.add(functionDefinition);
- return functionDefinition;
- }
-
- public List getFunctionDefinitionHeadlines(Graph g){
- SBML_SBase_Writer writer = new SBML_SBase_Writer();
- return writer.headlineHelper(g, SBML_Constants.SBML_FUNCTION_DEFINITION);
- }
-
- public List addFunctionDefinitions(Graph g, List internHeadlines){
- List returnList = new ArrayList();
- Iterator internHeadlineIt = internHeadlines.iterator();
- while(internHeadlineIt.hasNext()){
- returnList.add(addFunctionDefinition(g, internHeadlineIt.next()));
- }
- return returnList;
- }
-}
diff --git a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLHelper.java b/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLHelper.java
deleted file mode 100644
index d2d0acc62..000000000
--- a/IPK-Plugins/src/java/de/ipk_gatersleben/ag_nw/graffiti/plugins/ios/sbml/SBMLHelper.java
+++ /dev/null
@@ -1,7978 +0,0 @@
-package de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.sbml;
-
-import java.awt.Color;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.AlignmentSetting;
-import org.AttributeHelper;
-import org.ErrorMsg;
-import org.PositionGridGenerator;
-import org.Vector2d;
-import org.graffiti.graph.Edge;
-import org.graffiti.graph.Graph;
-import org.graffiti.graph.Node;
-import org.sbml.jsbml.ASTNode;
-import org.sbml.jsbml.AlgebraicRule;
-import org.sbml.jsbml.AssignmentRule;
-import org.sbml.jsbml.Compartment;
-import org.sbml.jsbml.Constraint;
-import org.sbml.jsbml.Delay;
-import org.sbml.jsbml.Event;
-import org.sbml.jsbml.EventAssignment;
-import org.sbml.jsbml.FunctionDefinition;
-import org.sbml.jsbml.InitialAssignment;
-import org.sbml.jsbml.KineticLaw;
-import org.sbml.jsbml.ListOf;
-import org.sbml.jsbml.LocalParameter;
-import org.sbml.jsbml.ModifierSpeciesReference;
-import org.sbml.jsbml.Parameter;
-import org.sbml.jsbml.Priority;
-import org.sbml.jsbml.RateRule;
-import org.sbml.jsbml.Reaction;
-import org.sbml.jsbml.SBMLException;
-import org.sbml.jsbml.SimpleSpeciesReference;
-import org.sbml.jsbml.Species;
-import org.sbml.jsbml.SpeciesReference;
-import org.sbml.jsbml.Trigger;
-import org.sbml.jsbml.Unit;
-import org.sbml.jsbml.Unit.Kind;
-import org.sbml.jsbml.UnitDefinition;
-import org.sbml.jsbml.text.parser.ParseException;
-
-import de.ipk_gatersleben.ag_nw.graffiti.NodeTools;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.exporters.sbml.SBML_SBase_Writer;
-import de.ipk_gatersleben.ag_nw.graffiti.plugins.ios.importers.sbml.SBML_SBase_Reader;
-
-@SuppressWarnings({"deprecation", "unused"})
-public class SBMLHelper {
-
- /**
- * Provides necessary methods
- */
- public static SBML_SBase_Writer attWriter = new SBML_SBase_Writer();
-
- public static PositionGridGenerator _pgg = new PositionGridGenerator(100, 100, 1000);
-
- public static SBML_SBase_Reader attReader = new SBML_SBase_Reader();
-
- public static final String SBML_LAYOUT_EXTENSION_NAMESPACE = "http://www.sbml.org/sbml/level3/version1/layout/version1";
-
- private static boolean isInitializedReaction = false;
- private static boolean isInitializedKineticLaw = false;
-
- private static boolean isInitializedLocalParameter = false;
-
- private static int parameterCount = 1;
- private static int initialAssignmentCount = 1;
- private static int functionDefinitionCount = 1;
- private static int unitDefinitionCount = 1;
- private static int subUnitCount = 1;
- private static int constraintCount = 1;
- private static int assignmentRuleCount = 1;
- private static int rateRuleCount = 1;
- private static int algebraicRuleCount = 1;
- private static int eventCount = 1;
-
- private static PositionGridGenerator pgg = new PositionGridGenerator(100, 100,
- 1000);
-
- public static FunctionDefinition createFunctionDefinition(Graph g, String id) {
- String presentedHeadline = new StringBuffer("SBML Function Definition ").append(functionDefinitionCount).toString();
- String internHeadline = new StringBuffer(SBML_Constants.SBML_FUNCTION_DEFINITION).append(functionDefinitionCount).toString();
- setFunctionDefinitionID(g, internHeadline, id);
- FunctionDefinition fd = new FunctionDefinition();
- fd.setLevel(3);
- fd.setId(id);
- initFunctionDefinitionNiceIDs(internHeadline, presentedHeadline);
- ++functionDefinitionCount;
- return fd;
- }
-
- public static void createFunctionDefinition(Graph g, FunctionDefinition fd) {
- String presentedHeadline = new StringBuffer("SBML Function Definition ").append(functionDefinitionCount).toString();
- String internHeadline = new StringBuffer(SBML_Constants.SBML_FUNCTION_DEFINITION).append(functionDefinitionCount).toString();
- initFunctionDefinitionNiceIDs(internHeadline, presentedHeadline);
-
- fd.setLevel(3);
- if (fd.isSetId()) {
- setFunctionDefinitionID(g, internHeadline, fd.getId());
- }
- if (fd.isSetName()) {
- setFunctionDefinitionName(g, internHeadline, fd.getName());
- }
- String formula = "";
- try {
- if (fd.isSetMath()) {
- ASTNode mathTree = fd.getMath();
- formula = mathTree.toFormula();
- setFunctionDefinitionFunction(g, internHeadline, formula);
- }
- } catch (SBMLException e) {
- }
- ++functionDefinitionCount;
- }
-
- public static void addFunctionDefinitionName(Graph g, String id, String name) {
- setFunctionDefinitionName(g, returnFunctionDefinitionWithID(g, id), name);
- }
-
- public static void addFunctionDefinitionFunction(Graph g, String id, String function) {
- setFunctionDefinitionFunction(g, returnFunctionDefinitionWithID(g, id), function);
- }
-
- public static void deleteFunctionDefinitionID(Graph g, String id) {
- String headline = returnFunctionDefinitionWithID(g, id);
- if (AttributeHelper.hasAttribute(g, headline, new StringBuffer(headline).append(SBML_Constants.FUNCTION_DEFINITION_ID).toString())) {
- AttributeHelper.deleteAttribute(g, headline, new StringBuffer(headline).append(SBML_Constants.FUNCTION_DEFINITION_ID).toString());
- }
- }
-
- public static void deleteFunctionDefinitionName(Graph g, String id) {
- String headline = returnFunctionDefinitionWithID(g, id);
- if (AttributeHelper.hasAttribute(g, headline, new StringBuffer(headline).append(SBML_Constants.FUNCTION_DEFINITION_NAME).toString())) {
- AttributeHelper.deleteAttribute(g, headline, new StringBuffer(headline).append(SBML_Constants.FUNCTION_DEFINITION_NAME).toString());
- }
- }
-
- public static void deleteFunctionDefinitionFunction(Graph g, String id) {
- String headline = returnFunctionDefinitionWithID(g, id);
- if (AttributeHelper.hasAttribute(g, headline, new StringBuffer(headline).append(SBML_Constants.FUNCTION_DEFINITION_FUNCTION).toString())) {
- AttributeHelper.deleteAttribute(g, headline, new StringBuffer(headline).append(SBML_Constants.FUNCTION_DEFINITION_FUNCTION).toString());
- }
- }
-
- public static void deleteFunctionDefinition(Graph g, String id) {
- deleteFunctionDefinitionName(g, id);
- deleteFunctionDefinitionFunction(g, id);
- deleteFunctionDefinitionID(g, id);
- }
-
- public static boolean isSetFunctionDefinitionName(Graph g, String id) {
- if (AttributeHelper.hasAttribute(g, returnFunctionDefinitionWithID(g, id),
- new StringBuffer(returnFunctionDefinitionWithID(g, id)).append(SBML_Constants.FUNCTION_DEFINITION_NAME).toString())) {
- return true;
- }
- else {
- return false;
- }
- }
-
- public static boolean isSetFunctionDefinitionID(Graph g, String id) {
- if (AttributeHelper.hasAttribute(g, returnFunctionDefinitionWithID(g, id),
- new StringBuffer(returnFunctionDefinitionWithID(g, id)).append(SBML_Constants.FUNCTION_DEFINITION_ID).toString())) {
- return true;
- }
- else {
- return false;
- }
- }
-
- public static boolean isSetFunctionDefinitionFunction(Graph g, String id) {
- if (AttributeHelper.hasAttribute(g, returnFunctionDefinitionWithID(g, id),
- new StringBuffer(returnFunctionDefinitionWithID(g, id)).append(SBML_Constants.FUNCTION_DEFINITION_FUNCTION).toString())) {
- return true;
- }
- else {
- return false;
- }
- }
-
- /**
- * Indicates if the id of a specific function definition is set
- *
- * @param g
- * the graph where the information is read from
- * @param internHeadline
- * contains the number of the current function definition
- * @return true if the value is set.
- */
- static private Boolean isFunctionDefinitionID(Graph g, String internHeadline) {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.FUNCTION_DEFINITION_ID)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Indicates if the name of a specific function definition is set
- *
- * @param g
- * the graph where the information is read from
- * @param internHeadline
- * contains the number of the current function definition
- * @return true if the value is set.
- */
- private static Boolean isFunctionDefinitionName(Graph g,
- String internHeadline) {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.FUNCTION_DEFINITION_NAME)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Indicates if the function of a specific function definition is set
- *
- * @param g
- * the graph where the information is read from
- * @param internHeadline
- * contains the number of the current function definition
- * @return true if the value is set.
- */
- private static Boolean isFunctionDefinitionFunction(Graph g,
- String internHeadline) {
- if (AttributeHelper
- .hasAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_FUNCTION)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Deletes the id of a specific function definition
- *
- * @param g
- * the graph where the information is deleted from
- * @param internHeadline
- * contains the number of the current function definition
- */
- /*
- * public static void deleteFunctionDefinitionID(Graph g, String internHeadline) {
- * if (isFunctionDefinitionID(g, internHeadline)) {
- * AttributeHelper.deleteAttribute(g, internHeadline, new StringBuffer(internHeadline).append(
- * SBML_Constants.FUNCTION_DEFINITION_ID).toString());
- * }
- * }
- */
-
- /**
- * Deletes the name of a specific function definition
- *
- * @param g
- * the graph where the information is deleted from
- * @param internHeadline
- * contains the number of the current function definition
- */
- /*
- * public static void deleteFunctionDefinitionName(Graph g, String internHeadline) {
- * if (isFunctionDefinitionName(g, internHeadline)) {
- * AttributeHelper.deleteAttribute(g, internHeadline, new StringBuffer(internHeadline).append(
- * SBML_Constants.FUNCTION_DEFINITION_NAME).toString());
- * }
- * }
- */
-
- /**
- * Deletes the function of a specific function definition
- *
- * @param g
- * the graph where the information is deleted from
- * @param internHeadline
- * contains the number of the current function definition
- */
- /*
- * public static void deleteFunctionDefinitionFunction(Graph g, String internHeadline) {
- * if (isFunctionDefinitionFunction(g, internHeadline)) {
- * AttributeHelper.deleteAttribute(g, internHeadline, new StringBuffer(internHeadline).append(
- * SBML_Constants.FUNCTION_DEFINITION_FUNCTION).toString());
- * }
- * }
- */
-
- /**
- * Returns the function definition id if it is set
- *
- * @param g
- * the graph where the information is read from
- * @param internHeadline
- * contains the number of the current function definition
- * @return the id if it is set. Else the empty string
- */
- private static String getFunctionDefinitionID(Graph g, String internHeadline) {
- if (isFunctionDefinitionID(g, internHeadline)) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_ID).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- /**
- * Returns the function definition name if it is set
- *
- * @param g
- * the graph where the information is read from
- * @param internHeadline
- * contains the number of the current function definition
- * @return the name if it is set. Else the empty string
- */
- private static String getFunctionDefinitionName(Graph g,
- String internHeadline) {
- if (isFunctionDefinitionName(g, internHeadline)) {
- return (String) attWriter
- .getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_NAME)
- .toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- /**
- * Returns the function if it is set
- *
- * @param g
- * the graph where the information is read from
- * @param internHeadline
- * contains the number of the current function definition
- * @return the function if it is set. Else null
- */
- private static ASTNode getFunctionDefinitionFunction(Graph g,
- String internHeadline) {
- if (isFunctionDefinitionFunction(g, internHeadline)) {
- try {
- return ASTNode.parseFormula((String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_FUNCTION)
- .toString()));
- } catch (ParseException e) {
- e.printStackTrace();
- return null;
- }
- } else {
- return null;
- }
- }
-
- /**
- * Sets the id of a function definition
- *
- * @param g
- * the graph where the information will be set
- * @param internHeadline
- * contains the number of the current function definition
- * @param ID
- * the value that will be read in
- */
- private static void setFunctionDefinitionID(Graph g, String internHeadline,
- String ID) {
- if (!ID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_ID).toString(),
- ID);
- }
- }
-
- /**
- * Sets the name of a function definition
- *
- * @param g
- * the graph where the information will be set
- * @param internHeadline
- * contains the number of the current function definition
- * @param name
- * the value that will be read in
- */
- private static void setFunctionDefinitionName(Graph g,
- String internHeadline, String name) {
- if (!name.equals(SBML_Constants.EMPTY)) {
- AttributeHelper
- .setAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_NAME)
- .toString(), name);
-
- }
- }
-
- /**
- * Sets the function of a function definition
- *
- * @param g
- * the graph where the information will be set
- * @param internHeadline
- * contains the number of the current function definition
- * @param function
- * the value that will be read in
- */
- private static void setFunctionDefinitionFunction(Graph g,
- String internHeadline, String function) {
- if (!function.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.FUNCTION_DEFINITION_FUNCTION)
- .toString(), function);
- }
- }
-
- /**
- * Returns all intern function definition headlines
- *
- * @param g
- * the headlines are stored in this graph
- * @return a list of intern headlines
- */
- private static ArrayList getFunctionDefinitionHeadlines(Graph g) {
- SBML_SBase_Writer writer = new SBML_SBase_Writer();
- return writer
- .headlineHelper(g, SBML_Constants.SBML_FUNCTION_DEFINITION);
- }
-
- /**
- * Returns the number of function definitions in the graph
- *
- * @param g
- * where the information is read from
- * @return number of function definitios
- */
- public static int countFunctionDefinitions(Graph g) {
- return getFunctionDefinitionHeadlines(g).size();
- }
-
- /**
- * Returns a filled JSBML FunctionDefinition object. The function writes the attributes from a function definition in the graph into a JSBML function
- * definition.
- *
- * @param g
- * contains the information
- * @param internHeadline
- * contains the number of the current function definition
- * @return a filled FunctionDefinition object
- */
- private static FunctionDefinition getFunctionDefinition(Graph g,
- String internHeadline) {
- FunctionDefinition fd = new FunctionDefinition();
- fd.setLevel(3);
- if (isFunctionDefinitionID(g, internHeadline)) {
- fd.setId(getFunctionDefinitionID(g, internHeadline));
- }
- if (isFunctionDefinitionName(g, internHeadline)) {
- fd.setName(getFunctionDefinitionName(g, internHeadline));
- }
- if (isFunctionDefinitionFunction(g, internHeadline)) {
- fd.setMath(getFunctionDefinitionFunction(g, internHeadline));
- }
- return fd;
- }
-
- /**
- * Returns a list of filled JSBML FunctionDefinition objects
- *
- * @param g
- * contains the information
- * @param internHeadlines
- * contains the number of the current function definition
- * @return a filled list of function definitions
- */
- private static List getAllFunctionDefinitions(Graph g,
- List internHeadlines) {
- Iterator internHeadlinesIt = internHeadlines.iterator();
- List functionDefinitionList = new ArrayList();
- while (internHeadlinesIt.hasNext()) {
- String internHeadline = internHeadlinesIt.next();
- functionDefinitionList
- .add(getFunctionDefinition(g, internHeadline));
- }
- return functionDefinitionList;
- }
-
- /**
- * Returns a list of filled JSBML FunctionDefinition objects
- *
- * @param g
- * contains the information
- * @return a filled list of function definitions
- */
- public static List getAllFunctionDefinitions(Graph g) {
- List internHeadlines = getFunctionDefinitionHeadlines(g);
- Iterator internHeadlinesIt = internHeadlines.iterator();
- List functionDefinitionList = new ArrayList();
- while (internHeadlinesIt.hasNext()) {
- String internHeadline = internHeadlinesIt.next();
- functionDefinitionList
- .add(getFunctionDefinition(g, internHeadline));
- }
- return functionDefinitionList;
- }
-
- public static UnitDefinition createUnitDefinition(Graph g, String id) {
- String presentedHeadline = new StringBuffer("SBML Unit Definition ")
- .append(unitDefinitionCount).toString();
- String internHeadline = new StringBuffer(
- SBML_Constants.SBML_UNIT_DEFINITION).append(unitDefinitionCount)
- .toString();
- setUnitDefinitionID(g, internHeadline, id);
- UnitDefinition ud = new UnitDefinition();
- ud.setId(id);
- initUnitDefinitionNideIDs(internHeadline, presentedHeadline);
- ++unitDefinitionCount;
- return ud;
- }
-
- public static void createUnitDefinition(Graph g, UnitDefinition ud) {
- String presentedHeadline = new StringBuffer("SBML Unit Definition ")
- .append(unitDefinitionCount).toString();
- String internHeadline = new StringBuffer(
- SBML_Constants.SBML_UNIT_DEFINITION).append(unitDefinitionCount)
- .toString();
-
- if (ud.isSetId()) {
- ud.setLevel(3);
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.UNIT_DEFINITION_ID)
- .toString(), ud.getId());
- }
- if (ud.isSetName()) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.UNIT_DEFINITION_NAME)
- .toString(), ud.getName());
- }
-
- List ListOfSubUnits = new ArrayList();
- if (ud.isSetListOfUnits()) {
- List unitList = ud.getListOfUnits();
- Iterator itUnit = unitList.iterator();
- while (itUnit.hasNext()) {
- initSubUnitDefinitionNideIDs(internHeadline, presentedHeadline, subUnitCount);
- Unit unit = itUnit.next();
- int scale = unit.getScale();
- Double exponent = unit.getExponent();
- if (exponent.equals(Double.NaN)) {
- ErrorMsg.addErrorMessage("Attribute exponent of unit definition "
- + subUnitCount
- + " sub unit "
- + subUnitCount
- + " with the id "
- + ud.getId()
- + " is not a valid double value.");
- }
- Double multiplier = unit.getMultiplier();
- if (multiplier.equals(Double.NaN)) {
- ErrorMsg.addErrorMessage("Attribute multiplier of unit definition "
- + subUnitCount
- + " sub unit "
- + subUnitCount
- + " with the id "
- + ud.getId()
- + " is not a valid double value.");
- }
- String kind = unit.getKind().getName();
- String composedSubUnit = "(" + multiplier + " * 10^"
- + scale + " * " + kind + ")^" + exponent;
- setComposedSubUnit(g, internHeadline, composedSubUnit, subUnitCount);
- ListOfSubUnits.add(composedSubUnit);
- subUnitCount++;
- }
- String composedUnit = "";
- int size = ListOfSubUnits.size();
- int count = 0;
- Iterator itSubUnits = ListOfSubUnits.iterator();
- while (itSubUnits.hasNext()) {
- String subUnit = itSubUnits.next();
- composedUnit = composedUnit + subUnit;
- count++;
- if (count < size) {
- composedUnit = composedUnit + " * ";
- }
- }
- setComposedUnit(g, internHeadline, composedUnit);
- }
- initUnitDefinitionNideIDs(internHeadline, presentedHeadline);
- subUnitCount = 1;
- ++unitDefinitionCount;
- }
-
- public static void addUnitToUnitDefinition(Graph g, String id, Unit unit) {
- String headline = returnUnitDefinitionWithID(g, id);
- char index = headline.charAt(headline.length() - 1);
- String presentedHeadline = new StringBuffer("SBML Unit Definition ")
- .append(index).toString();
- initSubUnitDefinitionNideIDs(headline, presentedHeadline, getSubUnitCount(g, headline) + 1);
-
- int scale = unit.getScale();
- Double exponent = unit.getExponent();
- if (exponent.equals(Double.NaN)) {
- ErrorMsg.addErrorMessage("Attribute exponent of unit definition "
- + getSubUnitCount(g, headline)
- + " sub unit "
- + getSubUnitCount(g, headline)
- + " is not a valid double value.");
- }
- Double multiplier = unit.getMultiplier();
- if (multiplier.equals(Double.NaN)) {
- ErrorMsg.addErrorMessage("Attribute multiplier of unit definition "
- + getSubUnitCount(g, headline)
- + " sub unit "
- + getSubUnitCount(g, headline)
- + " is not a valid double value.");
- }
- String kind = unit.getKind().getName();
- String composedSubUnit = "(" + multiplier + " * 10^"
- + scale + " * " + kind + ")^" + exponent;
- setComposedSubUnit(g, headline, composedSubUnit, getSubUnitCount(g, headline) + 1);
- String composedUnit = getComposedUnit(g, headline);
- String nextComposedUnit = "";
- if (composedUnit != "") {
- nextComposedUnit = composedUnit + " * " + composedSubUnit;
- }
- else {
- nextComposedUnit = composedSubUnit;
- }
- setComposedUnit(g, headline, nextComposedUnit);
-
- }
-
- public static void addUnitToUnitDefinition(Graph g, String id, Unit.Kind kind, double exponent, double multiplier, int scale) {
- String headline = returnUnitDefinitionWithID(g, id);
- char index = headline.charAt(headline.length() - 1);
- String presentedHeadline = new StringBuffer("SBML Unit Definition ")
- .append(index).toString();
- initSubUnitDefinitionNideIDs(headline, presentedHeadline, getSubUnitCount(g, headline) + 1);
-
- String composedSubUnit = "(" + multiplier + " * 10^"
- + scale + " * " + kind + ")^" + exponent;
- setComposedSubUnit(g, headline, composedSubUnit, getSubUnitCount(g, headline) + 1);
- String composedUnit = getComposedUnit(g, headline);
- String nextComposedUnit = "";
- if (composedUnit != "") {
- nextComposedUnit = composedUnit + " * " + composedSubUnit;
- }
- else {
- nextComposedUnit = composedSubUnit;
- }
- setComposedUnit(g, headline, nextComposedUnit);
-
- }
-
- public static void addUnitDefinitionName(Graph g, String id, String name) {
- setUnitDefinitionName(g, returnUnitDefinitionWithID(g, id), name);
- }
-
- public static void addUnitDefinitionID(Graph g, String oldID, String newID) {
- setUnitDefinitionID(g, returnUnitDefinitionWithID(g, oldID), newID);
- }
-
- public static void deleteUnitDefinitionID(Graph g, String id) {
- String headline = returnUnitDefinitionWithID(g, id);
- if (AttributeHelper.hasAttribute(g, headline, new StringBuffer(
- headline).append(SBML_Constants.UNIT_DEFINITION_ID)
- .toString())) {
- AttributeHelper.deleteAttribute(g, headline, new StringBuffer(
- headline).append(SBML_Constants.UNIT_DEFINITION_ID)
- .toString());
- }
- }
-
- public static void deleteUnitDefinitionName(Graph g, String id) {
- String headline = returnUnitDefinitionWithID(g, id);
- if (AttributeHelper.hasAttribute(g, headline, new StringBuffer(
- headline).append(SBML_Constants.UNIT_DEFINITION_NAME)
- .toString())) {
- AttributeHelper.deleteAttribute(g, headline, new StringBuffer(
- headline).append(SBML_Constants.UNIT_DEFINITION_NAME)
- .toString());
- }
- }
-
- public static boolean isSetUnitDefinitionName(Graph g, String id) {
- if (AttributeHelper.hasAttribute(g, returnUnitDefinitionWithID(g, id), new StringBuffer(
- returnUnitDefinitionWithID(g, id)).append(SBML_Constants.UNIT_DEFINITION_NAME)
- .toString())) {
- return true;
- }
- else {
- return false;
- }
- }
-
- public static boolean isSetUnitDefinitionID(Graph g, String id) {
- if (AttributeHelper.hasAttribute(g, returnUnitDefinitionWithID(g, id), new StringBuffer(
- returnUnitDefinitionWithID(g, id)).append(SBML_Constants.UNIT_DEFINITION_ID)
- .toString())) {
- return true;
- }
- else {
- return false;
- }
- }
-
- /**
- * Indicates if the unit definition id is set
- *
- * @param g
- * the graph where the information is read from
- * @param internHeadline
- * contains the number of the current unit definition
- * @return true if the value is set.
- */
- private static Boolean isUnitDefinitionID(Graph g, String internHeadline) {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.UNIT_DEFINITION_ID)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Indicates if the unit definition name is set
- *
- * @param g
- * the graph where the information is read from
- * @param internHeadline
- * contains the number of the current unit definition
- * @return true if the value is set.
- */
- private static Boolean isUnitDefinitionName(Graph g, String internHeadline) {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.UNIT_DEFINITION_NAME)
- .toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Returns the unit definition id if it is set
- *
- * @param g
- * the graph where the information is read from
- * @param internHeadline
- * contains the number of the current unit definition
- * @return the id if it is set. Else the empty string
- */
- private static String getUnitDefinitionID(Graph g, String internHeadline) {
- if (isUnitDefinitionID(g, internHeadline)) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.UNIT_DEFINITION_ID).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- /**
- * Returns the unit definition name if it is set
- *
- * @param g
- * the graph where the information is read from
- * @param internHeadline
- * contains the number of the current unit definition
- * @return the name if it is set. Else the empty string
- */
- private static String getUnitDefinitionName(Graph g, String internHeadline) {
- if (isUnitDefinitionName(g, internHeadline)) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline).append(
- SBML_Constants.UNIT_DEFINITION_NAME).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- /**
- * Sets the id of a unit definition
- *
- * @param g
- * the graph where the information will be set
- * @param internHeadline
- * contains the number of the current unit definition
- * @param ID
- * the value that will be read in
- */
- private static void setUnitDefinitionID(Graph g, String internHeadline,
- String ID) {
- if (!ID.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.UNIT_DEFINITION_ID)
- .toString(), ID);
- }
- }
-
- /**
- * Sets the name of a unit definition
- *
- * @param g
- * the graph where the information will be set
- * @param internHeadline
- * contains the number of the current unit definition
- * @param name
- * the value that will be read in
- */
- private static void setUnitDefinitionName(Graph g, String internHeadline,
- String name) {
- if (!name.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.UNIT_DEFINITION_NAME)
- .toString(), name);
- }
- }
-
- /**
- * Sets a composed sub unit. All composed sub units will merge to a composed
- * unit
- *
- * @param g
- * the graph where the information will be set
- * @param internHeadline
- * contains the number of the current unit definition
- * @param composedSubUnit
- * the information that will be read in
- * @param subUnitCount
- * the number of the current sub unit
- */
- private static void setComposedSubUnit(Graph g, String internHeadline,
- String composedSubUnit, int subUnitCount) {
- if (!composedSubUnit.equals(SBML_Constants.EMPTY)) {
- System.out.println("drin");
- AttributeHelper.setAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline)
- .append(SBML_Constants.SUB_UNIT)
- .append(subUnitCount).append("_").toString(),
- composedSubUnit);
- }
- }
-
- /**
- * Sets the composed unit which consists of the composed sub units
- *
- * @param g
- * the graph where the information will be set
- * @param internHeadline
- * contains the number of the current unit definition
- * @param composedUnit
- * the information that will be set
- */
- private static void setComposedUnit(Graph g, String internHeadline,
- String composedUnit) {
- if (!composedUnit.equals(SBML_Constants.EMPTY)) {
- AttributeHelper.setAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.UNIT).toString(),
- composedUnit);
- }
- }
-
- /**
- * Indicates if a composed sub unit with a certain index is set
- *
- * @param g
- * the graph where the information can be found
- * @param internHeadline
- * contains the number of the current unit definition
- * @param unitCount
- * the index of the sub unit
- * @return true if a sub unit with a certain index is set
- */
- private static boolean isComposedSubUnit(Graph g, String internHeadline,
- int unitCount) {
- if (AttributeHelper.hasAttribute(g, internHeadline,
- new StringBuffer(internHeadline)
- .append(SBML_Constants.SUB_UNIT).append(unitCount)
- .append(SBML_Constants.UNDERLINE).toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Indicates if there is a composed unit
- *
- * @param g
- * the graph where the information can be found
- * @param internHeadline
- * contains the number of the current unit definition
- * @return true if the value is set. Else false
- */
- private static boolean isComposedUnit(Graph g, String internHeadline) {
- if (AttributeHelper.hasAttribute(g, internHeadline, new StringBuffer(
- internHeadline).append(SBML_Constants.UNIT).toString())) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Return the sub unit with a certain number
- *
- * @param g
- * the graph where the information can be found
- * @param internHeadline
- * contains the number of the current unit definition
- * @param unitCount
- * the number of the sub unit
- * @return the sub unit if it is set. Else the empty string
- */
- private static String getComposedSubUnit(Graph g, String internHeadline,
- int unitCount) {
- if (isComposedSubUnit(g, internHeadline, unitCount)) {
- return (String) attWriter.getAttribute(
- g,
- internHeadline,
- new StringBuffer(internHeadline)
- .append(SBML_Constants.SUB_UNIT).append(unitCount)
- .append(SBML_Constants.UNDERLINE).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- /**
- * Returns the composed unit which consists of the composed sub units
- *
- * @param g
- * the graph where the information can be found
- * @param internHeadline
- * contains the number of the current unit definition
- * @return the composed unit if it is set. Else the empty string
- */
- private static String getComposedUnit(Graph g, String internHeadline) {
- if (isComposedUnit(g, internHeadline)) {
- return (String) attWriter.getAttribute(g, internHeadline,
- new StringBuffer(internHeadline)
- .append(SBML_Constants.UNIT).toString());
- } else {
- return SBML_Constants.EMPTY;
- }
- }
-
- /**
- * Returns the amount of sub units of a certain unit definition
- *
- * @param g
- * the graph where the information can be found
- * @param internHeadline
- * contains the number of the current unit definition
- * @return the amount of sub units
- */
- private static int getSubUnitCount(Graph g, String internHeadline) {
- int suCount = 0;
- while (isComposedSubUnit(g, internHeadline, suCount + 1)) {
- suCount += 1;
- }
- return suCount;
- }
-
- /**
- * Returns a filled JSBML UnitDefinition object
- *
- * @param g
- * the graph where the information can be found
- * @param internHeadline
- * contains the number of the current unit definition
- * @return a filled UnitDefinition object
- */
- private static UnitDefinition getUnitDefinition(Graph g,
- String internHeadline) {
- UnitDefinition ud = new UnitDefinition();
- ud.setLevel(3);
- if (isUnitDefinitionID(g, internHeadline)) {
- ud.setId(getUnitDefinitionID(g, internHeadline));
- }
- if (isUnitDefinitionName(g, internHeadline)) {
- ud.setName(getUnitDefinitionName(g, internHeadline));
- }
- for (int i = 1; i <= getSubUnitCount(g, internHeadline); i++) {
- String subUnit = getComposedSubUnit(g, internHeadline, i);
- String[] subUnitArray = subUnit.split(Pattern.quote(")"));
- String exponent = subUnitArray[1].replace("^", "");
- String[] subUnitArray2 = subUnitArray[0].split("\\*");
- String multiplier = subUnitArray2[0].replace("(", "");
- String[] subUnitArray3 = subUnitArray2[1].split("\\^");
- String scale = subUnitArray3[1];
- String kind = subUnitArray2[2];
- Unit u = new Unit();
- u.setLevel(3);
- u.setKind(Kind.valueOf(kind.trim().toUpperCase()));
- u.setExponent(Double.parseDouble(exponent.trim()));
- u.setMultiplier(Double.parseDouble(multiplier.trim()));
- u.setScale(Integer.parseInt(scale.trim()));
- ud.addUnit(u);
- }
- return ud;
- }
-
- /**
- * Returns a filled list of UnitDefinition objects
- *
- * @param g
- * the graph where the information can be found
- * @param internHeadlines
- * contains the number of the current unit definition
- * @return a filled UnitDefinition list
- */
- private static List getAllUnitDefinitions(Graph g,
- List internHeadlines) {
- List udList = new ArrayList();
- Iterator internHeadlineIt = internHeadlines.iterator();
- while (internHeadlineIt.hasNext()) {
- String internHeadline = internHeadlineIt.next();
- udList.add(getUnitDefinition(g, internHeadline));
- }
- return udList;
- }
-
- /**
- * Returns a list of all unit definition headlines in the graph
- *
- * @param g
- * the graph where the information can be found
- * @return list of headlines
- */
- private static ArrayList getUnitDefinitionHeadlines(Graph g) {
- SBML_SBase_Writer writer = new SBML_SBase_Writer();
- return writer.headlineHelper(g, SBML_Constants.SBML_UNIT_DEFINITION);
- }
-
- /**
- * Returns a filled list of UnitDefinition objects
- *
- * @param g
- * the graph where the information can be found
- * @return a filled UnitDefinition list
- */
- public static List getAllUnitDefinitions(Graph g) {
- ArrayList internHeadlines = getUnitDefinitionHeadlines(g);
- List udList = new ArrayList();
- Iterator