Skip to content
Snippets Groups Projects
Commit 23d046ad authored by Andreas Bayha's avatar Andreas Bayha
Browse files

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: default avatarAndreas Bayha <bayha@fortiss.org>
parent 35b67747
No related branches found
No related tags found
1 merge request!1254014
...@@ -87,6 +87,15 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP ...@@ -87,6 +87,15 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP
/** Option text for the annotation type filter combo box. */ /** Option text for the annotation type filter combo box. */
private static final String SHOW_ALL_ANNOTATION_TYPES = "Show all annotation types"; 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. */ /** {@link TextField} for entering the filter pattern. */
@FXML @FXML
private TextField txtFilterText; private TextField txtFilterText;
...@@ -508,7 +517,7 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP ...@@ -508,7 +517,7 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP
@Override @Override
public Color getBackgroundColor(int column, AnnotationEntry element) { public Color getBackgroundColor(int column, AnnotationEntry element) {
if(element.getModelElement().equals(selected)) { if(element.getModelElement().equals(selected)) {
return LIGHTSEAGREEN; return READ_ONLY_EMPTY_ANNOTATION_BACKGROUND_COLOR;
} }
if(column > 1 && colIdxAnnotationMap.containsKey(column)) { if(column > 1 && colIdxAnnotationMap.containsKey(column)) {
...@@ -518,11 +527,11 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP ...@@ -518,11 +527,11 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP
element.getAnnotationValueProvider(spec.getClass()); element.getAnnotationValueProvider(spec.getClass());
if(valueProvider != null && valueProvider.getAnnotationValue(spec) != null && if(valueProvider != null && valueProvider.getAnnotationValue(spec) != null &&
!isEditable(column, element)) { !isEditable(column, element)) {
return BISQUE; return READ_ONLY_ANNOTATION_BACKGROUND_COLOR;
} }
if(!isEditable(column, element)) { if(!isEditable(column, element)) {
return LIGHTGREY; return READ_ONLY_ANNOTATION_BACKGROUND_COLOR;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment