JAL-2797 first attempt
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Tue, 30 Jan 2018 15:16:16 +0000 (15:16 +0000)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Tue, 30 Jan 2018 15:16:16 +0000 (15:16 +0000)
forester/java/src/org/forester/archaeopteryx/AptxFrame.java [new file with mode: 0644]
forester/java/src/org/forester/archaeopteryx/EmbeddedFrame.java [new file with mode: 0644]
forester/java/src/org/forester/archaeopteryx/StandaloneFrame.java [new file with mode: 0644]

diff --git a/forester/java/src/org/forester/archaeopteryx/AptxFrame.java b/forester/java/src/org/forester/archaeopteryx/AptxFrame.java
new file mode 100644 (file)
index 0000000..00817f9
--- /dev/null
@@ -0,0 +1,60 @@
+package org.forester.archaeopteryx;
+
+
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import org.forester.archaeopteryx.tools.InferenceManager;
+import org.forester.archaeopteryx.tools.ProcessPool;
+
+public interface AptxFrame extends ActionListener {
+
+    NHFilter            nhfilter           = new NHFilter();
+    NHXFilter           nhxfilter          = new NHXFilter();
+    XMLFilter           xmlfilter          = new XMLFilter();
+    TolFilter           tolfilter          = new TolFilter();
+    NexusFilter         nexusfilter        = new NexusFilter();
+    PdfFilter           pdffilter          = new PdfFilter();
+    GraphicsFileFilter  graphicsfilefilter = new GraphicsFileFilter();
+    MsaFileFilter       msafilter          = new MsaFileFilter();
+    SequencesFileFilter seqsfilter         = new SequencesFileFilter();
+    DefaultFilter       defaultfilter      = new DefaultFilter();
+
+    /**
+     * Action performed.
+     */
+    void actionPerformed( ActionEvent e );
+
+    Configuration getConfiguration();
+
+    /**
+     * This method returns the current external node data which
+     * has been selected by the user by clicking the "Return ..."
+     * menu item. This method is expected to be called from Javascript or
+     * something like it.
+     *
+     * @return current external node data as String
+     */
+    String getCurrentExternalNodesDataBuffer();
+
+    int getCurrentExternalNodesDataBufferChangeCounter();
+
+    int getCurrentExternalNodesDataBufferLength();
+
+    InferenceManager getInferenceManager();
+
+    MainPanel getMainPanel();
+
+    Options getOptions();
+
+    ProcessPool getProcessPool();
+
+    void showTextFrame( String s, String title );
+
+    void showWhole();
+
+    void updateProcessMenu();
+
+    void activateSaveAllIfNeeded();
+}
\ No newline at end of file
diff --git a/forester/java/src/org/forester/archaeopteryx/EmbeddedFrame.java b/forester/java/src/org/forester/archaeopteryx/EmbeddedFrame.java
new file mode 100644 (file)
index 0000000..3bfe3ec
--- /dev/null
@@ -0,0 +1,90 @@
+package org.forester.archaeopteryx;
+
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.JInternalFrame;
+
+import org.forester.archaeopteryx.tools.InferenceManager;
+import org.forester.archaeopteryx.tools.ProcessPool;
+
+public class EmbeddedFrame extends JInternalFrame implements AptxFrame{
+    
+    MainFrame aptx;
+    
+    public EmbeddedFrame(MainFrame aptxInstance) {
+        aptx = aptxInstance;
+    }
+
+    @Override
+    public void actionPerformed( ActionEvent e ) {
+        aptx.actionPerformed( e );
+        
+    }
+
+    @Override
+    public Configuration getConfiguration() {
+        return aptx.getConfiguration();
+    }
+
+    @Override
+    public String getCurrentExternalNodesDataBuffer() {
+        return aptx.getCurrentExternalNodesDataBuffer();
+    }
+
+    @Override
+    public int getCurrentExternalNodesDataBufferChangeCounter() {
+        return aptx.getCurrentExternalNodesDataBufferChangeCounter();
+    }
+
+    @Override
+    public int getCurrentExternalNodesDataBufferLength() {
+        return aptx.getCurrentExternalNodesDataBufferLength();
+    }
+
+    @Override
+    public InferenceManager getInferenceManager() {
+        return aptx.getInferenceManager();
+    }
+
+    @Override
+    public MainPanel getMainPanel() {
+        return aptx.getMainPanel();
+    }
+
+    @Override
+    public Options getOptions() {
+        return aptx.getOptions();
+    }
+
+    @Override
+    public ProcessPool getProcessPool() {
+        return aptx.getProcessPool();
+    }
+
+    @Override
+    public void showTextFrame( String s, String title ) {
+        aptx.showTextFrame( s, title );
+        
+    }
+
+    @Override
+    public void showWhole() {
+        aptx.showWhole();
+        
+    }
+
+    @Override
+    public void updateProcessMenu() {
+        aptx.updateProcessMenu();
+        
+    }
+
+    @Override
+    public void activateSaveAllIfNeeded() {
+        aptx.activateSaveAllIfNeeded();
+        
+    }
+
+    
+}
diff --git a/forester/java/src/org/forester/archaeopteryx/StandaloneFrame.java b/forester/java/src/org/forester/archaeopteryx/StandaloneFrame.java
new file mode 100644 (file)
index 0000000..b3654b9
--- /dev/null
@@ -0,0 +1,89 @@
+package org.forester.archaeopteryx;
+
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.JFrame;
+
+import org.forester.archaeopteryx.tools.InferenceManager;
+import org.forester.archaeopteryx.tools.ProcessPool;
+
+public class StandaloneFrame extends JFrame implements AptxFrame{
+    
+    MainFrame aptx;
+    
+    public StandaloneFrame(MainFrame aptxInstance) {
+        aptx = aptxInstance;
+    }
+
+    @Override
+    public void actionPerformed( ActionEvent e ) {
+        aptx.actionPerformed( e );
+        
+    }
+
+    @Override
+    public Configuration getConfiguration() {
+        return aptx.getConfiguration();
+    }
+
+    @Override
+    public String getCurrentExternalNodesDataBuffer() {
+        return aptx.getCurrentExternalNodesDataBuffer();
+    }
+
+    @Override
+    public int getCurrentExternalNodesDataBufferChangeCounter() {
+        return aptx.getCurrentExternalNodesDataBufferChangeCounter();
+    }
+
+    @Override
+    public int getCurrentExternalNodesDataBufferLength() {
+        return aptx.getCurrentExternalNodesDataBufferLength();
+    }
+
+    @Override
+    public InferenceManager getInferenceManager() {
+        return aptx.getInferenceManager();
+    }
+
+    @Override
+    public MainPanel getMainPanel() {
+        return aptx.getMainPanel();
+    }
+
+    @Override
+    public Options getOptions() {
+        return aptx.getOptions();
+    }
+
+    @Override
+    public ProcessPool getProcessPool() {
+        return aptx.getProcessPool();
+    }
+
+    @Override
+    public void showTextFrame( String s, String title ) {
+        aptx.showTextFrame( s, title );
+        
+    }
+
+    @Override
+    public void showWhole() {
+        aptx.showWhole();
+        
+    }
+
+    @Override
+    public void updateProcessMenu() {
+        aptx.updateProcessMenu();
+        
+    }
+
+    @Override
+    public void activateSaveAllIfNeeded() {
+        aptx.activateSaveAllIfNeeded();
+        
+    }
+
+}