List of usage examples for com.vaadin.ui HorizontalSplitPanel addComponent
@Override public void addComponent(Component c)
From source file:com.esspl.datagen.ui.SettingsView.java
License:Open Source License
private Component createWorkArea() { HorizontalSplitPanel split = new HorizontalSplitPanel(); split.setSizeFull();//from ww w .ja va2s.c om split.setSplitPosition(30); List<ConnectionProfile> profiles = SettingsManager.get().getConfiguration().getProfiles(); list = new ListSelect(null, new BeanItemContainer<ConnectionProfile>(ConnectionProfile.class, profiles)); list.setSizeFull(); list.setNullSelectionAllowed(false); list.setImmediate(true); if (!profiles.isEmpty()) { list.select(profiles.get(0)); } list.addListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { refreshDetails(); } }); panel = new Panel(); panel.setSizeFull(); split.addComponent(list); split.addComponent(panel); return split; }
From source file:com.mycompany.filmupo.Graficos.java
/** * Metodo de inicializacion de la clase//from www .j a v a 2 s .c om * * @param vaadinRequest VaadinRequest */ @Override protected void init(VaadinRequest vaadinRequest) { try { HorizontalLayout v2h2 = new HorizontalLayout(); v2h2.setMargin(true); final VerticalLayout v2h1 = new VerticalLayout(); v2h1.setMargin(true); final VerticalSplitPanel v2 = new VerticalSplitPanel(); v2.addComponent(v2h2); v2.addComponent(v2h1); v2.setSplitPosition(22, Unit.PERCENTAGE); v2.setLocked(true); VerticalLayout v1 = new VerticalLayout(); v1.setMargin(true); HorizontalSplitPanel layout = new HorizontalSplitPanel(); layout.addComponent(v1); layout.addComponent(v2); layout.setSplitPosition(28, Unit.PERCENTAGE); setContent(layout); //Creamos los 3 links de navegacion de la aplicacion y loa aadimos al layout declarado al principio del codigo Link pri = new Link("Principal", new ExternalResource("/Principal")); Link est = new Link("Graficos", new ExternalResource("/Graficos")); Link adm = new Link("Administracin", new ExternalResource("/Admin")); v2h2.addComponent(pri); v2h2.addComponent(new Label(" / ")); v2h2.addComponent(est); v2h2.addComponent(new Label(" / ")); v2h2.addComponent(adm); final DAO dao = new DAO(); dao.abrirConexion(); final List<Pelicula> listaPeliculas = dao.consultarPeliculas(); final List<Director> listaDirectores = dao.consultarDirectores(); final List<Actor> listaActores = dao.consultarActores(); //Creamos un unico arbol que contiene el acceso a las 4 graficas que hemos creado: // - Peliculas segun su duracion // - Peliculas segun su genero // - Numero de peliculas segun actor // - Numero de peliculas segun director Tree tree = new Tree(""); String a = "Estadisticas"; tree.addItem(a); String aa = "Peliculas segn su duracin"; tree.addItem(aa); tree.setParent(aa, a); tree.setChildrenAllowed(aa, false); String ab = "Peliculas segn su gnero"; tree.addItem(ab); tree.setParent(ab, a); tree.setChildrenAllowed(ab, false); String ac = "Numero de peliculas segn actor"; tree.addItem(ac); tree.setParent(ac, a); tree.setChildrenAllowed(ac, false); String ad = "Numero de peliculas segn director"; tree.addItem(ad); tree.setParent(ad, a); tree.setChildrenAllowed(ad, false); tree.setSelectable(true); tree.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { v2h1.removeAllComponents(); //Grafica de las peliculas segun su duracion if (event.getProperty().getValue().toString().contains("duracin")) { Chart chart = new Chart(ChartType.PIE); Configuration conf = chart.getConfiguration(); conf.setTitle("Peliculas"); conf.setSubTitle("Segn su duracin en minutos"); PlotOptionsPie options = new PlotOptionsPie(); options.setInnerSize(0); options.setSize("75%"); options.setCenter("50%", "50%"); conf.setPlotOptions(options); DataSeries series = new DataSeries(); for (Pelicula p : listaPeliculas) { series.add(new DataSeriesItem(p.getTitulo(), p.getDuracion())); } conf.addSeries(series); v2h1.addComponent(chart); //Grafica de las peliculas segun su genero } else if (event.getProperty().getValue().toString().contains("gnero")) { Chart chart = new Chart(ChartType.COLUMN); chart.setWidth("400px"); chart.setHeight("300px"); Configuration conf = chart.getConfiguration(); conf.setTitle("Peliculas"); conf.setSubTitle("Agrupadas segn su gnero"); PlotOptionsLine plotOptions = new PlotOptionsLine(); plotOptions.setMarker(new Marker(false)); conf.setPlotOptions(plotOptions); ListSeries series = new ListSeries("Numero de peliculas"); int i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0; try { dao.abrirConexion(); i1 = dao.numGeneros("Accin"); i2 = dao.numGeneros("Ciencia Ficcin"); i3 = dao.numGeneros("Drama"); i4 = dao.numGeneros("Romance"); i5 = dao.numGeneros("Novela de Suspense"); } catch (IllegalAccessException ex) { Logger.getLogger(Graficos.class.getName()).log(Level.SEVERE, null, ex); } catch (SQLException ex) { Logger.getLogger(Graficos.class.getName()).log(Level.SEVERE, null, ex); } catch (InstantiationException ex) { Logger.getLogger(Graficos.class.getName()).log(Level.SEVERE, null, ex); } series.addData(i1); series.addData(i2); series.addData(i3); series.addData(i4); series.addData(i5); conf.addSeries(series); XAxis xaxis = new XAxis(); xaxis.setTitle("Gnero"); xaxis.setCategories("Accin", "Ciencia Ficcin", "Drama", "Romance", "Novela de suspense"); conf.addxAxis(xaxis); YAxis yayis = new YAxis(); yayis.setTitle("Nmero de peliculas"); conf.addyAxis(yayis); v2h1.addComponent(chart); //Grafica de las peliculas segun actor } else if (event.getProperty().getValue().toString().contains("actor")) { Chart chart = new Chart(ChartType.PIE); Configuration conf = chart.getConfiguration(); conf.setTitle("Actores"); conf.setSubTitle("Nmero de peliculas que tienen"); PlotOptionsPie options = new PlotOptionsPie(); options.setInnerSize(0); options.setSize("75%"); options.setCenter("50%", "50%"); conf.setPlotOptions(options); DataSeries series = new DataSeries(); for (Actor a : listaActores) { int i = 0; try { dao.abrirConexion(); i = dao.numPeliculasA(a.getIdActor()); } catch (InstantiationException ex) { Logger.getLogger(Graficos.class.getName()).log(Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { Logger.getLogger(Graficos.class.getName()).log(Level.SEVERE, null, ex); } catch (SQLException ex) { Logger.getLogger(Graficos.class.getName()).log(Level.SEVERE, null, ex); } series.add(new DataSeriesItem(a.getNombreCompleto(), i)); } conf.addSeries(series); v2h1.addComponent(chart); //Grafica del numero de peliculas segun director } else if (event.getProperty().getValue().toString().contains("director")) { Chart chart = new Chart(ChartType.PIE); Configuration conf = chart.getConfiguration(); conf.setTitle("Directores"); conf.setSubTitle("Nmero de peliculas que tienen"); PlotOptionsPie options = new PlotOptionsPie(); options.setInnerSize(0); options.setSize("75%"); options.setCenter("50%", "50%"); conf.setPlotOptions(options); DataSeries series = new DataSeries(); for (Director d : listaDirectores) { int i = 0; try { dao.abrirConexion(); i = dao.numPeliculasD(d.getIdDirector()); } catch (InstantiationException ex) { Logger.getLogger(Graficos.class.getName()).log(Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { Logger.getLogger(Graficos.class.getName()).log(Level.SEVERE, null, ex); } catch (SQLException ex) { Logger.getLogger(Graficos.class.getName()).log(Level.SEVERE, null, ex); } series.add(new DataSeriesItem(d.getNombreCompleto(), i)); } conf.addSeries(series); v2h1.addComponent(chart); } } }); v1.addComponent(tree); dao.cerrarConexion(); } catch (SQLException ex) { Logger.getLogger(Graficos.class.getName()).log(Level.SEVERE, null, ex); } catch (InstantiationException ex) { Logger.getLogger(Graficos.class.getName()).log(Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { Logger.getLogger(Graficos.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:com.vaushell.treetasker.application.window.UserWindow.java
License:Open Source License
/** * Displays the user's view.// w ww. ja v a 2 s . co m */ public void setUserView() { mainLayout.removeComponent(controller.getLoginLayout()); mainLayout.addComponent(controller.getActionBar()); HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(); splitPanel.setWidth("1000px"); splitPanel.setHeight("100%"); splitPanel.setSplitPosition(30); splitPanel.setLocked(true); splitPanel.setMargin(true); splitPanel.setStyleName("content"); splitPanel.addComponent(controller.getTree()); splitPanel.addComponent(controller.getContent()); controller.refresh(); mainLayout.addComponent(splitPanel); mainLayout.setExpandRatio(splitPanel, 1); mainLayout.setComponentAlignment(splitPanel, Alignment.TOP_CENTER); }
From source file:de.catma.ui.analyzer.AnalyzerView.java
License:Open Source License
private void initComponents() { setSizeFull();/*from w w w . j a va2s. c o m*/ Component searchPanel = createSearchPanel(); Component convenienceButtonPanel = createConvenienceButtonPanel(); VerticalLayout searchAndConveniencePanel = new VerticalLayout(); searchAndConveniencePanel.setSpacing(true); searchAndConveniencePanel.setMargin(true); searchAndConveniencePanel.addComponent(searchPanel); searchAndConveniencePanel.addComponent(convenienceButtonPanel); Component documentsPanel = createDocumentsPanel(); HorizontalSplitPanel topPanel = new HorizontalSplitPanel(); topPanel.setSplitPosition(70); topPanel.addComponent(searchAndConveniencePanel); topPanel.addComponent(documentsPanel); addComponent(topPanel); setExpandRatio(topPanel, 0.25f); Component resultPanel = createResultPanel(); resultPanel.setSizeFull(); addComponent(resultPanel); setExpandRatio(resultPanel, 0.75f); }
From source file:de.catma.ui.analyzer.MarkupResultPanel.java
License:Open Source License
private void initComponents() { setSizeFull();/*from ww w . j av a 2 s.c om*/ HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(); splitPanel.setSizeFull(); VerticalLayout leftComponent = new VerticalLayout(); leftComponent.setSpacing(true); leftComponent.setSizeFull(); resultTable = new TreeTable(); resultTable.setSelectable(true); resultTable.setMultiSelect(true); HierarchicalContainer container = new HierarchicalContainer(); container.setItemSorter(new PropertyDependentItemSorter(TreePropertyName.caption, new PropertyToTrimmedStringCIComparator())); resultTable.setContainerDataSource(container); resultTable.addContainerProperty(TreePropertyName.caption, String.class, null); resultTable.setColumnHeader(TreePropertyName.caption, "Tag Definition"); resultTable.addContainerProperty(TreePropertyName.sourcedocument, String.class, null); resultTable.setColumnHeader(TreePropertyName.sourcedocument, "Source Document"); resultTable.addContainerProperty(TreePropertyName.markupcollection, String.class, null); resultTable.setColumnHeader(TreePropertyName.markupcollection, "Markup Collection"); resultTable.addContainerProperty(TreePropertyName.phrase, String.class, null); resultTable.setColumnHeader(TreePropertyName.phrase, "Phrase"); resultTable.addContainerProperty(TreePropertyName.propertyname, String.class, null); resultTable.setColumnHeader(TreePropertyName.propertyname, "Property"); resultTable.addContainerProperty(TreePropertyName.propertyvalue, String.class, null); resultTable.setColumnHeader(TreePropertyName.propertyvalue, "Property value"); resultTable.addContainerProperty(TreePropertyName.frequency, Integer.class, null); resultTable.setColumnHeader(TreePropertyName.frequency, "Frequency"); resultTable.addContainerProperty(TreePropertyName.visible, AbstractComponent.class, null); resultTable.setColumnHeader(TreePropertyName.visible, "Visible in Kwic"); resultTable.setItemCaptionPropertyId(TreePropertyName.caption); resultTable.setPageLength(10); //TODO: config resultTable.setSizeFull(); resultTable.setColumnCollapsingAllowed(true); resultTable.setColumnCollapsible(TreePropertyName.caption, false); resultTable.setColumnCollapsible(TreePropertyName.sourcedocument, true); resultTable.setColumnCollapsible(TreePropertyName.markupcollection, true); resultTable.setColumnCollapsible(TreePropertyName.phrase, true); resultTable.setColumnCollapsible(TreePropertyName.propertyname, true); resultTable.setColumnCollapsible(TreePropertyName.propertyvalue, true); resultTable.setColumnCollapsible(TreePropertyName.frequency, false); resultTable.setColumnCollapsible(TreePropertyName.visible, false); //TODO: a description generator that shows the version of a Tag // resultTable.setItemDescriptionGenerator(generator); leftComponent.addComponent(resultTable); leftComponent.setExpandRatio(resultTable, 1.0f); HorizontalLayout buttonPanel = new HorizontalLayout(); buttonPanel.setSpacing(true); buttonPanel.setWidth("100%"); btDist = new Button(); btDist.setIcon(new ClassResource("ui/analyzer/resources/chart.gif", getApplication())); buttonPanel.addComponent(btDist); btResultExcelExport = new Button(); btResultExcelExport.setIcon(new ThemeResource("../images/table-excel.png")); btResultExcelExport.setDescription("Export all Query result data as an Excel spreadsheet."); buttonPanel.addComponent(btResultExcelExport); cbFlatTable = new CheckBox("flat table", false); cbFlatTable.setImmediate(true); buttonPanel.addComponent(cbFlatTable); buttonPanel.setComponentAlignment(cbFlatTable, Alignment.MIDDLE_RIGHT); buttonPanel.setExpandRatio(cbFlatTable, 1f); btSelectAll = new Button("Select all for Kwic"); buttonPanel.addComponent(btSelectAll); buttonPanel.setComponentAlignment(btSelectAll, Alignment.MIDDLE_RIGHT); // buttonPanel.setExpandRatio(btSelectAll, 1f); btDeselectAll = new Button("Deselect all for Kwic"); buttonPanel.addComponent(btDeselectAll); buttonPanel.setComponentAlignment(btDeselectAll, Alignment.MIDDLE_RIGHT); leftComponent.addComponent(buttonPanel); splitPanel.addComponent(leftComponent); VerticalLayout rightComponent = new VerticalLayout(); rightComponent.setSpacing(true); rightComponent.setSizeFull(); this.kwicPanel = new KwicPanel(repository, relevantUserMarkupCollectionProvider, true); rightComponent.addComponent(kwicPanel); rightComponent.setExpandRatio(kwicPanel, 1f); HorizontalLayout kwicButtonPanel = new HorizontalLayout(); kwicButtonPanel.setSpacing(true); kwicButtonPanel.setWidth("100%"); btKwicExcelExport = new Button(); btKwicExcelExport.setIcon(new ThemeResource("../images/table-excel.png")); btKwicExcelExport.setDescription("Export all Query result data as an Excel spreadsheet."); kwicButtonPanel.addComponent(btKwicExcelExport); kwicButtonPanel.setComponentAlignment(btKwicExcelExport, Alignment.MIDDLE_LEFT); btUntagResults = new Button("Untag selected Kwics"); kwicButtonPanel.addComponent(btUntagResults); kwicButtonPanel.setComponentAlignment(btUntagResults, Alignment.MIDDLE_RIGHT); kwicButtonPanel.setExpandRatio(btUntagResults, 1f); Label helpLabel = new Label(); helpLabel.setIcon(new ClassResource("ui/resources/icon-help.gif", getApplication())); helpLabel.setWidth("20px"); helpLabel.setDescription("<h3>Hints</h3>" + "<h4>Tagging search results</h4>" + "You can tag the search results in the Kwic-view: " + "<p>First select one or more rows and then drag the desired " + "Tag from the Tag Manager over the Kwic-results.</p>" + "<h4>Take a closer look</h4>" + "You can jump to the location in the full text by double " + "clicking on a row in the Kwic-view."); kwicButtonPanel.addComponent(helpLabel); kwicButtonPanel.setComponentAlignment(helpLabel, Alignment.MIDDLE_RIGHT); rightComponent.addComponent(kwicButtonPanel); rightComponent.setComponentAlignment(kwicButtonPanel, Alignment.MIDDLE_RIGHT); splitPanel.addComponent(rightComponent); addComponent(splitPanel); }
From source file:de.catma.ui.analyzer.PhraseResultPanel.java
License:Open Source License
private void initComponents() { setSizeFull();//from ww w .ja va 2 s . co m HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(); splitPanel.setSizeFull(); VerticalLayout leftComponent = new VerticalLayout(); leftComponent.setSpacing(true); leftComponent.setSizeFull(); resultTable = new TreeTable(); resultTable.setSelectable(true); resultTable.setMultiSelect(true); HierarchicalContainer container = new HierarchicalContainer(); container.setItemSorter(new PropertyDependentItemSorter(TreePropertyName.caption, new PropertyToTrimmedStringCIComparator())); resultTable.setContainerDataSource(container); resultTable.addContainerProperty(TreePropertyName.caption, String.class, null); resultTable.setColumnHeader(TreePropertyName.caption, "Phrase"); resultTable.addContainerProperty(TreePropertyName.frequency, Integer.class, null); resultTable.setColumnHeader(TreePropertyName.frequency, "Frequency"); resultTable.addContainerProperty(TreePropertyName.visibleInKwic, AbstractComponent.class, null); resultTable.setColumnHeader(TreePropertyName.visibleInKwic, "Visible in Kwic"); resultTable.setItemCaptionPropertyId(TreePropertyName.caption); resultTable.setPageLength(10); //TODO: config resultTable.setSizeFull(); leftComponent.addComponent(resultTable); leftComponent.setExpandRatio(resultTable, 1.0f); HorizontalLayout buttonPanel = new HorizontalLayout(); buttonPanel.setSpacing(true); buttonPanel.setWidth("100%"); btDist = new Button(); btDist.setIcon(new ClassResource("ui/analyzer/resources/chart.gif", getApplication())); btDist.setDescription("Show selected phrases as a distribution trend in a " + "chart like visualization."); buttonPanel.addComponent(btDist); btDoubleTree = new Button(); btDoubleTree.setIcon(new ClassResource("ui/analyzer/resources/doubletree.gif", getApplication())); btDoubleTree.setDescription("Show a selected phrase with a doubletree kwic visualization."); buttonPanel.addComponent(btDoubleTree); btExcelExport = new Button(); btExcelExport.setIcon(new ThemeResource("../images/table-excel.png")); btExcelExport.setDescription("Export all Query result data as an Excel spreadsheet."); buttonPanel.addComponent(btExcelExport); btSelectAll = new Button("Select all for Kwic"); buttonPanel.addComponent(btSelectAll); buttonPanel.setComponentAlignment(btSelectAll, Alignment.MIDDLE_RIGHT); buttonPanel.setExpandRatio(btSelectAll, 1f); btDeselectAll = new Button("Deselect all for Kwic"); buttonPanel.addComponent(btDeselectAll); buttonPanel.setComponentAlignment(btDeselectAll, Alignment.MIDDLE_RIGHT); leftComponent.addComponent(buttonPanel); splitPanel.addComponent(leftComponent); VerticalLayout rightComponent = new VerticalLayout(); rightComponent.setSpacing(true); rightComponent.setSizeFull(); this.kwicPanel = new KwicPanel(repository, relevantUserMarkupCollectionProvider); rightComponent.addComponent(kwicPanel); rightComponent.setExpandRatio(kwicPanel, 1f); HorizontalLayout kwicButtonPanel = new HorizontalLayout(); kwicButtonPanel.setSpacing(true); kwicButtonPanel.setWidth("100%"); btKwicExcelExport = new Button(); btKwicExcelExport.setIcon(new ThemeResource("../images/table-excel.png")); btKwicExcelExport.setDescription("Export all Query result data as an Excel spreadsheet."); kwicButtonPanel.addComponent(btKwicExcelExport); Label helpLabel = new Label(); helpLabel.setIcon(new ClassResource("ui/resources/icon-help.gif", getApplication())); helpLabel.setDescription("<h3>Hints</h3>" + "<h4>Tagging search results</h4>" + "You can tag the search results in the Kwic-view: " + "<p>First select one or more rows and then drag the desired " + "Tag from the Tag Manager over the Kwic-results.</p>" + "<h4>Take a closer look</h4>" + "You can jump to the location in the full text by double " + "clicking on a row in the Kwic-view." + "<h4>Untag search results</h4>" + "The \"Results by markup\" tab gives you the opportunity " + "to untag markup for selected search results in the Kwic-view."); kwicButtonPanel.addComponent(helpLabel); kwicButtonPanel.setExpandRatio(helpLabel, 1f); kwicButtonPanel.setComponentAlignment(helpLabel, Alignment.MIDDLE_RIGHT); rightComponent.addComponent(kwicButtonPanel); rightComponent.setComponentAlignment(kwicButtonPanel, Alignment.MIDDLE_RIGHT); splitPanel.addComponent(rightComponent); addComponent(splitPanel); }
From source file:de.catma.ui.repository.RepositoryView.java
License:Open Source License
private Component createDocumentsManagerPanel() { HorizontalSplitPanel documentsManagerPanel = new HorizontalSplitPanel(); documentsManagerPanel.setSplitPosition(25); documentsManagerPanel.setSizeFull(); sourceDocumentPanel = new SourceDocumentPanel(repository); corpusPanel = new CorpusPanel(repository, new ValueChangeListener() { public void valueChange(ValueChangeEvent event) { Object value = event.getProperty().getValue(); sourceDocumentPanel.setSourceDocumentsFilter((Corpus) value); }//from w w w . j av a2 s. com }); documentsManagerPanel.addComponent(corpusPanel); documentsManagerPanel.addComponent(sourceDocumentPanel); return documentsManagerPanel; }
From source file:de.catma.ui.tagger.TaggerView.java
License:Open Source License
private void initComponents(Application application) { setSizeFull();//from w w w .ja v a 2 s .c o m VerticalLayout taggerPanel = new VerticalLayout(); taggerPanel.setSpacing(true); Label helpLabel = new Label(); helpLabel.setIcon(new ClassResource("ui/resources/icon-help.gif", application)); helpLabel.setWidth("20px"); helpLabel.setDescription("<h3>Hints</h3>" + "<h4>Tag this Source Document</h4>" + "<ol><li>First you have to tell CATMA which Tagset you want to use. " + "Open a Tag Library from the Repository Manager and drag a Tagset to the \"Active Tagsets\" section.</li>" + "<li>Now you can mark the text sequence you want to tag.</li><li>Click the colored button of the desired Tag to apply it to the marked sequence.</li></ol> " + "When you click on a tagged text, i. e. a text that is underlined with colored bars, you should see " + "the available Tag Instances in the section on the lower right of this view."); pager = new Pager(taggerID, 80, 30); tagger = new Tagger(taggerID, pager, this); tagger.addStyleName("tagger"); tagger.setWidth("550px"); taggerPanel.addComponent(tagger); // Panel actionPanel = new Panel(new HorizontalLayout()); // ((HorizontalLayout)actionPanel.getContent()).setSpacing(true); HorizontalLayout actionPanel = new HorizontalLayout(); actionPanel.setSpacing(true); taggerPanel.addComponent(actionPanel); pagerComponent = new PagerComponent(pager, new PageChangeListener() { public void pageChanged(int number) { tagger.setPage(number); } }); actionPanel.addComponent(helpLabel); actionPanel.addComponent(pagerComponent); btAnalyze = new Button("Analyze Document"); btAnalyze.setEnabled(repository instanceof IndexedRepository); actionPanel.addComponent(btAnalyze); linesPerPageSlider = new Slider("page size zoom", 1, 100, "%"); linesPerPageSlider.setImmediate(true); linesPerPageSlider.setWidth("150px"); actionPanel.addComponent(linesPerPageSlider); markupPanel = new MarkupPanel(repository, new ColorButtonListener() { private boolean enabled = false; public void colorButtonClicked(TagDefinition tagDefinition) { if (enabled) { tagger.addTagInstanceWith(tagDefinition); } else { getWindow().showNotification( "Information", "Please select a User Markup Collection " + " to store your markup first!<br>" + "See 'Active Markup Collections'.", Notification.TYPE_TRAY_NOTIFICATION); } } public void setEnabled(boolean enabled) { this.enabled = enabled; } }, new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { boolean selected = evt.getNewValue() != null; @SuppressWarnings("unchecked") List<TagReference> tagReferences = (List<TagReference>) (selected ? evt.getNewValue() : evt.getOldValue()); tagger.setVisible(tagReferences, selected); } }, new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { @SuppressWarnings("unchecked") Set<TagDefinition> removedTagDefinitions = (Set<TagDefinition>) evt.getOldValue(); pager.removeTagInstances(removedTagDefinitions); tagger.setPage(pager.getCurrentPageNumber()); } }); HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(); splitPanel.addComponent(taggerPanel); splitPanel.addComponent(markupPanel); addComponent(splitPanel); }
From source file:edu.cornell.qatarmed.planrnaseq.AnnotateRNAseq.java
private void initLayout() { /* Root of the user interface component tree is set */ HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(); setContent(splitPanel);/*w ww . ja va 2 s. c o m*/ /* Build the component tree */ VerticalLayout leftLayout = new VerticalLayout(); VerticalLayout rightLayout = new VerticalLayout(); splitPanel.addComponent(leftLayout); splitPanel.addComponent(rightLayout); /* //make form asking parameters and add it to leftLaayout VerticalLayout formLayout = new VerticalLayout(); // TextField studyName = new TextField("RNAseq Study Name"); formLayout.addComponent(studyName); List replist = new ArrayList(); ComboBox numReplicates = new ComboBox("Replicates", replist); formLayout.addComponent(numReplicates); leftLayout.addComponent(formLayout); */ leftLayout.addComponent(tree); /* Set the contents in the left of the split panel to use all the space */ leftLayout.setSizeFull(); /* VerticalLayout resultLayout = new VerticalLayout(); rightLayout.addComponent(resultLayout); VerticalLayout chartLayout = new VerticalLayout(); rightLayout.addComponent(chartLayout); chartLayout.setVisible(false); */ initRNAseqTable(); }
From source file:edu.cornell.qatarmed.planrnaseq.AnnotateRNAseq1.java
private void initLayout() { /* Root of the user interface component tree is set */ HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(); setContent(splitPanel);/*from w w w .j ava2 s . c o m*/ /* Build the component tree */ VerticalLayout leftLayout = new VerticalLayout(); VerticalLayout rightLayout = new VerticalLayout(); splitPanel.addComponent(leftLayout); splitPanel.addComponent(rightLayout); /* //make form asking parameters and add it to leftLaayout VerticalLayout formLayout = new VerticalLayout(); // TextField studyName = new TextField("RNAseq Study Name"); formLayout.addComponent(studyName); List replist = new ArrayList(); ComboBox numReplicates = new ComboBox("Replicates", replist); formLayout.addComponent(numReplicates); leftLayout.addComponent(formLayout); */ initRNAseqTable(); bioprojectSummaryTable.setSizeFull(); leftLayout.addComponent(bioprojectSummaryTable); /* Set the contents in the left of the split panel to use all the space */ leftLayout.setSizeFull(); /* VerticalLayout resultLayout = new VerticalLayout(); rightLayout.addComponent(resultLayout); VerticalLayout chartLayout = new VerticalLayout(); rightLayout.addComponent(chartLayout); chartLayout.setVisible(false); */ rightLayout.addComponent(tree); rightLayout.setSizeFull(); }