inprogress
[jalview.git] / forester / java / src / org / forester / archaeopteryx / AptxUtil.java
index 1f7af11..f84d8c4 100644 (file)
@@ -21,7 +21,7 @@
 // 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;
 
@@ -300,7 +300,7 @@ public final class AptxUtil {
                                                                          final ControlPanel ac,
                                                                          final GraphicsExportType type,
                                                                          final Options options ) throws IOException {
-        tree_panel.setParametersForPainting( width, height, true );
+        tree_panel.calcParametersForPainting( width, height, true );
         tree_panel.resetPreferredSize();
         tree_panel.repaint();
         final RenderingHints rendering_hints = new RenderingHints( RenderingHints.KEY_RENDERING,
@@ -949,7 +949,7 @@ public final class AptxUtil {
 
     final static void unexpectedError( final Error e ) {
         System.err.println();
-        e.printStackTrace(  System.err );
+        e.printStackTrace( System.err );
         System.err.println();
         final StringBuffer sb = new StringBuffer();
         for( final StackTraceElement s : e.getStackTrace() ) {
@@ -958,39 +958,41 @@ public final class AptxUtil {
         JOptionPane
                 .showMessageDialog( null,
                                     "An unexpected (possibly severe) error has occured - terminating. \nPlease contact: "
-                                            + Constants.AUTHOR_EMAIL + " \nError: " + e.getLocalizedMessage() + "\n" + sb,
+                                            + Constants.AUTHOR_EMAIL + " \nError: " + e.getLocalizedMessage() + "\n"
+                                            + sb,
                                     "Unexpected Severe Error [" + Constants.PRG_NAME + " " + Constants.VERSION + "]",
                                     JOptionPane.ERROR_MESSAGE );
         System.exit( -1 );
     }
-    
+
     final static void outOfMemoryError( final OutOfMemoryError e ) {
         System.err.println();
         System.err.println( "Java memory allocation might be too small, try \"-Xmx2048m\" java command line option" );
         System.err.println();
         e.printStackTrace();
         System.err.println();
-        
-        JOptionPane
-                .showMessageDialog( null,
-                                    "Java memory allocation might be too small, try \"-Xmx2048m\" java command line option"
-                                            + "\n\nError: " + e.getLocalizedMessage(),
-                                    "Out of Memory Error [" + Constants.PRG_NAME + " " + Constants.VERSION + "]",
-                                    JOptionPane.ERROR_MESSAGE );
+        JOptionPane.showMessageDialog( null,
+                                       "Java memory allocation might be too small, try \"-Xmx2048m\" java command line option"
+                                               + "\n\nError: " + e.getLocalizedMessage(),
+                                       "Out of Memory Error [" + Constants.PRG_NAME + " " + Constants.VERSION + "]",
+                                       JOptionPane.ERROR_MESSAGE );
         System.exit( -1 );
     }
 
     final static void unexpectedException( final Exception e ) {
         System.err.println();
-        e.printStackTrace(  System.err );
+        e.printStackTrace( System.err );
         System.err.println();
         final StringBuffer sb = new StringBuffer();
         for( final StackTraceElement s : e.getStackTrace() ) {
             sb.append( s + "\n" );
         }
-        JOptionPane.showMessageDialog( null, "An unexpected exception has occured. \nPlease contact: "
-                + Constants.AUTHOR_EMAIL + " \nException: " + e.getLocalizedMessage() + "\n" + sb, "Unexpected Exception ["
-                + Constants.PRG_NAME + Constants.VERSION + "]", JOptionPane.ERROR_MESSAGE );
+        JOptionPane.showMessageDialog( null,
+                                       "An unexpected exception has occured. \nPlease contact: "
+                                               + Constants.AUTHOR_EMAIL + " \nException: " + e.getLocalizedMessage()
+                                               + "\n" + sb,
+                                       "Unexpected Exception [" + Constants.PRG_NAME + Constants.VERSION + "]",
+                                       JOptionPane.ERROR_MESSAGE );
     }
 
     final static String writePhylogenyToGraphicsByteArrayOutputStream( final ByteArrayOutputStream baos,
@@ -1004,7 +1006,7 @@ public final class AptxUtil {
             if ( options.isGraphicsExportVisibleOnly() ) {
                 throw new IllegalArgumentException( "cannot export visible rectangle only without exporting in actual size" );
             }
-            tree_panel.setParametersForPainting( options.getPrintSizeX(), options.getPrintSizeY(), true );
+            tree_panel.calcParametersForPainting( options.getPrintSizeX(), options.getPrintSizeY(), true );
             tree_panel.resetPreferredSize();
             tree_panel.repaint();
         }
@@ -1069,7 +1071,7 @@ public final class AptxUtil {
             if ( options.isGraphicsExportVisibleOnly() ) {
                 throw new IllegalArgumentException( "cannot export visible rectangle only without exporting in actual size" );
             }
-            tree_panel.setParametersForPainting( options.getPrintSizeX(), options.getPrintSizeY(), true );
+            tree_panel.calcParametersForPainting( options.getPrintSizeX(), options.getPrintSizeY(), true );
             tree_panel.resetPreferredSize();
             tree_panel.repaint();
         }