sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 04/06: Try again to fix the problem of missing column headers. This hack seems to work.
Date Sat, 22 Feb 2020 17:04:15 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 8ade352ae5795581fbbaa86ee2f0f2cc93ff7810
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Sat Feb 22 14:09:56 2020 +0100

    Try again to fix the problem of missing column headers. This hack seems to work.
---
 .../main/java/org/apache/sis/gui/coverage/GridViewSkin.java   | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridViewSkin.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridViewSkin.java
index 5fdf06a..a1323c7 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridViewSkin.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridViewSkin.java
@@ -510,8 +510,17 @@ final class GridViewSkin extends VirtualContainerBase<GridView, GridRow>
impleme
                 layoutInArea(cell, pos, y, cellWidth, headerHeight, Node.BASELINE_OFFSET_SAME_AS_HEIGHT,
HPos.RIGHT, VPos.CENTER);
                 pos += cellWidth;
             }
+            /*
+             * For a mysterious reason, all row headers except the first one (0) are invisible
on the first time
+             * that the grid is shown. I have been unable to identify the reason; all `GridCell`
are created and
+             * received a non-empty text string. Doing a full layout again makes them appear.
So as a workaround
+             * we request the next layout to be full again if it seems that we have done
the initial layout. The
+             * very first layout create one cell (count = 0 & missing = 1), the next
layout create missing cells
+             * (count = 1 & missing = 18) — this is where we want to force a third
layou — then the third layout
+             * is stable (count = 19 & missing = 0).
+             */
+            layoutAll = count <= missing;
         }
-        layoutAll = false;
         if (hasErrors) {
             computeErrorBounds(flow);
         }


Mime
View raw message