why is AbstractGeomerty not public? [message #1750383] |
Tue, 20 December 2016 09:56  |
Eclipse User |
|
|
|
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 09:26   |
Eclipse User |
|
|
|
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 04:19  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04371 seconds