I’ve been struggling with this for a few days now and I really don’t know what to do anymore. I’m using JGo for Java, version 5.30.
I have created a JGoIconincNode and a JGoBasicNode, and to each of them I added an extra JGoPort that has as port object a JGoImage. Here is a piece of code:
JGoPort port = new JGoPort(); port.setFromSpot(JGoPort.NoSpot); port.setToSpot(JGoPort.NoSpot); port.setValidSource(false); port.setValidDestination(false); port.setSelectable(false); port.setDraggable(false); Point boxLocation = iBox.getLocation(JGoObject.TopLeft); port.setLocation(boxLocation.x - 3, boxLocation.y - 3); port.setSize(16, 16); // port.setAutoRescale(false); port.setPortObject(hasInfoPortObject); port.setStyle(JGoPort.StyleObject); iBox.addObjectAtTail(port);
The problem appears when I click+hold on the port or on the JGoBasicNode.
If autoRescale is true, the port starts to become huge and it grows each time I click and hold on the node or on the port. If I set it to false, dragging the node doesn’t drag the port, too, clicking on the port will make the node move further from the port, dragging the port won’t work. This happens even if I set explicitly port.setDraggable(true) and/or port.setDragsNode(true).
This doesn’t happen for the JGoIconicNode, even if I’m using exactly the same approach for adding that JGoPort. I don’t know if this is a bug or if I did something wrong.
Could anyone please help me? Thank you!