From f4fb23cb07075ba87d6b812c3b6af92bb438dc59 Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Fri, 9 Dec 2011 02:15:00 +0000 Subject: [PATCH] cleanup --- .../src/org/forester/application/surfacing.java | 5 ++- .../forester/application/surfacing_hmmpfam.java | 1 - .../src/org/forester/archaeopteryx/NodePanel.java | 4 -- .../src/org/forester/archaeopteryx/TreePanel.java | 10 ++--- .../src/org/forester/surfacing/SurfacingUtil.java | 40 ++++++++++---------- 5 files changed, 25 insertions(+), 35 deletions(-) diff --git a/forester/java/src/org/forester/application/surfacing.java b/forester/java/src/org/forester/application/surfacing.java index aafd989..f878fa6 100644 --- a/forester/java/src/org/forester/application/surfacing.java +++ b/forester/java/src/org/forester/application/surfacing.java @@ -2373,8 +2373,9 @@ public class surfacing { System.out.println(); } - private static void createSplitWriters( File out_dir, String my_outfile, Map split_writers ) - throws IOException { + private static void createSplitWriters( final File out_dir, + final String my_outfile, + final Map split_writers ) throws IOException { split_writers.put( 'a', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile + "_domains_A.html" ) ) ); split_writers.put( 'b', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile diff --git a/forester/java/src/org/forester/application/surfacing_hmmpfam.java b/forester/java/src/org/forester/application/surfacing_hmmpfam.java index bd97c50..476640b 100644 --- a/forester/java/src/org/forester/application/surfacing_hmmpfam.java +++ b/forester/java/src/org/forester/application/surfacing_hmmpfam.java @@ -1973,7 +1973,6 @@ public class surfacing_hmmpfam { pw_stats = SurfacingUtil .writeDomainSimilaritiesToFile( html_desc, new StringBuilder( number_of_genomes + " genomes" ), - writer, null, similarities, diff --git a/forester/java/src/org/forester/archaeopteryx/NodePanel.java b/forester/java/src/org/forester/archaeopteryx/NodePanel.java index 768a397..37810c6 100644 --- a/forester/java/src/org/forester/archaeopteryx/NodePanel.java +++ b/forester/java/src/org/forester/archaeopteryx/NodePanel.java @@ -231,9 +231,6 @@ class NodePanel extends JPanel implements TreeSelectionListener { } } - - - private static void addBasics( final DefaultMutableTreeNode top, final PhylogenyNode phylogeny_node, final String name ) { @@ -264,7 +261,6 @@ class NodePanel extends JPanel implements TreeSelectionListener { if ( no_tax > 0 ) { addSubelement( category, "External nodes without taxonomy", String.valueOf( no_tax ) ); } - } } if ( !phylogeny_node.isRoot() ) { diff --git a/forester/java/src/org/forester/archaeopteryx/TreePanel.java b/forester/java/src/org/forester/archaeopteryx/TreePanel.java index f33c31d..6afa7a7 100644 --- a/forester/java/src/org/forester/archaeopteryx/TreePanel.java +++ b/forester/java/src/org/forester/archaeopteryx/TreePanel.java @@ -216,7 +216,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee private double _max_distance_to_root = -1; private int _dynamic_hiding_factor = 0; private boolean _edited = false; - private Popup _node_desc_popup; + private Popup _node_desc_popup; private JTextArea _rollover_popup; // private final int _box_size; // private final int _half_box_size; @@ -3168,10 +3168,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee else { sb.append( " " ); } - - final Property p = properties.getProperty( ref ); - sb.append( getPartAfterColon( p.getRef() ) ); sb.append( "=" ); sb.append( p.getValue() ); @@ -3181,10 +3178,10 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee } return sb; } - + final private static String getPartAfterColon( final String s ) { final int i = s.indexOf( ':' ); - if ( (i < 1) ||( i == ( s.length()-1)) ) { + if ( ( i < 1 ) || ( i == ( s.length() - 1 ) ) ) { return s; } return s.substring( i + 1, s.length() ); @@ -4755,7 +4752,6 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee } } } - if ( _popup_buffer.length() > 0 ) { if ( !getConfiguration().isUseNativeUI() ) { _rollover_popup diff --git a/forester/java/src/org/forester/surfacing/SurfacingUtil.java b/forester/java/src/org/forester/surfacing/SurfacingUtil.java index e6e8736..ddc6602 100644 --- a/forester/java/src/org/forester/surfacing/SurfacingUtil.java +++ b/forester/java/src/org/forester/surfacing/SurfacingUtil.java @@ -2139,18 +2139,15 @@ public final class SurfacingUtil { System.out.println( "Pearsonian skewness : n/a" ); } } - - if ( single_writer != null && ( split_writers == null || split_writers.isEmpty() ) ) { + if ( ( single_writer != null ) && ( ( split_writers == null ) || split_writers.isEmpty() ) ) { split_writers = new HashMap(); split_writers.put( '_', single_writer ); - } - switch ( print_option ) { case SIMPLE_TAB_DELIMITED: break; case HTML: - for (Writer w : split_writers.values()) { + for( final Writer w : split_writers.values() ) { w.write( "" ); w.write( SurfacingConstants.NL ); addHtmlHead( w, "SURFACING :: " + html_title ); @@ -2209,7 +2206,7 @@ public final class SurfacingUtil { } break; } - for (Writer w : split_writers.values()) { + for( final Writer w : split_writers.values() ) { w.write( SurfacingConstants.NL ); } for( final DomainSimilarity similarity : similarities ) { @@ -2220,33 +2217,34 @@ public final class SurfacingUtil { single_writer.write( similarity.toStringBuffer( print_option ).toString() ); } else { - Writer local_writer = split_writers.get( ( similarity.getDomainId().getId().charAt( 0 ) + "" ).toLowerCase().charAt( 0 ) ); + Writer local_writer = split_writers.get( ( similarity.getDomainId().getId().charAt( 0 ) + "" ) + .toLowerCase().charAt( 0 ) ); if ( local_writer == null ) { local_writer = split_writers.get( '0' ); - } + } local_writer.write( similarity.toStringBuffer( print_option ).toString() ); } - for (Writer w : split_writers.values()) { + for( final Writer w : split_writers.values() ) { w.write( SurfacingConstants.NL ); } } switch ( print_option ) { case HTML: - for (Writer w : split_writers.values()) { - w.write( SurfacingConstants.NL ); - w.write( "" ); - w.write( SurfacingConstants.NL ); - w.write( "" ); - w.write( SurfacingConstants.NL ); - w.write( "" ); - w.write( SurfacingConstants.NL ); - w.write( "" ); - w.write( SurfacingConstants.NL ); + for( final Writer w : split_writers.values() ) { + w.write( SurfacingConstants.NL ); + w.write( "" ); + w.write( SurfacingConstants.NL ); + w.write( "" ); + w.write( SurfacingConstants.NL ); + w.write( "" ); + w.write( SurfacingConstants.NL ); + w.write( "" ); + w.write( SurfacingConstants.NL ); } break; } - for (Writer w : split_writers.values()) { - w.close(); + for( final Writer w : split_writers.values() ) { + w.close(); } return stats; } -- 1.7.10.2