Differences between revisions 44 and 45
Revision 44 as of 2005-09-29 19:48:52
Size: 4374
Editor: GaryBader
Comment:
Revision 45 as of 2005-11-21 15:55:10
Size: 4344
Editor: mskresolve-b
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
This page describes what Cyto Panels are, how to use them, and how to programmatically access them. This feature is new in 2.2 This page describes what CytoPanels are, how to use them, and how to programmatically access them. This feature is new in 2.2
Line 5: Line 5:
== What are Cyto Panels? == == What are CytoPanels? ==
Line 7: Line 7:
Cyto Panels are floatable / dockable panels, which will be available in Cytoscape 2.2. We built the Cyto Panel API to cut down on the number of pop-up windows within Cytoscape, and create a more unified user experience. For example, in Cytoscape 2.1, the cPath Plugin enables users to click on a node and immediately view node details in a pop-up window. Using the Cyto Panel API, we can now show these node details in an embedded Cyto Panel, and present a more integrated experience to the user. For example, the image below shows a screenshot of the latest BioPAX Plugin. When you click on a node, the node details appear directly in the left Cyto Panel. CytoPanels are floatable / dockable panels, which will be available in Cytoscape 2.2. We built the CytoPanel API to cut down on the number of pop-up windows within Cytoscape, and create a more unified user experience. For example, in Cytoscape 2.1, the cPath Plugin enables users to click on a node and immediately view node details in a pop-up window. Using the CytoPanel API, we can now show these node details in an embedded CytoPanel, and present a more integrated experience to the user. For example, the image below shows a screenshot of the latest BioPAX Plugin. When you click on a node, the node details appear directly in the left CytoPanel.
Line 11: Line 11:
The user can then chose to resize, hide or float the left Cyto Panel. For example, in the screenshot below, the user has chosen to float it: The user can then chose to resize, hide or float the left CytoPanel. For example, in the screenshot below, the user has chosen to float it:
Line 17: Line 17:
Cytoscape 2.2 now includes three Cyto Panels: Cyto Panel 1 (appears on the left), Cyto Panel 2 (appears on the right), and Cyto Panel 3 (appears on the bottom). By default, only Cyto Panel 1 will appear, and it will automatically contain the network list and bird's eye view component. The other panels will be hidden. Cytoscape 2.2 now includes three CytoPanels: CytoPanel 1 (appears on the left), CytoPanel 2 (appears on the bottom), and CytoPanel 3 (appears on the right). By default, only CytoPanel 1 will appear, and it will automatically contain the network list and bird's eye view component. The other panels will be hidden.
Line 19: Line 19:
The end-user can show / hide any panel via the new Cyto Panel menu, or via the keyboard accelerator short-cuts. The end-user can show / hide any panel via the new CytoPanel menu, or via the keyboard accelerator short-cuts.
Line 21: Line 21:
== Working with the Cyto Panel API == == Working with the CytoPanel API ==
Line 23: Line 23:
The Cyto Panel API is straightforward and fully documented. If you are a core Cytoscape coder or a Plugin writer, here are a few tips to get started. The CytoPanel API is straightforward and fully documented. If you are a core Cytoscape coder or a Plugin writer, here are a few tips to get started.
Line 25: Line 25:
=== Step 1: Obtain a Cyto Panel === === Step 1: Obtain a CytoPanel ===
Line 27: Line 27:
As noted above, the Cytoscape Desktop contains three default Cyto Panels. To obtain one, use the {{{CytoscapeDesktop.getCytoPanel()}}} method. This method takes a {{{SwingConstants}}} integer value, indicating a compass direction (this enables us to add additional Cyto Panels in the future, if we decide that's necessary.) Here is sample code for accessing the left Cyto Panel: As noted above, the Cytoscape Desktop contains three default CytoPanels. To obtain one, use the {{{CytoscapeDesktop.getCytoPanel()}}} method. This method takes a {{{SwingConstants}}} integer value, indicating a compass direction (this enables us to add additional CytoPanels in the future, if we decide that's necessary.) Here is sample code for accessing the left CytoPanel:
Line 36: Line 36:
You can place any Swing {{{Component}}} object in a Cyto Panel, and it will automatically get its own tab. For example, in the code below, I create a BioPAX component, and add it the left Cyto Panel. The code also adds an icon and a tooltip: You can place any Swing {{{Component}}} object in a CytoPanel, and it will automatically get its own tab. For example, in the code below, I create a BioPAX component, and add it the left CytoPanel. The code also adds an icon and a tooltip:
Line 47: Line 47:
=== Step 3: Set the Cyto Panel State === === Step 3: Set the CytoPanel State ===
Line 49: Line 49:
You can also (optionally) set the Cyto Panel state. Each Cyto Panel exists in one of three states: You can also (optionally) set the CytoPanel state. Each CytoPanel exists in one of three states:
Line 61: Line 61:
If you want, you can also activate your tab within a Cyto Panel. To do so, first determine the index value of your component. Then, call {{{setSelectedIndex()}}}. For example: If you want, you can also activate your tab within a CytoPanel. To do so, first determine the index value of your component. Then, call {{{setSelectedIndex()}}}. For example:
Line 69: Line 69:
=== Cyto Panel Events === === CytoPanel Events ===
Line 71: Line 71:
You can also (optionally) register to receive Cyto Panel Events. This is done via: You can also (optionally) register to receive CytoPanel Events. This is done via:
Line 78: Line 78:
Once you are registered to receive Cyto Panel events, you will be notified of the following: Once you are registered to receive CytoPanel events, you will be notified of the following:
Line 85: Line 85:
See the Cyto Panel Listener class docs for more information. See the CytoPanel Listener class docs for more information.

About this Page

This page describes what CytoPanels are, how to use them, and how to programmatically access them. This feature is new in 2.2

What are CytoPanels?

CytoPanels are floatable / dockable panels, which will be available in Cytoscape 2.2. We built the CytoPanel API to cut down on the number of pop-up windows within Cytoscape, and create a more unified user experience. For example, in Cytoscape 2.1, the cPath Plugin enables users to click on a node and immediately view node details in a pop-up window. Using the CytoPanel API, we can now show these node details in an embedded CytoPanel, and present a more integrated experience to the user. For example, the image below shows a screenshot of the latest BioPAX Plugin. When you click on a node, the node details appear directly in the left CytoPanel.

http://cbio.mskcc.org/~cerami/biopax/bp_plugin1.png

The user can then chose to resize, hide or float the left CytoPanel. For example, in the screenshot below, the user has chosen to float it:

http://cbio.mskcc.org/~cerami/biopax/bp_plugin2.png

Basic Usage

Cytoscape 2.2 now includes three CytoPanels: CytoPanel 1 (appears on the left), CytoPanel 2 (appears on the bottom), and CytoPanel 3 (appears on the right). By default, only CytoPanel 1 will appear, and it will automatically contain the network list and bird's eye view component. The other panels will be hidden.

The end-user can show / hide any panel via the new CytoPanel menu, or via the keyboard accelerator short-cuts.

Working with the CytoPanel API

The CytoPanel API is straightforward and fully documented. If you are a core Cytoscape coder or a Plugin writer, here are a few tips to get started.

Step 1: Obtain a CytoPanel

As noted above, the Cytoscape Desktop contains three default CytoPanels. To obtain one, use the CytoscapeDesktop.getCytoPanel() method. This method takes a SwingConstants integer value, indicating a compass direction (this enables us to add additional CytoPanels in the future, if we decide that's necessary.) Here is sample code for accessing the left CytoPanel:

   1    CytoscapeDesktop desktop = Cytoscape.getDesktop();
   2    CytoPanel cytoPanel = desktop.getCytoPanel (SwingConstants.WEST);
   3 

Step 2: Add your component

You can place any Swing Component object in a CytoPanel, and it will automatically get its own tab. For example, in the code below, I create a BioPAX component, and add it the left CytoPanel. The code also adds an icon and a tooltip:

   1    BioPaxContainer bpContainer = BioPaxContainer.getInstance();
   2    CytoscapeDesktop desktop = Cytoscape.getDesktop();
   3    CytoPanel cytoPanel = desktop.getCytoPanel (SwingConstants.WEST);
   4    URL url = BioPaxDetailsPanel.class.getResource("resources/read_obj.gif");
   5    Icon icon = new ImageIcon(url);
   6    cytoPanel.add("BioPax PlugIn", icon, bpContainer, "BioPax PlugIn");
   7 

Step 3: Set the CytoPanel State

You can also (optionally) set the CytoPanel state. Each CytoPanel exists in one of three states:

  • CytoPanelState.HIDE: The panel is hidden from the user's view.

  • CytoPanelState.FLOAT: The panel is floating in a separate, external window frame.

  • CytoPanelState.DOCK: The panel is docked in the main Cytoscape window, and visible to the user.

Here is sample code for setting the current state:

   1    cytoPanel.setState(CytoPanelState.DOCK);
   2 

If you want, you can also activate your tab within a CytoPanel. To do so, first determine the index value of your component. Then, call setSelectedIndex(). For example:

   1    int index = cytoPanel.indexOfComponent(myComponent);
   2    cytoPanel.setSelectedIndex(index);
   3 

CytoPanel Events

You can also (optionally) register to receive CytoPanel Events. This is done via:

   1    addCytoPanelListener(CytoPanelListener);
   2    removeCytoPanelListener(CytoPanelListener);
   3 

Once you are registered to receive CytoPanel events, you will be notified of the following:

  • onStateChange()

  • onComponentSelected()

  • onComponentAdded()

  • onComponentRemoved()

See the CytoPanel Listener class docs for more information.

CytoPanel_Tutorial (last edited 2009-02-12 01:03:13 by localhost)

Funding for Cytoscape is provided by a federal grant from the U.S. National Institute of General Medical Sciences (NIGMS) of the Na tional Institutes of Health (NIH) under award number GM070743-01. Corporate funding is provided through a contract from Unilever PLC.

MoinMoin Appliance - Powered by TurnKey Linux