Lines 227-233
Link Here
|
227 |
* Returns an anchor entry representing the source of the connection widget. |
227 |
* Returns an anchor entry representing the source of the connection widget. |
228 |
* @return the anchor entry representing the source of the connection widget |
228 |
* @return the anchor entry representing the source of the connection widget |
229 |
*/ |
229 |
*/ |
230 |
public Anchor.Entry getSourceAnchorEntry () { |
230 |
public final Anchor.Entry getSourceAnchorEntry () { |
231 |
return sourceEntry; |
231 |
return sourceEntry; |
232 |
} |
232 |
} |
233 |
|
233 |
|
Lines 235-241
Link Here
|
235 |
* Returns an anchor entry representing the target of the connection widget. |
235 |
* Returns an anchor entry representing the target of the connection widget. |
236 |
* @return the anchor entry representing the target of the connection widget |
236 |
* @return the anchor entry representing the target of the connection widget |
237 |
*/ |
237 |
*/ |
238 |
public Anchor.Entry getTargetAnchorEntry () { |
238 |
public final Anchor.Entry getTargetAnchorEntry () { |
239 |
return targetEntry; |
239 |
return targetEntry; |
240 |
} |
240 |
} |
241 |
|
241 |
|
Lines 243-249
Link Here
|
243 |
* Returns an anchor shape of the source of the connection widget. |
243 |
* Returns an anchor shape of the source of the connection widget. |
244 |
* @return the source anchor shape |
244 |
* @return the source anchor shape |
245 |
*/ |
245 |
*/ |
246 |
public AnchorShape getSourceAnchorShape () { |
246 |
public final AnchorShape getSourceAnchorShape () { |
247 |
return sourceAnchorShape; |
247 |
return sourceAnchorShape; |
248 |
} |
248 |
} |
249 |
|
249 |
|
Lines 251-257
Link Here
|
251 |
* Sets the anchor shape of the source of the connection widget. |
251 |
* Sets the anchor shape of the source of the connection widget. |
252 |
* @param sourceAnchorShape the source anchor shape |
252 |
* @param sourceAnchorShape the source anchor shape |
253 |
*/ |
253 |
*/ |
254 |
public void setSourceAnchorShape (AnchorShape sourceAnchorShape) { |
254 |
public final void setSourceAnchorShape (AnchorShape sourceAnchorShape) { |
255 |
assert sourceAnchorShape != null; |
255 |
assert sourceAnchorShape != null; |
256 |
boolean repaintOnly = this.sourceAnchorShape.getRadius () == sourceAnchorShape.getRadius (); |
256 |
boolean repaintOnly = this.sourceAnchorShape.getRadius () == sourceAnchorShape.getRadius (); |
257 |
this.sourceAnchorShape = sourceAnchorShape; |
257 |
this.sourceAnchorShape = sourceAnchorShape; |
Lines 262-268
Link Here
|
262 |
* Returns an anchor shape of the target of the connection widget. |
262 |
* Returns an anchor shape of the target of the connection widget. |
263 |
* @return the target anchor shape |
263 |
* @return the target anchor shape |
264 |
*/ |
264 |
*/ |
265 |
public AnchorShape getTargetAnchorShape () { |
265 |
public final AnchorShape getTargetAnchorShape () { |
266 |
return targetAnchorShape; |
266 |
return targetAnchorShape; |
267 |
} |
267 |
} |
268 |
|
268 |
|
Lines 270-276
Link Here
|
270 |
* Sets the anchor shape of the target of the connection widget. |
270 |
* Sets the anchor shape of the target of the connection widget. |
271 |
* @param targetAnchorShape the target anchor shape |
271 |
* @param targetAnchorShape the target anchor shape |
272 |
*/ |
272 |
*/ |
273 |
public void setTargetAnchorShape (AnchorShape targetAnchorShape) { |
273 |
public final void setTargetAnchorShape (AnchorShape targetAnchorShape) { |
274 |
assert targetAnchorShape != null; |
274 |
assert targetAnchorShape != null; |
275 |
boolean repaintOnly = this.targetAnchorShape.getRadius () == targetAnchorShape.getRadius (); |
275 |
boolean repaintOnly = this.targetAnchorShape.getRadius () == targetAnchorShape.getRadius (); |
276 |
this.targetAnchorShape = targetAnchorShape; |
276 |
this.targetAnchorShape = targetAnchorShape; |
Lines 281-287
Link Here
|
281 |
* Returns a point shape of control points of the connection widget. |
281 |
* Returns a point shape of control points of the connection widget. |
282 |
* @return the control points shape |
282 |
* @return the control points shape |
283 |
*/ |
283 |
*/ |
284 |
public PointShape getControlPointShape () { |
284 |
public final PointShape getControlPointShape () { |
285 |
return controlPointShape; |
285 |
return controlPointShape; |
286 |
} |
286 |
} |
287 |
|
287 |
|
Lines 289-295
Link Here
|
289 |
* Sets a point shape of control points of the connection widget. |
289 |
* Sets a point shape of control points of the connection widget. |
290 |
* @param controlPointShape the control points shape |
290 |
* @param controlPointShape the control points shape |
291 |
*/ |
291 |
*/ |
292 |
public void setControlPointShape (PointShape controlPointShape) { |
292 |
public final void setControlPointShape (PointShape controlPointShape) { |
293 |
assert controlPointShape != null; |
293 |
assert controlPointShape != null; |
294 |
boolean repaintOnly = this.controlPointShape.getRadius () == controlPointShape.getRadius (); |
294 |
boolean repaintOnly = this.controlPointShape.getRadius () == controlPointShape.getRadius (); |
295 |
this.controlPointShape = controlPointShape; |
295 |
this.controlPointShape = controlPointShape; |
Lines 300-306
Link Here
|
300 |
* Returns a point shape of end points of the connection widget. |
300 |
* Returns a point shape of end points of the connection widget. |
301 |
* @return the end points shape |
301 |
* @return the end points shape |
302 |
*/ |
302 |
*/ |
303 |
public PointShape getEndPointShape () { |
303 |
public final PointShape getEndPointShape () { |
304 |
return endPointShape; |
304 |
return endPointShape; |
305 |
} |
305 |
} |
306 |
|
306 |
|
Lines 308-314
Link Here
|
308 |
* Sets a point shape of end points of the connection widget. |
308 |
* Sets a point shape of end points of the connection widget. |
309 |
* @param endPointShape the end points shape |
309 |
* @param endPointShape the end points shape |
310 |
*/ |
310 |
*/ |
311 |
public void setEndPointShape (PointShape endPointShape) { |
311 |
public final void setEndPointShape (PointShape endPointShape) { |
312 |
assert endPointShape != null; |
312 |
assert endPointShape != null; |
313 |
boolean repaintOnly = this.endPointShape.getRadius () == endPointShape.getRadius (); |
313 |
boolean repaintOnly = this.endPointShape.getRadius () == endPointShape.getRadius (); |
314 |
this.endPointShape = endPointShape; |
314 |
this.endPointShape = endPointShape; |
Lines 336-352
Link Here
|
336 |
* Returns a list of control points. |
336 |
* Returns a list of control points. |
337 |
* @return the list of control points |
337 |
* @return the list of control points |
338 |
*/ |
338 |
*/ |
339 |
public List<Point> getControlPoints () { |
339 |
public final List<Point> getControlPoints () { |
340 |
return controlPointsUm; |
340 |
return controlPointsUm; |
341 |
} |
341 |
} |
342 |
|
342 |
|
343 |
/** |
343 |
/** |
344 |
* Returns a location of control point at the specified index in the list of control points. |
344 |
* Returns a location of control point at the specified index in the list of control points. |
345 |
* |
|
|
346 |
* @param index index of the control point to return |
345 |
* @param index index of the control point to return |
347 |
* @return the point; null if the control point does not exist |
346 |
* @return the point; null if the control point does not exist |
348 |
*/ |
347 |
*/ |
349 |
public Point getControlPoint (int index) { |
348 |
public final Point getControlPoint (int index) { |
350 |
if (index < 0 && index >= controlPoints.size ()) |
349 |
if (index < 0 && index >= controlPoints.size ()) |
351 |
return null; |
350 |
return null; |
352 |
return new Point (controlPoints.get(index)); |
351 |
return new Point (controlPoints.get(index)); |
Lines 358-364
Link Here
|
358 |
* @param sceneLocations if true, then controlPoints argyment is taken as a list of scene locations; |
357 |
* @param sceneLocations if true, then controlPoints argyment is taken as a list of scene locations; |
359 |
* if false, then controlPoints argument is taken as a list of local locations |
358 |
* if false, then controlPoints argument is taken as a list of local locations |
360 |
*/ |
359 |
*/ |
361 |
public void setControlPoints (Collection<Point> controlPoints, boolean sceneLocations) { |
360 |
public final void setControlPoints (Collection<Point> controlPoints, boolean sceneLocations) { |
362 |
if (sceneLocations) { |
361 |
if (sceneLocations) { |
363 |
Point translation = this.convertLocalToScene (new Point ()); |
362 |
Point translation = this.convertLocalToScene (new Point ()); |
364 |
ArrayList<Point> list = new ArrayList<Point> (); |
363 |
ArrayList<Point> list = new ArrayList<Point> (); |
Lines 378-384
Link Here
|
378 |
* @param alignment the alignment specified relatively to the origin point |
377 |
* @param alignment the alignment specified relatively to the origin point |
379 |
* @param placementInPercentage the placement on a path in percentage of the path length |
378 |
* @param placementInPercentage the placement on a path in percentage of the path length |
380 |
*/ |
379 |
*/ |
381 |
public void setConstraint (Widget childWidget, LayoutFactory.ConnectionWidgetLayoutAlignment alignment, float placementInPercentage) { |
380 |
public final void setConstraint (Widget childWidget, LayoutFactory.ConnectionWidgetLayoutAlignment alignment, float placementInPercentage) { |
382 |
connectionWidgetLayout.setConstraint (childWidget, alignment, placementInPercentage); |
381 |
connectionWidgetLayout.setConstraint (childWidget, alignment, placementInPercentage); |
383 |
} |
382 |
} |
384 |
|
383 |
|
Lines 388-394
Link Here
|
388 |
* @param alignment the alignment specified relatively to the origin point |
387 |
* @param alignment the alignment specified relatively to the origin point |
389 |
* @param placementAtDistance the placement on a path in pixels as a distance from the source anchor |
388 |
* @param placementAtDistance the placement on a path in pixels as a distance from the source anchor |
390 |
*/ |
389 |
*/ |
391 |
public void setConstraint (Widget childWidget, LayoutFactory.ConnectionWidgetLayoutAlignment alignment, int placementAtDistance) { |
390 |
public final void setConstraint (Widget childWidget, LayoutFactory.ConnectionWidgetLayoutAlignment alignment, int placementAtDistance) { |
392 |
connectionWidgetLayout.setConstraint (childWidget, alignment, placementAtDistance); |
391 |
connectionWidgetLayout.setConstraint (childWidget, alignment, placementAtDistance); |
393 |
} |
392 |
} |
394 |
|
393 |
|
Lines 396-402
Link Here
|
396 |
* Removes a constraint for a child widget. |
395 |
* Removes a constraint for a child widget. |
397 |
* @param childWidget the child widget |
396 |
* @param childWidget the child widget |
398 |
*/ |
397 |
*/ |
399 |
public void removeConstraint (Widget childWidget) { |
398 |
public final void removeConstraint (Widget childWidget) { |
400 |
connectionWidgetLayout.removeConstraint (childWidget); |
399 |
connectionWidgetLayout.removeConstraint (childWidget); |
401 |
} |
400 |
} |
402 |
|
401 |
|
Lines 514-520
Link Here
|
514 |
* Returns the rotation of the target anchor shape. |
513 |
* Returns the rotation of the target anchor shape. |
515 |
* @return the target anchor shape rotation |
514 |
* @return the target anchor shape rotation |
516 |
*/ |
515 |
*/ |
517 |
public double getTargetAnchorShapeRotation () { |
516 |
private double getTargetAnchorShapeRotation () { |
518 |
int size = controlPoints.size (); |
517 |
int size = controlPoints.size (); |
519 |
if (size <= 1) |
518 |
if (size <= 1) |
520 |
return 0.0; |
519 |
return 0.0; |