JAL-1158 use CutAndPasteHtmlTransfer for alignment properties report
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 31 Jan 2018 14:57:32 +0000 (14:57 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 31 Jan 2018 14:57:32 +0000 (14:57 +0000)
resources/lang/Messages.properties
resources/lang/Messages_es.properties
src/jalview/appletgui/APopupMenu.java
src/jalview/gui/AlignFrame.java
src/jalview/io/AlignmentProperties.java
src/jalview/jbgui/GUserDefinedColours.java

index f526699..05f7a57 100644 (file)
@@ -314,7 +314,6 @@ label.removed_columns = Removed {0} columns.
 label.removed_empty_columns = Removed {0} empty columns.
 label.paste_newick_tree_file = Paste your Newick tree file here.
 label.order_by_params = Order by {0}
-label.html_content = <html>{0}</html>
 label.paste_pdb_file= Paste your PDB file here.
 label.paste_pdb_file_for_sequence = Paste PDB file for sequence {0}
 label.could_not_parse_newick_file  = Could not parse Newick file\!\n {0}
index 77f053e..1c62648 100644 (file)
@@ -283,7 +283,6 @@ label.removed_columns = {0} columnas eliminadas.
 label.removed_empty_columns = {0} columnas vacías eliminadas.
 label.paste_newick_tree_file = Pegar su fichero árbol Newick aquí. 
 label.order_by_params = Ordenar por {0}
-label.html_content = <html>{0}</html>
 label.paste_pdb_file= Pegar tu fichero PDB aquí.
 label.paste_pdb_file_for_sequence = Pegar fichero PDB para la secuencia {0}
 label.could_not_parse_newick_file  = No se pudo analizar el fichero Newick\!\n {0}
index 46bd4fd..da04d23 100644 (file)
@@ -914,9 +914,7 @@ public class APopupMenu extends java.awt.PopupMenu
                     ? sequences[0].getDisplayId(true)
                     : "Selection"),
             600, 500);
-    cap.setText(
-            MessageManager.formatMessage("label.html_content", new Object[]
-            { contents.toString() }));
+    cap.setText("<html>" + contents.toString() + "</html>");
   }
 
   void editName()
index 298688b..da11536 100644 (file)
@@ -134,12 +134,10 @@ import java.util.List;
 import java.util.Vector;
 
 import javax.swing.JCheckBoxMenuItem;
-import javax.swing.JEditorPane;
 import javax.swing.JInternalFrame;
 import javax.swing.JLayeredPane;
 import javax.swing.JMenu;
 import javax.swing.JMenuItem;
-import javax.swing.JScrollPane;
 import javax.swing.SwingUtilities;
 
 /**
@@ -3222,17 +3220,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   @Override
   public void alignmentProperties()
   {
-    JEditorPane editPane = new JEditorPane("text/html", "");
-    editPane.setEditable(false);
+    CutAndPasteHtmlTransfer cap = new CutAndPasteHtmlTransfer();
     StringBuffer contents = new AlignmentProperties(viewport.getAlignment())
             .formatAsHtml();
-    editPane.setText(
-            MessageManager.formatMessage("label.html_content", new Object[]
-            { contents.toString() }));
-    JInternalFrame frame = new JInternalFrame();
-    frame.getContentPane().add(new JScrollPane(editPane));
+    cap.setText("<html>" + contents.toString() + "</html>");
 
-    Desktop.addInternalFrame(frame, MessageManager
+    Desktop.addInternalFrame(cap, MessageManager
             .formatMessage("label.alignment_properties", new Object[]
             { getTitle() }), 500, 400);
   }
index f2a6150..6a7d1c1 100644 (file)
@@ -50,7 +50,7 @@ public class AlignmentProperties
    * @param pw
    * @param html
    */
-  public void writeProperties(PrintWriter pw, boolean html)
+  protected void writeProperties(PrintWriter pw, boolean html)
   {
     final String nl = html ? "<br>" : System.getProperty("line.separator");
     float avg = 0;
index 3d7d779..f98e5c0 100755 (executable)
@@ -207,10 +207,9 @@ public class GUserDefinedColours extends JPanel
     label.setFont(new java.awt.Font("Verdana", Font.ITALIC, 10));
     label.setOpaque(false);
     label.setPreferredSize(new Dimension(260, 34));
-    label.setText(
-            MessageManager.formatMessage("label.html_content", new String[]
-            { MessageManager.getString(
-                    "label.save_colour_scheme_with_unique_name_added_to_colour_menu") }));
+    label.setText("<html>" + MessageManager.getString(
+            "label.save_colour_scheme_with_unique_name_added_to_colour_menu")
+            + "</html>");
     caseSensitive.setText(MessageManager.getString("label.case_sensitive"));
     caseSensitive.addActionListener(new ActionListener()
     {
@@ -259,7 +258,7 @@ public class GUserDefinedColours extends JPanel
               { choosers[0] });
     }
 
-    selectedButtons = new ArrayList<JButton>();
+    selectedButtons = new ArrayList<>();
   }
 
   /**