Skip to content

Commit 55e4d94

Browse files
Laurieprinceprmr
authored andcommitted
Issue #484 Fix use DiagramRenderer instance
1 parent 6781859 commit 55e4d94

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/org/jetuml/diagram/builder/DiagramBuilder.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ private Runnable createDetachOperation(Node pNode)
480480
{
481481
return ()->
482482
{
483-
Rectangle parentBound = packageNodeViewer().getBounds(parent);
483+
Rectangle parentBound = packageNodeRenderer().getBounds(parent);
484484
pNode.detach();
485485
parent.removeChild(pNode);
486486
parent.translate( parentBound.getX()-parent.position().getX(), parentBound.getY()-parent.position().getY() );
@@ -493,9 +493,9 @@ private Runnable createDetachOperation(Node pNode)
493493
};
494494
}
495495

496-
private PackageNodeRenderer packageNodeViewer()
496+
private PackageNodeRenderer packageNodeRenderer()
497497
{
498-
return (PackageNodeRenderer)DiagramType.newRendererInstanceFor(aDiagramRenderer.diagram()).rendererFor(PackageNode.class);
498+
return (PackageNodeRenderer)aDiagramRenderer.rendererFor(PackageNode.class);
499499
}
500500

501501
private Point computePosition(Dimension pDimension, Point pRequestedPosition)

src/org/jetuml/diagram/builder/SequenceDiagramBuilder.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ private Optional<ImplicitParameterNode> insideTargetArea(Point pPoint)
248248
{
249249
if( node instanceof ImplicitParameterNode && aDiagramRenderer.contains(node, pPoint) )
250250
{
251-
if( !(pPoint.getY() < implicitParameterNodeViewer().getTopRectangle(node).getMaxY() + CALL_NODE_YGAP) )
251+
if( !(pPoint.getY() < implicitParameterRenderer().getTopRectangle(node).getMaxY() + CALL_NODE_YGAP) )
252252
{
253253
return Optional.of( (ImplicitParameterNode)node );
254254
}
@@ -257,9 +257,9 @@ private Optional<ImplicitParameterNode> insideTargetArea(Point pPoint)
257257
return Optional.empty();
258258
}
259259

260-
private ImplicitParameterNodeRenderer implicitParameterNodeViewer()
260+
private ImplicitParameterNodeRenderer implicitParameterRenderer()
261261
{
262-
return (ImplicitParameterNodeRenderer)DiagramType.newRendererInstanceFor(aDiagramRenderer.diagram()).rendererFor(ImplicitParameterNode.class);
262+
return (ImplicitParameterNodeRenderer)aDiagramRenderer.rendererFor(ImplicitParameterNode.class);
263263
}
264264

265265
/**

0 commit comments

Comments
 (0)