Author: apico
Date: 2010-09-14 16:42:44 -0700 (Tue, 14 Sep 2010)
New Revision: 21857

Modified:
   
cytoscape/trunk/application/src/main/java/cytoscape/view/cytopanels/CytoPanel.java
   
cytoscape/trunk/application/src/main/java/cytoscape/view/cytopanels/CytoPanelImp.java
Log:
Additional CytoPanel.add() signature to include support for 
JTabbedPane.insertTab(). This completes the set and provides support for 
inserting a Component with title, icon, component and tip at a specified index. 

Modified: 
cytoscape/trunk/application/src/main/java/cytoscape/view/cytopanels/CytoPanel.java
===================================================================
--- 
cytoscape/trunk/application/src/main/java/cytoscape/view/cytopanels/CytoPanel.java
  2010-09-14 23:34:55 UTC (rev 21856)
+++ 
cytoscape/trunk/application/src/main/java/cytoscape/view/cytopanels/CytoPanel.java
  2010-09-14 23:42:44 UTC (rev 21857)
@@ -101,6 +101,17 @@
        public void add(String title, Icon icon, Component component, String 
tip);
 
        /**
+        * Adds a component to the CytoPanel with specified title, icon, and 
tool tip at specified index.
+        *
+        * @param title     Component title (can be null).
+        * @param icon      Component icon (can be null).
+        * @param component Component reference.
+        * @param tip       Component Tool tip text.
+        * @param index     Component index.
+        */
+       public void add(String title, Icon icon, Component component, String 
tip, int index);
+
+       /**
         * Returns the title of the CytoPanel.
         *
         * @return String Title.

Modified: 
cytoscape/trunk/application/src/main/java/cytoscape/view/cytopanels/CytoPanelImp.java
===================================================================
--- 
cytoscape/trunk/application/src/main/java/cytoscape/view/cytopanels/CytoPanelImp.java
       2010-09-14 23:34:55 UTC (rev 21856)
+++ 
cytoscape/trunk/application/src/main/java/cytoscape/view/cytopanels/CytoPanelImp.java
       2010-09-14 23:42:44 UTC (rev 21857)
@@ -348,6 +348,23 @@
        }
 
        /**
+        * Adds a component to the CytoPanel with specified title, icon, and 
tool tip at specified index.
+        *
+        * @param title     Component title (can be null).
+        * @param icon      Component icon (can be null).
+        * @param component Component reference.
+        * @param tip       Component Tool tip text.
+        * @param index     Component index.
+        */
+       public void add(String title, Icon icon, Component component, String 
tip, int index) {
+               // insert tab into JTabbedPane (string, icon, component, tip, 
index)
+               tabbedPane.insertTab(title, icon, component, tip, index);
+
+               // send out a notification
+               notifyListeners(NOTIFICATION_COMPONENT_ADDED);
+       }
+
+       /**
         * Returns the number of components in the CytoPanel.
         *
         * @return int Number of components.

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to