Giter VIP home page Giter VIP logo

fxdiagram's Introduction

fxdiagram's People

Contributors

beatngu13 avatar jankoehnlein avatar johngitpod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fxdiagram's Issues

Make binaries smaller

Currently, I ship two example movies which make 30MB of the binary. I should reduce that.

Cannot add xtext elements to diagram that are not exported in an IResourceDescription

I'm using version 0.25.0-SNAPSHOT of FXDiagram with Eclipse and Xtext. I have create a own diagram configuration for our DSL. When adding some references to new elements via the side buttons of an existing node the selection animation hangs. The problem is an unhandled but swallowed NoSuchElementException in the rendering thread.

I have debugged the problem and found the following issues:

Due to the size of our model only very few objects are exported in an IResourceDescription. Some Element types do have a QualifiedName (calculated by DefaultDeclarativeQualifiedNameProvider) but are not exported in an IResourceDescription, in particular, the element type that is represented by an edge on a diagram.

When trying to add some of those edges to new nodes via the side buttons of an existing node the following happens: In XtextEObjectID.Factory a DefaultXtextEObjectID is created if a QN exists. Later, when the element shall be resolved, resolve(ResourceSet) in DefaultXtextEObjectID fails with a NoSuchElementException because the object is not exported via the IResourceDescription. This NoSuchElementException is not logged and essentially crashes the animation that displays the available nodes for the edge type.

Layout nested diagrams before they become visible

When a nested diagram is opened for the first time, its contents are automatically layouted. It would be much smoother when this happened before it becomes visible.

This requires to precompute the bounds of nodes. Node#autosize() should work as long as we don't allow CSS styled nodes. Consider creating a new API method getBounds(BoundsType), that obsoletes getSnapBounds() as well.

Using mapping API in my own Xtext DSL

I'm just starting out with Xtext and wanted to try out FXDiagram for graphical view of a textual
DSL that I'm developing as a learning exercise. I tried to look for a complete working example
of the code snippets on
http://jankoehnlein.github.io/FXDiagram/hla.html
and browsed the sources and plugin.xml files in the Xtext generated projects to no avail.
I couldn't find (with ctntl-H) any references to Diagram in my Eclipse Neon workspace either!

I'm puzzled because I can use the FXDiagram view for the compartments example of statemachine
in an EclipseApplication.

Thanks,

Ajit

[releng] extend update site instead of overwriting it

Currently, each new release deletes the previous one on the bintray update site. This is OK as long as we don't have an official release. After that, we should at least keep the previous releases available or some time.

Possible solutions:

  • Properly use tycho. Question is where to keep the previous update site locally.
  • Changes the bintray repository URL for each release.

Facilitate standalone build

The promote.sh script does a number of naughty things in order to reduce the jar files to the minimum.
Most of this should be ported to the maven build.

[eclipse] Make sure keybindings work

Some keybindings work OOTB, others are shadowed by Eclipse actions (CMD-SHIFT-L), others don't have an effect at all (CMD-Z).
Akira-san also reported CMD-P not working on Japanese keyboards.

[eclipse] Save diagram fails

I'm using version 0.25.0-SNAPSHOT of FXDiagram with Eclipse. I get the following error when saving an untitled diagram to a *.fxd file:

Caused by: java.lang.IllegalArgumentException: Path must include project and resource name: /Untitled.fxd at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63) at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2075) at org.eclipse.core.internal.resources.Container.getFile(Container.java:192) at de.fxdiagram.eclipse.actions.EclipseSaveAction.doSave(EclipseSaveAction.java:83) at de.fxdiagram.eclipse.actions.EclipseSaveAction.lambda$0(EclipseSaveAction.java:64)

The problem is caused by an incorrectly constructed default file name in EclipseSaveAction:

workspaceDir.getFile(new Path(root.fileName)) creates a file directly within the workspace. However, Eclipse requires files to be in a project. I think the issue should be fixed by using the save dialog for eclipse resources as in #41.

[eclipse] Save diagram to SVG causes NPE

I'm using version 0.25.0-SNAPSHOT of FXDiagram with Eclipse. I get the following error when saving a diagram as SVG:

Exception in thread "JavaFX Application Thread" java.lang.NullPointerException at de.fxdiagram.core.export.SvgExporter.doGetSvgLink(SvgExporter.java:640) at de.fxdiagram.core.export.SvgExporter.toSvgElement(SvgExporter.java:168) at de.fxdiagram.core.export.SvgExporter.toSvg(SvgExporter.java:136) at de.fxdiagram.core.export.SvgExporter.toSvg(SvgExporter.java:162) at de.fxdiagram.core.tools.actions.ExportSvgAction.perform(ExportSvgAction.java:61) at de.fxdiagram.core.tools.DiagramActionTool.lambda$11(DiagramActionTool.java:192)

linkProvider is set to null when using method def toSvg(XDiagram diagram, File baseDir). I think there should be a null check in def SvgLink doGetSvgLink(Node node), e.g.:

val newLink = linkProvider?.getLink(node) ?: SvgLink.NONE

[PDE example] improve usability

The PDE example has a number of glitches

  • A node from the chooser won't be connected when the respective connections are disabled
  • Triggering optional dependencies and fragments should add/remove the respective connections

For the latter we might consider choosing a different form of diagram persistence (action based), or a mechanism to make shapes invisible.

FXDiagram example using a non PDE (vanilla) maven build

I'm having trouble getting FXDiagram to work in my non PDE maven build. I can successfully build the project and have published the maven jars. However, there are many dependencies that apparently are not included in pom's of the built artifacts. Apparently, the OSGi bundle dependencies are not picked up by the vanilla maven dependency mechanism.

I understand this has to do with the eclipse plugin. However, I'm curious as to how I work with this issue. Do you have a simple example of just running your demo from within a separate, generic, maven only build?

Appreciate any guidance you can provide.

[eclipse] CME when closing diagram tab

java.util.ConcurrentModificationException
    at java.util.HashMap$KeySet.forEach(HashMap.java:931)
    at de.fxdiagram.eclipse.FXDiagramTab.lambda$1(FXDiagramTab.java:201)
    at de.fxdiagram.eclipse.FXDiagramTab$$Lambda$176/1536814563.widgetDisposed(Unknown Source)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:123)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4199)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1471)
    at org.eclipse.swt.widgets.Widget.release(Widget.java:1308)
    at org.eclipse.swt.widgets.Widget.dispose(Widget.java:671)
    at org.eclipse.swt.custom.CTabItem.dispose(CTabItem.java:128)
    at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1880)
    at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:288)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4199)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4042)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3669)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

Adding new node in maximized diagram view causes diagram view to get incorrectly restored

I'm using version 0.25.0 of FXDiagram with a Xtext DSL. Models are spread across several files. Creating diagrams works fine in Eclipse with the Diagram View being inside or outside of the Eclipse main window.

Actual behavior

If the Diagram View is inside the Eclipse main window and is set to maximized (because the diagrams get large) the follwing happens when adding a new node (from another model file) using the side buttons of an existing node:

  • A new Xtext editor for the file containing the new node is opened.
  • The Diagram View is resized to fill the lower half of the screen - the state is still displayed as maximized
  • Somtimes the Diagram View zooms to another zoom level.
  • In order to maximize the Diagram View again you have to klick Restore and then Maximize.

Expected behavior

  • The Diagram View is maximized
  • A new Xtext editor for the file containing the new node is opened (btw. does it really need to be openend?)
  • The new Xtext editor is opened minimized but focused, i.e., it is displayed as a small overlay near the view icon and automatically hides when it is unfocused.

Steps to reproduce

As far as I know there are no examples in Xtext that use more than one model file. However, the problem can also be reproduced with FXDiagram on a Java class, although the Java editor is not automatically opened when adding a new class:

  1. Open a Java class and add it to the Diagram View
  2. Maximize the Diagram View inside the Eclipse main window
  3. Add any other class to the diagram that is not already openend in an editor using the side buttons
  4. Double click the new class - a Java editor is opened in the upper half of the screen

The expected behavior is demonstrated e.g., by the statemachine (fowlerdsl) editor. Adding and double clicking a new node opens the statemachine editor as a small overlay.

AIOBEs in examples.Demo with Java 8u74

Introduction and Summary Nodes open and close without Exceptions.

Other Nodes experience repeated AIOBEs.
I note a fix for https://bugs.openjdk.java.net/browse/JDK-8096304

Does this trace look familiar?

de.fxdiagram.core.XConnection layoutChildren
SEVERE: ArrayIndexOutOfBoundsException in XConnection.layoutChildren() -1
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at com.sun.javafx.collections.ObservableListWrapper.get(Unknown Source)
at com.sun.javafx.collections.VetoableListDecorator.get(Unknown Source)
at javafx.scene.Parent.updateCachedBounds(Unknown Source)
at javafx.scene.Parent.recomputeBounds(Unknown Source)
... elided
at javafx.scene.Node$LazyBoundsProperty.get(Unknown Source)
at javafx.scene.Node.getBoundsInLocal(Unknown Source)
at de.fxdiagram.core.anchors.ConnectionRouter.midPoint(ConnectionRouter.java:593)
at de.fxdiagram.core.anchors.ConnectionRouter.findClosestSourceAnchor(ConnectionRouter.java:548)
at de.fxdiagram.core.anchors.ConnectionRouter.calculatePoints(ConnectionRouter.java:318)
at de.fxdiagram.core.XConnection.layoutChildren(XConnection.java:679)

Add a container node to the library

The container node should automatically resize to its contained diagram (as opposed to the LevelOfDetailNode that scales its diagram to fit within its fixed bounds).

FXDiagram crashes in Eclipse Neon in Ubuntu 14.04

I can view FXDiagram of a statemachine example in an EclipseApplication on Windows 10,
but it crashes on Ubuntu 14.04 (but I can run the standalone Java demo fine).

The main error shown in the console of the original Eclipse instance is:
40 [main] ERROR org.eclipse.xtext.service.CompoundModule - Type org.eclipse.xtext.xbase.file.AbstractFileSystemSupport not present
However, I'm confused because the log shows libgdk at the top.

Sorry I'm not familiar with Eclipse packages etc, and I couldn't find any leads from
web searches for the xtext error, so I decided to file this sighting. I've attached the
log file and console output.

Thanks,

Ajit

FXDiagram-Crash-Ubuntu.zip

[tests] Make tests runnable from Eclipse again

Currently we get a popup "An internal error occurred during: "Launching de.fxdiagram.annotations.tests".
java.lang.NullPointerException". Something seems to be missing in the Oomph setup.

[update] connections dirty after load

Steps to reproduce:

  • create a domain model diagram with connections
  • save
  • open a new diagram
  • load
  • enable "Link FXDiagram with editor"
    -> connections blink

[eclipse] Load diagram dialog is not an eclipse dialog

I'm using version 0.26.0 of Fxdiagram. With #41 the save diagram dialog has been changed to an eclipse dialog. Saving a diagram works fine. However, the load diagram dialog is still a standard file dialog. This dialog should also be changed to an eclipse dialog.

[descriptors] Revise descriptors

  • move #withDomainObject to separate interface
  • moving String based ID to some subclass
  • move behavior from descriptors to provider

Make auxiliary lines magnetic

Auxiliary lines should attract dragged nodes within a certain threshold, and once docked need a bit more fore to release them.

Needs thorough testing, as it might annoy users when they cannot place elements as they want. Consider using a modifier key to switch this behavior off.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.