Example usage for com.vaadin.ui HorizontalSplitPanel HorizontalSplitPanel

List of usage examples for com.vaadin.ui HorizontalSplitPanel HorizontalSplitPanel

Introduction

In this page you can find the example usage for com.vaadin.ui HorizontalSplitPanel HorizontalSplitPanel.

Prototype

public HorizontalSplitPanel() 

Source Link

Document

Creates an empty horizontal split panel.

Usage

From source file:com.m4gik.views.MainView.java

/**
 * @param root//w w  w. ja v  a2  s. c o  m
 */
private void addSplitPanel(VerticalLayout root) {
    final HorizontalSplitPanel split = new HorizontalSplitPanel();
    split.setStyleName(Runo.SPLITPANEL_REDUCED);
    split.setSplitPosition(1, Sizeable.Unit.PIXELS);
    split.setLocked(true);
    root.addComponent(split);
    root.setExpandRatio(split, 1);

    addPanelLeft(split);
    addPanelRight(split);
}

From source file:com.mcparland.john.AdjustableLayout.java

License:Apache License

/**
 * Create the editor panel./*from   w  w  w . j  ava2  s  . c  o m*/
 * 
 * @return the editor panel.
 */
private Component createEditorPanel() {
    SafeHtml safeHtml = SafeHtmlUtils.fromSafeConstant("<b>Help</b> <br />" + LIPSUM);
    HorizontalSplitPanel editorPanel = new HorizontalSplitPanel();
    RichTextArea editor = new RichTextArea();
    editor.setSizeFull();
    editor.setValue(LIPSUM);
    editorPanel.setFirstComponent(editor);
    editorPanel.setSecondComponent(new Label(safeHtml.asString(), ContentMode.HTML));
    editorPanel.setSplitPosition(80, Unit.PERCENTAGE);
    return editorPanel;
}

From source file:com.mcparland.john.ContactViewer.java

License:Apache License

/**
 * @param contacts/*from   w  w  w . j a v  a  2 s . c  o m*/
 */
public ContactViewer(BeanItemContainer<Contact> contacts) {
    final HorizontalSplitPanel panel = new HorizontalSplitPanel();
    setCompositionRoot(panel);

    final ListSelect contactSelect = new ListSelect();
    contactSelect.setSizeFull();
    contactSelect.setImmediate(true);
    contactSelect.setContainerDataSource(contacts);
    contactSelect.setItemCaptionPropertyId("fullName");

    // Listen for selections
    contactSelect.addValueChangeListener(new ValueChangeListener() {
        /*
         * (non-Javadoc)
         * 
         * @see
         * com.vaadin.data.Property.ValueChangeListener#valueChange(com.
         * vaadin.data.Property.ValueChangeEvent)
         */
        @Override
        public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
            final Contact contact = (Contact) event.getProperty().getValue();
            panel.setSecondComponent(createInfoLabel(contact));
            contactSelect.focus();
        }
    });
    panel.setFirstComponent(contactSelect);
}

From source file:com.mycompany.filmupo.Graficos.java

/**
 * Metodo de inicializacion de la clase/*w  w w  .j  a  va  2  s.  c o  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.ocs.dynamo.ui.composite.layout.BaseSplitLayout.java

License:Apache License

/**
 * Builds the component/*from ww  w.  j  a  v  a 2  s.  co  m*/
 */
@Override
public void build() {
    mainLayout = new DefaultVerticalLayout(true, true);

    HorizontalSplitPanel splitter = null;
    VerticalLayout splitterLayout = null;

    detailLayout = new DefaultVerticalLayout();
    emptyDetailView();

    // optional header
    headerLayout = constructHeaderLayout();
    if (headerLayout != null) {
        mainLayout.addComponent(headerLayout);
    }

    // construct option quick search field
    quickSearchField = constructSearchField();

    // additional quick search field
    if (!isHorizontalMode()) {
        if (quickSearchField != null) {
            mainLayout.addComponent(quickSearchField);
        }
    }

    // table init
    getTableWrapper().getTable().setPageLength(getPageLength());
    getTableWrapper().getTable().setSortEnabled(isSortEnabled());
    constructTableDividers();

    // extra splitter (for horizontal mode)
    if (isHorizontalMode()) {
        splitter = new HorizontalSplitPanel();
        mainLayout.addComponent(splitter);

        splitterLayout = new DefaultVerticalLayout(false, true);
        if (quickSearchField != null) {
            splitterLayout.addComponent(quickSearchField);
        }

        splitterLayout.addComponent(getTableWrapper());
        splitter.setFirstComponent(splitterLayout);
    } else {
        mainLayout.addComponent(getTableWrapper());
    }

    if (isHorizontalMode()) {
        splitterLayout.addComponent(getButtonBar());
    } else {
        mainLayout.addComponent(getButtonBar());
    }

    // create a panel to hold the edit form
    Panel editPanel = new Panel();
    editPanel.setContent(detailLayout);

    if (isHorizontalMode()) {
        // create the layout that is the right part of the splitter
        VerticalLayout extra = new DefaultVerticalLayout(true, false);
        extra.addComponent(editPanel);
        splitter.setSecondComponent(extra);
    } else {
        mainLayout.addComponent(editPanel);
    }

    addButton = constructAddButton();
    if (addButton != null) {
        getButtonBar().addComponent(addButton);
    }

    removeButton = constructRemoveButton();
    if (removeButton != null) {
        registerButton(removeButton);
        getButtonBar().addComponent(removeButton);
    }

    // allow the user to define extra buttons
    postProcessButtonBar(getButtonBar());

    postProcessLayout(mainLayout);

    checkButtonState(null);
    setCompositionRoot(mainLayout);
}

From source file:com.oodrive.nuage.webui.VvrManagerUi.java

License:Apache License

/**
 * Add a VVR user interface./*from   w ww . j  a  v  a  2 s. c o  m*/
 * 
 * @param vvrUuid
 *            the vvr unique identifier
 * 
 */
public final void addVvr(final UUID vvrUuid) {

    // Create a vvr model
    final VvrModel vvrModel = jmxHandler.createVvrModel(vvrUuid);
    vvrModels.put(vvrUuid, vvrModel);

    // Layout for the first component
    final VerticalLayout vvrLayout = new VerticalLayout();
    vvrLayout.setWidth("100%");

    vvrsTabsheet.addTab(vvrLayout, vvrModel.getVvrName(), null, vvrsTabsheet.getComponentCount() - 1);
    vvrLayouts.put(vvrUuid, vvrLayout);

    // Create component for vvr operations
    final VvrOperationComponent op = new VvrOperationComponent(vvrManagerModel);
    final AbstractComponent opComponent = op.createComponent(vvrModel, jmxHandler);
    opComponent.setHeight(opLayoutHeight);
    vvrLayout.addComponent(opComponent);

    final Label label = new Label("&nbsp", ContentMode.HTML);
    label.setHeight(labelLayoutHeight);
    vvrLayout.addComponent(label);
    vvrLayout.addComponent(new Label("<hr />", ContentMode.HTML));

    // Create Tool tip for attributes
    final VvrAttributesComponent attr = new VvrAttributesComponent(vvrUuid);
    vvrsTabsheet.getTab(vvrLayout).setDescription(attr.createComponent(vvrModel));

    // If there was only the + sheet, select the new vvr sheet
    if (vvrsTabsheet.getComponentCount() == 2) {
        vvrsTabsheet.setSelectedTab(0);
    }

    // Create its panel
    final HorizontalSplitPanel panel = new HorizontalSplitPanel();
    vvrLayout.addComponent(panel);
    panel.setWidth("100%");
    panel.setHeight(panelLayoutHeight);
    panel.setSplitPosition(35);

    // Component to display snapshot/device atributes
    final VerticalLayout vvrTreeLayout = new VerticalLayout();
    final VvrTreeComponent vvrTreeComponent = new VvrTreeComponent(vvrTreeLayout);
    panel.setFirstComponent(vvrTreeComponent.createComponent(vvrModel, jmxHandler));
    panel.setSecondComponent(vvrTreeLayout);

    vvrTreeComponents.put(vvrUuid, vvrTreeComponent);
}

From source file:com.parship.roperty.ui.WorkBenchSplitViewUI.java

License:Apache License

@AutoGenerated
private AbsoluteLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new AbsoluteLayout();
    mainLayout.setImmediate(false);//from   w ww.j  av a2s. c  o  m
    mainLayout.setWidth("100%");
    mainLayout.setHeight("100%");

    // top-level component properties
    setWidth("100.0%");
    setHeight("100.0%");

    // splitPanel
    splitPanel = new HorizontalSplitPanel();
    splitPanel.setImmediate(false);
    splitPanel.setWidth("100.0%");
    splitPanel.setHeight("100.0%");
    mainLayout.addComponent(splitPanel, "top:0.0px;right:0.0px;bottom:0.0px;left:0.0px;");

    Roperty r = new Roperty();
    r.set("/key1", "value_1", "desc");
    r.set("/key1/subkey1", "value_1_1", "desc");
    r.set("/key1/subkey2", "value_1_2", "desc");
    r.set("/key1/subkey2/subsub1", "value_1_2_1", "desc");
    r.set("/key1/subkey2/subsub2", "value_1_2_2", "desc");
    r.set("/key1/subkey2/subsub2/subsubsub1", "value_1_2_2_1", "desc");
    r.set("/key2", "value_2", "desc");
    r.set("/key2/subkey1", "value_1_1", "desc");
    r.set("/key2/subkey2", "value_1_2", "desc");
    r.set("plain", "plainValue", "desc");
    r.set("plain/plainsub1", "plainValue_1", "desc");
    r.set("plain/plainsub2", "plainValue_2", "desc");
    r.set("plain/plainsub3", "plainValue_3", "desc");
    Tree tree = new Tree("Properties", new RopertyPropertyTreeContainer(r));
    splitPanel.setFirstComponent(tree);

    return mainLayout;
}

From source file:com.rdonasco.datamanager.view.DataManagerView.java

License:Apache License

@Override
public void initWidget() throws WidgetInitalizeException {
    HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
    splitPanel.setSplitPosition(300f, UNITS_PIXELS);

    getListView().getTable().setDataManager(dataManager);
    refreshData();//from www.j  a  v a 2 s.  c  om
    getListView().setSizeFull();
    splitPanel.setFirstComponent(getListView());

    getDataForm().setSizeFull();
    getDataForm().setDataManager(dataManager);
    getDataForm().setView(this);
    splitPanel.setSecondComponent(getDataForm());

    splitPanel.setSizeFull();
    addComponent(splitPanel);
    setExpandRatio(splitPanel, 1.0f);

    setMargin(false);

    // setup listeners
    getListView().getTable().addListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            displaySelectedRecordInTheForm();
        }
    });
}

From source file:com.saax.gestorweb.view.ChatView.java

/**
 * Chat Pop-Up/*from www . j a  va2 s.c  o  m*/
 *
 */
public ChatView() {
    super();

    setCaption(messages.getString("ChatView.titulo"));
    setModal(true);
    setWidth("80%");
    setHeight("80%");
    setResizable(false);

    VerticalLayout container = new VerticalLayout();
    container.setMargin(true);
    container.setWidth("100%");
    container.setHeight("100%");
    setContent(container);

    userLogged = (Usuario) GestorSession.getAttribute(SessionAttributesEnum.USUARIO_LOGADO);

    HorizontalLayout hlayout = new HorizontalLayout();

    // Have a horizontal split panel as its content
    hsplit = new HorizontalSplitPanel();
    hsplit.setSizeFull();
    // Put a component in the left panel
    hsplit.setFirstComponent(containerUserTable());
    hsplit.getFirstComponent().setWidth("100%");

    // A static variable so that everybody gets the same instance.

    //accordion
    container.addComponent(hsplit);
    accordion = new Accordion();
    accordion.setWidth("100%");
    accordion.addTab(buildAttachTable(), "Anexos", null);
    container.addComponent(accordion);
    //container.addComponent(buildAttachTable());

}

From source file:com.vaushell.treetasker.application.window.UserWindow.java

License:Open Source License

/**
 * Displays the user's view./*  ww  w  . ja va 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);
}