JAL-2844 removed resetting line drawing to keep line on screen
[jalview.git] / forester / java / src / org / forester / archaeopteryx / TextFrame.java
index 6d52a26..b2a35ea 100644 (file)
@@ -28,6 +28,7 @@
 
 package org.forester.archaeopteryx;
 
+import java.awt.AWTPermission;
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Container;
@@ -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 ) {