This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 262216 - Add more extension points to VMDGraphScene
Summary: Add more extension points to VMDGraphScene
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Graph (show other bugs)
Version: 8.1
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: issues@platform
Depends on:
Reported: 2016-05-25 09:12 UTC by crosati
Modified: 2016-05-25 09:12 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description crosati 2016-05-25 09:12:45 UTC
VMDGraphScene is a great class but it is difficult to extend or add functionalities to it.

To change the move action from the default one to AlignWithMoveAction, this is what I have to do:

private class MyVMDGraphScene extends VMDGraphScene {

    private final WidgetAction alignWithMoveAction;

    public MyVMDGraphScene() {

        super(new InspectorColorScheme());

        alignWithMoveAction = ActionFactory.createAlignWithMoveAction(
            (LayerWidget) getChildren().get(1),
            (LayerWidget) getChildren().get(3),


    protected Widget attachNodeWidget( String node ) {

        Widget widget = super.attachNodeWidget(node);


        return widget;



This is not a clean way to do it because of lack of proper extension points in the base class.

I suggest/request the following:

1. Add getters for the 4 layers [getBackgroundLayer(), getMainLayer(), getConnectionLayer(), getUpperLayer() - or getInteractionLayer()];

2. Add lazy creation of the moveAction, using a factory method:

    private WidgetAction moveAction = null;
    private WidgetAction getMoveAction() {
        if ( moveAction == null } {
            moveAction = createMoveAction();
        return moveAction;
    protected WidgetAction createMoveAction() {
        return ActionFactory.createMoveAction();
    protected Widget attachNodeWidget (String node) {
        widget.getActions ().addAction (getMoveAction());

3. Similarly for moveControlPointAction, router and sceneLayout.

Thank you,
Claudio Rosati

Product Version = NetBeans IDE 8.1 (Build 201510222201)
Operating System = Mac OS X version 10.11.5 running on x86_64
Java; VM; Vendor = 1.8.0_92
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.92-b14