Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gef3d-dev] Added feedback figures for connections

Dear GEF3D developers,

I have started fixing bug 

https://bugs.eclipse.org/bugs/show_bug.cgi?id=269337 -- Connections can not be selected

I haven't fixed it completely, as connections cannot be selected yet, but at least when drawing a  connection, a dummy line is drawn. This is also not working 100% correctly, I assume this has something to do with wrongly converted coordinates. As this is a general problem, I have added a new bug report summarizing this problem:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=278634 -- Coordinate conversion not (always) working properly

Since drawing feedback connections probably is an interesting feature, here is a short note on how to activate it:

A new policy must be installed on NodeEditParts. This is a snippet from an example editor, I will update the graph example as soon as possible:

borgFactory.addAssimilator(new AbstractPolicyModifier() {
    public boolean match(EditPart part) {
        return part instanceof NodeEditPart;
    }

    public void modifyPolicies(EditPart io_editpart) {
        io_editpart.installEditPolicy(
            ShowSourceFeedback3DEditPolicy.ROLE,
            new ShowSourceFeedback3DEditPolicy());
    }
});
Pretty simple, I guess ;-)
I have also added a new class org.eclipse.draw3d.geometryext.PointList3D which is a 3D version of PointList (and a List<IVector3f>)! In order to keep in sync with GEF's design, Polyline3D's getter and setter (of its point list) is working with references (just as the original 2D version). This is a little bit tricky, since in most cases the following workflow is executed: get point list, modify point list, set point list. The last setter is only called in order to update the figure!
The PointList3D is internally working with Vector3fImpl, but it can be used in 2D contexts as well because PointList is its super class. 2D and 3D values are kept in sync (actually, there are only 3D values ;-).

Cheers,

Jens



Back to the top