List of usage examples for com.vaadin.ui Window getWidthUnits
@Override
public Unit getWidthUnits()
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);/* www.jav a2 s .c om*/ 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()); }/*from ww w.j a v a 2 s. c om*/ } 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);/* w w w.j a v a 2s.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(); } }