Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added reference point for viewport movement tracking #374

Closed
wants to merge 1 commit into from
Closed

Added reference point for viewport movement tracking #374

wants to merge 1 commit into from

Conversation

8ware
Copy link

@8ware 8ware commented Apr 13, 2016

Implements #371 as described in my second comment.

* Added viewport reference point to DiagramHandler
* Added methods for accessing the reference point
* Adjusted UniversalListener to update the reference point
* Added serialization vp_reference element
* Adjusted (de)serialization process to use the reference point for
  restoring the elements' original coordinates

Note, that this will only work for viewport movements. Any zoom action
will still affect the resulting (serialized) element coordinates.
@afdia
Copy link
Collaborator

afdia commented Apr 23, 2016

Thanks for your contribution.
I finally found some time to test it and it seems to work if you drag elements to the bottom right corner.
Unfortunately it doesn't work if you drag them to the upper left corner (probably because we use some kind of a hack to allow the drawpanel to grow to the upper left corner which is otherwise not possible with Swing)
Perhaps you find a way to fix that?

Other than that, the viewport doesn't work with the GWT version, but I can live with that as long as the diagrams can be opened without problems (which is the case)

By the way: did you have any problems with checking out the UMLet projects in Eclipse or did everything work fine?

@8ware
Copy link
Author

8ware commented Apr 28, 2016

I agree, too bad. Can you give me a hint, where to look for your drawpanel hack? I would give it another try...

Anyways, maybe my initial idea is not sufficient. Considering such border cases might create a non-trivial overhead which is clearly out of scope of my hack. I think that the whole layout mechanism has to be re-designed in order to achieve that feature in a robust way since the viewport and zoom properties must be taken into account natively.

Regarding your question about any problems during the setup: I didn't tried to import the project into Eclipse, so I don't know if there are any problems. But, I encountered problems when building the project on the command line using maven package -DskipTests. The build fails with the following error message:

[ERROR] Failed to execute goal on project umlet-gwt: Could not resolve dependencies for project com.umlet:umlet-gwt:gwt-app:14.3.0-SNAPSHOT: Could not find artifact com.umlet:umlet-elements:jar:sources:14.3.0-SNAPSHOT -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :umlet-gwt

I didn't investigated the issue any further, so the solution might be trivial.

@afdia
Copy link
Collaborator

afdia commented Apr 28, 2016

It has been some time since I looked at that part of the code, but it should be contained in the DrawPanel.java class

I guess the most important part is in the insertUpperLeftWhitespaceIfNeeded() method (line 236), but there are other methods which recalculate the scrollbars to make sure they "feel natural" which could possibly also influence the positioning of the diagram content.

The maven error is probably occurring because you haven't built the other modules (such as umlet-elements). If you build the umlet-parent pom.xml, it should work.

@8ware
Copy link
Author

8ware commented May 18, 2016

I'll think about it. But as I already mentioned it's probably more effective to re-implement the draw panel on the whole.

I tried to build the application from the root directory but still the same error.

@afdia afdia closed this Apr 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants