OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[Solved] Tree view in a Java dialog box

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Alexius
General User
General User


Joined: 30 Apr 2009
Posts: 13
Location: France

PostPosted: Mon Jun 22, 2009 6:09 am    Post subject: [Solved] Tree view in a Java dialog box Reply with quote

Hi everybody !

I want to show a custom tree view in a dialog box and I don't know how I can do it ?...
Do you have some ideas, samples with details in order to build treeview, populate nodes, catch mouse events and more ?

For instance when you select a leaf, treeview give you the path of the selected leaf from a node like a folder path. (String path = "/node1/node2/leaf 1")

Thanks in advance.

PS : I can build custom dialog box, it's not the problem. (Is there a Java GUI builder enabled for OOo ?)


Last edited by Alexius on Mon Jun 29, 2009 2:42 am; edited 1 time in total
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Tue Jun 23, 2009 1:00 am    Post subject: Reply with quote

Since OOo2.0.4 there are two kind of dialog :
- runtime dialog
- OOoBasic dialog
There is an example of runtime dialog in Java in SDK.
See Developer's Guide for OOoBasic Dialog :
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Accessing_Dialogs
For your information I have documented OOoBasic dialog but with C++ language :
http://wiki.services.openoffice.org/wiki/Component_and_Dialog
The examples only show buttons and text controls. The documentation of all other controls is in project, but no idea when I will start.
See also in this forum :
Tree Control: Color Problem http://www.oooforum.org/forum/viewtopic.phtml?t=71607&highlight=
Event listeners in the new Tree View Control (solved) http://www.oooforum.org/forum/viewtopic.phtml?t=68424&highlight=
TreeView control in a OOo dialog http://www.oooforum.org/forum/viewtopic.phtml?t=67005&highlight=
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
Alexius
General User
General User


Joined: 30 Apr 2009
Posts: 13
Location: France

PostPosted: Tue Jun 23, 2009 7:07 am    Post subject: Reply with quote

Thanks you for your answer.

I developed the extension only in Java (I use NetBeans Integration). Maybe I can extrapolate basic code (for tree control, tree view, …) to Java code.

I found a solution: I built a dialog with Java UNO API, add a button which runs a class which contains a JFrame with Jpanel and JTree and catch/checks all events from this frame and I catch the path of one leaf on the dialog (I done) when I close the JFrame or pressed the “ok” button of the JPanel.

I am not sure it is the best solution, maybe I need to use Java UNO API to build an equivalent to JTree but it is here my problem... I don’t know how I can do it properly.

If my solution is good, using Swing/AWT, why not! (Because it seems to work properly, I done a lot of tests)

What do you think about my solution ?
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Wed Jun 24, 2009 12:20 pm    Post subject: Reply with quote

I think your solution is good because Java Inspector uses also Swing to display a tree...
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
Alexius
General User
General User


Joined: 30 Apr 2009
Posts: 13
Location: France

PostPosted: Wed Jun 24, 2009 1:11 pm    Post subject: Reply with quote

Ok thanks you ever so much, because I wasn't sure that we can use Swing and Awt instead of awt from Java UNO API ((com.sun.star.awt is more complicated to write your UI yourself than the GUI Builder from NetBeans)
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Fri Jun 26, 2009 9:28 am    Post subject: Reply with quote

The Java Object inspector is described here :
http://wiki.services.openoffice.org/wiki/Object_Inspector
and the screenshot shows you the use of swing. This example belongs to the SDK since I use SDK (vers 1.1.0 in 2004) even if at this time it was not able to generate code.
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
Alexius
General User
General User


Joined: 30 Apr 2009
Posts: 13
Location: France

PostPosted: Fri Jun 26, 2009 1:13 pm    Post subject: Reply with quote

I read this example and download sources, but I was a bit lost the last week LoL Rolling Eyes

At this time I can easily manage Java UNO API (with com.sun.star.awt) and Swing/Awt to design OpenOffice dialogs (manually...) and complex dialogs (Swing/Awt) built with the GUI Builder from NetBeans. Cool Wink

Thanks ! Smile
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Mon Jun 29, 2009 8:54 am    Post subject: Reply with quote

You are welcome.
Good luck
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
bavol
Newbie
Newbie


Joined: 23 Oct 2009
Posts: 1

PostPosted: Fri Oct 23, 2009 10:55 pm    Post subject: Reply with quote

This fairly complicated dialog has three major parts. The first part allows you to set the pixel scaling for the global and zoom views. The second part allows you to set the contrast. The third part allows you to set the color settings for the dendroview.
The pixel scaling determines how tall and wide the boxes are in both the zoom and global views. Basically, the larger the pixel scaling, the bigger the box. If the pixel scaling is less than one, the rows are averaged. This can make your data look better, since missing values disappear. The contrast is the expression value which corresponds to fully induced. testking 1z0-146 Any values greater than this will appear to be the induced color, and values between this and zero will appear to be a color between the zero and up color. The contrast is similarly used to color repressed boxes.The color part allows you to set the up, down, zero and missing colors. You can double-click the boxes to get a color selection dialog, click a preset to load a color, and load and store color sets to files. testking JN0-201 In LinkedView, a dendrogram must be active in order for this option to appear on the settings menu. Any settings made only apply to the active dendrogram. Coordinates may be parsed from the current file, if it is formatted properly, or parsed from an external file. The proper formatting is discussed in the File Formats section. The settings files provided with Java Treeview are nothing more than minimal PCL files, which contain no data but have annotation columns for chromosome, arm and position. The coordinates in an external files are matched up with the loci in the current file using either the first column, or if the first column has the header GID the second column. This gives the expected result when operating on PCL or CDT files, provided that the id column is unique. testking 000-100 Loci which do not have coordinates are not displayed. However, loci which have coordinates but not expression data associated with them do affect the extent of the chromosome displayed.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group