Visualization API Graphscene Settings

"laadams85" <[email protected]> Sat, 06 May 2017 12:10:35 +0000
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <[email protected]>
I have a couple of questions related to the use of a Graphscene for displaying widgets.  Right now I have a topcomponent that contains a scrollpane which has the graphscene view as it's viewport.  I have also associated the palette with the lookup of the top component.  I am trying to make a 2D modeler, think AutoCAD or similar.  I have working code using Swing but I would like to port it over to the Netbeans platform.  Any help would be appreciated.

1)  There first one is if there is a default way to include Gridlines, and if not what's the easiest way to do that.  I have considered creating a gridline widget and adding it to the scene, but that seems very clunky. 

2)  Is there a way to make the pan and zoom actions expands the graphscene if the action moves out of bounds?  So if I pan to the left past x=0 the graphscene would expand the view component.  When you drag a widget out of bounds it will automatically expand the view it just won't do it for view operations.  One way to do it is to have a fake widget in the graphscene that is not rendered but expands when you pan/zoom but again seems hokey.

3)  Is there any easy way to use a palette to be a click bar instead of drag and drop.  What i means is you click on an icon and it sets the tool and when you click on the graphscene it places a widget.  I have it now where the TopComponent associated with the palette listens for new selections and places and action in it's lookup.  Then the graphscene listens to the globalactioncontext lookup for actions that it can use, and if any are available run them.  This seems somewhat error prone if the topcomponent is not focused, there won't be anything in the global lookup.