From 29dbc60ccd9161f4b5a5aaff8c8ad3b5945f2fad Mon Sep 17 00:00:00 2001 From: Philipp Bauer Date: Thu, 22 Aug 2024 09:52:56 +0200 Subject: [PATCH] added getter for ZestRoorLayer ordering constants --- .../core/widgets/internal/ZestRootLayer.java | 38 +++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/org.eclipse.zest.core/src/org/eclipse/zest/core/widgets/internal/ZestRootLayer.java b/org.eclipse.zest.core/src/org/eclipse/zest/core/widgets/internal/ZestRootLayer.java index bc3f8cf30..5d9ad9591 100644 --- a/org.eclipse.zest.core/src/org/eclipse/zest/core/widgets/internal/ZestRootLayer.java +++ b/org.eclipse.zest.core/src/org/eclipse/zest/core/widgets/internal/ZestRootLayer.java @@ -64,37 +64,61 @@ public class ZestRootLayer extends FreeformLayer { */ private boolean isLayerKnown = false; + protected int getConnectionsLayer() { + return CONNECTIONS_LAYER; + } + + protected int getSubgraphsLayer() { + return SUBGRAPHS_LAYER; + } + + protected int getNodesLayer() { + return NODES_LAYER; + } + + protected int getConnectionsHighlightedLayer() { + return CONNECTIONS_HIGHLIGHTED_LAYER; + } + + protected int getNodesHighlightedLayer() { + return NODES_HIGHLIGHTED_LAYER; + } + + protected int getTopLayer() { + return TOP_LAYER; + } + /** * Adds a node to the ZestRootLayer * * @param nodeFigure The figure representing the node */ public void addNode(IFigure nodeFigure) { - addFigure(nodeFigure, NODES_LAYER); + addFigure(nodeFigure, getNodesLayer()); } public void addConnection(IFigure connectionFigure) { - addFigure(connectionFigure, CONNECTIONS_LAYER); + addFigure(connectionFigure, getConnectionsLayer()); } public void addSubgraph(IFigure subgraphFigrue) { - addFigure(subgraphFigrue, SUBGRAPHS_LAYER); + addFigure(subgraphFigrue, getSubgraphsLayer()); } public void highlightNode(IFigure nodeFigure) { - changeFigureLayer(nodeFigure, NODES_HIGHLIGHTED_LAYER); + changeFigureLayer(nodeFigure, getNodesHighlightedLayer()); } public void highlightConnection(IFigure connectionFigure) { - changeFigureLayer(connectionFigure, CONNECTIONS_HIGHLIGHTED_LAYER); + changeFigureLayer(connectionFigure, getConnectionsHighlightedLayer()); } public void unHighlightNode(IFigure nodeFigure) { - changeFigureLayer(nodeFigure, NODES_LAYER); + changeFigureLayer(nodeFigure, getNodesLayer()); } public void unHighlightConnection(IFigure connectionFigure) { - changeFigureLayer(connectionFigure, CONNECTIONS_LAYER); + changeFigureLayer(connectionFigure, getConnectionsLayer()); } private void changeFigureLayer(IFigure figure, int newLayer) {