Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » why is AbstractGeomerty not public?
why is AbstractGeomerty not public? [message #1750383] Tue, 20 December 2016 14:56 Go to next message
Shenwei Zheng is currently offline Shenwei ZhengFriend
Messages: 22
Registered: December 2016
Junior Member
Hi guys,
I want to have a box layout for laying out several rectangles in a single vertical or horizontal column but GEF geometry didn't provide such layouts (no edges connecting these rectangles, it is not a Graph and I cannot apply with the BoxLayoutAlgorithm under layout package). I am wondering if I can implement my own box layout. I looked into the source code of Geometry package and it might be possible if I can implement a box layout extending the AbstractGeometry. But the abstract class AbstractGeometry is not public, is there a reason for it?
Thanks in advance for any hints!
Best regards
Shenwei
Re: why is AbstractGeomerty not public? [message #1750636 is a reply to message #1750383] Fri, 23 December 2016 14:26 Go to previous messageGo to next message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi Shenwei,

you can utilize the JavaFX layout panes HBox and VBox to place multiple JavaFX nodes in the same row or column. In order to display a geometry, you can either represent it using JavaFX shapes, or wrap it in a GeometryNode. Besides, GEF Geometry does not provide any layout computations, but only geometry abstractions and calculation methods. Moreover, you actually can use the BoxLayoutAlgorithm by computing a layout model for the geometries, applying the box layout, and transferring the positions and sizes back from the layout model to the geometries. Additionally, you can also write your own layout algorithm without needing to subclass AbstractGeometry.

Nevertheless, I am unsure why AbstractGeometry is not public. The class AbstractRectangleBasedGeometry is the only one declared public out of the abstract geometry classes. We should probably expose all of them. Would you please open a Bugzilla ticket to keep track of the issue?

Best regards,
Matthias
Re: why is AbstractGeomerty not public? [message #1750760 is a reply to message #1750636] Wed, 28 December 2016 09:19 Go to previous message
Shenwei Zheng is currently offline Shenwei ZhengFriend
Messages: 22
Registered: December 2016
Junior Member
Hi Matthias,

thanks for your hints.

We are very reluctant to binding ourselves directly to JavaFX - thus the question in regards to AbstractGeometry.

However, are you saying that facing the problem stated above one does not really have another choice other than directly utilizing JavaFX, i.e. writing code directly against the JavaFX API? Is it possible to provide a layout algorithm without directly using JavaFX?

Quote:

Moreover, you actually can use the BoxLayoutAlgorithm by computing a layout model for the geometries, applying the box layout, and transferring the positions and sizes back from the layout model to the geometries.

How could I apply BoxLayoutAlgorithm for a non-Graph application? As my understanding, all GEF layout algorithms implementing ILayoutAlgorithm are only for Graph applications.
Quote:

Additionally, you can also write your own layout algorithm without needing to subclass AbstractGeometry.

Does it mean I could write my own layout algorithm implementing ILayoutAlgorithm with my own LayoutContext?

Thanks!

Best Regards
Shenwei Zheng
Previous Topic:java.lang.NoClassDefFoundError: org/eclipse/ui/views/properties/IPropertySource
Next Topic:ClassNotFoundException: javafx.embed.swt.FXCanvas cannot be found by org.eclipse.gef4.mvc.fx.ui
Goto Forum:
  


Current Time: Tue Apr 23 06:11:36 GMT 2024

Powered by FUDForum. Page generated in 0.03324 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top