Package org.cytoscape.ClusterViz.internal

Examples of org.cytoscape.ClusterViz.internal.Cluster


  public void listIt(){
     ResultPanel.this.exploreContent = new JPanel[ResultPanel.this.clusters.size()];
        this.data = new Object[ResultPanel.this.clusters.size()][this.columnNames.length];

        for (int i = 0; i < ResultPanel.this.clusters.size(); i++) {
          Cluster c = (Cluster)ResultPanel.this.clusters.get(i);
          c.setRank(i);
          StringBuffer details = getClusterDetails(c);
          this.data[i][1] = new StringBuffer(details);

          Image image = c.getImage();
          this.data[i][0] = (image != null ? new ImageIcon(image) : new ImageIcon());
        }   
  }
View Full Code Here


      // processes here, while the heavy weights are handled by the drawer's thread.
      final JSlider source = (JSlider) e.getSource();
      final double nodeScoreCutoff = (((double) source.getValue()) / 1000);
      final int clusterRow = selectedRow;
      // Store current cluster content for comparison
        final Cluster oldCluster = clusters.get(clusterRow);
     
      if (futureLoader != null && !futureLoader.isDone()) {
        drawer.stop();
        futureLoader.cancel(false);
       
        if (!oldCluster.equals(clusters.get(clusterRow)))
          oldCluster.dispose();
      }
     
      final Runnable command = new Runnable() {
              @Override
            public void run() {
                final List<Long> oldALCluster = oldCluster.getALCluster();
          // Find the new cluster given the node score cutoff
          final Cluster newCluster = alg.exploreCluster(oldCluster, nodeScoreCutoff, network, resultId);
         
          // We only want to do the following work if the newly found cluster is actually different
          // So we get the new cluster content
          List<Long> newALCluster = newCluster.getALCluster();
         
          // If the new cluster is too large to draw within a reasonable time
          // and won't look understandable in the table cell, then we draw a place holder
          drawPlaceHolder = newALCluster.size() > 300;
         
          // And compare the old and new
          if (!newALCluster.equals(oldALCluster)) { // TODO
            // If the cluster has changed, then we conduct all non-rate-limiting steps:
            // Update the cluster array
            clusters.set(clusterRow, newCluster);
            // Update the cluster details
            clusterBrowserPanel.update(newCluster, clusterRow);
            // Fire the enumeration action
            nodeAttributesComboBox.setSelectedIndex(nodeAttributesComboBox.getSelectedIndex());
   
            // There is a small difference between expanding and retracting the cluster size.
            // When expanding, new nodes need random position and thus must go through the layout.
            // When retracting, we simply use the layout that was generated and stored.
            // This speeds up the drawing process greatly.
            boolean layoutNecessary = newALCluster.size() > oldALCluster.size();
            // Draw Graph and select the cluster in the view in a separate thread so that it can be
            // interrupted by the slider movement
            if (!newCluster.isDisposed()) {
              drawer.drawGraph(newCluster, layoutNecessary, drawPlaceHolder);
              oldCluster.dispose();
            }
          }
          mcodeUtil.destroyUnusedNetworks(network, clusters);// TODO
View Full Code Here

      ListSelectionModel lsm = (ListSelectionModel)e.getSource();

      if (!lsm.isSelectionEmpty()) {
        int selectedRow = lsm.getMinSelectionIndex();
        Cluster c = (Cluster)ResultPanel.this.clusters.get(selectedRow);
        CyNetwork gpCluster = c.getNetwork();//���µĽ�����Ի��ֵ���������½�����ܻ��ֵ
        ResultPanel.this.selectCluster(gpCluster);

        if (ResultPanel.this.exploreContent[selectedRow] == null) {
          ResultPanel.this.exploreContent[selectedRow] = ResultPanel.this.createExploreContent(selectedRow);
        }

        if (ResultPanel.this.explorePanel.isVisible()) {
          ResultPanel.this.explorePanel.getContentPane().remove(0);
        }

        ResultPanel.this.explorePanel.getContentPane().add(ResultPanel.this.exploreContent[selectedRow], "Center");

        if (!ResultPanel.this.explorePanel.isVisible()) {
          ResultPanel.this.explorePanel.setVisible(true);
        }

        String title = "Explore: ";

        if (c.getName() != null)
          title = title + c.getName();
        else {
          title = title + "Cluster " + (selectedRow + 1);
        }

        ResultPanel.this.explorePanel.setTitleComponentText(title);
View Full Code Here

TOP

Related Classes of org.cytoscape.ClusterViz.internal.Cluster

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.