Example usage for com.vaadin.ui HorizontalLayout setExpandRatio

List of usage examples for com.vaadin.ui HorizontalLayout setExpandRatio

Introduction

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

Prototype

public void setExpandRatio(Component component, float ratio) 

Source Link

Document

This method is used to control how excess space in layout is distributed among components.

Usage

From source file:eu.eco2clouds.portal.component.apwizard.TrendWindow.java

License:Apache License

private void render() {

    this.center();
    this.setModal(true);

    HorizontalLayout hl = new HorizontalLayout();
    hl.setSpacing(true);/* w ww.  j  av a  2s  . c  om*/
    hl.setMargin(true);
    hl.setSizeFull();

    final InlineDateField datePicker = new InlineDateField();
    datePicker.setValue(new Date());
    datePicker.setImmediate(true);
    datePicker.setTimeZone(TimeZone.getTimeZone("UTC"));
    datePicker.setLocale(Locale.US);
    datePicker.setResolution(Resolution.MINUTE);
    hl.addComponent(datePicker);

    this.chart = new CO2PredictionChart();
    chart.update(new Date(), fr_power, uk_power, de_power, duration);

    datePicker.addValueChangeListener(new ValueChangeListener() {
        @Override
        public void valueChange(final ValueChangeEvent event) {
            chart.update(datePicker.getValue(), fr_power, uk_power, de_power, duration);
        }
    });

    chart.addListener(new Timeline.EventClickListener() {

        @Override
        public void eventClick(Timeline.EventButtonClickEvent event) {
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }
    });

    hl.addComponent(this.chart);

    hl.setComponentAlignment(datePicker, Alignment.TOP_LEFT);
    hl.setComponentAlignment(chart, Alignment.TOP_LEFT);
    hl.setExpandRatio(datePicker, 1.0f);
    hl.setExpandRatio(chart, 3.0f);

    this.setContent(hl);
}

From source file:eu.eco2clouds.portal.page.APWizardLayout.java

License:Apache License

private void render() {

    this.setSpacing(true);
    this.setMargin(true);
    this.setSizeFull();

    HorizontalLayout hl = new HorizontalLayout();
    hl.setSpacing(true);//from   www.  ja  v a2s  .  com
    hl.setMargin(false);
    hl.setSizeFull();
    menu = new APWizardMenu(this);

    hl.addComponent(menu);
    hl.addComponent(aptext);
    hl.setExpandRatio(menu, 1.0f);

    this.addComponent(hl);

    Label space = new Label("");
    this.addComponent(space);
    Label version = new Label("<hr/>ECO2Clouds Portal v." + E2CPortal.VERSION
            + " - (c) ECO2Clouds project 2012-2014 (<a href='http://www.eco2clouds.eu' target='_blank'>http://www.eco2clouds.eu</a>)",
            ContentMode.HTML);
    this.addComponent(version);

    this.setExpandRatio(hl, 1.0f);

}

From source file:eu.lod2.stat.dsdrepo.DSDRepoComponent.java

public DSDRepoComponent(Repository repository, String dataGraph, String repoGraph) {
    this.repository = repository;
    this.dataGraph = dataGraph;
    this.repoGraph = repoGraph;

    initializeRepoGraph();/*from www.j  a  v a 2  s .  c  o m*/

    dcRepo = new SparqlDCRepository(repository);
    graph = new SparqlDCGraph(repository, dataGraph);

    setSizeFull();
    VerticalLayout rootLayout = new VerticalLayout();
    rootLayout.setSizeFull();
    rootLayout.setSpacing(true);
    setDebugId("dsd-repo");

    mainLayout = new VerticalLayout();
    mainLayout.setSizeUndefined();
    mainLayout.setWidth("100%");
    //        mainLayout.setHeight("800px");
    mainLayout.setSpacing(true);

    HorizontalLayout menuLayout = new HorizontalLayout();
    menuLayout.setSpacing(true);
    menuLayout.setWidth("100%");
    rootLayout.addComponent(menuLayout);
    rootLayout.setExpandRatio(menuLayout, 0.0f);

    final MenuBar menu = new MenuBar();
    menu.addStyleName("dsd");
    cmdFindDSD = new MenuBar.Command() {
        public void menuSelected(MenuBar.MenuItem selectedItem) {
            for (MenuBar.MenuItem item : menu.getItems()) {
                if (item == selectedItem) {
                    if (!item.getStyleName().contains("selected")) {
                        if (ds != null)
                            item.setStyleName("selected");
                        findDSDs();
                    }
                } else
                    item.setStyleName("bleja");
            }
        }
    };
    menu.addItem("Find Suitable DSDs", cmdFindDSD).setStyleName("bleja");
    cmdCreateDSD = new MenuBar.Command() {
        public void menuSelected(MenuBar.MenuItem selectedItem) {
            for (MenuBar.MenuItem item : menu.getItems()) {
                if (item == selectedItem) {
                    if (!item.getStyleName().contains("selected")) {
                        if (ds != null)
                            item.setStyleName("selected");
                        createDSD();
                    }
                } else
                    item.setStyleName("bleja");
            }
        }
    };
    menu.addItem("Create DSD", cmdCreateDSD).setStyleName("bleja");
    cmdStoreDSD = new MenuBar.Command() {
        public void menuSelected(MenuBar.MenuItem selectedItem) {
            for (MenuBar.MenuItem item : menu.getItems()) {
                if (item == selectedItem) {
                    if (!item.getStyleName().contains("selected")) {
                        if (ds != null)
                            item.setStyleName("selected");
                        storeDSD();
                    }
                } else
                    item.setStyleName("bleja");
            }
        }
    };
    menu.addItem("Store DSD", cmdStoreDSD).setStyleName("bleja");

    menuLayout.addComponent(menu);
    Label spaceLbl = new Label("");
    menuLayout.addComponent(spaceLbl);
    menuLayout.setExpandRatio(spaceLbl, 2.0f);
    Label lbl = new Label("Choose dataset: ");
    lbl.setSizeUndefined();
    menuLayout.addComponent(lbl);

    Collection<DataSet> colDataSets = graph.getDataSets();
    if (colDataSets == null)
        colDataSets = new LinkedList<DataSet>();
    selectDataSet = new ComboBox(null, colDataSets);
    selectDataSet.setImmediate(true);
    selectDataSet.setNewItemsAllowed(false);
    selectDataSet.setNullSelectionAllowed(false);
    selectDataSet.setWidth("300px");
    selectDataSet.addListener(new Property.ValueChangeListener() {
        public void valueChange(Property.ValueChangeEvent event) {
            ds = (DataSet) event.getProperty().getValue();
        }
    });
    menuLayout.addComponent(selectDataSet);

    Panel mainPanel = new Panel(mainLayout);
    mainPanel.setSizeFull();
    mainPanel.setScrollable(true);
    mainPanel.setStyleName(Reindeer.PANEL_LIGHT);

    Label hrLabel = new Label("<hr/>", Label.CONTENT_XHTML);
    rootLayout.addComponent(hrLabel);
    rootLayout.setExpandRatio(hrLabel, 0.0f);
    rootLayout.addComponent(mainPanel);
    rootLayout.setExpandRatio(mainPanel, 2.0f);
    rootLayout.setMargin(true, false, true, false);

    setCompositionRoot(rootLayout);
}

From source file:fi.jasoft.draganddrop.DemoUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {

    Panel showcase = new Panel();
    showcase.setSizeUndefined();/*from w w w.  j a v a  2 s . co  m*/

    navigator = new Navigator(this, showcase);

    for (DemoView view : views) {
        navigator.addView(view.getViewPath(), view);
    }

    // default
    openView(views.get(0));

    MenuBar demos = new MenuBar();
    demos.setStyleName(ValoTheme.MENUBAR_BORDERLESS);

    for (final DemoView view : views) {
        demos.addItem(view.getViewCaption(), new Command() {

            @Override
            public void menuSelected(MenuItem selectedItem) {
                openView(view);
            }
        });
    }

    VerticalLayout root = new VerticalLayout(demos, showcase);
    root.setSizeFull();
    root.setExpandRatio(showcase, 1);
    root.setComponentAlignment(showcase, Alignment.MIDDLE_CENTER);
    setContent(root);

    HorizontalLayout sourceWrapperLayout = new HorizontalLayout();
    Label caption = new Label("Source code for example");
    caption.setStyleName("source-caption");
    sourceWrapperLayout.addComponent(caption);

    Panel sourceWrapper = new Panel(codeLabel);
    sourceWrapper.setStyleName(ValoTheme.PANEL_BORDERLESS);
    sourceWrapper.setHeight(getPage().getBrowserWindowHeight() + "px");
    sourceWrapperLayout.addComponent(sourceWrapper);
    sourceWrapperLayout.setExpandRatio(sourceWrapper, 1);

    Toolbox sourceBox = new Toolbox();
    sourceBox.setOrientation(ORIENTATION.RIGHT_CENTER);
    sourceBox.setContent(sourceWrapperLayout);
    sourceBox.setOverflowSize(30);
    root.addComponent(sourceBox);
}

From source file:fi.jasoft.dragdroplayouts.demo.DemoUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {

    VerticalLayout content = new VerticalLayout();
    content.setSizeFull();//  www .j  a v a 2s.c o m
    setContent(content);

    Label header = new Label("DragDropLayouts for Vaadin 8");
    header.setStyleName(ValoTheme.LABEL_H1);
    content.addComponent(header);

    HorizontalLayout hl = new HorizontalLayout();
    hl.setSizeFull();
    content.addComponent(hl);
    content.setExpandRatio(hl, 1);

    VerticalSplitPanel split = new VerticalSplitPanel();
    hl.addComponent(split);
    hl.setExpandRatio(split, 1);

    CssLayout placeHolder = new CssLayout(new Label("No view selected."));
    placeHolder.setSizeFull();
    split.setFirstComponent(placeHolder);

    Panel codePanel = new Panel(codeLabel);
    codePanel.setSizeFull();
    split.setSecondComponent(codePanel);

    navigator = new Navigator(this, placeHolder);

    navigator.addViewChangeListener(new ViewChangeListener() {

        @Override
        public boolean beforeViewChange(ViewChangeEvent event) {
            DemoView view = (DemoView) event.getNewView();
            selection.getSelectionModel().select(view);
            codeLabel.setValue(getFormattedSourceCode(view.getSource()));
            return true;
        }

        @Override
        public void afterViewChange(ViewChangeEvent event) {
            // TODO Auto-generated method stub

        }
    });

    try {
        addView(new DragdropAbsoluteLayoutDemo(navigator));
        addView(new DragdropVerticalLayoutDemo(navigator));
        addView(new DragdropHorizontalLayoutDemo(navigator));
        addView(new DragdropGridLayoutDemo(navigator));
        addView(new DragdropCssLayoutDemo(navigator));
        addView(new DragdropFormLayoutDemo(navigator));
        addView(new DragdropPanelDemo(navigator));

        addView(new DragdropLayoutDraggingDemo(navigator));
        addView(new DragdropHorizontalSplitPanelDemo(navigator));
        addView(new DragdropVerticalSplitPanelDemo(navigator));
        addView(new DragdropTabsheetDemo(navigator));
        addView(new DragdropAccordionDemo(navigator));

        addView(new DragdropDragFilterDemo(navigator));
        addView(new DragdropCaptionModeDemo(navigator));

        addView(new DragdropV7VerticalLayoutDemo(navigator));
        addView(new DragdropV7HorizontalLayoutDemo(navigator));

        // addView(new DragdropIframeDragging(navigator));

    } catch (Exception e) {
        e.printStackTrace();
        return;
    }

    hl.addComponent(selection = createViewSelection(), 0);

    String fragment = Page.getCurrent().getUriFragment();
    if (fragment == null || fragment.equals("")) {
        navigator.navigateTo(DragdropAbsoluteLayoutDemo.NAME);
    }
}

From source file:fi.jasoft.dragdroplayouts.demo.views.DragdropHorizontalSplitPanelDemo.java

License:Apache License

@Override
public Component getLayout() {
    // start-source
    CssLayout root = new CssLayout();
    root.setSizeFull();// w w w.j ava2 s . co  m

    Label lbl = new Label("To the left are some buttons, and to the right is a horizontal split panel. "
            + "Try dragging the buttons on to the splitpanel. If a component already exists in the SplitPanel it is replaced with the dragged one.");
    root.addComponent(lbl);

    // Wrapping components in a horizontal layout
    HorizontalLayout inner = new HorizontalLayout();
    inner.setMargin(true);
    inner.setSizeFull();
    inner.setSpacing(true);
    root.addComponent(inner);

    // Add some buttons to a vertical layout with dragging enabled
    final DDVerticalLayout btns = new DDVerticalLayout();
    btns.setDragMode(LayoutDragMode.CLONE);
    btns.setSizeUndefined();
    btns.setSpacing(true);
    String caption = "Button ";
    btns.addComponent(new Button(caption + buttonCount++));
    btns.addComponent(new Button(caption + buttonCount++));
    btns.addComponent(new Button(caption + buttonCount++));
    btns.addComponent(new Button(caption + buttonCount++));
    btns.addComponent(new Button(caption + buttonCount++));
    inner.addComponent(btns);

    // Create a drag & drop horizontal split panel
    final DDHorizontalSplitPanel panel = new DDHorizontalSplitPanel();
    panel.setSizeFull();

    inner.addComponent(panel);
    inner.setExpandRatio(panel, 1);

    // Enable dragging
    panel.setDragMode(LayoutDragMode.CLONE);

    // Enable dropping
    panel.setDropHandler(new DefaultHorizontalSplitPanelDropHandler());

    // end-source
    return root;
}

From source file:fi.jasoft.remoteconnection.ServerExampleUI.java

License:Apache License

private void buildUI() {
    FormLayout vl = new FormLayout();
    setContent(vl);/* w  w  w .j a v  a  2s  .com*/

    // Our id
    myId = new Label("Connecting...");
    myId.setCaption("My id:");
    vl.addComponent(myId);

    // Remote id
    final TextField remoteId = new TextField();
    remoteId.setWidth("100%");
    NativeButton connectToRemote = new NativeButton("Connect", new Button.ClickListener() {

        @Override
        public void buttonClick(final ClickEvent event) {
            final RemoteChannel channel = peer.openChannel(remoteId.getValue());
            channel.addConnectedListener(new ConnectedListener() {

                @Override
                public void connected(String channelId) {
                    remoteId.setReadOnly(true);
                    event.getButton().setVisible(false);
                    Notification.show("Connected to " + channelId, Type.TRAY_NOTIFICATION);
                }
            });
        }
    });

    HorizontalLayout hl = new HorizontalLayout(remoteId, connectToRemote);
    hl.setExpandRatio(remoteId, 1);
    hl.setWidth("100%");
    hl.setCaption("Remote id: ");
    vl.addComponent(hl);

    // Message display where messages are displayed
    messages = new TextArea();
    messages.setWidth("100%");
    vl.addComponent(messages);

    // Message field
    final TextField message = new TextField();
    message.setWidth("100%");
    NativeButton send = new NativeButton("Send", new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {

            // Show message in message window
            messages.setValue(
                    messages.getValue() + peer.getConfiguration().getId() + " >> " + message.getValue() + "\n");

            // Broadcast the message to all connected peers
            peer.broadcast(message.getValue());

            message.setValue("");
        }
    });

    hl = new HorizontalLayout(message, send);
    hl.setExpandRatio(message, 1);
    hl.setWidth("100%");
    hl.setCaption("Send message: ");
    vl.addComponent(hl);
}

From source file:fi.jasoft.simplecalendar.demo.SimpleCalendarDemoUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {

    setLocale(DEFAULT_LOCALE);//w w  w . jav  a2  s. c o  m

    VerticalLayout content = new VerticalLayout();
    content.setMargin(true);
    content.setSpacing(true);

    Label lbl = new Label("SimpleCalendar");
    lbl.setStyleName(Reindeer.LABEL_H1);
    content.addComponent(lbl);

    HorizontalLayout layout = new HorizontalLayout();
    layout.setWidth("100%");
    layout.setSpacing(true);

    final SimpleCalendar calendar = new SimpleCalendar();
    calendar.setImmediate(true);
    calendar.addValueChangeListener(new Property.ValueChangeListener() {
        public void valueChange(ValueChangeEvent event) {
            Notification.show(calendar.getValue().toString());
        }
    });

    calendar.setMultiSelect(true);

    layout.addComponent(calendar);

    Label description = new Label("A calendar component that supports the following features:<ul>"
            + "<li>Selecting multiple dates by control click</li>" + "<li>Range selection with shift click</li>"
            + "<li>Keyboard navigation with arrow keys</li>" + "<li>Possibility to disable certain dates</li>"
            + "<li>Date tooltips</li>" + "<li>Limit start and end dates of calendar</li>"
            + "<li>Selecting multiple locales", ContentMode.HTML);
    layout.addComponent(description);
    layout.setExpandRatio(description, 1);

    content.addComponent(layout);

    BeanItemContainer<Locale> locales = new BeanItemContainer<Locale>(Locale.class);
    locales.addAll(Arrays.asList(Locale.getAvailableLocales()));

    NativeSelect localeSelect = new NativeSelect();
    localeSelect.setContainerDataSource(locales);
    localeSelect.setValue(DEFAULT_LOCALE);
    localeSelect.setImmediate(true);
    localeSelect.setItemCaptionMode(ItemCaptionMode.PROPERTY);
    localeSelect.setItemCaptionPropertyId("displayName");
    localeSelect.addValueChangeListener(new Property.ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            calendar.setLocale((Locale) event.getProperty().getValue());
        }
    });
    content.addComponent(new HorizontalLayout(new Label("Locale:"), localeSelect));

    final CheckBox disableWeekends = new CheckBox("Disable weekends", false);
    disableWeekends.setImmediate(true);
    disableWeekends.addValueChangeListener(new Property.ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            if (disableWeekends.getValue()) {
                calendar.setDisabledWeekDays(Weekday.SATURDAY, Weekday.SUNDAY);
            } else {
                calendar.setDisabledWeekDays();
            }
        }
    });
    content.addComponent(disableWeekends);

    final CheckBox disable15th = new CheckBox("Disable 15th each month", false);
    disable15th.setImmediate(true);
    disable15th.addValueChangeListener(new Property.ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            if (disable15th.getValue()) {
                calendar.setDisabledMonthlyDates(15);
            } else {
                calendar.setDisabledMonthlyDates();
            }
        }
    });
    content.addComponent(disable15th);

    final CheckBox disableToday = new CheckBox("Disable todays date", false);
    disableToday.setImmediate(true);
    disableToday.addValueChangeListener(new Property.ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            if (disableToday.getValue()) {
                calendar.setDisabledDates(new Date());
            } else {
                calendar.setDisabledDates();
            }
        }
    });
    content.addComponent(disableToday);

    final CheckBox allowFutureDate = new CheckBox("Only allow future dates", false);
    allowFutureDate.setImmediate(true);
    allowFutureDate.addValueChangeListener(new Property.ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            if (allowFutureDate.getValue()) {
                calendar.setStartDate(new Date());
            } else {
                calendar.setStartDate(null);
            }
        }
    });
    content.addComponent(allowFutureDate);

    final CheckBox allowPastDate = new CheckBox("Only allow past dates", false);
    allowPastDate.setImmediate(true);
    allowPastDate.addValueChangeListener(new Property.ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            if (allowPastDate.getValue()) {
                calendar.setEndDate(new Date());
            } else {
                calendar.setEndDate(null);
            }
        }
    });
    content.addComponent(allowPastDate);

    setContent(content);
}

From source file:fi.semantum.strategia.Main.java

License:Open Source License

@Override
protected void init(VaadinRequest request) {

    getPage().addUriFragmentChangedListener(new UriFragmentChangedListener() {
        public void uriFragmentChanged(UriFragmentChangedEvent source) {
            applyFragment(source.getUriFragment(), true);
        }/*from  www.j  a v a  2 s  .  c  om*/
    });

    String pathInfo = request.getPathInfo();
    if (pathInfo.startsWith("/"))
        pathInfo = pathInfo.substring(1);
    if (pathInfo.endsWith("/"))
        pathInfo = pathInfo.substring(0, pathInfo.length() - 1);

    String databaseId = validatePathInfo(pathInfo);

    setWindowWidth(Page.getCurrent().getBrowserWindowWidth(), Page.getCurrent().getBrowserWindowHeight());

    // Find the application directory
    String basepath = VaadinService.getCurrent().getBaseDirectory().getAbsolutePath();

    // Image as a file resource
    redResource = new FileResource(new File(basepath + "/WEB-INF/images/bullet_red.png"));
    greenResource = new FileResource(new File(basepath + "/WEB-INF/images/bullet_green.png"));
    blackResource = new FileResource(new File(basepath + "/WEB-INF/images/bullet_black.png"));
    mapMagnify = new FileResource(new File(basepath + "/WEB-INF/images/map_magnify.png"));

    abs = new AbsoluteLayout();

    final VerticalLayout vs = new VerticalLayout();
    vs.setSizeFull();

    abs.addComponent(vs);
    setContent(abs);

    // This will set the login cookie
    Wiki.login(this);

    // Make sure that the printing directory exists
    new File(Main.baseDirectory(), "printing").mkdirs();

    database = Database.load(this, databaseId);
    database.getOrCreateTag("Tavoite");
    database.getOrCreateTag("Painopiste");

    for (Strategiakartta map : Strategiakartta.enumerate(database)) {
        Strategiakartta parent = map.getPossibleParent(database);
        if (parent == null)
            uiState.setCurrentMap(parent);
    }

    if (uiState.getCurrentMap() == null)
        uiState.setCurrentMap(database.getRoot());

    uiState.currentPosition = uiState.getCurrentMap();

    uiState.currentItem = uiState.getCurrentMap();

    setPollInterval(10000);

    addPollListener(new PollListener() {

        @Override
        public void poll(PollEvent event) {

            if (database.checkChanges()) {
                String curr = uiState.getCurrentMap().uuid;
                database = Database.load(Main.this, database.getDatabaseId());
                uiState.setCurrentMap((Strategiakartta) database.find(curr));
                Updates.updateJS(Main.this, false);
            }

        }

    });

    js.addListener(new MapListener(this, false));
    js2.addListener(new MapListener(this, true));

    browser_.addListener(new BrowserListener() {

        @Override
        public void select(double x, double y, String uuid) {
            Base b = database.find(uuid);
            Actions.selectAction(Main.this, x, y, null, b);
        }

        @Override
        public void save(String name, Map<String, BrowserNodeState> states) {

            UIState state = getUIState().duplicate(name);
            state.browserStates = states;

            account.uiStates.add(state);

            Updates.update(Main.this, true);

        }

    });

    Page.getCurrent().addBrowserWindowResizeListener(new BrowserWindowResizeListener() {

        @Override
        public void browserWindowResized(BrowserWindowResizeEvent event) {
            setWindowWidth(event.getWidth(), event.getHeight());
            Updates.updateJS(Main.this, false);
        }
    });

    modeLabel = new Label("Katselutila");
    modeLabel.setWidth("95px");
    modeLabel.addStyleName("viewMode");

    mode = new Button();
    mode.setDescription("Siirry tiedon sytttilaan");
    mode.setIcon(FontAwesome.EYE);
    mode.addStyleName(ValoTheme.BUTTON_TINY);

    mode.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {

            if ("Siirry tiedon sytttilaan".equals(mode.getDescription())) {

                mode.setDescription("Siirry katselutilaan");
                mode.setIcon(FontAwesome.PENCIL);
                modeLabel.setValue("Sytttila");
                modeLabel.removeStyleName("viewMode");
                modeLabel.addStyleName("editMode");

                UIState s = uiState.duplicate(Main.this);
                s.input = true;
                setFragment(s, true);

            } else {

                mode.setDescription("Siirry tiedon sytttilaan");
                mode.setIcon(FontAwesome.EYE);
                modeLabel.setValue("Katselutila");
                modeLabel.removeStyleName("editMode");
                modeLabel.addStyleName("viewMode");

                UIState s = uiState.duplicate(Main.this);
                s.input = false;
                setFragment(s, true);

            }

        }

    });

    meterMode = new Button();
    meterMode.setDescription("Vaihda toteumamittareihin");
    meterMode.setCaption("Ennuste");
    meterMode.addStyleName(ValoTheme.BUTTON_TINY);

    meterMode.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {

            if ("Vaihda toteumamittareihin".equals(meterMode.getDescription())) {

                meterMode.setDescription("Vaihda ennustemittareihin");
                meterMode.setCaption("Toteuma");

                UIState s = uiState.duplicate(Main.this);
                s.setActualMeters();
                setFragment(s, true);

            } else {

                meterMode.setDescription("Vaihda toteumamittareihin");
                meterMode.setCaption("Ennuste");

                UIState s = uiState.duplicate(Main.this);
                s.setForecastMeters();
                setFragment(s, true);

            }

        }

    });

    pdf = new PDFButton();
    pdf.setDescription("Tallenna kartta PDF-muodossa");
    pdf.setIcon(FontAwesome.PRINT);
    pdf.addStyleName(ValoTheme.BUTTON_TINY);

    pdf.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {

            Utils.print(Main.this);

        }

    });

    propertyExcelButton = new Button();
    propertyExcelButton.setDescription("Tallenna tiedot Excel-tiedostona");
    propertyExcelButton.setIcon(FontAwesome.PRINT);
    propertyExcelButton.addStyleName(ValoTheme.BUTTON_TINY);

    OnDemandFileDownloader dl = new OnDemandFileDownloader(new OnDemandStreamSource() {

        private static final long serialVersionUID = 981769438054780731L;

        File f;
        Date date = new Date();

        @Override
        public InputStream getStream() {

            String uuid = UUID.randomUUID().toString();
            File printing = new File(Main.baseDirectory(), "printing");
            f = new File(printing, uuid + ".xlsx");

            Workbook w = new XSSFWorkbook();
            Sheet sheet = w.createSheet("Sheet1");
            int row = 1;
            for (List<String> cells : propertyCells) {
                Row r = sheet.createRow(row++);
                for (int i = 0; i < cells.size(); i++) {
                    String value = cells.get(i);
                    r.createCell(i).setCellValue(value);
                }
            }

            try {
                FileOutputStream s = new FileOutputStream(f);
                w.write(s);
                s.close();
            } catch (Exception e) {
                e.printStackTrace();
            }

            try {
                return new FileInputStream(f);
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }

            throw new IllegalStateException();

        }

        @Override
        public void onRequest() {
        }

        @Override
        public long getFileSize() {
            return f.length();
        }

        @Override
        public String getFileName() {
            return "Strategiakartta_" + Utils.dateString(date) + ".xlsx";
        }

    });

    dl.getResource().setCacheTime(0);
    dl.extend(propertyExcelButton);

    states = new ComboBox();
    states.setWidth("250px");
    states.addStyleName(ValoTheme.COMBOBOX_TINY);
    states.setInvalidAllowed(false);
    states.setNullSelectionAllowed(false);

    states.addValueChangeListener(statesListener);

    saveState = new Button();
    saveState.setEnabled(false);
    saveState.setDescription("Tallenna nykyinen nkym");
    saveState.setIcon(FontAwesome.BOOKMARK);
    saveState.addStyleName(ValoTheme.BUTTON_TINY);
    saveState.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            Utils.saveCurrentState(Main.this);
        }

    });

    class SearchTextField extends TextField {
        public boolean hasFocus = false;
    }

    final SearchTextField search = new SearchTextField();
    search.setWidth("100%");
    search.addStyleName(ValoTheme.TEXTFIELD_TINY);
    search.addStyleName(ValoTheme.TEXTFIELD_BORDERLESS);
    search.setInputPrompt("hae vapaasanahaulla valitun asian alta");
    search.setId("searchTextField");
    search.addShortcutListener(new ShortcutListener("Shortcut Name", ShortcutAction.KeyCode.ENTER, null) {
        @Override
        public void handleAction(Object sender, Object target) {

            if (!search.hasFocus)
                return;

            String text = search.getValue().toLowerCase();
            try {

                Map<String, String> content = new HashMap<String, String>();
                List<String> hits = Lucene.search(database.getDatabaseId(), text + "*");
                for (String uuid : hits) {
                    Base b = database.find(uuid);
                    if (b != null) {
                        String report = "";
                        Map<String, String> map = b.searchMap(database);
                        for (Map.Entry<String, String> e : map.entrySet()) {
                            if (e.getValue().contains(text)) {
                                if (!report.isEmpty())
                                    report += ", ";
                                report += e.getKey();
                            }
                        }
                        if (!report.isEmpty())
                            content.put(uuid, report);
                    }
                }

                uiState.setCurrentFilter(new SearchFilter(Main.this, content));

                Updates.updateJS(Main.this, false);

                switchToBrowser();

            } catch (IOException e) {
                e.printStackTrace();
            }

        }
    });
    search.addFocusListener(new FocusListener() {

        @Override
        public void focus(FocusEvent event) {
            search.hasFocus = true;
        }
    });
    search.addBlurListener(new BlurListener() {

        @Override
        public void blur(BlurEvent event) {
            search.hasFocus = false;
        }
    });

    hallinnoi = new Button("Hallinnoi");
    hallinnoi.setWidthUndefined();
    hallinnoi.setVisible(false);
    hallinnoi.addStyleName(ValoTheme.BUTTON_TINY);
    hallinnoi.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            if (account != null) {
                if (account.isAdmin()) {
                    Utils.manage(Main.this);
                }
            }
        }

    });

    tili = new Button("Kyttjtili");
    tili.setWidthUndefined();
    tili.setVisible(false);
    tili.addStyleName(ValoTheme.BUTTON_TINY);
    tili.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            if (account != null) {
                Utils.modifyAccount(Main.this);
            }
        }

    });

    duplicate = new Button("Avaa ikkunassa");
    duplicate2 = new Button("Avaa alas");

    duplicate.setWidthUndefined();
    duplicate.addStyleName(ValoTheme.BUTTON_TINY);
    duplicate.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {

            MapVis model = js2.getModel();
            if (model == null) {

                UIState s = uiState.duplicate(Main.this);
                s.reference = s.current;

                mapDialog = new Window(s.reference.getText(database), new VerticalLayout());
                mapDialog.setWidth(dialogWidth());
                mapDialog.setHeight(dialogHeight());
                mapDialog.setResizable(true);
                mapDialog.setContent(js2Container);
                mapDialog.setVisible(true);
                mapDialog.setResizeLazy(false);
                mapDialog.addCloseListener(new CloseListener() {

                    @Override
                    public void windowClose(CloseEvent e) {

                        duplicate.setCaption("Avaa ikkunassa");
                        duplicate2.setVisible(true);

                        UIState s = uiState.duplicate(Main.this);
                        mapDialog.close();
                        mapDialog = null;
                        s.reference = null;
                        setFragment(s, true);

                    }

                });
                mapDialog.addResizeListener(new ResizeListener() {

                    @Override
                    public void windowResized(ResizeEvent e) {
                        Updates.updateJS(Main.this, false);
                    }

                });

                setFragment(s, true);

                addWindow(mapDialog);

                duplicate.setCaption("Sulje referenssi");
                duplicate2.setVisible(false);

            } else {

                UIState s = uiState.duplicate(Main.this);
                if (mapDialog != null) {
                    mapDialog.close();
                    mapDialog = null;
                }

                panelLayout.removeComponent(js2Container);

                s.reference = null;
                setFragment(s, true);

                duplicate.setCaption("Avaa ikkunassa");
                duplicate2.setVisible(true);

            }

        }

    });

    duplicate2.setWidthUndefined();
    duplicate2.addStyleName(ValoTheme.BUTTON_TINY);
    duplicate2.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {

            MapVis model = js2.getModel();
            assert (model == null);

            UIState s = uiState.duplicate(Main.this);
            s.reference = s.current;
            setFragment(s, true);

            panelLayout.addComponent(js2Container);

            duplicate.setCaption("Sulje referenssi");
            duplicate2.setVisible(false);

        }

    });

    login = new Button("Kirjaudu");
    login.setWidthUndefined();
    login.addStyleName(ValoTheme.BUTTON_TINY);
    login.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            if (account != null) {
                account = null;
                hallinnoi.setVisible(false);
                tili.setVisible(false);
                Updates.update(Main.this, true);
                login.setCaption("Kirjaudu");
            } else {
                Login.login(Main.this);
            }
        }

    });

    times = new ComboBox();
    times.setWidth("130px");
    times.addStyleName(ValoTheme.COMBOBOX_SMALL);
    times.addItem(Property.AIKAVALI_KAIKKI);
    times.addItem("2016");
    times.addItem("2017");
    times.addItem("2018");
    times.addItem("2019");
    times.select("2016");
    times.setInvalidAllowed(false);
    times.setNullSelectionAllowed(false);

    times.addValueChangeListener(timesListener);

    final HorizontalLayout hl0 = new HorizontalLayout();
    hl0.setWidth("100%");
    hl0.setHeight("32px");
    hl0.setSpacing(true);

    hl0.addComponent(pdf);
    hl0.setComponentAlignment(pdf, Alignment.MIDDLE_LEFT);
    hl0.setExpandRatio(pdf, 0.0f);

    hl0.addComponent(propertyExcelButton);
    hl0.setComponentAlignment(propertyExcelButton, Alignment.MIDDLE_LEFT);
    hl0.setExpandRatio(propertyExcelButton, 0.0f);

    hl0.addComponent(states);
    hl0.setComponentAlignment(states, Alignment.MIDDLE_LEFT);
    hl0.setExpandRatio(states, 0.0f);

    hl0.addComponent(saveState);
    hl0.setComponentAlignment(saveState, Alignment.MIDDLE_LEFT);
    hl0.setExpandRatio(saveState, 0.0f);

    hl0.addComponent(times);
    hl0.setComponentAlignment(times, Alignment.MIDDLE_LEFT);
    hl0.setExpandRatio(times, 0.0f);

    hl0.addComponent(search);
    hl0.setComponentAlignment(search, Alignment.MIDDLE_LEFT);
    hl0.setExpandRatio(search, 1.0f);

    hl0.addComponent(modeLabel);
    hl0.setComponentAlignment(modeLabel, Alignment.MIDDLE_LEFT);
    hl0.setExpandRatio(modeLabel, 0.0f);

    hl0.addComponent(mode);
    hl0.setComponentAlignment(mode, Alignment.MIDDLE_LEFT);
    hl0.setExpandRatio(mode, 0.0f);

    hl0.addComponent(meterMode);
    hl0.setComponentAlignment(meterMode, Alignment.MIDDLE_LEFT);
    hl0.setExpandRatio(meterMode, 0.0f);

    hl0.addComponent(hallinnoi);
    hl0.setComponentAlignment(hallinnoi, Alignment.MIDDLE_LEFT);
    hl0.setExpandRatio(hallinnoi, 0.0f);

    hl0.addComponent(tili);
    hl0.setComponentAlignment(tili, Alignment.MIDDLE_LEFT);
    hl0.setExpandRatio(tili, 0.0f);

    hl0.addComponent(duplicate);
    hl0.setComponentAlignment(duplicate, Alignment.MIDDLE_LEFT);
    hl0.setExpandRatio(duplicate, 0.0f);

    hl0.addComponent(duplicate2);
    hl0.setComponentAlignment(duplicate2, Alignment.MIDDLE_LEFT);
    hl0.setExpandRatio(duplicate2, 0.0f);

    hl0.addComponent(login);
    hl0.setComponentAlignment(login, Alignment.MIDDLE_LEFT);
    hl0.setExpandRatio(login, 0.0f);

    propertiesPanel = new Panel();
    propertiesPanel.setSizeFull();

    properties = new VerticalLayout();
    properties.setSpacing(true);
    properties.setMargin(true);

    propertiesPanel.setContent(properties);
    propertiesPanel.setVisible(false);

    tags = new VerticalLayout();
    tags.setSpacing(true);
    Updates.updateTags(this);

    AbsoluteLayout tabs = new AbsoluteLayout();
    tabs.setSizeFull();

    {
        panel = new Panel();
        panel.addStyleName(ValoTheme.PANEL_BORDERLESS);
        panel.setSizeFull();
        panel.setId("mapContainer1");
        panelLayout = new VerticalLayout();
        panelLayout.addComponent(js);
        panelLayout.setHeight("100%");

        js2Container = new VerticalLayout();
        js2Container.setHeight("100%");
        js2Container.addComponent(new Label("<hr />", ContentMode.HTML));
        js2Container.addComponent(js2);

        panel.setContent(panelLayout);
        tabs.addComponent(panel);
    }

    wiki = new BrowserFrame();
    wiki.setSource(new ExternalResource(Wiki.wikiAddress() + "/"));
    wiki.setWidth("100%");
    wiki.setHeight("100%");

    {

        wiki_ = new VerticalLayout();
        wiki_.setSizeFull();
        Button b = new Button("Palaa sovellukseen");
        b.setWidth("100%");
        b.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                applyFragment(backFragment, true);
                String content = Wiki.get(wikiPage);
                if (content == null)
                    return;
                int first = content.indexOf("<rev contentformat");
                if (first == -1)
                    return;
                content = content.substring(first);
                int term = content.indexOf(">");
                content = content.substring(term + 1);
                int end = content.indexOf("</rev>");
                content = content.substring(0, end);
                if (wikiBase.modifyMarkup(Main.this, content)) {
                    Updates.update(Main.this, true);
                }
            }
        });
        wiki_.addComponent(b);
        wiki_.addComponent(wiki);
        wiki_.setVisible(false);

        wiki_.setExpandRatio(b, 0.0f);
        wiki_.setExpandRatio(wiki, 1.0f);

        tabs.addComponent(wiki_);

    }

    hs = new HorizontalSplitPanel();
    hs.setSplitPosition(0, Unit.PIXELS);
    hs.setHeight("100%");
    hs.setWidth("100%");

    browser = new VerticalLayout();
    browser.setSizeFull();

    HorizontalLayout browserWidgets = new HorizontalLayout();
    browserWidgets.setWidth("100%");

    hori = new Button();
    hori.setDescription("Nyt asiat taulukkona");
    hori.setEnabled(true);
    hori.setIcon(FontAwesome.ARROW_RIGHT);
    hori.addStyleName(ValoTheme.BUTTON_TINY);
    hori.addClickListener(new ClickListener() {

        boolean right = false;

        @Override
        public void buttonClick(ClickEvent event) {
            if (right) {
                hs.setSplitPosition(0, Unit.PIXELS);
                hori.setIcon(FontAwesome.ARROW_RIGHT);
                hori.setDescription("Nyt asiat taulukkona");
                right = false;
            } else {
                hs.setSplitPosition(windowWidth / 2, Unit.PIXELS);
                hori.setIcon(FontAwesome.ARROW_LEFT);
                hori.setDescription("Piilota taulukko");
                right = true;
            }
        }

    });

    more = new Button();
    more.setDescription("Laajenna nytettvien asioiden joukkoa");
    more.setIcon(FontAwesome.PLUS_SQUARE);
    more.addStyleName(ValoTheme.BUTTON_TINY);
    more.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            uiState.level++;
            Updates.updateJS(Main.this, false);
            if (uiState.level >= 2)
                less.setEnabled(true);
        }

    });

    less = new Button();
    less.setDescription("Supista nytettvien asioiden joukkoa");
    less.setIcon(FontAwesome.MINUS_SQUARE);
    less.addStyleName(ValoTheme.BUTTON_TINY);
    less.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            if (uiState.level > 1) {
                uiState.level--;
                Updates.updateJS(Main.this, false);
            }
            if (uiState.level <= 1)
                less.setEnabled(false);
        }

    });

    reportAllButton = new Button();
    reportAllButton.setCaption("Nkyvt tulokset");
    reportAllButton.addStyleName(ValoTheme.BUTTON_TINY);
    reportAllButton.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            if (uiState.reportAll) {
                reportAllButton.setCaption("Nkyvt tulokset");
                uiState.reportAll = false;
            } else {
                reportAllButton.setCaption("Kaikki tulokset");
                uiState.reportAll = true;
            }
            Updates.updateJS(Main.this, false);
        }

    });

    reportStatus = new Label("0 tulosta.");
    reportStatus.setWidth("100px");

    filter = new ComboBox();
    filter.setWidth("100%");
    filter.addStyleName(ValoTheme.COMBOBOX_SMALL);
    filter.setInvalidAllowed(false);
    filter.setNullSelectionAllowed(false);

    filter.addValueChangeListener(filterListener);

    browserWidgets.addComponent(hori);
    browserWidgets.setComponentAlignment(hori, Alignment.MIDDLE_LEFT);
    browserWidgets.setExpandRatio(hori, 0.0f);

    browserWidgets.addComponent(more);
    browserWidgets.setComponentAlignment(more, Alignment.MIDDLE_LEFT);
    browserWidgets.setExpandRatio(more, 0.0f);

    browserWidgets.addComponent(less);
    browserWidgets.setComponentAlignment(less, Alignment.MIDDLE_LEFT);
    browserWidgets.setExpandRatio(less, 0.0f);

    browserWidgets.addComponent(reportAllButton);
    browserWidgets.setComponentAlignment(reportAllButton, Alignment.MIDDLE_LEFT);
    browserWidgets.setExpandRatio(reportAllButton, 0.0f);

    browserWidgets.addComponent(reportStatus);
    browserWidgets.setComponentAlignment(reportStatus, Alignment.MIDDLE_LEFT);
    browserWidgets.setExpandRatio(reportStatus, 0.0f);

    browserWidgets.addComponent(filter);
    browserWidgets.setComponentAlignment(filter, Alignment.MIDDLE_LEFT);
    browserWidgets.setExpandRatio(filter, 1.0f);

    browser.addComponent(browserWidgets);
    browser.addComponent(hs);

    browser.setExpandRatio(browserWidgets, 0.0f);
    browser.setExpandRatio(hs, 1.0f);

    browser.setVisible(false);

    tabs.addComponent(browser);

    {
        gridPanelLayout = new VerticalLayout();
        gridPanelLayout.setMargin(false);
        gridPanelLayout.setSpacing(false);
        gridPanelLayout.setSizeFull();
        hs.addComponent(gridPanelLayout);
    }

    CssLayout browserLayout = new CssLayout();

    browserLayout.setSizeFull();

    browserLayout.addComponent(browser_);

    hs.addComponent(browserLayout);

    tabs.addComponent(propertiesPanel);

    vs.addComponent(hl0);
    vs.addComponent(tabs);

    vs.setExpandRatio(hl0, 0.0f);
    vs.setExpandRatio(tabs, 1.0f);

    // Ground state
    fragments.put("", uiState);

    setCurrentItem(uiState.currentItem, (Strategiakartta) uiState.currentItem);

}

From source file:fi.semantum.strategia.Updates.java

License:Open Source License

private static void updateQueryGrid(final Main main, final FilterState state) {

    main.gridPanelLayout.removeAllComponents();
    main.gridPanelLayout.setMargin(false);

    final List<String> keys = state.reportColumns;
    if (keys.isEmpty()) {
        Label l = new Label("Kysely ei tuottanut yhtn tulosta.");
        l.addStyleName(ValoTheme.LABEL_BOLD);
        l.addStyleName(ValoTheme.LABEL_HUGE);
        main.gridPanelLayout.addComponent(l);
        return;/*  w  w w  . j  a  v a 2  s .c  o  m*/
    }

    final IndexedContainer container = new IndexedContainer();

    for (String key : keys) {
        container.addContainerProperty(key, String.class, "");
    }

    rows: for (Map<String, ReportCell> map : state.report) {
        Object item = container.addItem();
        for (String key : keys)
            if (map.get(key) == null)
                continue rows;

        for (Map.Entry<String, ReportCell> entry : map.entrySet()) {
            @SuppressWarnings("unchecked")
            com.vaadin.data.Property<String> p = container.getContainerProperty(item, entry.getKey());
            p.setValue(entry.getValue().get());
        }

    }

    HorizontalLayout hl = new HorizontalLayout();
    hl.setWidth("100%");

    final TextField filter = new TextField();
    filter.addStyleName(ValoTheme.TEXTFIELD_TINY);
    filter.setInputPrompt("rajaa hakutuloksia - kirjoitetun sanan tulee lyty rivin teksteist");
    filter.setWidth("100%");

    final Image clipboard = new Image();
    clipboard.setSource(new ThemeResource("page_white_excel.png"));
    clipboard.setHeight("24px");
    clipboard.setWidth("24px");

    hl.addComponent(filter);
    hl.setExpandRatio(filter, 1.0f);
    hl.setComponentAlignment(filter, Alignment.BOTTOM_CENTER);
    hl.addComponent(clipboard);
    hl.setComponentAlignment(clipboard, Alignment.BOTTOM_CENTER);
    hl.setExpandRatio(clipboard, 0.0f);

    main.gridPanelLayout.addComponent(hl);
    main.gridPanelLayout.setExpandRatio(hl, 0f);

    filter.addValueChangeListener(new ValueChangeListener() {

        private static final long serialVersionUID = 3033918399018888150L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            container.removeAllContainerFilters();
            container.addContainerFilter(new QueryFilter(filter.getValue(), true, false));
        }
    });

    AbsoluteLayout abs = new AbsoluteLayout();
    abs.setSizeFull();

    final Grid queryGrid = new Grid(container);
    queryGrid.setSelectionMode(SelectionMode.NONE);
    queryGrid.setHeightMode(HeightMode.CSS);
    queryGrid.setHeight("100%");
    queryGrid.setWidth("100%");

    for (String key : keys) {
        Column col = queryGrid.getColumn(key);
        col.setExpandRatio(1);
    }

    abs.addComponent(queryGrid);

    OnDemandFileDownloader dl = new OnDemandFileDownloader(new OnDemandStreamSource() {

        private static final long serialVersionUID = 981769438054780731L;

        File f;
        Date date = new Date();

        @Override
        public InputStream getStream() {

            String uuid = UUID.randomUUID().toString();
            File printing = new File(Main.baseDirectory(), "printing");
            f = new File(printing, uuid + ".xlsx");

            Workbook w = new XSSFWorkbook();
            Sheet sheet = w.createSheet("Sheet1");
            Row header = sheet.createRow(0);
            for (int i = 0; i < keys.size(); i++) {
                Cell cell = header.createCell(i);
                cell.setCellValue(keys.get(i));
            }

            int row = 1;
            rows: for (Map<String, ReportCell> map : state.report) {
                for (String key : keys)
                    if (map.get(key) == null)
                        continue rows;

                Row r = sheet.createRow(row++);
                int column = 0;
                for (int i = 0; i < keys.size(); i++) {
                    Cell cell = r.createCell(column++);
                    ReportCell rc = map.get(keys.get(i));
                    cell.setCellValue(rc.getLong());
                }

            }

            try {
                FileOutputStream s = new FileOutputStream(f);
                w.write(s);
                s.close();
            } catch (Exception e) {
                e.printStackTrace();
            }

            try {
                return new FileInputStream(f);
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }

            throw new IllegalStateException();

        }

        @Override
        public void onRequest() {
            // TODO Auto-generated method stub

        }

        @Override
        public long getFileSize() {
            return f.length();
        }

        @Override
        public String getFileName() {
            return "Strategiakartta_" + Utils.dateString(date) + ".xlsx";
        }

    });

    dl.getResource().setCacheTime(0);
    dl.extend(clipboard);

    main.gridPanelLayout.addComponent(abs);
    main.gridPanelLayout.setExpandRatio(abs, 1f);

}