@@ -194,6 +194,10 @@ private void updateLaneSizeByDividerPos(GNode gNode, double offsetY) throws BPMN
194
194
String upperLaneID = gNode .getArgs ().get ("upperlaneid" ).toString ();
195
195
String lowerLaneID = gNode .getArgs ().get ("lowerlaneid" ).toString ();
196
196
197
+ logger .debug ("--- Update Lane ---" );
198
+ logger .debug ("--- offsetY=" + offsetY );
199
+ logger .debug ("--- gNodeID=" + gNode .getId ());
200
+
197
201
// Upper Lane
198
202
GNode upperGLane = (GNode ) modelState .getIndex ().get (upperLaneID )
199
203
.orElse (null );
@@ -207,43 +211,38 @@ private void updateLaneSizeByDividerPos(GNode gNode, double offsetY) throws BPMN
207
211
throw new BPMNMissingElementException (BPMNMissingElementException .MISSING_ELEMENT ,
208
212
"Lane " + upperLaneID + " not found in model!" );
209
213
}
210
-
211
214
String poolID = upperGLane .getParent ().getId ();
212
215
participant = modelState .getBpmnModel ().findParticipantById (poolID );
213
-
214
- // Lane currentLane = participant.openProcess().findLaneById(gNode.getId());
215
- // double myY = currentLane.getBounds().getPosition().getY();
216
-
217
216
upperBpmnLane = participant .openProcess ().findLaneById (upperLaneID );
218
217
lowerBpmnLane = participant .openProcess ().findLaneById (lowerLaneID );
218
+
219
+ logger .debug ("--- " + poolID + " y=" + participant .getBounds ().getPosition ().getY ());
220
+
219
221
// test if y-offset between min/max y range?
220
222
double yMin = Double .parseDouble (gNode .getArgs ().get ("ymin" ).toString ());
221
223
double yMax = Double .parseDouble (gNode .getArgs ().get ("ymax" ).toString ());
222
224
223
- logger .info ("-------------------" );
224
-
225
- logger .info ( " upperLane - y=" + upperBpmnLane .getBounds ().getPosition ().getY () + " h="
225
+ logger .debug ("--- divider ymin=" + yMin );
226
+ logger . debug ( "--- divider ymax=" + yMax );
227
+ logger .debug ( "--- upperLane - y=" + upperBpmnLane .getBounds ().getPosition ().getY () + " h="
226
228
+ upperBpmnLane .getBounds ().getDimension ().getHeight ());
227
-
228
- logger .info (" lowerBpmnLane - y=" + lowerBpmnLane .getBounds ().getPosition ().getY () + " h="
229
+ logger .debug ("--- lowerBpmnLane - y=" + lowerBpmnLane .getBounds ().getPosition ().getY () + " h="
229
230
+ lowerBpmnLane .getBounds ().getDimension ().getHeight ());
230
- logger .info (" yMin = " + yMin + " yMax=" + yMax );
231
231
232
- logger . info ( " OffsetY = " + offsetY );
232
+ // Compute new lane dimensions....
233
233
234
- if (upperBpmnLane .getBounds ().getDimension ().getHeight ()
235
- + offsetY < lowerBpmnLane .getBounds ().getPosition ().getY () + yMin ) {
236
- logger .info ("zu klein " );
237
- offsetY = -(upperBpmnLane .getBounds ().getDimension ().getHeight () - yMin );
238
- } else if (lowerBpmnLane .getBounds ().getPosition ().getY () + offsetY > yMax ) {
239
- logger .info ("zu groß" );
240
- offsetY = yMax - lowerBpmnLane .getBounds ().getPosition ().getY ();
234
+ if (upperBpmnLane .getBounds ().getDimension ().getHeight () + offsetY < Lane .MIN_HEIGHT ) {
235
+ logger .debug ("to small " );
236
+ offsetY = -(upperBpmnLane .getBounds ().getDimension ().getHeight () - Lane .MIN_HEIGHT );
237
+ } else if (lowerBpmnLane .getBounds ().getDimension ().getHeight () - offsetY < Lane .MIN_HEIGHT ) {
238
+ logger .debug ("to big" );
239
+ offsetY = lowerBpmnLane .getBounds ().getDimension ().getHeight () - Lane .MIN_HEIGHT ;
241
240
}
241
+ logger .debug ("--- Final Offset = " + offsetY );
242
242
243
- // recompute lane sizes....
243
+ // // recompute lane sizes....
244
244
upperBpmnLane .setDimension (upperBpmnLane .getBounds ().getDimension ().getWidth (),
245
245
upperBpmnLane .getBounds ().getDimension ().getHeight () + offsetY );
246
-
247
246
lowerBpmnLane .setPosition (lowerBpmnLane .getBounds ().getPosition ().getX (),
248
247
lowerBpmnLane .getBounds ().getPosition ().getY () + offsetY );
249
248
lowerBpmnLane .setDimension (lowerBpmnLane .getBounds ().getDimension ().getWidth (),
0 commit comments