git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' of https://source.jalview.org/git/jalview.git into develop
[jalview.git]
/
src
/
jalview
/
appletgui
/
CutAndPasteTransfer.java
diff --git
a/src/jalview/appletgui/CutAndPasteTransfer.java
b/src/jalview/appletgui/CutAndPasteTransfer.java
index
d33e0cc
..
5b699a6
100644
(file)
--- a/
src/jalview/appletgui/CutAndPasteTransfer.java
+++ b/
src/jalview/appletgui/CutAndPasteTransfer.java
@@
-41,7
+41,10
@@
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.io.AnnotationFile;
import jalview.io.AppletFormatAdapter;
import jalview.datamodel.SequenceI;
import jalview.io.AnnotationFile;
import jalview.io.AppletFormatAdapter;
+import jalview.io.FileParse;
+import jalview.io.HtmlFile;
import jalview.io.IdentifyFile;
import jalview.io.IdentifyFile;
+import jalview.io.JSONFile;
import jalview.io.NewickFile;
import jalview.io.TCoffeeScoreFile;
import jalview.schemes.TCoffeeColourScheme;
import jalview.io.NewickFile;
import jalview.io.TCoffeeScoreFile;
import jalview.schemes.TCoffeeColourScheme;
@@
-60,6
+63,8
@@
public class CutAndPasteTransfer extends Panel implements ActionListener,
AlignFrame alignFrame;
AlignFrame alignFrame;
+ FileParse source = null;
+
public CutAndPasteTransfer(boolean forImport, AlignFrame alignFrame)
{
try
public CutAndPasteTransfer(boolean forImport, AlignFrame alignFrame)
{
try
@@
-163,7
+168,7
@@
public class CutAndPasteTransfer extends Panel implements ActionListener,
}
else if (alignFrame != null)
{
}
else if (alignFrame != null)
{
- loadAlignment(text, newWindow);
+ loadAlignment(text, newWindow, alignFrame.getAlignViewport());
}
// TODO: dialog should indicate if data was parsed correctly or not - see
}
// TODO: dialog should indicate if data was parsed correctly or not - see
@@
-212,16
+217,18
@@
public class CutAndPasteTransfer extends Panel implements ActionListener,
* @param text
* @param newWindow
*/
* @param text
* @param newWindow
*/
- protected void loadAlignment(String text, boolean newWindow)
+ protected void loadAlignment(String text, boolean newWindow,
+ AlignViewport viewport)
{
Alignment al = null;
String format = new IdentifyFile().Identify(text,
AppletFormatAdapter.PASTE);
{
Alignment al = null;
String format = new IdentifyFile().Identify(text,
AppletFormatAdapter.PASTE);
+ AppletFormatAdapter afa = new AppletFormatAdapter(viewport);
try
{
try
{
- al = new AppletFormatAdapter().readFile(text,
- AppletFormatAdapter.PASTE, format);
+ al = afa.readFile(text, AppletFormatAdapter.PASTE, format);
+ source = afa.getAlignFile();
} catch (java.io.IOException ex)
{
ex.printStackTrace();
} catch (java.io.IOException ex)
{
ex.printStackTrace();
@@
-247,6
+254,15
@@
public class CutAndPasteTransfer extends Panel implements ActionListener,
af.statusBar
.setText(MessageManager
.getString("label.successfully_pasted_annotation_to_alignment"));
af.statusBar
.setText(MessageManager
.getString("label.successfully_pasted_annotation_to_alignment"));
+
+ if (source instanceof HtmlFile)
+ {
+ ((HtmlFile) source).applySettingsToAlignmentView(af);
+ }
+ else if (source instanceof JSONFile)
+ {
+ ((JSONFile) source).applySettingsToAlignmentView(af);
+ }
}
else
{
}
else
{