List of usage examples for com.vaadin.ui VerticalSplitPanel VerticalSplitPanel
public VerticalSplitPanel()
From source file:com.mcparland.john.AdjustableLayout.java
License:Apache License
/** * Create the content panel.// w ww.j a v a 2s .com * * @return the content panel. */ private Component createContentPanel() { VerticalSplitPanel contentPanel = new VerticalSplitPanel(); contentPanel.setFirstComponent(createEditorPanel()); contentPanel.setSecondComponent(createTable()); contentPanel.setSplitPosition(80, Unit.PERCENTAGE); return contentPanel; }
From source file:com.mcparland.john.DragAndDropPanel.java
License:Apache License
/** * Create a DragAndDropPanel./*w ww . jav a2s . c o m*/ * */ public DragAndDropPanel() { super(); final VerticalSplitPanel leftSplitPanel = new VerticalSplitPanel(); leftSplitPanel.setSizeFull(); leftSplitPanel.setFirstComponent(createLayout(new HorizontalLayout())); leftSplitPanel.setSecondComponent(new VerticalLayout()); final VerticalSplitPanel rightSplitPanel = new VerticalSplitPanel(); rightSplitPanel.setSizeFull(); rightSplitPanel.setFirstComponent(createLayout(new GridLayout(3, 3))); rightSplitPanel.setSecondComponent(new InlineCssLayout()); setFirstComponent(leftSplitPanel); setSecondComponent(rightSplitPanel); setSizeFull(); }
From source file:com.mycompany.filmupo.Graficos.java
/** * Metodo de inicializacion de la clase//from ww w . ja v a 2s . co m * * @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.openhris.payroll.PayrollAdvancesLedgerUI.java
public PayrollAdvancesLedgerUI(int branchId) { this.branchId = branchId; setSpacing(false);//from w w w. j av a 2 s . co m setMargin(false); setWidth("100%"); setHeight("100%"); setImmediate(true); final VerticalSplitPanel vsplit = new VerticalSplitPanel(); vsplit.setImmediate(true); vsplit.setMargin(false); vsplit.setSizeFull(); vsplit.setLocked(true); vsplit.setSplitPosition(90, Sizeable.UNITS_PIXELS); GridLayout glayout = new GridLayout(2, 1); glayout.setWidth("60%"); glayout.setMargin(true); glayout.setSpacing(true); employeeComboBox(getBranchId()); glayout.addComponent(employee, 0, 0); Button button = new Button(); button.setWidth("100%"); button.setCaption("Generate Ledger"); button.setEnabled(UserAccessControl.isPayroll()); button.addListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { System.out.println("employeeId: " + employee.getValue()); } }); glayout.addComponent(button, 1, 0); glayout.setComponentAlignment(button, Alignment.BOTTOM_LEFT); vsplit.setFirstComponent(glayout); addComponent(vsplit); setExpandRatio(vsplit, 1.0f); }
From source file:de.catma.ui.analyzer.querybuilder.CollocPanel.java
License:Open Source License
private void initComponents() { VerticalSplitPanel splitPanel = new VerticalSplitPanel(); Component searchPanel = createSearchPanel(); splitPanel.addComponent(searchPanel); resultPanel = new ResultPanel(queryOptions); splitPanel.addComponent(resultPanel); addComponent(splitPanel);//from w w w. jav a 2 s .co m super.initSearchPanelComponents(splitPanel); }
From source file:de.catma.ui.analyzer.querybuilder.PhrasePanel.java
License:Open Source License
private void initComponents() { VerticalSplitPanel splitPanel = new VerticalSplitPanel(); Component searchPanel = createSearchPanel(); splitPanel.addComponent(searchPanel); resultPanel = new ResultPanel(queryOptions); splitPanel.addComponent(resultPanel); addComponent(splitPanel);/*from w w w . j a v a 2 s .c o m*/ super.initSearchPanelComponents(splitPanel); }
From source file:de.catma.ui.analyzer.querybuilder.TagPanel.java
License:Open Source License
private void initComponents() { contentPanel = new VerticalLayout(); contentPanel.setSizeFull();//from ww w . j a va 2 s. c o m addComponent(contentPanel); if (tagsetDefinitionDictionary.isEmpty()) { tagLibraryPanel = createTagLibraryPanel(); contentPanel.addComponent(tagLibraryPanel); } HorizontalLayout tagSearchPanel = new HorizontalLayout(); tagSearchPanel.setSizeFull(); tagSearchPanel.setSpacing(true); tagsetTree = new TagsetTree(queryOptions.getRepository().getTagManager(), null, false, false, null); tagSearchPanel.addComponent(tagsetTree); tagSearchPanel.setExpandRatio(tagsetTree, 0.8f); tagMatchModeCombo = new ComboBox("Please choose what you consider a match:"); tagMatchModeCombo.setImmediate(true); TagMatchModeItem exactMatchItem = new TagMatchModeItem("exact match", TagMatchMode.EXACT); tagMatchModeCombo.addItem(exactMatchItem); tagMatchModeCombo.addItem(new TagMatchModeItem("boundary match", TagMatchMode.BOUNDARY)); tagMatchModeCombo.addItem(new TagMatchModeItem("overlap match", TagMatchMode.OVERLAP)); tagMatchModeCombo.setNullSelectionAllowed(false); tagMatchModeCombo.setNewItemsAllowed(false); tagMatchModeCombo.setDescription( "The three different match modes influence the way tags refine" + " your search results:" + "<ul>" + "<li>exact match - the tag boundaries have to match exactly to " + "keep a result item in the result set</li>" + "<li>boundary match - result items that should be kept in the " + "result set must start and end within the boundaries of the tag</li>" + "<li>overlap - the result items that should be kept in the result " + "set must overlap with the range of the tag</li>" + "</ul>"); tagMatchModeCombo.setValue(exactMatchItem); tagSearchPanel.addComponent(tagMatchModeCombo); tagSearchPanel.setExpandRatio(tagMatchModeCombo, 0.2f); splitPanel = new VerticalSplitPanel(); contentPanel.addComponent(splitPanel); splitPanel.addComponent(tagSearchPanel); if (tagsetDefinitionDictionary.isEmpty()) { splitPanel.setVisible(false); } else { tagsetTree.addTagsetDefinition(tagsetDefinitionDictionary.values()); } resultPanel = new ResultPanel(queryOptions); splitPanel.addComponent(resultPanel); initSearchPanelComponents(contentPanel); }
From source file:de.catma.ui.repository.RepositoryView.java
License:Open Source License
private void initComponents() { setSizeFull();/*from www . ja v a 2 s.com*/ this.setMargin(false, true, true, true); this.setSpacing(true); Component documentsLabel = createDocumentsLabel(); addComponent(documentsLabel); VerticalSplitPanel splitPanel = new VerticalSplitPanel(); splitPanel.setSplitPosition(65); Component documentsManagerPanel = createDocumentsManagerPanel(); splitPanel.addComponent(documentsManagerPanel); tagLibraryPanel = new TagLibraryPanel(repository.getTagManager(), repository); splitPanel.addComponent(tagLibraryPanel); addComponent(splitPanel); setExpandRatio(splitPanel, 1f); }
From source file:dhbw.ka.mwi.businesshorizon2.ui.initialscreen.InitialScreenViewImpl.java
License:Open Source License
/** * Diese Methode setzt das Layout fr den Screen fest sowie den Titel der Anwendung. * Zustzlich wird hier noch das Men erzeugt und die Buttons, um ein Projekt zu bearbeiten, * ein neues anzulegen oder ein bestehendes zu lschen. * * @author Christian Scherer, Mirko Gpfrich, Marco Glaser *///from w w w.ja v a 2s . c om private void generateUi() { mainLayout = new VerticalLayout(); leftLayout = new HorizontalLayout(); rightLayout = new VerticalLayout(); topRightLayout = new HorizontalLayout(); leftContentLayout = new VerticalLayout(); bottomLeftLayout = new VerticalLayout(); bottomRightLayout = new VerticalLayout(); bottomRightLayout.setHeight(90, UNITS_PERCENTAGE); bottomRightLayout.setWidth(100, UNITS_PERCENTAGE); bottomRightLayout.addStyleName("horizontalBottom"); bottomLayout = new VerticalLayout(); gap = new Label(); leftContainerSpacing = new VerticalLayout(); progressBar = new Embedded(null); progressBarGap = new Label(); splitter = new Label("<hr style='border:none;background-color:black;height:2px'>", Label.CONTENT_XHTML); splitter2 = new Label("<hr style='border:none;background-color:black;height:2px'>", Label.CONTENT_XHTML); menuButtonsLayout = new HorizontalLayout(); homeButtonLayout = new VerticalLayout(); logoutButtonLayout = new VerticalLayout(); homeButton = new Button(); logoutButton = new Button(); homeButtonLabel = new Label("Startseite"); logoutButtonLabel = new Label("Ausloggen"); descriptionLayout = new VerticalLayout(); bottomGap = new Label(); faqLayout = new HorizontalLayout(); homeIcon = new Embedded(null, new ThemeResource("./images/icons/newIcons/1418766062_house_home-128.png")); middleGap = new Label(); mainLayout.setSizeFull(); mainLayout.setStyleName("mainLayout"); leftLayout.setSizeFull(); leftLayout.setStyleName("leftContainer"); rightLayout.setSizeFull(); rightLayout.setStyleName("rightContainer"); bottomLayout.setSizeFull(); bottomLeftLayout.setSizeFull(); // bottomRightLayout.setWidth(90, UNITS_PERCENTAGE); // bottomRightLayout.setStyleName("projectDetailsLayout"); topRightLayout.setSizeFull(); leftContentLayout.setSizeFull(); progressBar.setSizeUndefined(); progressBar.setVisible(false); // leftContentLayout.setHeight(Sizeable.SIZE_UNDEFINED, 0); leftLogoLayout = new VerticalLayout(); logo = new Embedded(null, new ThemeResource("images/logo_businesshorizon_vertical.png")); gap.setHeight("10px"); bottomGap.setHeight("40px"); middleGap.setHeight("10px"); progressBarGap.setHeight("15px"); leftContainerSpacing.setSizeFull(); homeIcon.setWidth(70, UNITS_PIXELS); homeIcon.setHeight(70, UNITS_PIXELS); seitenLabel = new Label("Startseite"); seitenLabel.setStyleName("seitenLabel"); seitenLabel.setWidth(Sizeable.SIZE_UNDEFINED, 0); descriptionLabel = new Label("bersicht ber alle Projekte"); descriptionLabel.setStyleName("descriptionLabel"); descriptionLabel.setWidth(Sizeable.SIZE_UNDEFINED, 0); descriptionLayout.setWidth(100, UNITS_PERCENTAGE); descriptionLayout.setHeight(80, UNITS_PIXELS); splitter.setWidth(98, UNITS_PERCENTAGE); splitter2.setWidth(98, UNITS_PERCENTAGE); menuButtonsLayout.setWidth(100, UNITS_PERCENTAGE); menuButtonsLayout.setHeight(Sizeable.SIZE_UNDEFINED, 0); homeButtonLayout.setSizeFull(); logoutButtonLayout.setSizeFull(); homeButton.setHeight(30, UNITS_PIXELS); homeButton.setWidth(30, UNITS_PIXELS); homeButton.setStyleName("homeButton"); logoutButton.setHeight(30, UNITS_PIXELS); logoutButton.setWidth(30, UNITS_PIXELS); logoutButton.setStyleName("logoutButton"); homeButtonLabel.setWidth(Sizeable.SIZE_UNDEFINED, 0); homeButtonLabel.setStyleName("topBarButtonLabel"); logoutButtonLabel.setWidth(Sizeable.SIZE_UNDEFINED, 0); logoutButtonLabel.setStyleName("topBarButtonLabel"); faqLayout.setWidth(100, UNITS_PERCENTAGE); faqLayout.setHeight(50, UNITS_PIXELS); horizontalSplitPanel = new HorizontalSplitPanel(); horizontalSplitPanel.setSplitPosition(30, UNITS_PERCENTAGE); horizontalSplitPanel.setLocked(true); horizontalSplitPanel.setStyleName("horizontalMain"); verticalSplitPanel = new VerticalSplitPanel(); verticalSplitPanel.setSplitPosition(126, UNITS_PIXELS); verticalSplitPanel.setLocked(true); verticalSplitPanel.setWidth(90, UNITS_PERCENTAGE); verticalSplitPanel.setHeight(100, UNITS_PERCENTAGE); horizontalSplitPanelRight = new HorizontalSplitPanel(); horizontalSplitPanelRight.setSplitPosition(30, UNITS_PERCENTAGE); horizontalSplitPanelRight.setLocked(true); horizontalSplitPanelRight.addStyleName("horizontalBottom"); horizontalSplitPanelRight.setHeight(90, UNITS_PERCENTAGE); horizontalSplitPanelRight.setWidth(100, UNITS_PERCENTAGE); descriptionLayout.addComponent(descriptionLabel); leftLogoLayout.addComponent(logo); leftContentLayout.addComponent(gap); leftContentLayout.addComponent(homeIcon); leftContentLayout.addComponent(seitenLabel); leftContentLayout.addComponent(splitter); leftContentLayout.addComponent(descriptionLayout); leftContentLayout.addComponent(splitter2); leftContentLayout.addComponent(middleGap); leftContentLayout.addComponent(menuButtonsLayout); leftContentLayout.addComponent(progressBarGap); leftContentLayout.addComponent(progressBar); leftContentLayout.addComponent(leftContainerSpacing); leftContentLayout.addComponent(bottomGap); leftContentLayout.setExpandRatio(leftContainerSpacing, 1.0f); leftLayout.addComponent(leftLogoLayout); leftLayout.addComponent(leftContentLayout); leftLayout.setExpandRatio(leftContentLayout, 1.0f); descriptionLayout.setComponentAlignment(descriptionLabel, Alignment.MIDDLE_CENTER); leftLogoLayout.setComponentAlignment(logo, Alignment.MIDDLE_CENTER); leftContentLayout.setComponentAlignment(homeIcon, Alignment.TOP_CENTER); leftContentLayout.setComponentAlignment(seitenLabel, Alignment.TOP_CENTER); leftContentLayout.setComponentAlignment(progressBar, Alignment.MIDDLE_CENTER); // leftContentLayout.setComponentAlignment(descriptionLabel, Alignment.TOP_CENTER); menuButtonsLayout.addComponent(homeButtonLayout); menuButtonsLayout.addComponent(logoutButtonLayout); homeButtonLayout.addComponent(homeButton); homeButtonLayout.addComponent(homeButtonLabel); logoutButtonLayout.addComponent(logoutButton); logoutButtonLayout.addComponent(logoutButtonLabel); homeButtonLayout.setComponentAlignment(homeButton, Alignment.TOP_CENTER); homeButtonLayout.setComponentAlignment(homeButtonLabel, Alignment.MIDDLE_CENTER); logoutButtonLayout.setComponentAlignment(logoutButton, Alignment.TOP_CENTER); logoutButtonLayout.setComponentAlignment(logoutButtonLabel, Alignment.MIDDLE_CENTER); leftLogoLayout.setWidth(Sizeable.SIZE_UNDEFINED, 0); leftLogoLayout.setHeight(100, UNITS_PERCENTAGE); leftContentLayout.setSizeFull(); rightLayout.addComponent(verticalSplitPanel); bottomLayout.addComponent(horizontalSplitPanelRight); horizontalSplitPanel.addComponent(leftLayout); horizontalSplitPanel.addComponent(rightLayout); verticalSplitPanel.addComponent(topRightLayout); verticalSplitPanel.addComponent(bottomLayout); // horizontalSplitPanelRight.setSecondComponent(bottomRightLayout); rightLayout.setComponentAlignment(verticalSplitPanel, Alignment.MIDDLE_CENTER); bottomLayout.setComponentAlignment(horizontalSplitPanelRight, Alignment.MIDDLE_CENTER); mainLayout.addComponent(horizontalSplitPanel); homeButton.addListener(new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { ConfirmDialog.show(event.getButton().getWindow(), "Warnung", "Beim Abbruch gehen Ihre Eingaben verloren! Mchten Sie zur Startseite zurckkehren?", "Okay", "Abbrechen", new ConfirmDialog.Listener() { private static final long serialVersionUID = 1L; @Override public void onClose(ConfirmDialog dialog) { if (dialog.isConfirmed()) { presenter.showInitialScreen(); } else { } } }); } }); logoutButton.addListener(new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { ConfirmDialog.show(event.getButton().getWindow(), "Warnung", "Mchten Sie sich wirklich ausloggen?", "Okay", "Abbrechen", new ConfirmDialog.Listener() { private static final long serialVersionUID = 1L; @Override public void onClose(ConfirmDialog dialog) { if (dialog.isConfirmed()) { presenter.doLogout(); } else { } } }); } }); setContent(mainLayout); addProjectButton = new TopBarButton("addProjectButton", "Neues Projekt"); addProjectButton.addLabel("hinzufgen"); addProjectButtonListener = new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { presenter.showProjectCreationScreen(); String[] desc = new String[2]; desc[0] = "Geben Sie hier den Namen und"; desc[1] = "eine Beschreibung ein"; setPageDescription("./images/icons/newIcons/1418831401_circle_add_plus-128.png", "Neues Projekt anlegen", desc); } }; addTopButton(addProjectButton, addProjectButtonListener); editProjectButton = new TopBarButton("editProjectButton", "Projekt bearbeiten"); editProjectButtonListener = new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { presenter.showProjectEditScreen(); String[] desc = new String[2]; desc[0] = "ndern Sie hier Name oder"; desc[1] = "Beschreibung des Projekts"; setPageDescription("./images/icons/newIcons/1418765965_editor_pencil_pen_edit_write-128.png", "Projekt bearbeiten", desc); } }; addTopButton(editProjectButton, editProjectButtonListener); deleteProjectButton = new TopBarButton("deleteProjectButton", "Projekt lschen"); deleteProjectButton.setButtonWidth(25); deleteProjectButtonListener = new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { final Project project = projectProxy.getSelectedProject(); logger.debug("Projekt-loeschen Button aus dem Hauptfenster aufgerufen."); ConfirmDialog.show(getWindow(), project.getName() + " lschen?", "Wollen sie das Projekt wirklich lschen?", "Ja", "Nein", new ConfirmDialog.Listener() { private static final long serialVersionUID = 1L; @Override public void onClose(ConfirmDialog dialog) { if (dialog.isConfirmed()) { presenter.removeProject(project); } else { } } }); } }; addTopButton(deleteProjectButton, deleteProjectButtonListener); createImportButton(); topRightLayout.addComponent(importButton); topRightLayout.setComponentAlignment(importButton, Alignment.MIDDLE_CENTER); exportButton = new TopBarButton("exportButton", "Projekte"); exportButton.addLabel("exportieren"); exportButtonListener = new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { File exportFile = presenter.exportProjects(); event.getButton().getWindow().open(new Downloader(exportFile, getApplication())); } }; addTopButton(exportButton, exportButtonListener); topBarSpacing = new VerticalLayout(); topBarSpacing.setSizeFull(); topRightLayout.addComponent(topBarSpacing); topRightLayout.setExpandRatio(topBarSpacing, 1.0f); }
From source file:dhbw.ka.mwi.businesshorizon2.ui.login.LogInScreenViewImplv2.java
License:Open Source License
/** * Diese Methode setzt den Titel (im Browser-Fenster) zu * "Business Horizon 2" und erstellt die LogIn Maske mit Listener. Der * Listener prft ruft die im LogIn Event gesammelten LogIn-Daten und * bergibt sie dem presenter zur Kontrolle. Je nach ausgang der Konrolle * wird dann eine Fehlermeldung aufgerufen. Zudem wird mittels dem * "registrieren" Button und dessen Listener eine Dialogfenster * bereitgestellt mit dessen sich ein neuer Anwender registrieren kann. * //ww w. j a v a 2s . c o m * @author Christian Scherer */ private void generateUi() { setCaption("Business Horizon 3"); logger.debug("berschrift fr Browser erstellt"); horizontal = new HorizontalLayout(); vSplitPanel = new VerticalSplitPanel(); vSplitPanel.setSplitPosition(70, Sizeable.UNITS_PERCENTAGE); vSplitPanel.setLocked(true); verticalTop = new VerticalLayout(); verticalTop.setSizeFull(); verticalTop.setMargin(true, true, true, true); verticalTop.setStyleName("loginTop"); //Erzeugt ein Label mit dem Willkommens-Text neben dem Logo welcome = new Label("Willkommen bei"); welcome.setStyleName("welcomeSlogan"); //Erezeugt ein Label mit dem Beschreibungstext welcomeText = new Label( "Mithilfe dieser Software knnen Sie Ihre zuknftige Unternehmenswerte berechnen lassen. Hierzu stehen Ihnen verschiedene Methoden zur Verfgung, die Ihnen unterschiedliche Herangehensweisen ermglichen je nachdem, welche Daten Ihnen zur Verfgung stehen. "); welcomeText.setStyleName("welcomeText"); welcomeText.setSizeFull(); textLayout = new HorizontalLayout(); textLayout.setWidth(50, Sizeable.UNITS_PERCENTAGE); textLayout.addComponent(welcomeText); textLayout.setComponentAlignment(welcomeText, Alignment.TOP_RIGHT); iconLabel = new Label(); iconLabel.setIcon(new ThemeResource("images/Logo_businesshorizon.png")); iconLabel.setWidth(40, Sizeable.UNITS_PERCENTAGE); iconLabel.setStyleName("logo"); welcomeLayout = new HorizontalLayout(); welcomeLayout.setSizeFull(); welcomeLayout.addComponent(welcome); welcomeLayout.setComponentAlignment(welcome, Alignment.BOTTOM_CENTER); welcomeLayout.addComponent(iconLabel); welcomeLayout.setComponentAlignment(iconLabel, Alignment.BOTTOM_RIGHT); //Fgt den Beschreibungs-Text dem Bildschirm hinzu verticalTop.addComponent(textLayout); verticalTop.setComponentAlignment(textLayout, Alignment.TOP_RIGHT); verticalTop.addComponent(welcomeLayout); verticalTop.setComponentAlignment(welcomeLayout, Alignment.BOTTOM_RIGHT); login = new LoginForm(); //Zur Anmeldung muss die Mailadresse als Benutzername angegeben werden login.setUsernameCaption("Mailadresse"); login.setPasswordCaption("Passwort"); login.setWidth(null); login.setStyleName("login_form"); login.addListener(new LoginForm.LoginListener() { private static final long serialVersionUID = 1L; @Override public void onLogin(LoginEvent event) { presenter.doLogin(event.getLoginParameter("username"), event.getLoginParameter("password")); } }); //VerticalLayout login = generateLogin(); horizontal.addComponent(login); horizontal.setComponentAlignment(login, Alignment.TOP_CENTER); HorizontalLayout landingBtnLayout = new HorizontalLayout(); loginBtnLayout = new VerticalLayout(); loginBtn = new Button("", this); loginBtn.setWidth(100, Sizeable.UNITS_PIXELS); loginBtn.setHeight(100, Sizeable.UNITS_PIXELS); loginBtn.addStyleName("loginBtn"); loginBtnLabel = new Label("Login"); loginBtnLabel.setWidth(100, Sizeable.UNITS_PIXELS); loginBtnLabel.addStyleName("loginBtnLabel"); loginBtnLayout.addComponent(loginBtn); loginBtnLayout.addComponent(loginBtnLabel); // landingBtnLayout.addComponent(loginBtnLayout); //horizontal.addComponent(loginBtnLayout); //horizontal.setComponentAlignment(loginBtnLayout, Alignment.TOP_RIGHT); registerBtnLayout = new VerticalLayout(); registerBtnLayout.setSizeUndefined(); registerBtn = new Button("", this); registerBtn.setSizeUndefined(); registerBtn.setHeight(100, Sizeable.UNITS_PIXELS); registerBtn.setWidth(100, Sizeable.UNITS_PIXELS); registerBtn.addStyleName("registerBtn"); registerBtnLabel = new Label("Registrieren"); registerBtnLabel.setWidth(100, Sizeable.UNITS_PIXELS); addStyleName("registerBtnLabel"); registerBtnLayout.addComponent(registerBtn); registerBtnLayout.addComponent(registerBtnLabel); landingBtnLayout.addComponent(registerBtnLayout); passwordForgotBtn = new Button("Passwort vergessen", this); passwordForgotBtn.setEnabled(false); horizontal.addComponent(landingBtnLayout); horizontal.setComponentAlignment(landingBtnLayout, Alignment.TOP_RIGHT); horizontal.setMargin(new MarginInfo(true, true, true, true)); horizontal.setSizeFull(); //vertical.addComponent(passwordForgotBtn); //vertical.setComponentAlignment(passwordForgotBtn, Alignment.MIDDLE_CENTER); logger.debug("LogIn UI erstellt und Listener gesetzt"); vSplitPanel.setFirstComponent(verticalTop); vSplitPanel.setSecondComponent(horizontal); setContent(vSplitPanel); }