[Logo] VUE Users Forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Groups] Back to home page 
[Login] Login 
If this is your first visit to the new VUE forums, you can login using the same username and password you currently use on VUE's website. If you need an account, please create one through VUE's website. If you have problems, please contact us via the contact form on http://vue.tufts.edu
Adding row and column layout for child nodes  XML
Forum Index » Developers' Corner
Author Message
jason m


Joined: 08/08/2008 11:36:13
Messages: 22
Offline

Hi, I'm looking into added options to layout node children either by row or column.
I know implementing a layout manager would be preferable but right now I'm just adding a new method handle the row layout.
It works for the most part but if I already have a node with children and I change the layout the children will only update after I move the parent and the parent will only resize to contain the children after I attempt to adjust the parent size manually.
Could I have a hint as to how to repaint the node correctly? thx.
jason
Mike Korcynski

[Avatar]

Joined: 08/08/2008 11:36:13
Messages: 749
Offline

jason,

I'm sorry I just noticed I missed this message. Can you share what you have so I can take a look at the repaint problem?

Mike
jason m


Joined: 08/08/2008 11:36:13
Messages: 22
Offline

Hi Mike,

I haven't looked at this for a little while now however I have attached a patch file generated out of eclipse.

I have added 2 menu items in the node context menu (right click node, Arrange->( Children Row | Children Column))

Clicking the menu item does not immediately change the node children layout, you either need to move the node or grab a parent node handle and move that, only then does a redraw happen.

I also have not mastered castor yet so the nodes do not persist.

Regards,
Jason
 Filename patch1.txt [Disk] Download
 Description
 Filesize 12 Kbytes
 Downloaded:  2 time(s)

jason m


Joined: 08/08/2008 11:36:13
Messages: 22
Offline

I've sorted out Castor so the layout now persists.
Still trying to understand the screen refresh issue.
jason
Mike Korcynski

[Avatar]

Joined: 08/08/2008 11:36:13
Messages: 749
Offline

jason,

I'm currently working on another project due this week but your on my list to take a look at this at the end of this week beginning of next.

Thanks,
Mike
Mike Korcynski

[Avatar]

Joined: 08/08/2008 11:36:13
Messages: 749
Offline

Hi jason,

i took a look at your code. it's pretty close to working from what i can tell. You just need to call .layout() on the right node. If want the feature to work when you select a parent node that has children you just need to call node.layout() after you've marked the children as row/column. if you want to allow the children to be selected and cause the layout then you need to call node.getParent().layout(). I tried this layoutChildrenRow() accounting for the first case and it worked.


Mike
Mike Korcynski

[Avatar]

Joined: 08/08/2008 11:36:13
Messages: 749
Offline

Also you may want to reset the flag on a node if it gets reparented to the map or a new node.

-Mike
jason m


Joined: 08/08/2008 11:36:13
Messages: 22
Offline

Thanks Mike!

I can't believe it. node. layout(), I was trying almost everything else but that! (e.g. getParent().layout, sending events hoping another component would redraw, etc)
With regard to resetting the flag on a reparent to map or another node, my intent is to maintain the layout in these situations and also on duplication. The nodes, to support their nesting ability, can be parent, child or both (of type container). The flag I have added is only relevant when a node contains children (ie of type parent). Child nodes are logically unaware of their layout and the flag has no contextual meaning. That's the mental model I was working to anyway.

If you can think of a use case where this might not be desirable pls let me know.

Thanks again.


Regards, Jason




Mike Korcynski

[Avatar]

Joined: 08/08/2008 11:36:13
Messages: 749
Offline

jason,

cool. when you're happy with how its working send me another svn patch and we'll incorporate it into the main build, this seems like a feature that would have appeal to many users.

Mike
jason m


Joined: 08/08/2008 11:36:13
Messages: 22
Offline

Hi Mike,

Attached is a patch containing,

* Row & Column layout options for node children (in Arrange menu).
* A fix to allow a selection of LWNodes be reset back to the minimum size. (also added a shortcut key)
* Added shortcut keys to FillHeight and FillWidth
* Renamed .setLabel to .setText in MapViewer.java as they were being flagged a deprecated. (you could ignore this file if you like)
* The VueResources.properties I have didn't have the tool 'flag2' enabled, I have enabled it. It seems to work fine for me.

regards, Jason
 Filename patch6.txt [Disk] Download
 Description
 Filesize 16 Kbytes
 Downloaded:  2 time(s)

 
Forum Index » Developers' Corner
Go to:   
Powered by JForum 2.1.8 © JForum Team