Example usage for com.vaadin.ui Window getWidth

List of usage examples for com.vaadin.ui Window getWidth

Introduction

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

Prototype

@Override
    public float getWidth() 

Source Link

Usage

From source file:com.lizardtech.expresszip.ui.SetupMapPresenter.java

License:Apache License

@Override
public void shapeFileUploadedEvent(final String filename, final ByteArrayInputStream input) {
    final Window modal = new Window("Wait");
    final Window mainWindow = (ExpressZipWindow) setupMapView.getApplication().getMainWindow();
    final SetupMapPresenter presenter = this;

    Thread spinner = new Thread(new Runnable() {
        public void run() {
            ProgressIndicator pi = new ProgressIndicator();
            pi.setCaption("Processing Shapefile...");
            modal.setModal(true);//from w ww  . ja v  a 2  s  .  c  o m
            modal.setClosable(false);
            modal.setResizable(false);
            modal.getContent().setSizeUndefined(); // trick to size around content
            modal.getContent().addComponent(pi);
            modal.setWidth(modal.getWidth(), modal.getWidthUnits());
            mainWindow.addWindow(modal);
            VectorLayer uploadedShapeFile = setupMapModel.shapeFileUploaded(filename, input);
            if (uploadedShapeFile != null) {
                shapeFileLayer = uploadedShapeFile;
                mapModel.addVectorLayer(shapeFileLayer);
                setupMapView.updateShapeLayer(shapeFileLayer);
                mapModel.updateOpenLayersMap();

                Bounds shpFileBounds = shapeFileLayer.getBoundsForLayer(mapModel.getCurrentProjection());
                resetExtentLayer(shpFileBounds, presenter);
                map.addLayer(boundingBoxLayer);
            }
            mainWindow.removeWindow(modal);
        }
    });
    spinner.start();
}

From source file:de.catma.ui.repository.RepositoryManagerWindow.java

License:Open Source License

@Override
public void setPosition() {

    Window mainWindow = getApplication().getMainWindow();
    if ((mainWindow.getWidthUnits() == UNITS_PIXELS) && (mainWindow.getWidth() > 0)) {
        setPositionX(Float.valueOf(Math.min(mainWindow.getWidth(), 50)).intValue());

        if ((mainWindow.getHeightUnits() == UNITS_PIXELS) && (mainWindow.getHeight() > 0)) {
            setPositionY(Float.valueOf(Math.min(mainWindow.getHeight(), 50)).intValue());
        }//  ww w.j a va2  s  .  c o  m
    } else {
        super.setPosition();
    }
}

From source file:de.catma.ui.tagmanager.TagManagerWindow.java

License:Open Source License

@Override
public void setPosition() {
    Window mainWindow = getApplication().getMainWindow();
    if ((mainWindow.getWidthUnits() == UNITS_PIXELS) && (mainWindow.getWidth() > 0)) {

        int posX = Float.valueOf(mainWindow.getWidth() - (mainWindow.getWidth() * 38 / 100)).intValue();
        if (posX > 0) {
            setPositionX(posX);//from www .  j av a  2 s.  co m
            if ((mainWindow.getHeightUnits() == UNITS_PIXELS) && (mainWindow.getHeight() > 0)) {
                setPositionY(Float.valueOf(Math.min(mainWindow.getHeight(), 20)).intValue());
            }
        } else {
            super.setPosition();
        }
    } else {
        super.setPosition();
    }
}

From source file:org.semanticsoft.vaaclipse.presentation.renderers.WorkbenchWindowRenderer.java

License:Open Source License

@Override
public void hookControllerLogic(final MUIElement element) {
    if (element instanceof MWindow) {
        final MWindow mWindow = (MWindow) element;

        if (!element.getTags().contains(Tags.MAIN_WINDOW)) {// only for child windows (main window not need that)
            final Window window = (Window) mWindow.getWidget();

            window.addListener(new Window.ResizeListener() {

                @Override// www .  ja  v  a 2  s .  c o  m
                public void windowResized(ResizeEvent e) {
                    mWindow.setWidth((int) window.getWidth());
                    mWindow.setHeight((int) window.getHeight());
                }
            });

            // TODO: there are no window move listener in vaadin, implement
            // it later
        }
    }
}