Closed eckig closed 9 years ago
The method that's responsible for drawing this path is in the DefaultTailSkin class:
public void draw(Point2D start, Point2D end, GConnector target, boolean valid)
The simplest way I can think of to implement what you need is to create a custom tail skin class that extends DefaultTailSkin, override this method, call super.draw(...), then do the additional logic to move the points inside the viewport.
I wouldn't implement this in the default skin class myself, because I prefer the current behaviour. I don't think the position of the viewport should have any influence on the initial connection layout. If the user wants to reposition some joints after the connection's created, they simply have to pan the window upwards.
And if the window is already maximized?
I meant to pan the window upwards by right-clicking-and-dragging, or using the mouse-wheel. But of course if the viewport is already at the top and the joints are outside the bounds of the view itself, this would be a problem. Is this what you're referring to?
This is what I meant, yes.
Hrm well the problem in this case is that there is just no 'nice-looking' connection shape you can draw. There isn't enough room to draw one. So then I would just say, the user should drag the node down first so that there is enough room. Or drag a selection box around the new joints and target node afterwards (this is possible in the demo even if it's full-screen) and move everything down.
If you want to enforce that the new joint positions are within the boundaries, you can extend the default tail skin like I mentioned above. I hope it's only a few lines of code. But I won't change the default tail skin right now because neither approach leads to great behaviour, and when in doubt I leave the simpler implementation as it is.
Yes you are right, that it is hard to draw a connection right with so little space available, but its still better than "no" connection.
Most of our application works without the need for our users to study the manual in depth. That' s why I would prefer an automatic solution... So I will check the TailSkin implementation.
You once again, pointed me in the right direction: Just a little minor change in our GTailSkin
did the trick - thanks.
Look at the following situation:
If I know connect the left output to the top input, I get the following:
They are connected, but the most part of the connection is outside the viewport and thus can not be modified with mouse gestures.
It would be nice if the framework would restrict the maximum / minimum GJoiunt Position so they stay within the visible area and thus can be moved.