JAL-2844 removed resetting line drawing to keep line on screen
[jalview.git] / forester / java / src / org / forester / archaeopteryx / TextFrame.java
index 55c12d4..b2a35ea 100644 (file)
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 //
 // Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
+// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
 
 package org.forester.archaeopteryx;
 
+import java.awt.AWTPermission;
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Container;
@@ -52,7 +53,7 @@ import javax.swing.JTextArea;
 final class TextFrame extends JFrame implements ActionListener, ClipboardOwner {
 
     /**
-     * 
+     *
      */
     private static final long           serialVersionUID = -5012834229705518363L;
     private static Color                ta_text_color    = new Color( 0, 0, 0 ),
@@ -79,10 +80,9 @@ final class TextFrame extends JFrame implements ActionListener, ClipboardOwner {
         final SecurityManager sm = System.getSecurityManager();
         if ( sm != null ) {
             try {
-                sm.checkSystemClipboardAccess();
+                sm.checkPermission( new AWTPermission( "accessClipboard" ) );
             }
             catch ( final Exception e ) {
-                //nope!
                 can_use_clipboard = false;
             }
         }
@@ -138,17 +138,8 @@ final class TextFrame extends JFrame implements ActionListener, ClipboardOwner {
         }
     }
 
-    void close() {
-        setVisible( false );
-        dispose();
-    }
-
-    void removeMe() {
-        final int i = _tframes.indexOf( this );
-        if ( i >= 0 ) {
-            _tframes.remove( i );
-        }
-        close();
+    @Override
+    public void lostOwnership( final Clipboard clipboard, final Transferable contents ) {
     }
 
     private void copy() {
@@ -161,8 +152,17 @@ final class TextFrame extends JFrame implements ActionListener, ClipboardOwner {
         sys_clipboard.setContents( contents, this );
     }
 
-    @Override
-    public void lostOwnership( final Clipboard clipboard, final Transferable contents ) {
+    void close() {
+        setVisible( false );
+        dispose();
+    }
+
+    void removeMe() {
+        final int i = _tframes.indexOf( this );
+        if ( i >= 0 ) {
+            _tframes.remove( i );
+        }
+        close();
     }
 
     static TextFrame instantiate( final String s, final String title, final LinkedList<TextFrame> tframes ) {