Auar / flexvizgraphlib

Automatically exported from code.google.com/p/flexvizgraphlib
0 stars 0 forks source link

I get null object error trying using vgraph in mxml #24

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
My Code is:
<?xml version="1.0" encoding="utf-8"?>
<VisualGraph xmlns="org.un.flex.graphLayout.visual.*"
xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
xmlns:layout="org.un.flex.graphLayout.layout.*">
    <layouter>
        <layout:ConcentricRadialLayouter vgraph="{this}" autoFitEnabled="true">
        </layout:ConcentricRadialLayouter>
    </layouter>
</VisualGraph>

And I get an error during execution of Baselayouter:
public function BaseLayouter(vg:IVisualGraph = null):void {

            _vgraph = vg;
            if(vg) {
                _graph = _vgraph.graph;
            } else {
                _graph = new Graph("dummyID");
            }

            /* this is required to smooth the animation */
            _vgraph.addEventListener("forceRedrawEvent",forceRedraw); //HERE I GET
AN //ERROR BECAUSE _graph is null
        }

What is the expected output? What do you see instead?
you have a null object when you didn't experct...(in german)

What version of the product are you using? On what operating system?
FlexBuilder 3 and the current version of Flex Visual Graph Library

Please provide any additional information below.

Original issue reported on code.google.com by andreas....@gmail.com on 2 Apr 2008 at 2:18

GoogleCodeExporter commented 9 years ago
And basically it is not possible to instantiate a ConcentricRadialLayouter 
without
setting the _vgraph. I get a lot of errors because the implementation assumes 
that
the visual graph is set although the code comments state that it is possible to 
set
the visual graph later...

Original comment by andreas....@gmail.com on 8 Apr 2008 at 8:48

GoogleCodeExporter commented 9 years ago
Hi Andreas,

hmm no I think you cannot have a layouter but no VGraph, but you can do it
the other way round. Which comment in the code are you referring to?
I think almost all layouters assume the vgraph is present and valid.
It is really the most essential object of the library.

Try to do it differently, i.e. create the VGraph first and add
the layouter next. Yes, that may not be possible in pure MXML,
but so be it.

Original comment by spo...@gmail.com on 18 May 2008 at 5:48

GoogleCodeExporter commented 9 years ago
I am referring to the asdocs befor the constructor of BaseLayouter. And yes, 
there
are a lot of work around methods. But sometimes it would be nice to be able to 
create
the instances of your layouter classes, configure them and switch between them
without the need to create new objects. On the other side, it is just confusing 
that
you cannot call the constructor of the class with default parameter because of 
the
failure described above.

Original comment by andreas....@gmail.com on 20 May 2008 at 11:36