X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FTextFrame.java;h=b2a35ea8867c4d4a4018b91daaebc7a868d563af;hb=814c97be10a4c55b0bb642668f9ef8e1f80d5a6c;hp=11954fa514b55f64d8f2c9d7f8aba241f5e8be7d;hpb=656be28debec520e0e35a8b311114398a40ea366;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/TextFrame.java b/forester/java/src/org/forester/archaeopteryx/TextFrame.java index 11954fa..b2a35ea 100644 --- a/forester/java/src/org/forester/archaeopteryx/TextFrame.java +++ b/forester/java/src/org/forester/archaeopteryx/TextFrame.java @@ -28,6 +28,7 @@ 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 tframes ) {