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 5cda62a090499fe16ecffd0c6fcceaaa387d0a8e..bbaed2b85902c95ed3eedfb2ab40a72e1dc47df1 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 @@ -27,6 +27,8 @@ public class PlateStyleSetter { public static final int WELL_BOX_SIZE_PX = 20; + public static final int WELL_SPACING_PX = 2; + public static Component setWellStyle(Component component) { setPointerCursor(component); diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/heatmaps/HeatmapScaleFactory.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/heatmaps/HeatmapScaleFactory.java index 50b75b9505b9276e2e6302fd68fac11a9817cf52..f4a26bb547de2c47793522c20825d8cdbb62703a 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/heatmaps/HeatmapScaleFactory.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/heatmaps/HeatmapScaleFactory.java @@ -12,6 +12,7 @@ import com.extjs.gxt.ui.client.widget.layout.TableData; import com.extjs.gxt.ui.client.widget.layout.TableLayout; import com.google.gwt.user.client.ui.Widget; +import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.PlateStyleSetter; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.heatmaps.dto.Color; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.heatmaps.dto.HeatmapScaleElement; @@ -34,6 +35,7 @@ class HeatmapScaleFactory container.setLayout(new TableLayout(2)); container.setBorders(false); container.setScrollMode(Scroll.NONE); + container.setAutoHeight(true); boolean isFirstLabel = firstLabelOrNull != null; if (isFirstLabel) { @@ -78,8 +80,9 @@ class HeatmapScaleFactory { box.setStyleAttribute("background-color", color.getHexColor()); } - box.setWidth("2em"); - box.setHeight("2em"); + int size = PlateStyleSetter.WELL_BOX_SIZE_PX + PlateStyleSetter.WELL_SPACING_PX; + box.setWidth("" + size); + box.setHeight("" + size); return box; } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/heatmaps/PlateLayouter.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/heatmaps/PlateLayouter.java index e23f7d1e82e15eebc476ff241001f9b21fe618f7..153c0986e158c208eca128e9d11801c898c7ad9e 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/heatmaps/PlateLayouter.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/heatmaps/PlateLayouter.java @@ -16,6 +16,8 @@ package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.heatmaps; +import static ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.PlateStyleSetter.WELL_SPACING_PX; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -95,8 +97,6 @@ public class PlateLayouter private static final int HEATMAP_KIND_COMBOBOX_CHOOSER_WIDTH_PX = 200; - private static final int WELL_SPACING_PX = 2; - // ------- internal fixed state private final PlateLayouterModel model; @@ -191,6 +191,7 @@ public class PlateLayouter { legendContainer.removeAll(); legendContainer.add(legend); + legendContainer.setAutoHeight(true); legendContainer.layout(); } @@ -259,11 +260,10 @@ public class PlateLayouter plateContainer.setLayout(new ColumnLayout()); int legendWidth = 200; - int topChoosersHeight = 70; // height of things above plate layout in this container int plateWidth = getPlateMatrixPixelWidth(renderedWells); - int plateHeight = getPlateMatrixPixelHeight(renderedWells); int totalWidth = plateWidth + legendWidth; - plateContainer.setSize(totalWidth, plateHeight); + plateContainer.setAutoHeight(true); + plateContainer.setWidth(totalWidth); plateContainer.add(renderPlateLayout(renderedWells)); @@ -275,14 +275,19 @@ public class PlateLayouter plateContainer.add(legendContainer); container.add(plateContainer); - container.setSize(totalWidth, plateHeight + topChoosersHeight); + container.setAutoHeight(true); + container.setWidth(totalWidth); return container; } private static int getPlateMatrixPixelHeight(Component[][] renderedWells) { - int boxes = renderedWells.length + 1; - return WELL_SPACING_PX * (boxes + 1) + PlateStyleSetter.WELL_BOX_SIZE_PX * boxes; + return getPlateMatrixPixelHeight(renderedWells.length + 1); + } + + private static int getPlateMatrixPixelHeight(int numRows) + { + return WELL_SPACING_PX * (numRows + 1) + PlateStyleSetter.WELL_BOX_SIZE_PX * numRows; } private static int getPlateMatrixPixelWidth(Component[][] renderedWells)