Thread: [Jtreeview-devel] What is the best way to add more functions/panels?
Brought to you by:
alokito
From: Xiaoqing Z. <xia...@cg...> - 2005-03-15 22:30:06
|
Hi Alok, =20 This is Xiaoqing Zhang from Columbia University. I am a Java programmer = and work for Dr. Christina Leslie. We want to add some functions in the JTV. = The idea is after it opens a .cpt file, we hope JVT can load some additional files which contain upstream regulatory motif of each probe or such information can be included in the .cpt file too. An additional Gene = Panel will be created. Then when the mouse moves over some probes, in the = gene panel, it will display a line with colored motif in it for each selected gene. I did not see any similar thing in the current JTV. I just wonder whether you can give me some suggestions about how to do it. I know I = may change the GUI of your JTV and I do not want to disrupt more things than absolutely necessary. =20 =20 Thanks a lot for your attention. =20 =20 =20 =20 Xiaoqing |
From: Alok S. <al...@ca...> - 2005-03-15 23:26:32
|
Hi Xiaoqing, First, let me say that I don't really understand what you want to do-=20 it is hard to get a sense for it over email. In general, I recommend=20 that you write a new "View". There are already several views, such as=20 dendroview, karyoview, scatterview, and treeanno. Each view is defined=20= in it's own package. The main class for each view implements MainPanel,=20= i.e. Dendroview: edu.stanford.genetics.treeview.dendroview.Dendroview.java Karyoview: edu.stanford.genetics.treeview.karyoview.KaryoPanel.java Scatterview:=20 edu.stanford.genetics.treeview.scatterview.ScatterPanel.java Tree Annotation:=20 edu.stanford.genetics.treeview.treeanno.TreeAnnoPanel.java I recommend that you define a new view in a new package. The package=20 need not begin with edu.stanford.genetics.treeview, but the main class=20= of your view must implement MainPanel. Since your view is likely very=20 similar to the dendroview, you can either copy over the classes into=20 your package, or just reference the relevant parts. If you find that=20 you must modify something, just copy the code over. I recommend that you add new annotation columns or rows in the CDT file=20= with special column/row names that only your View uses, and that you=20 put all specific data for your view in those columns or rows. This will=20= ensure that the standard DataModel can load your data and make it=20 available to your View. Once you have defined your main class, you just need to add an option=20 for it to edu.stanford.genetics.treeview.LinkedPanel. It should be=20 straightforward, as there are only a few parts of LinkedPanel that=20 depend upon knowing what views exist. After you have done this, you can=20= open up your custom view using "Analysis->Your view". Alternatively,=20 you can make your view the one that is loaded by default by=20 LinkedPanel, by editing the setupRunning method or one of the functions=20= it calls. I am sorry that this is so complicated. By the end of the year, I hope=20= to transition to a plugin-style architecture. In the new architecture,=20= Java Treeview will be split into a small kernel and a variety of=20 plugins, one plugin for each View. Each plugin will be distributed as a=20= separate jar file, and Java Treeview will load all the plugins at=20 startup. The user will be able to change the plugin that is used by=20 default, so they won't have to continually select "Analysis->Your=20 View". Once that transition is complete, you will be able to make your=20= View available as a jar file plugin that people can download and use=20 with the standard Treeview distribution simply by copying it to the=20 "plugins" folder. The user will also be able to delete the jar files=20 for plugins that they seldom use. Until then, I recommend that you=20 maintain a separate source tree for your organization, and distribute=20 your modified version to whoever needs it. I am willing to consider adding your functionality to the main=20 Dendroview component. However, I would prefer that you implement it=20 first, with maximum freedom to add the features you want, and then=20 later on we can consider whether to add it to Dendroview or keep it as=20= a separate plugin. I hope that this is enough to get you started. -Alok On Mar 15, 2005, at 2:30 PM, Xiaoqing Zhang wrote: > Hi Alok, > > =A0 > > This is Xiaoqing Zhang from Columbia University. I am a Java=20 > programmer and work for Dr. Christina Leslie. We want to add some=20 > functions in the JTV. The idea is after it opens a .cpt file, we hope=20= > JVT can load some additional files which contain upstream regulatory=20= > motif of each probe or such information can be included in the .cpt=20 > file too. An additional Gene Panel will be created. =A0Then when the=20= > mouse moves over some probes, in the gene panel, it will display a=20 > line with colored motif in it for each selected gene. =A0I did not see=20= > any similar thing in the current JTV. I just wonder whether you can=20 > give me some suggestions about how to do it. I know I may change the=20= > GUI of your JTV and I do not want to disrupt more things than=20 > absolutely necessary. > > =A0 > > =A0 > > Thanks a lot for your attention. > > =A0 > > =A0 > > =A0 > > =A0 > > Xiaoqing |