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

DynamicTreetbaleViewer: Cell background color correct under selection

The background color of cells is always used with 50% transparency such
that the selection bar is displayed correctly, if a row is selected.

Issue-Ref: 4014
Issue-Url: https://af3-developer.fortiss.org/issues/4014


Signed-off-by: default avatarAndreas Bayha <bayha@fortiss.org>
parent 158badfa
No related branches found
No related tags found
1 merge request!1254014
AnnotationFxViewPart.java 6b65210913c150420f4fe67d055a0051d1d37a4e YELLOW
AnnotationViewFXController.java f0131450c4fd4266312b28bbe35eb12caa0b339a YELLOW
AnnotationViewFXController.java d31a8251ed42a9b432f6f978768413f6a20315f1 YELLOW
FXAnnotationFilterContentProvider.java 80fa6e9cc2f5ba3a255cab7061edca5fa368451a YELLOW
......@@ -18,7 +18,7 @@ package org.fortiss.tooling.base.ui.annotation.view.fx;
import static java.util.Collections.emptyList;
import static java.util.Collections.sort;
import static java.util.stream.Collectors.toList;
import static javafx.scene.paint.Color.ALICEBLUE;
import static javafx.scene.paint.Color.BISQUE;
import static javafx.scene.paint.Color.LIGHTGREY;
import static javafx.scene.paint.Color.LIGHTSEAGREEN;
import static org.fortiss.tooling.base.ui.annotation.view.fx.FXAnnotationFilterContentProvider.HIERARCHY_LEVELS_ALL;
......@@ -147,7 +147,7 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP
new HashMap<String, IAnnotatedSpecification>();
/** Content provider for the annotation table with all filtering functionality. */
private FXAnnotationFilterContentProvider filterContentProvider =
private final FXAnnotationFilterContentProvider filterContentProvider =
new FXAnnotationFilterContentProvider();
/**
......@@ -167,13 +167,6 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP
@Override
public void initialize() {
setupFilterWidgets();
// annotationTreeTableView.setStyle("-fx-selection-bar: transparent");
Node lookup1 = annotationTreeTableView.lookup(".tree-table-row-cell:selected");
Node lookup2 = annotationTreeTableView.lookup(".tree-table-row-cell");
System.out.println("fg");
// .setStyle("-fx-background-color: #000069");
}
/** {@inheritDoc} */
......@@ -310,12 +303,6 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP
updateAnnotationTree();
});
comboAnnotationType.valueProperty().addListener((obs, oVal, nVal) -> {
filterContentProvider.setHierarchyLevelFilter(nVal);
updateAnnotationTree();
});
txtFilterText.textProperty().addListener((obs, oVal, nVal) -> {
filterContentProvider.setFilterExpression(nVal);
......@@ -532,7 +519,7 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP
element.getAnnotationValueProvider(spec.getClass());
if(valueProvider != null && valueProvider.getAnnotationValue(spec) != null &&
!isEditable(column, element)) {
return ALICEBLUE;
return BISQUE;
}
if(!isEditable(column, element)) {
......
DynamicTextFieldTreeTableCell.java de24117e6f785b328f1ff62383626a0b4b54e8ff YELLOW
DynamicTreeContentProviderBase.java 6760a6dc5721175b1dada8f30fd9da05f7bcc4b3 GREEN
DynamicTreeItem.java 75dc5534b119ffdb3c10a65810c2a0f330b7955e GREEN
DynamicTreeTableUIProviderBase.java 0297555f7ef6880deea63b015b3acbc0d7a788d1 RED
DynamicTreeTableUIProviderBase.java 2c4886a5ecd7dc06c281e63c00c4e3499e5d8f28 YELLOW
DynamicTreeTableViewer.java 3d91b1bd43393f5d0733a253a85436b8255526ae YELLOW
DynamicTreeUIProviderBase.java e9b68607683de279d0cb8712a28dc131c5c33ece GREEN
DynamicTreeViewer.java 725f41f4fb4b6bfa813f010fb9083ab02eea164a GREEN
......
......@@ -87,7 +87,8 @@ public abstract class DynamicTreeTableUIProviderBase<T> {
if(data != null) {
Color bgColor = getBackgroundColor(columnIndex, data);
if(bgColor != null) {
String colorStr = colorToHex(bgColor);
double alpha = 0.5;
String colorStr = colorToRgbaString(bgColor, alpha);
cell.setStyle("-fx-background-color: " + colorStr);
}
}
......@@ -460,10 +461,10 @@ public abstract class DynamicTreeTableUIProviderBase<T> {
};
}
/** Converts a {@link Color} object into a rgb hex format as used in css. */
private final static String colorToHex(Color color) {
return String.format("#%02X%02X%02X", (int)(color.getRed() * 255),
(int)(color.getGreen() * 255), (int)(color.getBlue() * 255));
/** Converts a {@link Color} object into a rgba format as used in css. */
private final static String colorToRgbaString(Color color, double alpha) {
return String.format("rgba(%d,%d,%d,%.1f)", (int)(color.getRed() * 255),
(int)(color.getGreen() * 255), (int)(color.getBlue() * 255), alpha);
}
/**
......
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