MyGraphics added to enhance applet GUI
authoramwaterhouse <Andrew Waterhouse>
Thu, 27 Oct 2005 11:12:06 +0000 (11:12 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 27 Oct 2005 11:12:06 +0000 (11:12 +0000)
12 files changed:
src/jalview/appletgui/APopupMenu.java
src/jalview/appletgui/AlignFrame.java
src/jalview/appletgui/AnnotationLabels.java
src/jalview/appletgui/AnnotationPanel.java
src/jalview/appletgui/FeatureRenderer.java
src/jalview/appletgui/IdCanvas.java
src/jalview/appletgui/IdPanel.java
src/jalview/appletgui/MyGraphics.java [new file with mode: 0755]
src/jalview/appletgui/RotatableCanvas.java
src/jalview/appletgui/ScalePanel.java
src/jalview/appletgui/SeqCanvas.java
src/jalview/appletgui/TreeCanvas.java

index 272d653..0d1dad3 100755 (executable)
@@ -46,7 +46,7 @@ public class APopupMenu
   MenuItem noColourmenuItem = new MenuItem();\r
   protected CheckboxMenuItem conservationMenuItem = new CheckboxMenuItem();\r
 \r
-  AlignmentPanel ap;\r
+  final AlignmentPanel ap;\r
   MenuItem unGroupMenuItem = new MenuItem();\r
   MenuItem nucleotideMenuItem = new MenuItem();\r
   Menu colourMenu = new Menu();\r
@@ -54,7 +54,7 @@ public class APopupMenu
   CheckboxMenuItem showText = new CheckboxMenuItem();\r
   CheckboxMenuItem showColourText = new CheckboxMenuItem();\r
 \r
-  public APopupMenu(AlignmentPanel ap, Sequence seq, Vector links)\r
+  public APopupMenu(AlignmentPanel apanel, Sequence seq, Vector links)\r
   {\r
     ///////////////////////////////////////////////////////////\r
     // If this is activated from the sequence panel, the user may want to\r
@@ -63,7 +63,7 @@ public class APopupMenu
     // If from the IDPanel, we must display the sequence menu\r
     //////////////////////////////////////////////////////////\r
 \r
-    this.ap = ap;\r
+    this.ap = apanel;\r
 \r
     try\r
     {\r
@@ -105,7 +105,7 @@ public class APopupMenu
            {\r
                public void actionPerformed(ActionEvent e)\r
                {\r
-                  jalview.bin.JalviewLite.showURL(url, target);\r
+                  ap.alignFrame.showURL(url, target);\r
                }\r
            });\r
           linkMenu.add(item);\r
index b632442..c9c5117 100755 (executable)
@@ -29,7 +29,7 @@ import java.awt.event.*;
 import java.util.*;\r
 import java.io.InputStreamReader;\r
 import java.io.BufferedReader;\r
-import java.io.FileReader;\r
+import java.net.URL;\r
 \r
 public class AlignFrame\r
     extends GAlignFrame\r
@@ -147,33 +147,36 @@ public class AlignFrame
    * @param String DOCUMENT ME!\r
    */\r
 \r
-  public void parseGroupsFile(String file)\r
+  public void parseFeaturesFile(String file)\r
   {\r
     try\r
     {\r
-      BufferedReader in = new BufferedReader(new FileReader(file));\r
+      URL url = new URL(file);\r
+\r
+      BufferedReader in =  new BufferedReader(new InputStreamReader(url.openStream()));\r
       SequenceI seq = null;\r
-      String line, text, token;\r
-      UserColourScheme ucs;\r
+      String line, type, desc, token;\r
+\r
       int index, start, end;\r
       StringTokenizer st;\r
-      SequenceGroup sg;\r
+      SequenceFeature sf;\r
+      FeatureRenderer fr = alignPanel.seqPanel.seqCanvas.getFeatureRenderer();\r
       int lineNo = 0;\r
       while ( (line = in.readLine()) != null)\r
       {\r
         lineNo++;\r
         st = new StringTokenizer(line, "\t");\r
-        if (st.countTokens() != 6)\r
+        if (st.countTokens() == 2)\r
         {\r
-          System.out.println("Groups file " + file +\r
-                             " is invalid. Read help file.\nLine: \n"\r
-              +lineNo +": "+line);\r
-          break;\r
+          type = st.nextToken();\r
+          UserColourScheme ucs = new UserColourScheme(st.nextToken());\r
+          fr.setColour(type, ucs.findColour("A"));\r
+          continue;\r
         }\r
 \r
         while (st.hasMoreElements())\r
         {\r
-          text = st.nextToken();\r
+          desc = st.nextToken();\r
           token = st.nextToken();\r
           if (!token.equals("ID_NOT_SPECIFIED"))\r
           {\r
@@ -188,20 +191,29 @@ public class AlignFrame
 \r
           start = Integer.parseInt(st.nextToken());\r
           end = Integer.parseInt(st.nextToken());\r
-          ucs = new UserColourScheme(st.nextToken());\r
 \r
           seq = viewport.alignment.getSequenceAt(index);\r
           start = seq.findIndex(start) - 1;\r
           end = seq.findIndex(end) - 1;\r
 \r
-          sg = new SequenceGroup(text, ucs, true, true, false, start, end);\r
-          sg.addSequence(seq, false);\r
+          type = st.nextToken();\r
+\r
+          if(fr.getColour(type)==null)\r
+          {\r
+            // Probably the old style groups file\r
+            UserColourScheme ucs = new UserColourScheme(type);\r
+            fr.setColour(type, ucs.findColour("A"));\r
+          }\r
 \r
-          viewport.alignment.addGroup(sg);\r
+          sf = new SequenceFeature(type, desc, "", start, end);\r
 \r
+          seq.addSequenceFeature(sf);\r
         }\r
       }\r
 \r
+      viewport.showSequenceFeatures = true;\r
+      ((Alignment)viewport.alignment).featuresAdded = true;\r
+\r
       alignPanel.repaint();\r
 \r
     }\r
@@ -1348,7 +1360,7 @@ public class AlignFrame
 \r
   protected void documentation_actionPerformed(ActionEvent e)\r
   {\r
-    jalview.bin.JalviewLite.showURL("http://www.jalview.org/help.html");\r
+    showURL("http://www.jalview.org/help.html");\r
   }\r
 \r
   protected void about_actionPerformed(ActionEvent e)\r
@@ -1415,4 +1427,36 @@ public class AlignFrame
     jalview.bin.JalviewLite.addFrame(frame, "Jalview", 580, 200);\r
 \r
   }\r
+\r
+  /**\r
+   * Displays the given URL in a new browser window\r
+   *\r
+   * @param url URL to display in browser window.\r
+   * <br>New window will be named "HELP_WINDOW"\r
+   */\r
+  public void showURL(String url)\r
+  {\r
+    showURL(url, "HELP");\r
+  }\r
+\r
+  public void showURL(String url, String target)\r
+  {\r
+    if (applet == null)\r
+    {\r
+      System.out.println("Not running as applet - no browser available.");\r
+    }\r
+    else\r
+    {\r
+      try\r
+      {\r
+        applet.getAppletContext().showDocument(new java.net.URL(url),\r
+                                               target);\r
+      }\r
+      catch (Exception ex)\r
+      {\r
+        ex.printStackTrace();\r
+      }\r
+    }\r
+  }\r
+\r
 }\r
index 1df7455..dcdccc5 100755 (executable)
@@ -159,6 +159,11 @@ public class AnnotationLabels
 \r
   public void drawComponent(Graphics g, int width)\r
   {\r
+    if (!jalview.bin.JalviewLite.AWT1)\r
+    {\r
+      MyGraphics.AntiAlias(g);\r
+    }\r
+\r
     FontMetrics fm = g.getFontMetrics(g.getFont());\r
     g.setColor(Color.white);\r
     g.fillRect(0, 0, getSize().width, getSize().height);\r
index a1597f8..15e2671 100755 (executable)
@@ -219,6 +219,12 @@ public class AnnotationPanel
       fastPaint = false;\r
     }\r
 \r
+    if (!jalview.bin.JalviewLite.AWT1)\r
+    {\r
+      MyGraphics.AntiAlias(gg);\r
+    }\r
+\r
+\r
     if (fastPaint)\r
     {\r
       g.drawImage(image, 0, 0, this);\r
index 9d6503d..50f1378 100755 (executable)
  * along with this program; if not, write to the Free Software\r
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
  */\r
-\r
 package jalview.appletgui;\r
 \r
-import java.util.*;\r
+import jalview.datamodel.*;\r
 \r
 import java.awt.*;\r
 \r
-import jalview.datamodel.*;\r
+import java.util.*;\r
+\r
+import java.awt.image.*;\r
 \r
+\r
+/**\r
+ * DOCUMENT ME!\r
+ *\r
+ * @author $author$\r
+ * @version $Revision$\r
+ */\r
 public class FeatureRenderer\r
 {\r
-  AlignViewport av;\r
-\r
-  SequenceGroup currentSequenceGroup = null;\r
-  SequenceGroup[] allGroups = null;\r
-  Color resBoxColour;\r
-  Graphics graphics;\r
-\r
-  public FeatureRenderer(AlignViewport av)\r
-  {\r
-    this.av = av;\r
-  }\r
-\r
-  public void drawSequence(Graphics g, SequenceI seq, SequenceGroup[] sg,\r
-                           int start, int end, int x1, int y1, int width,\r
-                           int height)\r
-  {\r
-    Vector features = seq.getSequenceFeatures();\r
-    Enumeration e = features.elements();\r
-    while (e.hasMoreElements())\r
+    AlignViewport av;\r
+    SequenceGroup currentSequenceGroup = null;\r
+    SequenceGroup[] allGroups = null;\r
+    Color resBoxColour;\r
+    Graphics graphics;\r
+    float transparency = .4f;\r
+\r
+    // The following vector holds the features which are\r
+    // to be added, in the correct order or rendering\r
+    Vector featuresDisplayed;\r
+\r
+    /**\r
+     * Creates a new FeatureRenderer object.\r
+     *\r
+     * @param av DOCUMENT ME!\r
+     */\r
+    public FeatureRenderer(AlignViewport av)\r
     {\r
-      SequenceFeature sf = (SequenceFeature) e.nextElement();\r
-      if (sf.getBegin() > seq.getEnd())\r
-      {\r
-        continue;\r
-      }\r
+        this.av = av;\r
+        initColours();\r
+        String version = System.getProperty("java.version");\r
+        if (version.indexOf("1.1") == 0)\r
+          highlightTransparent = false;\r
 \r
-      int fstart = seq.findIndex(sf.getBegin()) - 1;\r
-      int fend = seq.findIndex(sf.getEnd()) - 1;\r
+    }\r
 \r
-      if ( (fstart <= end && fend >= start))\r
-      {\r
-        if (fstart < 0) // fix for if the feature we have starts before the sequence start,\r
+boolean highlightTransparent = true;\r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @param g DOCUMENT ME!\r
+     * @param seq DOCUMENT ME!\r
+     * @param sg DOCUMENT ME!\r
+     * @param start DOCUMENT ME!\r
+     * @param end DOCUMENT ME!\r
+     * @param x1 DOCUMENT ME!\r
+     * @param y1 DOCUMENT ME!\r
+     * @param width DOCUMENT ME!\r
+     * @param height DOCUMENT ME!\r
+     */\r
+    public void drawSequence(Graphics g, SequenceI seq, SequenceGroup[] sg,\r
+        int start, int end, int x1, int y1, int width, int height)\r
+    {\r
+\r
+        if(seq.getSequenceFeatures()==null)\r
+          return;\r
+\r
+        Enumeration e = null, e2;\r
+        String type;\r
+        if(featuresDisplayed!=null)\r
+          e = featuresDisplayed.elements();\r
+        else\r
+         e = seq.getSequenceFeatures().elements();\r
+\r
+       if(highlightTransparent)\r
         {\r
-          fstart = 0; // but the feature end is still valid!!\r
+        //  MyGraphics.SetTransparency(g, transparency);\r
         }\r
 \r
-        if (fstart == fend)\r
-        {\r
-          g.setColor(Color.red);\r
-          g.fillRoundRect( (fstart - start) * width, y1, width, height, 4, 4);\r
-          g.setColor(Color.white);\r
-\r
-          char s = seq.getSequence().charAt(fstart);\r
-          FontMetrics fm = g.getFontMetrics();\r
-          int charOffset = (width - fm.charWidth(s)) / 2;\r
-          int pady = height / 5;\r
-          g.drawString(String.valueOf(s),\r
-                       charOffset + x1 + width * (fstart - start),\r
-                       y1 + height - pady);\r
 \r
-        }\r
-        else\r
+        while (e.hasMoreElements())\r
         {\r
-          for (int i = fstart; i <= fend; i++)\r
-          {\r
-            char s = seq.getSequence().charAt(i);\r
-            if (jalview.util.Comparison.isGap(s))\r
+            SequenceFeature sf=null;\r
+            if(featuresDisplayed!=null)\r
             {\r
+              e2 = seq.getSequenceFeatures().elements();\r
+              type = e.nextElement().toString();\r
+              while(e2.hasMoreElements())\r
+              {\r
+                sf = (SequenceFeature) e2.nextElement();\r
+                if(sf.getType().equals(type))\r
+                  break;\r
+                else\r
+                  sf = null;\r
+              }\r
+            }\r
+            else\r
+            {\r
+              sf = (SequenceFeature) e.nextElement();\r
+              type = sf.getType();\r
+            }\r
+\r
+            if(sf==null)\r
               continue;\r
+\r
+\r
+            if (sf.getBegin() > seq.getEnd())\r
+            {\r
+                continue;\r
             }\r
 \r
-            g.setColor(Color.blue);\r
-            g.fillRect( (i - start) * width, y1, width, height);\r
+            int fstart = seq.findIndex(sf.getBegin()) - 1;\r
+            int fend = seq.findIndex(sf.getEnd()) - 1;\r
+\r
+            if (((fstart <= end) && (fend >= start)))\r
+            {\r
+                if (fstart < start)\r
+                { // fix for if the feature we have starts before the sequence start,\r
+                    fstart = start; // but the feature end is still valid!!\r
+                }\r
+\r
+                if (fend >= end)\r
+                {\r
+                    fend = end;\r
+                }\r
+\r
+                if (fstart == fend)\r
+                {\r
+                    g.setColor(getColour(type));\r
+                    g.fillRoundRect((fstart - start) * width, y1, width,\r
+                        height, 4, 4);\r
+                    g.setColor(Color.white);\r
+\r
+                    char s = seq.getSequence().charAt(fstart);\r
+                    FontMetrics fm = g.getFontMetrics();\r
+                    int charOffset = (width - fm.charWidth(s)) / 2;\r
+                    int pady = height / 5;\r
+                    g.drawString(String.valueOf(s),\r
+                        charOffset + x1 + (width * (fstart - start)),\r
+                        (y1 + height) - pady);\r
+                }\r
+                else\r
+                {\r
+                    for (int i = fstart; i <= fend; i++)\r
+                    {\r
+                        char s = seq.getSequence().charAt(i);\r
 \r
-            g.setColor(Color.white);\r
+                        if (jalview.util.Comparison.isGap(s))\r
+                        {\r
+                            continue;\r
+                        }\r
 \r
-            FontMetrics fm = g.getFontMetrics();\r
-            int charOffset = (width - fm.charWidth(s)) / 2;\r
-            int pady = height / 5;\r
-            g.drawString(String.valueOf(s),\r
-                         charOffset + x1 + width * (i - start),\r
-                         y1 + height - pady);\r
+                        g.setColor(getColour(type));\r
+                        g.fillRect((i - start) * width, y1, width, height);\r
+\r
+                        g.setColor(Color.white);\r
+\r
+                        FontMetrics fm = g.getFontMetrics();\r
+                        int charOffset = (width - fm.charWidth(s)) / 2;\r
+                        int pady = height / 5;\r
+                        g.drawString(String.valueOf(s),\r
+                            charOffset + x1 + (width * (i - start)),\r
+                            (y1 + height) - pady);\r
+                    }\r
+                }\r
+            }\r
           }\r
-        }\r
+\r
+          if (highlightTransparent)\r
+          {\r
+        //    MyGraphics.SetTransparency(g, 1.0f);\r
+          }\r
+    }\r
+\r
+    public Color getColour(String featureType)\r
+    {\r
+      return (Color)featureColours.get(featureType);\r
+    }\r
+\r
+    public void setColour(String featureType, Color col)\r
+    {\r
+      featureColours.put(featureType, col);\r
+    }\r
+\r
+    public void setTransparency(float value)\r
+    {\r
+      transparency = value;\r
+    }\r
+\r
+    public float getTransparency()\r
+    {\r
+      return transparency;\r
+    }\r
+\r
+    public void setFeaturePriority(Object [][] data)\r
+    {\r
+      // The feature table will display high priority\r
+      // features at the top, but theses are the ones\r
+      // we need to render last, so invert the data\r
+      featuresDisplayed = new Vector();\r
+      for(int i=data.length-1; i>-1; i--)\r
+      {\r
+       String type = data[i][0].toString();\r
+       setColour(type, (Color)data[i][1]);\r
+       if( ((Boolean)data[i][2]).booleanValue() )\r
+         featuresDisplayed.addElement(type);\r
       }\r
+    }\r
 \r
+    Hashtable featureColours = new Hashtable();\r
+    void initColours()\r
+    {\r
+      featureColours.put("active site", new Color(255, 75, 0));\r
+      featureColours.put("binding site", new Color(245, 85, 0));\r
+      featureColours.put("calcium-binding region", new Color(235, 95, 0));\r
+      featureColours.put("chain", new Color(225, 105, 0));\r
+      featureColours.put("coiled-coil region", new Color(215, 115, 0));\r
+      featureColours.put("compositionally biased region", new Color(205, 125, 0));\r
+      featureColours.put("cross-link", new Color(195, 135, 0));\r
+      featureColours.put("disulfide bond", new Color(185, 145, 0));\r
+      featureColours.put("DNA-binding region", new Color(175, 155, 0));\r
+      featureColours.put("domain", new Color(165, 165, 0));\r
+      featureColours.put("glycosylation site", new Color(155, 175, 0));\r
+      featureColours.put("helix", new Color(145, 185, 0));\r
+      featureColours.put("initiator methionine", new Color(135, 195, 5));\r
+      featureColours.put("lipid moiety-binding region", new Color(125, 205, 15));\r
+      featureColours.put("metal ion-binding site", new Color(115, 215, 25));\r
+      featureColours.put("modified residue", new Color(105, 225, 35));\r
+      featureColours.put("mutagenesis site", new Color(95, 235, 45));\r
+      featureColours.put("non-consecutive residues", new Color(85, 245, 55));\r
+      featureColours.put("non-terminal residue", new Color(75, 255, 65));\r
+      featureColours.put("nucleotide phosphate-binding region",\r
+                         new Color(65, 245, 75));\r
+      featureColours.put("peptide", new Color(55, 235, 85));\r
+      featureColours.put("propeptide", new Color(45, 225, 95));\r
+      featureColours.put("region of interest", new Color(35, 215, 105));\r
+      featureColours.put("repeat", new Color(25, 205, 115));\r
+      featureColours.put("selenocysteine", new Color(15, 195, 125));\r
+      featureColours.put("sequence conflict", new Color(5, 185, 135));\r
+      featureColours.put("sequence variant", new Color(0, 175, 145));\r
+      featureColours.put("short sequence motif", new Color(0, 165, 155));\r
+      featureColours.put("signal peptide", new Color(0, 155, 165));\r
+      featureColours.put("site", new Color(0, 145, 175));\r
+      featureColours.put("splice variant", new Color(0, 135, 185));\r
+      featureColours.put("strand", new Color(0, 125, 195));\r
+      featureColours.put("topological domain", new Color(0, 115, 205));\r
+      featureColours.put("transit peptide", new Color(0, 105, 215));\r
+      featureColours.put("transmembrane region", new Color(0, 95, 225));\r
+      featureColours.put("turn", new Color(0, 85, 235));\r
+      featureColours.put("unsure residue", new Color(0, 75, 245));\r
+      featureColours.put("zinc finger region", new Color(0, 65, 255));\r
     }\r
-  }\r
 \r
 }\r
+\r
+\r
+\r
index a277adb..d581273 100755 (executable)
@@ -161,6 +161,12 @@ public class IdCanvas
       gg.setFont(av.getFont());\r
     }\r
 \r
+    if(!jalview.bin.JalviewLite.AWT1)\r
+    {\r
+      MyGraphics.AntiAlias(gg);\r
+    }\r
+\r
+\r
     //Fill in the background\r
     gg.setColor(Color.white);\r
     Font italic = new Font(av.getFont().getName(), Font.ITALIC,\r
index b6e6a2b..82fc507 100755 (executable)
@@ -127,7 +127,8 @@ public class IdPanel
 \r
     try\r
     {\r
-      jalview.bin.JalviewLite.showURL(url, target);\r
+\r
+      alignPanel.alignFrame.showURL(url, target);\r
     }\r
     catch (Exception ex)\r
     {\r
diff --git a/src/jalview/appletgui/MyGraphics.java b/src/jalview/appletgui/MyGraphics.java
new file mode 100755 (executable)
index 0000000..835aff2
--- /dev/null
@@ -0,0 +1,21 @@
+package jalview.appletgui;\r
+import java.awt.*;\r
+\r
+public class MyGraphics\r
+{\r
+  public static void AntiAlias(Graphics g)\r
+  {\r
+    Graphics2D g2 = (Graphics2D)g;\r
+    g2.setRenderingHint( RenderingHints.KEY_ANTIALIASING,\r
+            RenderingHints.VALUE_ANTIALIAS_ON);\r
+  }\r
+\r
+\r
+  public static void SetTransparency(Graphics g, float transparency)\r
+    {\r
+      Graphics2D g2 = (Graphics2D) g;\r
+      g2.setComposite(\r
+          AlphaComposite.getInstance(\r
+              AlphaComposite.SRC_OVER, transparency));\r
+    }\r
+}\r
index 5daa320..b27ab8a 100755 (executable)
@@ -293,6 +293,11 @@ public class RotatableCanvas
 \r
   public void paint(Graphics g)\r
   {\r
+    if (!jalview.bin.JalviewLite.AWT1)\r
+    {\r
+      MyGraphics.AntiAlias(g);\r
+    }\r
+\r
     if (points == null)\r
     {\r
       g.setFont(new Font("Verdana", Font.PLAIN, 18));\r
index af226f3..336da66 100755 (executable)
@@ -162,6 +162,11 @@ public class ScalePanel
   public void drawScale(Graphics gg, int startx, int endx, int width,\r
                         int height)\r
   {\r
+    if (!jalview.bin.JalviewLite.AWT1)\r
+    {\r
+      MyGraphics.AntiAlias(gg);\r
+    }\r
+\r
     gg.setFont(av.getFont());\r
 \r
     //Fill in the background\r
index 1de9418..ddc32e8 100755 (executable)
@@ -54,6 +54,11 @@ public class SeqCanvas
 \r
   }\r
 \r
+  public FeatureRenderer getFeatureRenderer()\r
+  {\r
+    return fr;\r
+  }\r
+\r
   void drawNorthScale(Graphics g, int startx, int endx, int ypos)\r
   {\r
     int scalestartx = startx - startx % 10 + 10;\r
@@ -235,6 +240,10 @@ public class SeqCanvas
     {\r
       img = createImage(imgWidth, imgHeight);\r
       gg = img.getGraphics();\r
+      if(!jalview.bin.JalviewLite.AWT1)\r
+      {\r
+        MyGraphics.AntiAlias(gg);\r
+      }\r
       gg.setFont(av.getFont());\r
     }\r
 \r
@@ -368,12 +377,12 @@ public class SeqCanvas
 \r
         if(av.showAnnotation)\r
         {\r
-          g.translate(0, cHeight + ypos);\r
+          g.translate(0, cHeight + ypos+4);\r
           if(annotations==null)\r
             annotations = new AnnotationPanel(av);\r
 \r
           annotations.drawComponent( g, startRes, endx + 1);\r
-          g.translate(0, -cHeight - ypos);\r
+          g.translate(0, -cHeight - ypos-4);\r
         }\r
         g.translate(-LABEL_WEST, 0);\r
 \r
index d4202c3..f74a1f6 100755 (executable)
@@ -354,8 +354,14 @@ public class TreeCanvas
     if(tree==null)\r
       return;\r
 \r
+    if (!jalview.bin.JalviewLite.AWT1)\r
+    {\r
+      MyGraphics.AntiAlias(g);\r
+    }\r
+\r
     g.setFont(font);\r
 \r
+\r
     FontMetrics fm = g.getFontMetrics(font);\r
 \r
     if (nameHash.size() == 0)\r