aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-09-30 01:32:28 +0200
committerSven Gothel <[email protected]>2023-09-30 01:32:28 +0200
commit972682a9247d3b4e8deb07b4ac1867d090f5ffff (patch)
treeb16939638e7d1063708b9e63b063dc24db06b9b5 /src/graphui
parentdd9f05890a157bf1688c3c325512e208cdd628ee (diff)
GraphUI: Group: Add attribute to allow not to relayout if child Shapes are dirty. Only issue validate on childs if theyre shape is dirty
Diffstat (limited to 'src/graphui')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/Group.java38
1 files changed, 24 insertions, 14 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/Group.java b/src/graphui/classes/com/jogamp/graph/ui/Group.java
index 17820702b..fc29b5eb2 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/Group.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/Group.java
@@ -239,14 +239,20 @@ public class Group extends Shape implements Container {
}
}
+ private boolean relayoutOnDirtyShapes = true;
+ public void setRelayoutOnDirtyShapes(final boolean v) { relayoutOnDirtyShapes = v; }
+ public boolean getRelayoutOnDirtyShapes() { return relayoutOnDirtyShapes; }
+
@Override
protected boolean isShapeDirty() {
- // Deep dirty state update:
- // - Ensure all group member's dirty state is updated
- // - Allowing all group member's validate to function
- for(final Shape s : shapes) {
- if( s.isShapeDirty() ) {
- markShapeDirty();
+ if( relayoutOnDirtyShapes ) {
+ // Deep dirty state update:
+ // - Ensure all group member's dirty state is updated
+ // - Allowing all group member's validate to function
+ for(final Shape s : shapes) {
+ if( s.isShapeDirty() ) {
+ markShapeDirty();
+ }
}
}
return super.isShapeDirty();
@@ -266,10 +272,12 @@ public class Group extends Shape implements Container {
firstGS = (GraphShape)s;
}
layouter.preValidate(s);
- if( null != gl ) {
- s.validate(gl);
- } else {
- s.validate(glp);
+ if( s.isShapeDirty() ) {
+ if( null != gl ) {
+ s.validate(gl);
+ } else {
+ s.validate(glp);
+ }
}
}
layouter.layout(this, box, pmv);
@@ -279,10 +287,12 @@ public class Group extends Shape implements Container {
if( needsRMs && null == firstGS && s instanceof GraphShape ) {
firstGS = (GraphShape)s;
}
- if( null != gl ) {
- s.validate(gl);
- } else {
- s.validate(glp);
+ if( s.isShapeDirty() ) {
+ if( null != gl ) {
+ s.validate(gl);
+ } else {
+ s.validate(glp);
+ }
}
pmv.pushMv();
s.setTransformMv(pmv);