/** Show lightbox */ public void show() { int w = getWidth(); int h = getHeight(); background.setWidth(Integer.toString(w)); background.setHeight(Integer.toString(h)); if (GWT.isScript()) { background.setWidget(png = new PNGImage("images/lightbox.png", w, h)); } background.setPopupPosition(0, 0); hideSelects(); background.show(); backgroundFixup(background.getElement()); /** * Using setPopupPositionAndShow so child popup will not jump when centering * * @author Luis Faria */ child.setPopupPositionAndShow( new PositionCallback() { public void setPosition(int offsetWidth, int offsetHeight) { center(offsetWidth, offsetHeight); } }); }
@Inject public DisplayHelpPopup(EventBus eventBus) { super(eventBus); widget = binder.createAndBindUi(this); widget.setWidth("600px"); widget.setHeight("400px"); }
private void openPanel() { if (isEnabled) { popup.setWidth((header.getOffsetWidth() - 10) + "px"); popup.setHeight((cellList.getRowCount() * 25) + "px"); popup.setPopupPosition(header.getAbsoluteLeft(), header.getAbsoluteTop() + 22); popup.show(); } }
private void openPanel() { int winWidth = popupWidth != -1 ? popupWidth : header.getOffsetWidth() * 2; int winHeight = (int) (winWidth / GOLDEN_RATIO); popup.setWidth(winWidth + "px"); popup.setHeight(winHeight + "px"); // right to left if (isRightToLeft) { int popupLeft = header.getAbsoluteLeft() - (winWidth - header.getOffsetWidth()); popup.setPopupPosition(popupLeft - 15, header.getAbsoluteTop() + 21); } else { int popupLeft = header.getAbsoluteLeft(); popup.setPopupPosition(popupLeft, header.getAbsoluteTop() + 21); } popup.show(); }
@Override public void go(final HasWidgets container) { if (m_addGraphView == null) { m_addGraphView = new KscAddGraphViewImpl(); m_addGraphView.setTitle(m_graphInfo.getTitle() == null ? "" : m_graphInfo.getTitle()); } if (m_popupPanel == null) { m_popupPanel = new PopupPanel(); m_popupPanel.setWidth("300px"); m_popupPanel.setHeight("79px"); m_popupPanel.add(m_addGraphView); m_popupPanel.setAutoHideEnabled(true); m_popupPanel.setAnimationEnabled(false); m_popupPanel.setModal(false); m_popupPanel.setVisible(false); m_popupPanel.hide(); } new KscAddGraphPresenter(m_popupPanel, m_addGraphView, m_reports, m_graphInfo).go(container); }
private void loadNewImage(final PhotoModel photoModel, final int nextIdx) { imagePopup.clear(); imagePopup.setHeight(photoModel.getHeight() + "px"); imagePopup.setWidth(photoModel.getWidth() + "px"); Image fullImage = new Image(photoModel.getURL()); imagePopup.setWidget(fullImage); if (currIdx > 0) { ImageMouseDownHandler mouseDownHandler = new ImageMouseDownHandler(); mouseDownHandler.setPhotoModelList(photoModelList); mouseDownHandler.setImagePopup(imagePopup); mouseDownHandler.setCurrIdx(nextIdx); mouseDownHandler.setFullImage(fullImage); fullImage.addMouseDownHandler(mouseDownHandler); ImageMouseMoveHandler mouseMoveHandler = new ImageMouseMoveHandler(); mouseMoveHandler.setFullImage(fullImage); fullImage.addMouseMoveHandler(mouseMoveHandler); } getImagePopup().center(); }
private SimplePlot createPlot( final String id, Markings markings, String xAxisLabel, double yMinimum, boolean isMetric) { PlotOptions plotOptions = new PlotOptions(); plotOptions.setZoomOptions(new ZoomOptions().setAmount(1.02)); plotOptions.setGlobalSeriesOptions( new GlobalSeriesOptions() .setLineSeriesOptions( new LineSeriesOptions().setLineWidth(1).setShow(true).setFill(0.1)) .setPointsOptions(new PointsSeriesOptions().setRadius(1).setShow(true)) .setShadowSize(0d)); plotOptions.setPanOptions(new PanOptions().setInteractive(true)); if (isMetric) { plotOptions.addXAxisOptions( new AxisOptions() .setZoomRange(true) .setTickDecimals(0) .setTickFormatter( new TickFormatter() { @Override public String formatTickValue(double tickValue, Axis axis) { if (tickValue >= 0 && tickValue < chosenSessions.size()) return chosenSessions.get((int) tickValue); else return ""; } })); } else { plotOptions.addXAxisOptions(new AxisOptions().setZoomRange(true).setMinimum(0)); } plotOptions.addYAxisOptions(new AxisOptions().setZoomRange(false).setMinimum(yMinimum)); plotOptions.setLegendOptions(new LegendOptions().setNumOfColumns(2)); if (markings == null) { // Make the grid hoverable plotOptions.setGridOptions(new GridOptions().setHoverable(true)); } else { // Make the grid hoverable and add markings plotOptions.setGridOptions( new GridOptions().setHoverable(true).setMarkings(markings).setClickable(true)); } // create the plot SimplePlot plot = new SimplePlot(plotOptions); plot.setHeight(200); plot.setWidth("100%"); final PopupPanel popup = new PopupPanel(); popup.addStyleName(getResources().css().infoPanel()); final HTML popupPanelContent = new HTML(); popup.add(popupPanelContent); // add hover listener if (isMetric) { plot.addHoverListener( new ShowCurrentValueHoverListener(popup, popupPanelContent, xAxisLabel, chosenSessions), false); } else { plot.addHoverListener( new ShowCurrentValueHoverListener(popup, popupPanelContent, xAxisLabel, null), false); } if (!isMetric && markings != null && !markingsMap.isEmpty()) { final PopupPanel taskInfoPanel = new PopupPanel(); taskInfoPanel.setWidth("200px"); taskInfoPanel.addStyleName(getResources().css().infoPanel()); final HTML taskInfoPanelContent = new HTML(); taskInfoPanel.add(taskInfoPanelContent); taskInfoPanel.setAutoHideEnabled(true); plot.addClickListener( new ShowTaskDetailsListener(id, markingsMap, taskInfoPanel, 200, taskInfoPanelContent), false); } return plot; }
/** @Override */ public void setWidth(String width) { super.setWidth(width); }
public void onModuleLoad() { Logger logger = Logger.getLogger(""); // logger.log(Level.FINE, "Arrancando aplicaciĆ³n"); logger.log(Level.INFO, "Arrancando aplicaciĆ³n2"); // Create app layout // Create ClientFactory using deferred binding so we can replace with // different // impls in gwt.xml clientFactory = GWT.create(ClientFactory.class); clientFactory.getLogger().log(Level.INFO, "holaaaaa"); // clientFactory.setMainView(this); EventBus eventBus = clientFactory.getEventBus(); PlaceController placeController = clientFactory.getPlaceController(); clientFactory.getRequestFactory().initialize(eventBus); // Initialize RequestFactory // clientFactory.initializeRequestFactory(); System.out.println("contruyendo mappers"); // Start ActivityManager for each area with its ActivityMapper ActivityMapper alumnoMapper = new AlumnoMapper(clientFactory); ActivityMapper observacionesAlumnoMapper = new ObservacionesAlumnoMapper(clientFactory); ActivityMapper matriculaMapper = new MatriculaMapper(clientFactory); ActivityMapper materialMapper = new MaterialMapper(clientFactory); /* ActivityMapper mainPanelActivityMapper = new MainPanelActivityMapper( clientFactory); ActivityMapper formularioAlumnoPanelActivityMapper = new FormularioAlumnoPanelActivityMapper( clientFactory); ActivityMapper alumnoPanelActivityMapper = new AlumnoPanelActivityMapper( clientFactory); ActivityMapper observacionesPanelActivityMapper = new ObservacionesPanelActivityMapper( clientFactory); ActivityMapper matriculaPanelActivityMapper = new MatriculaPanelActivityMapper( clientFactory); ActivityManager mainPanelActivityManager = new ActivityManager( mainPanelActivityMapper, eventBus); mainPanelActivityManager.setDisplay(appWidget); ActivityManager alumnoPanelActivityManager = new ActivityManager( alumnoPanelActivityMapper, eventBus); alumnoPanelActivityManager.setDisplay(alumnoPanel); ActivityManager formularioAlumnoPanelActivityManager = new ActivityManager( formularioAlumnoPanelActivityMapper, eventBus); formularioAlumnoPanelActivityManager.setDisplay(alumnoPanel); ActivityManager panelObservacionesActivityManager = new ActivityManager( observacionesPanelActivityMapper, eventBus); panelObservacionesActivityManager.setDisplay(observacionesalumnoPanel); ActivityManager panelMatriculaActivityManager = new ActivityManager( matriculaPanelActivityMapper, eventBus); panelMatriculaActivityManager.setDisplay(matriculaPanel); */ tabAlumno.selectTab(1); ActivityManager alumnoManager = new ActivityManager(alumnoMapper, eventBus); alumnoManager.setDisplay(alumnoPanel); ActivityManager observacionesAlumnoManager = new ActivityManager(observacionesAlumnoMapper, eventBus); observacionesAlumnoManager.setDisplay(observacionesalumnoPanel); ActivityManager matriculaManager = new ActivityManager(matriculaMapper, eventBus); matriculaManager.setDisplay(matriculaPanel); ActivityManager materialManager = new ActivityManager(materialMapper, eventBus); materialManager.setDisplay(materialPanel); // Start PlaceHistoryHandler with our PlaceHistoryMapper AppPlaceHistoryMapper historyMapper = GWT.create(AppPlaceHistoryMapper.class); PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper); historyHandler.register(placeController, eventBus, defaultPlace); // Add app layout to root layout RootLayoutPanel.get().add(outer); // historyHandler.handleCurrentHistory(); /*eventBus.addHandler(SeleccionAlumnoEvent.TYPE, new SeleccionAlumnoEventHandler() { @Override public void onSelecc( SeleccionAlumnoEvent authenticationEvent) { // authentication changed - do something System.out.println("tocado" + clientFactory.getSelectedAlumnoNif()); if (clientFactory.getSelectedAlumnoNif() == null) tabDatosAlumno.setVisible(false); else tabDatosAlumno.setVisible(true); } });*/ PopupPanel loggingPopup = new PopupPanel(false); loggingPopup.setPopupPosition(10, 240); loggingPopup.setWidth("500px"); clientFactory.getLogger().addHandler(new HasWidgetsLogHandler(loggingPopup)); }