From 23d046ad08ef67830828bb807f7360d14f11da59 Mon Sep 17 00:00:00 2001 From: Andreas Bayha <bayha@fortiss.org> Date: Tue, 13 Oct 2020 13:37:41 +0200 Subject: [PATCH] Annotations: Factored our color constants Constants used for backgrouind colors in the table are factored out. Issue-Ref: 4014 Issue-Url: https://af3-developer.fortiss.org/issues/4014 Signed-off-by: Andreas Bayha <bayha@fortiss.org> --- .../view/fx/AnnotationViewFXController.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/annotation/view/fx/AnnotationViewFXController.java b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/annotation/view/fx/AnnotationViewFXController.java index 3618e62b4..21041ec4f 100644 --- a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/annotation/view/fx/AnnotationViewFXController.java +++ b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/annotation/view/fx/AnnotationViewFXController.java @@ -87,6 +87,15 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP /** Option text for the annotation type filter combo box. */ private static final String SHOW_ALL_ANNOTATION_TYPES = "Show all annotation types"; + /** Background color for table cells, which are not editable and empty. */ + public static final Color READ_ONLY_EMPTY_ANNOTATION_BACKGROUND_COLOR = LIGHTGREY; + + /** Background color for table cells, which are not editable. */ + public static final Color READ_ONLY_ANNOTATION_BACKGROUND_COLOR = BISQUE; + + /** Background color for table cells of the selected element. */ + protected static final Color SELECTED_ANNOTATION_BACKGROUND_COLOR = LIGHTSEAGREEN; + /** {@link TextField} for entering the filter pattern. */ @FXML private TextField txtFilterText; @@ -508,7 +517,7 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP @Override public Color getBackgroundColor(int column, AnnotationEntry element) { if(element.getModelElement().equals(selected)) { - return LIGHTSEAGREEN; + return READ_ONLY_EMPTY_ANNOTATION_BACKGROUND_COLOR; } if(column > 1 && colIdxAnnotationMap.containsKey(column)) { @@ -518,11 +527,11 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP element.getAnnotationValueProvider(spec.getClass()); if(valueProvider != null && valueProvider.getAnnotationValue(spec) != null && !isEditable(column, element)) { - return BISQUE; + return READ_ONLY_ANNOTATION_BACKGROUND_COLOR; } if(!isEditable(column, element)) { - return LIGHTGREY; + return READ_ONLY_ANNOTATION_BACKGROUND_COLOR; } } -- GitLab