Skip to content
Snippets Groups Projects
Commit 0d2d81b0 authored by Stephane Dallongeville's avatar Stephane Dallongeville
Browse files

fixed possible exception

parent 74c5e2d9
No related branches found
No related tags found
No related merge requests found
...@@ -1132,22 +1132,27 @@ public class BlockPanel extends JPanel implements ActionListener, BlockListener ...@@ -1132,22 +1132,27 @@ public class BlockPanel extends JPanel implements ActionListener, BlockListener
public Point getDragZoneLocation(Var<?> output) public Point getDragZoneLocation(Var<?> output)
{ {
if (blockDesc.isCollapsed() && !(this instanceof WorkFlowPanel)) if (blockDesc.isCollapsed() && !(this instanceof WorkFlowPanel))
{
return new Point(getX() + getWidth() - SHADOW_SIZE, getY() + getHeight() / 2); return new Point(getX() + getWidth() - SHADOW_SIZE, getY() + getHeight() / 2);
}
DragDropZone dz = getDragZone(output); DragDropZone dz = getDragZone(output);
if (!dz.isVisible())
return new Point(getX() + getWidth() - SHADOW_SIZE, getY() + getHeight() / 2);
int x = dz.getLocationOnScreen().x - getParent().getLocationOnScreen().x; int x = dz.getLocationOnScreen().x - getParent().getLocationOnScreen().x;
int y = dz.getLocationOnScreen().y - getParent().getLocationOnScreen().y; int y = dz.getLocationOnScreen().y - getParent().getLocationOnScreen().y;
return new Point(x + dz.getWidth(), y + dz.getHeight() / 2); return new Point(x + dz.getWidth(), y + dz.getHeight() / 2);
} }
public Point getDropZoneLocation(Var<?> input) public Point getDropZoneLocation(Var<?> input)
{ {
if (blockDesc.isCollapsed() && !(this instanceof WorkFlowPanel)) if (blockDesc.isCollapsed() && !(this instanceof WorkFlowPanel))
{
return new Point(getX() + SHADOW_SIZE, getY() + getHeight() / 2); return new Point(getX() + SHADOW_SIZE, getY() + getHeight() / 2);
}
DragDropZone dz = getDropZone(input); DragDropZone dz = getDropZone(input);
if (!dz.isVisible())
return new Point(getX() + SHADOW_SIZE, getY() + getHeight() / 2);
int x = dz.getLocationOnScreen().x - getParent().getLocationOnScreen().x; int x = dz.getLocationOnScreen().x - getParent().getLocationOnScreen().x;
int y = dz.getLocationOnScreen().y - getParent().getLocationOnScreen().y; int y = dz.getLocationOnScreen().y - getParent().getLocationOnScreen().y;
return new Point(x, y + dz.getHeight() / 2); return new Point(x, y + dz.getHeight() / 2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment