コード例 #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
  private void popoutDataTab(DataTablePlace place, int id) {
    logger.log(Level.INFO, "Popping data panel: " + place.getDataKey());

    // FIXME: this needs to be injected...
    AppPlaceHistoryMapper historyMapper = Entry.getPlaceHistoryMapper();

    String token = historyMapper.getToken(place);
    String url = Window.Location.createUrlBuilder().setHash(token).buildString();
    int width = Window.getClientWidth() / 2;
    int height = Window.getClientHeight() / 2;
    String features =
        "width=" + width + ",height=" + height + ",menubar=0,location=0,toolbar=0,status=0";

    DataPanelActivity.openPanel(this, url, "_blank", features, Integer.toString(id));
  }