Menu

[Newbie] some questions regarding Royere

2002-10-29
2002-10-29
  • Artur Matos

    Artur Matos - 2002-10-29

    Hi,

    First of all sorry for posting this (eventually obvious)
    questions to the forum, but I am a complete
    newbie to Royere. I am currently evaluating some
    opensource graph layout packages, and I would
    like to know if Royere could do the job for me.

    I have tried the samples and screened lightly the
    docs, but I don't see any example on how to integrate
    the royere view into an application. For my specific application, I would need to put a customized
    Royere view/editor (if possible with a different
    drawing for the vertices) into my application. If this
    is possible, can someone give me some directions
    on how to do this?

    Other question I have is concerning the application data. In my application, the data is maintaned in
    a separate data structure. Is it possible to interface
    it with royere? Should I use Royere's graph class
    instead? Sorry if  the questions sound
    obvious, but I cannot find the answers I need in
    the docs.

    Thanks in advance,

    Artur Matos.

     
    • yugen

      yugen - 2002-10-29

      > For my specific application, I would need
      > to put a customized Royere view/editor (if
      > possible with a different drawing for the
      > vertices) into my application. If this
      > is possible, can someone give me some
      > directions on how to do this?

      To start with, Royere is based on a "pipeline" model.  Specifically, Royere uses an InputManager to fault a graph from a graph data store, then it uses a GraphManager to set some graph properties, then it uses a FilterManager to restrict which part of the graph gets laid out, then it uses a LayoutManager to perform the layout (by assigning coordinates to every node), and finally it uses a ViewManager to handle the actual rendering.  This "pipeline" model can be tailored for your purposes. 

      In order to use the Royere view module, you first need to assign coordinates to every node in the graph.  In Royere, node positioning is normally delegated to a Layout object that implements some layout algorithm.  However, Royere also provides a UserDefined layout object, which allows you to manually assign whatever coordinates you want to.  So, if you convert your graph object into a Royere Graph object, and then assign node coordinates using a Royere UserDefined layout object, you could then use the Royere view module to render the graph. 

      There are two ways you could do this.  You could bypass the pipeline entirely, by manually constructing a ViewMessage containing the Graph and Layout, and then passing it in to the View.handleViewMessage() method from your application. 

      The other approach is to insert your application at the beginning of Royere pipeline, in place of the InputManager.  This is where you would perform the object-model conversion, and then you could just send the graph through the Royere pipeline and let Royere behave normally.  The latter approach is much better if you want to use Royere's graph-editing capabilities, because the view module handles edits by sending EditMessages to the GraphManager earlier in the pipeline.  If you leave the pipeline intact, graph editing should work automatically.  (Of course, at some point you'd have to insert logic to convert the edited Royere Graph object back into your object model, so that you could use the edited graph in your application.)  You might find this post helpful: http://sourceforge.net/forum/forum.php?thread_id=686261&forum_id=126557.

      You can change the way vertices are rendered by overriding ElementDrawing.drawNode().

      > Other question I have is concerning the
      > application data. In my application,
      > the data is maintaned in a separate data
      > structure. Is it possible to interface
      > it with royere? Should I use Royere's graph
      > class instead?

      Yes, I strongly recommend converting your data to the Royere object model.  Trying to rewrite the Royere view module to accommodate your object model would be substantially more time-consuming.

       

Log in to post a comment.