コード例 #1
0
 @Override
 public void popout(TabLabelView tab) {
   if (dataTabs.hasTab(tab)) {
     int index = dataTabs.popTab(tab);
     view.removeDataTab(index);
     TabPanelPresenter p = dataTabs.getPresenter(tab);
     p.removed();
     String datakey = ((DataPanelPresenterImpl) p).getDataKey();
     DataTablePlace place = new DataTablePlace();
     place.setDataKey(datakey);
     popoutDataTab(place, tab.hashCode());
   } else if (visTabs.hasTab(tab)) {
     int index = visTabs.popTab(tab);
     view.removeVisTab(index);
     TabPanelPresenter p = visTabs.getPresenter(tab);
     p.removed();
     if (p instanceof ConfusionMatrixPresenterImpl) {
       ConfusionMatrixPresenterImpl cp = (ConfusionMatrixPresenterImpl) p;
       ConfusionMatrixPlace place = new ConfusionMatrixPlace();
       place.setRandomForest(cp.getRandomForest());
       popoutConfusionMatrixTab(place, tab.hashCode());
     } else {
       TreePanelPresenterImpl tp = (TreePanelPresenterImpl) p;
       TreeVisPlace place = new TreeVisPlace();
       place.setDataKey(tp.getDatakey());
       place.setModelKey(tp.getModelkey());
       place.setTree(tp.getTreeIndex());
       popoutTreeVisTab(place, tab.hashCode());
     }
   } else {
     logger.log(Level.SEVERE, "Unknown tab!");
   }
 }
コード例 #2
0
 public void popinVisPanel(String id) {
   logger.log(Level.INFO, "Adding vis panel back in!");
   TabLabelView tab = visTabs.unpopTab(Integer.parseInt(id));
   TabPanelPresenter p = visTabs.getPresenter(tab);
   // FIXME: reusing presenters/view does not work yet...
   // p.added();
   visTabs.deleteTab(tab);
   if (p instanceof ConfusionMatrixPresenterImpl) {
     ConfusionMatrixPresenterImpl cp = (ConfusionMatrixPresenterImpl) p;
     addConfusionMatrixTab(cp.getRandomForest(), cp.getData(), cp.getBuilder());
   } else {
     TreePanelPresenterImpl tp = (TreePanelPresenterImpl) p;
     addVisTab(tp.getDatakey(), tp.getModelkey(), tp.getTreeIndex());
   }
 }