some fixes
authorcmzmasek <cmzmasek@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Thu, 8 Dec 2011 21:27:18 +0000 (21:27 +0000)
committercmzmasek <cmzmasek@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Thu, 8 Dec 2011 21:27:18 +0000 (21:27 +0000)
forester/java/src/org/forester/archaeopteryx/NodePanel.java
forester/java/src/org/forester/archaeopteryx/TreePanel.java
forester/java/src/org/forester/phylogeny/data/Property.java

index 4cfb7b2..768a397 100644 (file)
@@ -231,6 +231,9 @@ class NodePanel extends JPanel implements TreeSelectionListener {
         }
     }
 
         }
     }
 
+   
+    
+    
     private static void addBasics( final DefaultMutableTreeNode top,
                                    final PhylogenyNode phylogeny_node,
                                    final String name ) {
     private static void addBasics( final DefaultMutableTreeNode top,
                                    final PhylogenyNode phylogeny_node,
                                    final String name ) {
@@ -261,10 +264,7 @@ class NodePanel extends JPanel implements TreeSelectionListener {
                 if ( no_tax > 0 ) {
                     addSubelement( category, "External nodes without taxonomy", String.valueOf( no_tax ) );
                 }
                 if ( no_tax > 0 ) {
                     addSubelement( category, "External nodes without taxonomy", String.valueOf( no_tax ) );
                 }
-                //TODO remove me... maybe make me into a method?
-                //for( final Taxonomy taxonomy : distinct_tax.keySet() ) {
-                //    System.out.println( taxonomy + ": " + distinct_tax.get( taxonomy ) );
-                //}
+              
             }
         }
         if ( !phylogeny_node.isRoot() ) {
             }
         }
         if ( !phylogeny_node.isRoot() ) {
@@ -360,7 +360,7 @@ class NodePanel extends JPanel implements TreeSelectionListener {
         top.add( category );
         for( final String key : properties_map.keySet() ) {
             final Property prop = properties_map.get( key );
         top.add( category );
         for( final String key : properties_map.keySet() ) {
             final Property prop = properties_map.get( key );
-            category.add( new DefaultMutableTreeNode( prop.getRef() + " " + prop.getValue() + " " + prop.getUnit()
+            category.add( new DefaultMutableTreeNode( prop.getRef() + "=" + prop.getValue() + " " + prop.getUnit()
                     + " [" + prop.getAppliesTo().toString() + "]" ) );
         }
     }
                     + " [" + prop.getAppliesTo().toString() + "]" ) );
         }
     }
index 3aa861c..f33c31d 100644 (file)
@@ -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 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;
     private JTextArea                       _rollover_popup;
     // private final int                       _box_size;
     // private final int                       _half_box_size;
@@ -3168,10 +3168,27 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
             else {
                 sb.append( " " );
             }
             else {
                 sb.append( " " );
             }
-            sb.append( properties.getProperty( ref ).asText() );
+           
+            
+            final Property p = properties.getProperty( ref );
+            
+            sb.append( getPartAfterColon( p.getRef() ) );
+            sb.append( "=" );
+            sb.append( p.getValue() );
+            if ( !ForesterUtil.isEmpty( p.getUnit() ) ) {
+                sb.append( getPartAfterColon( p.getUnit() ) );
+            }
         }
         return sb;
     }
         }
         return sb;
     }
+    
+    final private static String getPartAfterColon( final String s ) {
+        final int i = s.indexOf( ':' );
+        if ( (i < 1) ||( i == ( s.length()-1)) ) {
+            return s;
+        }
+        return s.substring( i + 1, s.length() );
+    }
 
     private double drawTaxonomyImage( final double x, final double y, final PhylogenyNode node, final Graphics2D g ) {
         final List<Uri> us = new ArrayList<Uri>();
 
     private double drawTaxonomyImage( final double x, final double y, final PhylogenyNode node, final Graphics2D g ) {
         final List<Uri> us = new ArrayList<Uri>();
@@ -4725,6 +4742,20 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
                                                                                                   .getNumberOfDigitsAfterCommaForConfidenceValues() ) ) );
                     }
                 }
                                                                                                   .getNumberOfDigitsAfterCommaForConfidenceValues() ) ) );
                     }
                 }
+                if ( node.getNodeData().isHasProperties() ) {
+                    final PropertiesMap properties = node.getNodeData().getProperties();
+                    for( final String ref : properties.getPropertyRefs() ) {
+                        _popup_buffer.append( "\n" );
+                        final Property p = properties.getProperty( ref );
+                        _popup_buffer.append( getPartAfterColon( p.getRef() ) );
+                        _popup_buffer.append( "=" );
+                        _popup_buffer.append( p.getValue() );
+                        if ( !ForesterUtil.isEmpty( p.getUnit() ) ) {
+                            _popup_buffer.append( getPartAfterColon( p.getUnit() ) );
+                        }
+                    }
+                }
+                
                 if ( _popup_buffer.length() > 0 ) {
                     if ( !getConfiguration().isUseNativeUI() ) {
                         _rollover_popup
                 if ( _popup_buffer.length() > 0 ) {
                     if ( !getConfiguration().isUseNativeUI() ) {
                         _rollover_popup
index d33ed01..ff14b0f 100644 (file)
@@ -104,6 +104,7 @@ public class Property implements PhylogenyData {
         sb.append( ": " );
         sb.append( getValue() );
         if ( !ForesterUtil.isEmpty( getUnit() ) ) {
         sb.append( ": " );
         sb.append( getValue() );
         if ( !ForesterUtil.isEmpty( getUnit() ) ) {
+            sb.append( " " );
             sb.append( getUnit() );
         }
         return sb;
             sb.append( getUnit() );
         }
         return sb;