From e7d376ff860a6de1f343ad52f9f2a765239412c3 Mon Sep 17 00:00:00 2001 From: kjvdheide Date: Tue, 30 Jan 2018 15:16:16 +0000 Subject: [PATCH] JAL-2797 first attempt --- .../src/org/forester/archaeopteryx/AptxFrame.java | 60 +++++++++++++ .../org/forester/archaeopteryx/EmbeddedFrame.java | 90 ++++++++++++++++++++ .../forester/archaeopteryx/StandaloneFrame.java | 89 +++++++++++++++++++ 3 files changed, 239 insertions(+) create mode 100644 forester/java/src/org/forester/archaeopteryx/AptxFrame.java create mode 100644 forester/java/src/org/forester/archaeopteryx/EmbeddedFrame.java create mode 100644 forester/java/src/org/forester/archaeopteryx/StandaloneFrame.java diff --git a/forester/java/src/org/forester/archaeopteryx/AptxFrame.java b/forester/java/src/org/forester/archaeopteryx/AptxFrame.java new file mode 100644 index 0000000..00817f9 --- /dev/null +++ b/forester/java/src/org/forester/archaeopteryx/AptxFrame.java @@ -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 index 0000000..3bfe3ec --- /dev/null +++ b/forester/java/src/org/forester/archaeopteryx/EmbeddedFrame.java @@ -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 index 0000000..b3654b9 --- /dev/null +++ b/forester/java/src/org/forester/archaeopteryx/StandaloneFrame.java @@ -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(); + + } + +} -- 1.7.10.2