List of usage examples for javax.swing JPanel setSize
public void setSize(Dimension d)
From source file:tufts.vue.AnalyzerAction.java
public void act(LWComponent c) { //if (VUE.getDRBrowser().getDataSourceViewer().mMapBasedSearchThreads.size() > 0) //{ /*from w w w .ja v a 2s .c o m*/ //System.out.println("SEARCH ALREADY RUNNING!!!!!!!!!!!"); // return; //} //Set the wait cursor here clear it when there's no threads left in the mbs. GUI.activateWaitCursor(); //figure out if anything is checked int selectionCount = DefaultQueryEditor.getSelectedRepositoryCount(); if (selectionCount == 0) { final ShowAgainDialog sad = new ShowAgainDialog(VUE.getApplicationFrame(), "noResourceSelected", VueResources.local("noResourceSelected.title"), "OK", null); JPanel panel = new JPanel(new GridLayout(1, 1)); String label = Util.formatLines(VueResources.local("noResourceSelected.message"), 30); JLabel vLabel = new JLabel(label); if (Util.isMacPlatform()) { panel.setPreferredSize(new Dimension(425, 25)); panel.setSize(new Dimension(425, 25)); panel.setMinimumSize(new Dimension(425, 25)); } else { panel.setPreferredSize(new Dimension(425, 25)); } panel.add(vLabel); sad.setContentPanel(panel); VueUtil.centerOnScreen(sad); if (sad.showAgain()) { sad.setVisible(true); sad.setVisible(false); sad.dispose(); GUI.clearWaitCursor(); return; } } // List<AnalyzerResult> list = analyzer.analyze(c); // Iterator<AnalyzerResult> i = list.iterator(); VUE.getActiveViewer().getSelection().clear(); //System.out.println("BLAH"); boolean hasResults = false; String query = ""; final int MAX_TERMS = 1; int termCount = 0; /* while (i.hasNext() && termCount < MAX_TERMS) { hasResults = true; AnalyzerResult l = i.next(); if (l !=null && l.getValue() !=null) { //System.out.println(l.getRelevance() + " : " + l.getValue()); query += l.getValue().trim() + " "; termCount++; }*/ /* * MK - For testing purposes I was adding Nodes of the search terms to the map. * if (l.getValue() !=null && l.getValue().trim() != " " && !label.startsWith("Topic")) { LWNode node = new LWNode(label); VUE.getActiveMap().add(node); //VUE.getActiveViewer().getSelection().add(node); LWLink link = new LWLink(c,node); VUE.getActiveMap().add(link); VUE.getActiveViewer().getSelection().add(link); LayoutAction.random.act(VUE.getActiveViewer().getSelection()); }*/ // } //if (query.equals("")) query = c.getLabel(); //if (!hasResults) //{ // VueUtil.alert(VueResources.getString("dialog.analyzeerror.message"), VueResources.getString("dialog.analyzeerror.title")); //just use the label from the node, it didn't go right. //} VUE.getDRBrowser().getDataSourceViewer().queryEditor.setCriteria(query); VUE.getDRBrowser().getDataSourceViewer().mapBasedSearch(c); if (firstTime) { GUI.makeVisibleOnScreen(VUE.getDRBrowser()); firstTime = false; } return; }