From a7c17d78eb8725beda5b5f1040ce5996baf9afa5 Mon Sep 17 00:00:00 2001
From: izabel <izabel>
Date: Wed, 18 Aug 2010 11:48:36 +0000
Subject: [PATCH] [LMS-1673] mark wells with images but without metadata

SVN: 17500
---
 .../detailviewers/PlateLayouter.java           | 18 +++++++++++++++++-
 .../detailviewers/PlateStyleSetter.java        |  8 ++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateLayouter.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateLayouter.java
index fa39e3d4c43..787beaa7efa 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateLayouter.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateLayouter.java
@@ -184,6 +184,9 @@ public class PlateLayouter
         legend.add(createEmptyWellWidget());
         legend.add(new Text("Empty well"));
 
+        legend.add(noMetadataWellWidget());
+        legend.add(new Text("No metadata well"));
+
         return legend;
     }
 
@@ -194,6 +197,13 @@ public class PlateLayouter
         return PlateStyleSetter.setEmptyWellStyle(widget);
     }
 
+    private static Component noMetadataWellWidget()
+    {
+        Component widget = createBox();
+        widget.setEnabled(true);
+        return PlateStyleSetter.setNoMetadataWellStyle(widget);
+    }
+
     private static Component createWellWidget(final WellData wellData,
             final PlateImages plateContent, final DefaultChannelState channelState,
             final ScreeningViewContext viewContext)
@@ -218,7 +228,13 @@ public class PlateLayouter
         {
             Component widget = createBox();
             // we may have images but at the same time no metadata
-            return PlateStyleSetter.setEmptyWellStyle(widget);
+            if (wellData.tryGetImages() != null)
+            {
+                return PlateStyleSetter.setNoMetadataWellStyle(widget);
+            } else
+            {
+                return PlateStyleSetter.setEmptyWellStyle(widget);
+            }
         } else
         {
             boolean isControlWell = isControlWell(metadata);
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateStyleSetter.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateStyleSetter.java
index 210c824ab15..23dd66fea56 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateStyleSetter.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateStyleSetter.java
@@ -57,6 +57,14 @@ public class PlateStyleSetter
         return widget;
     }
 
+    public static Component setNoMetadataWellStyle(Component widget)
+    {
+        setBackgroudColor(widget, "#BBBBBB");
+        setPointerCursor(widget);
+        setWellSize(widget);
+        return widget;
+    }
+
     private static void setWellSize(Component widget)
     {
         widget.setWidth(WELL_WIDGET_SIZE);
-- 
GitLab