Applet is going more functions.
[jalview.git] / forester / java / src / org / forester / surfacing / PrintableSpeciesSpecificDcData.java
index 2cfbf0b..56d0239 100644 (file)
@@ -34,7 +34,7 @@ import java.util.TreeMap;
 import java.util.TreeSet;
 
 import org.forester.util.ForesterUtil;
-import org.forester.util.SequenceIdParser;
+import org.forester.util.SequenceAccessionTools;
 
 class PrintableSpeciesSpecificDcData implements SpeciesSpecificDcData {
 
@@ -98,36 +98,38 @@ class PrintableSpeciesSpecificDcData implements SpeciesSpecificDcData {
         final StringBuffer sb = new StringBuffer();
         if ( detailedness == DomainSimilarityCalculator.Detailedness.PUNCTILIOUS ) {
             if ( html ) {
-                sb.append( " " );
+                //sb.append( " " );
+                sb.append( "<td>" );
             }
             sb.append( getKeyDomainDomainsCount() );
             if ( html ) {
-                sb.append( ", " );
+                //sb.append( ", " );
+                sb.append( "</td><td>" );
             }
             else {
                 sb.append( "\t" );
             }
             sb.append( getKeyDomainProteinsCount() );
             if ( html ) {
-                sb.append( ", " );
+                // sb.append( ", " );
+                sb.append( "</td><td>" );
             }
             else {
                 sb.append( "\t" );
             }
             sb.append( getCombinableDomainsCount() );
-            if ( html && !getCombinableDomainIdToCountsMap().isEmpty() ) {
-                sb.append( ":" );
+            if ( html /*&& !getCombinableDomainIdToCountsMap().isEmpty()*/) {
+                // sb.append( ":" );
+                sb.append( "</td><td>" );
             }
         }
         if ( html ) {
             final Set<String> ids = getCombinableDomainIdToCountsMap().keySet();
-            int i = 0;
             for( final String domain_id : ids ) {
-                ++i;
                 sb.append( " " );
                 if ( html ) {
                     sb.append( "<a href=\"" + SurfacingConstants.PFAM_FAMILY_ID_LINK + domain_id + "\">" + domain_id
-                            + "</a>" );
+                               + "</a>" );
                 }
                 else {
                     sb.append( domain_id );
@@ -150,6 +152,7 @@ class PrintableSpeciesSpecificDcData implements SpeciesSpecificDcData {
                 sb.append( link );
             }
             sb.append( "]" );
+            sb.append( "</td>" );
         }
         return sb;
     }
@@ -168,19 +171,19 @@ class PrintableSpeciesSpecificDcData implements SpeciesSpecificDcData {
 
     private static String obtainSeqLink( final String p ) {
         String link;
-        final String up_id = ForesterUtil.extractUniProtKbProteinSeqIdentifier( p );
+        final String up_id = SequenceAccessionTools.parseUniProtAccessorFromString( p );
         if ( !ForesterUtil.isEmpty( up_id ) ) {
             link = "<a class=\"pl\" href=\"" + ForesterUtil.UNIPROT_KB + up_id + "\" target=\"_up_window\">" + up_id
                     + "</a>";
         }
         else {
-            final String gb_id = SequenceIdParser.parseGenbankProteinAccessor( p );
+            final String gb_id = SequenceAccessionTools.parseGenbankProteinAccessorFromString( p );
             if ( !ForesterUtil.isEmpty( gb_id ) ) {
                 link = "<a class=\"pl\" href=\"" + ForesterUtil.NCBI_PROTEIN + gb_id + "\" target=\"_up_window\">"
                         + gb_id + "</a>";
             }
             else {
-                final String gi = SequenceIdParser.parseGInumber( p );
+                final String gi = SequenceAccessionTools.parseGInumberFromString( p );
                 if ( !ForesterUtil.isEmpty( gi ) ) {
                     link = "<a class=\"pl\" href=\"" + ForesterUtil.NCBI_GI + gi + "\" target=\"_up_window\">gi|" + gi
                             + "</a>";