Author: kono
Date: 2010-02-04 13:31:44 -0800 (Thu, 04 Feb 2010)
New Revision: 19183

Modified:
   cytoscape/trunk/src/cytoscape/view/NetworkPanel.java
Log:
Network Overview Icon function removed.  This feature will be developed in 
cytposcape_27_experimental.

Modified: cytoscape/trunk/src/cytoscape/view/NetworkPanel.java
===================================================================
--- cytoscape/trunk/src/cytoscape/view/NetworkPanel.java        2010-02-04 
20:30:44 UTC (rev 19182)
+++ cytoscape/trunk/src/cytoscape/view/NetworkPanel.java        2010-02-04 
21:31:44 UTC (rev 19183)
@@ -120,12 +120,8 @@
        
        private JPanel navigatorPanel;
        
-       // New for Cytoscape 2.7: Command buttons will be placed here.
-       private JPanel commandPanel;
        private JPanel networkTreePanel;
-       
-       private JToggleButton showNetworkIconButton;
-       
+               
        private JPopupMenu popup;
        private PopupActionListener popupActionListener;
 
@@ -182,23 +178,6 @@
                setLayout(new BorderLayout());
                setPreferredSize(new Dimension(PANEL_PREFFERED_WIDTH, 700));
                
-               // Setup command Panel
-               commandPanel = new JPanel(new SpringLayout());
-               commandPanel.setPreferredSize(new 
Dimension(PANEL_PREFFERED_WIDTH, 20));
-               commandPanel.setMaximumSize(new Dimension(10000, 20));
-               commandPanel.setMinimumSize(new 
Dimension(PANEL_PREFFERED_WIDTH, 20));
-               
-               showNetworkIconButton = new JToggleButton("+");
-               showNetworkIconButton.addActionListener(new ActionListener() {
-                       public void actionPerformed(ActionEvent e) {
-                               System.out.println("Expand");
-                               processIconColumn();
-                       }
-               });
-               showNetworkIconButton.setPreferredSize(COMMAND_BUTTON_SIZE);
-               
-               commandPanel.add(showNetworkIconButton);
-               
                networkTreePanel = new JPanel();
                networkTreePanel.setLayout(new BoxLayout(networkTreePanel, 
BoxLayout.Y_AXIS));
 
@@ -218,8 +197,6 @@
 
                final JScrollPane scroll = new JScrollPane(treeTable);
 
-               // Icon feature is turned off for now.
-               //networkTreePanel.add(commandPanel);
                networkTreePanel.add(scroll);
                split = new BiModalJSplitPane(cytoscapeDesktop, 
JSplitPane.VERTICAL_SPLIT,
                                              
BiModalJSplitPane.MODE_SHOW_SPLIT, networkTreePanel, navigatorPanel);
@@ -264,53 +241,7 @@
                treeTable.setRowHeight(DEF_ROW_HEIGHT);
        }
        
-       private void processIconColumn() {
-               if (showNetworkIconButton.isSelected()) {
-                       showIcons();
-               } else {
-                       hideIcons();
-               }       
-       }
        
-       private TableColumn iconColumn;
-       
-       private void showIcons() {
-               
-               
-               treeTableModel.addColumn(ColumnTypes.NETWORK_ICONS, 3);
-               if(iconColumn == null) {
-                       iconColumn = new TableColumn(3);
-                       
iconColumn.setIdentifier(ColumnTypes.NETWORK_ICONS.getDisplayName());
-                       
iconColumn.setHeaderValue(ColumnTypes.NETWORK_ICONS.getDisplayName());
-                       iconColumn.setCellRenderer(new IconTableCellRenderer());
-               }
-               treeTable.setRowHeight(NETWORK_ICON_SIZE + 2);
-               
-               
-               treeTable.addColumn(iconColumn);
-               updateIcons();
-       }
-       
-       private void hideIcons() {
-               treeTableModel.removeColumn(3);
-               treeTable.getColumnModel().removeColumn(iconColumn);
-               resetTable();
-       }
-       
-       private void updateIcons() {
-               final Set<CyNetwork> networkSet = Cytoscape.getNetworkSet();
-               
-               for(CyNetwork net: networkSet) {
-                       final CyNetworkView view = 
Cytoscape.getNetworkView(net.getIdentifier());
-                       if(view != null && view != 
Cytoscape.getNullNetworkView() && treeTableModel.getValueAt( 
getNetworkNode(net.getIdentifier()), 3) == null) {
-                               final Icon networkIcon = new 
ImageIcon(((DGraphView)view).createImage(NETWORK_ICON_SIZE, NETWORK_ICON_SIZE, 
1.0));
-                               
-                               treeTableModel.setValueAt(networkIcon, 
getNetworkNode(net.getIdentifier()), 3);
-                       }
-               }
-       }
-       
-       
        /**
         *  DOCUMENT ME!
         *
@@ -540,25 +471,7 @@
                }
        }
        
-
-       private class IconTableCellRenderer implements TableCellRenderer {
-
-               public Component getTableCellRendererComponent(JTable table,
-                               Object value, boolean isSelected, boolean 
hasFocus, int row,
-                               int column) {
-
-                       final JLabel label;
-                       if(value != null && value instanceof Icon) { 
-                               label = new JLabel();
-                               label.setIcon((Icon) value);
-                       } else
-                               label = new JLabel("?");
-                       
-                       return label;
-               }
-               
-       }
-
+       
        /**
         * This class listens to mouse events from the TreeTable, if the mouse 
event
         * is one that is canonically associated with a popup menu (ie, a right

-- 
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