public void prev() { iPanel.remove(iAssignmentDock); iPanel.insert(iCourseRequests, 0); iRequests.setVisible(false); iRequests.setEnabled(false); iReset.setVisible(false); iReset.setEnabled(false); iQuickAdd.setVisible(false); iQuickAdd.setEnabled(false); iEnroll.setVisible(false); iEnroll.setEnabled(false); if (iCustomCheckbox != null) { iCustomCheckbox.setVisible(false); iCustomCheckbox.setEnabled(false); } iPrint.setVisible(false); iPrint.setEnabled(false); if (iExport != null) { iExport.setVisible(false); iExport.setEnabled(false); } iSchedule.setVisible(iMode.isSectioning()); iSchedule.setEnabled(iMode.isSectioning()); iSave.setVisible(!iMode.isSectioning()); iSave.setEnabled(!iMode.isSectioning() && iEligibilityCheck != null && iEligibilityCheck.hasFlag(EligibilityFlag.CAN_REGISTER)); if (iEligibilityCheck != null && iEligibilityCheck.hasFlag(EligibilityFlag.DEGREE_PLANS)) { iDegreePlan.setVisible(true); iDegreePlan.setEnabled(true); } clearMessage(); ResizeEvent.fire(this, getOffsetWidth(), getOffsetHeight()); AriaStatus.getInstance().setHTML(ARIA.courseRequests()); updateScheduleChangedNoteIfNeeded(); }
public void createView() { shell = new ResizeLayoutPanel(); shell.setSize("100%", "100%"); shell.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { forceLayout(); } }); panel = new DockLayoutPanel(Style.Unit.PX); panel.setSize("100%", "100%"); shell.add(panel); Widget header = createNorth(); panel.addNorth(header, 128); Widget footer = createSouth(); panel.addSouth(footer, 42); }
private void createWidget() { widgetPanel = new ResizeLayoutPanel(); widgetPanel.addStyleName(style.widgetPanel()); widgetPanel.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { forceLayout(); } }); panel = new FlowPanel(); panel.addStyleName(style.panel()); widgetPanel.add(panel); label = new Label(); label.addStyleName(style.label()); panel.add(label); textBox = new TextBox(); textBox.addStyleName(style.textBox()); panel.add(textBox); initWidget(widgetPanel); }
public static void initWindow() { // consoleContainer = new AbsolutePanel(); // consoleContainer.setWidth("3000px"); // consoleContainer.setHeight("3000px"); // RootPanel.get().add(consoleContainer, 0, 0); // //consoleContainer.getElement().getStyle().setPosition(Position.FIXED); updateWindowInfo(); if (isMobile) { initMobile(); } else { // Prevent scrollbars from being shown Window.enableScrolling(false); } // Add window resize handler Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { doResizeAndRotate(); } }); }
/** * Set whether or not resize checking is enabled. If disabled, elements will * still be resized on window events, but the timer will not check their * dimensions periodically. * * @param enabled true to enable the resize checking timer */ public void setResizeCheckingEnabled(boolean enabled) { if (enabled && !resizeCheckingEnabled) { resizeCheckingEnabled = true; if (windowHandler == null) { windowHandler = Window.addResizeHandler(new ResizeHandler() { public void onResize(ResizeEvent event) { onWindowResized(event.getWidth(), event.getHeight()); } }); } resizeCheckTimer.schedule(resizeCheckDelay); } else if (!enabled && resizeCheckingEnabled) { resizeCheckingEnabled = false; if (windowHandler != null) { windowHandler.removeHandler(); windowHandler = null; } resizeCheckTimer.cancel(); } }
/** * Called when the window is resized. * The algorithm uses is increase/decrease the chart size according with * the new window size. */ public void onResize(ResizeEvent resize) { if (!autoResize) { return; } int nwheight = Window.getClientHeight(); int nwwidth = Window.getClientWidth(); double wfact = 1; double hfact = 1; if (nwheight != wheight) { hfact = (double) nwheight / (double) wheight; wheight = nwheight; } if (nwwidth != wwidth) { wfact = (double) nwwidth / (double) wwidth; wwidth = nwwidth; } if (wfact != 1 || hfact != 1) { resize((int) (width * wfact), (int) (height * hfact)); } }
public BasicImageGrid(AbstractPreviewData previewData) { super.setSize("100%", "100%"); _previewData = (PreviewImageGridCreator.ImageGridPreviewData)previewData; mainPanel.setSize("100%", "100%"); super.add(mainPanel); GwtUtil.setStyle(mainPanel, "backgroundColor", GRID_BACKGROUND_DEFAULT_COLOR); GwtUtil.setStyle(this, "backgroundColor", GRID_BACKGROUND_DEFAULT_COLOR); setPlotWidgetGroupValue(_previewData.getPlotWidgetGroup()); for (int i = 0; i < INIT_SIZE; i++) { createAndAddMiniPlotWidget(); } getPlotWidgetGroup().setImageGrid(this); getPlotWidgetGroup().setGridPopoutColumns(_previewData.getGridPopoutCols()); getPlotWidgetGroup().setGridPopoutZoomType(_previewData.getGridPopoutZoomtype()); Window.addResizeHandler(new ResizeHandler() { public void onResize(ResizeEvent event) { resize(); } }); plotError = new MiniPlotWidget.PlotError() { public void onError(WebPlot wp, String briefDesc, String desc, String details, Exception e) { } }; }
public static void addXYPlot(JscriptRequest jspr, String div) { Map<String,String> paramMap= jspr.asMap(); WidgetFactory factory= Application.getInstance().getWidgetFactory(); TablePreview xyPrev= factory.createObserverUI(WidgetFactory.XYPLOT,paramMap); xyPrev.bind(FFToolEnv.getHub()); SimplePanel panel= makeCenter(); panel.add(xyPrev.getDisplay()); FFToolEnv.addToPanel(div, panel, "XY Plot"); if (xyPrev.getDisplay() instanceof RequiresResize) { final RequiresResize resizer= (RequiresResize)xyPrev.getDisplay(); Window.addResizeHandler(new ResizeHandler() { public void onResize(ResizeEvent event) { resizer.onResize(); } }); } }
public void resize() { if (getLayoutManager() != null) { try { getLayoutManager().resize(); WebEventManager.getAppEvManager().fireEvent(new WebEvent(this, Name.WINDOW_RESIZE, new ResizeEvent(Window.getClientWidth(), Window.getClientHeight()) { })); } catch (Exception e) { GWT.log("unexpected exception", e); } } }
public ResizableLayoutManager(int minWidth, int minHeight) { super(minWidth, minHeight); mainPanel = new DockPanel(); // resizer = new Resizer(); Window.addResizeHandler(new ResizeHandler(){ public void onResize(ResizeEvent event) { Application.getInstance().resize(); } }); // WebEventManager.getAppEvManager().addListener(Name.REGION_SHOW, // new WebEventListener(){ // public void eventNotify(WebEvent ev) { // resizer.setVisible(Application.getInstance().hasSearchResult()); // } // }); setupStatusRegion(this); }
@Override public void show() { if (recenter == null) { recenter = Window.addResizeHandler( new ResizeHandler() { @Override public void onResize(ResizeEvent event) { final int w = event.getWidth(); final int h = event.getHeight(); AutoCenterDialogBox.this.onResize(w, h); } }); } super.show(); }
@Override public void onShowView() { super.onShowView(); Window.enableScrolling(false); if (prefs.hideTopMenu()) { Gerrit.setHeaderVisible(false); } resizeHandler = Window.addResizeHandler( new ResizeHandler() { @Override public void onResize(ResizeEvent event) { resizeCodeMirror(); } }); }
private void resize(ResizeEvent event) { secondResizeRequested = false; lastResizeEvent = event; if (lastShownFrame != null) { lastShownFrame.resize(event); centerHeader.setHeader(lastShownFrame.getLongTitle()); if (secondResizeRequested) { // lastShownFrame.resize(event); frameSpace.fireEvent(event); // Window.resizeBy(0, 0); } } history.resize(event); clipboard.resize(event); }
public void setComponentResized(JavaScriptObject aValue) { if (componentResized != aValue) { if (componentResizedReg != null) { componentResizedReg.removeHandler(); componentResizedReg = null; } componentResized = aValue; if (componentResized != null && component instanceof HasResizeHandlers) componentResizedReg = ((HasResizeHandlers) component).addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { if (componentResized != null) { executeEvent(componentResized, EventsPublisher.publish(event)); } } }); } }
public AbstractView() { super(Style.Unit.PX); setWidth(Window.getClientWidth() + "px"); setHeight(Window.getClientHeight() + "px"); Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { int height = event.getHeight(); setHeight(height + "px"); int width = event.getWidth(); setWidth(width + "px"); parentResized(height, width, "px"); } }); }
@Override public void initialize() { contactHistoryGrid = new Grid<ContactHistory>(new ListStore<ContactHistory>(), buildColumnModel()); contactHistoryGrid.getView().setForceFit(true); contactHistoryGrid.setAutoHeight(true); contactHistoryGrid.addListener(Events.ViewReady, new Listener<BaseEvent>() { @Override public void handleEvent(BaseEvent be) { resizeGrid(contactHistoryGrid, container, true); } }); Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { resizeGrid(contactHistoryGrid, container, true); } }); container = Panels.content(null, false, Layouts.vBoxLayout(VBoxLayout.VBoxLayoutAlign.STRETCH, new Layouts.LayoutOptions(new Padding(10))), "x-border-layout-ct"); container.setScrollMode(Style.Scroll.AUTOY); container.add(contactHistoryGrid); add(container); }
@Override public void addTab(String tabTitle, final Widget tabView) { final TabItem tabItem = new TabItem(tabTitle); tabItem.addListener(Events.Select, new Listener<ComponentEvent>() { @Override public void handleEvent(ComponentEvent be) { fixTabViewHeight(tabView, tabItem); } }); tabItem.add(tabView); Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { fixTabViewHeight(tabView, tabItem); } }); fixTabViewHeight(tabView, tabItem); tabPanel.add(tabItem); }
public void onResize(ResizeEvent event) { Style style = glass.getStyle(); int winWidth = Window.getClientWidth(); int winHeight = Window.getClientHeight(); style.setDisplay(Display.NONE); style.setWidth(0, Unit.PX); style.setHeight(0, Unit.PX); int width = Document.get().getScrollWidth(); int height = Document.get().getScrollHeight(); style.setWidth(Math.max(width, winWidth), Unit.PX); style.setHeight(Math.max(height, winHeight), Unit.PX); style.setDisplay(Display.BLOCK); }
@Override public void show() { if (resizeHandlerRegistration == null) { resizeHandlerRegistration = Window .addResizeHandler(new ResizeHandler() { public void onResize(ResizeEvent event) { windowWidth = event.getWidth(); } }); } Timer timer = new Timer() { public void run() { getElement().getStyle().setProperty("clip", "auto"); } }; timer.schedule(300); super.show(); }
protected void onLoad() { if (editor == null) { this.getElement().setAttribute("id", elementId); editor = initCodeMirrorNative(); } if (!fixedSize) { resizeHandler = Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { resize(); } }); resize(); } }
public DocumentationDisplay() { this.initWidget(Binder.BINDER.createAndBindUi(this)); Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { DocumentationDisplay.this.redraw(false); } }); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { DocumentationDisplay.this.redraw(true); } }); }
@Override public void onModuleLoad() { if (dispatchAsync == null) throw new RuntimeException( "dispatchAsync is not set! Set it in the contsructor of the derived class," + " or use GIN!"); clientI18nStore.registerModule(new IneFrameI18n(new ClientI18nProvider<IneFrameI18n>())); registerAdditionalI18nModules(); // query auth status if (!(authManager instanceof NoAuthManager)) { queryCounter.incQueries(); authManager.checkAuthStatus(new AuthStatusCallback()); } else { queryI18nAndInvokeOnIneModuleLoad(true); } Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { eventBus.fireEvent(new WindowResizeEvent(event.getWidth(), event.getHeight())); } }); }
public UiControlBinder() { instance = this; // createAndBindUi initializes this.nameSpan initWidget(uiBinder.createAndBindUi(this)); mainMenu.add(menuWidget); lastModifiedContainer.appendChild(lastModified.getElement()); statusContainer.appendChild(statusBox.getElement()); actionContainer.add(actionsWidget); Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { styleControls(); } }); initHandlers(); styleControls(); }
@Test public void shouldScheduleTimer() { // given ResizeEvent event = mock(ResizeEvent.class); int delayMillis = 250; // when testObj.onResize(event); // then verify(commandTimer).schedule(delayMillis); }
@Override protected void onAttach() { super.onAttach(); resizeFilterIfNeeded(); iResizeHandler = Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { resizeFilterIfNeeded(); } }); }
public void loadSimulator() { mysim = new CirSim(); mysim.localizationMap = localizationMap; mysim.init(); Window.addResizeHandler(new ResizeHandler() { public void onResize(ResizeEvent event) { mysim.setCanvasSize(); mysim.setiFrameHeight(); } }); /* Window.addWindowClosingHandler(new Window.ClosingHandler() { public void onWindowClosing(ClosingEvent event) { event.setMessage("Are you sure?"); } }); */ mysim.updateCircuit(); }
private FontDimensionsCalculator(String fontClassName) { this.fontClassName = fontClassName; // This handler will be called when the browser window zooms Window.addResizeHandler( new ResizeHandler() { @Override public void onResize(ResizeEvent arg0) { measureAndDispatch(); } }); // Build a multirow text block so we can measure it StringBuilder htmlContent = new StringBuilder(SAMPLE_TEXT); for (int i = 1; i < SAMPLE_ROWS; i++) { htmlContent.append("<br/>"); htmlContent.append(SAMPLE_TEXT); } dummyElement = Elements.createSpanElement(fontClassName); dummyElement.setInnerHTML(htmlContent.toString()); dummyElement.getStyle().setVisibility(CSSStyleDeclaration.Visibility.HIDDEN); dummyElement.getStyle().setPosition(CSSStyleDeclaration.Position.ABSOLUTE); Elements.getBody().appendChild(dummyElement); fontDimensions = new FontDimensionsImpl(); repeater.schedule(pollingDelay); /* * Force an initial measure (the dispatch won't happen since no one is * attached) */ measureAndDispatch(); }
public void start(DataSetInfoFactory factory, int bannerOffset, String footerHtmlFile, String defCommandName) { Application.setEventMode(eventMode); // -- uncomment for testing only, not ready for production boolean useCORSForXS= BrowserUtil.getSupportsCORS() && USE_CORS_IF_POSSIBLE; Request home; FFToolsDisplayMode displayMode= FFToolsDisplayMode.valueOf(getDisplayMode()); if (displayMode == FFToolsDisplayMode.embedded) { FFToolEnv.loadJS(); Application.setCreator(new FireflyToolsEmbededCreator()); Application.getInstance().setNetworkMode(useCORSForXS ? NetworkMode.RPC : NetworkMode.JSONP); FFToolEnv.setApiMode(true); home = null; Window.addResizeHandler(new ResizeHandler() { public void onResize(ResizeEvent event) { Application.getInstance().resize(); } }); } else { Creator creator; if (displayMode == FFToolsDisplayMode.full) { creator= new FFToolsStandaloneCreator(displayMode, factory, bannerOffset, footerHtmlFile, defCommandName); home = new Request(ImageSelectDropDownCmd.COMMAND_NAME, "Images", true, false); } else { creator= new FFToolsStandaloneCreator(displayMode, factory); home = new Request(FFToolsPushReceiveCmd.COMMAND); } Application.setCreator(creator); Application.getInstance().setNetworkMode(NetworkMode.RPC); FFToolEnv.setApiMode(false); } Application.getInstance().start(home, new AppReady()); }
public MinimalLayoutManager() { super(DEF_MIN_WIDTH, DEF_MIN_HEIGHT); mainPanel = new DockPanel(); Window.addResizeHandler(new ResizeHandler() { public void onResize(ResizeEvent event) { Application.getInstance().resize(); } }); }
public void onResize(ResizeEvent event) { if (GwtUtil.isOnDisplay(SplitLayoutPanelFirefly.this)) { resetCachePos(); checkSplitters(); SplitLayoutPanelFirefly.this.onResize(); } }
void initAllPlots() { if (!initialized) { WebEventManager.getAppEvManager().addListener(Name.SEARCH_RESULT_START, new TearDownListen()); Window.addResizeHandler(new ResizeHandler() { public void onResize(ResizeEvent event) { getVisMenuBar().updateLayout(); } }); loadVisCommands(_commandMap); initialized = true; _pvListener = new MPWListener(); layout(); } }
public IrsaLayoutManager(int minWidth, int minHeight, int topOffset) { super(minWidth, minHeight); this.topOffset= topOffset; mainPanel = new DockPanel(); Window.addResizeHandler(new ResizeHandler(){ public void onResize(ResizeEvent event) { Application.getInstance().resize(); } }); setupStatusRegion(this); }
public AutoResizeScrollDropPanel(final AutoresizeScrollDropTarget diagram) { setAlwaysShowScrollBars(true); // must be set otherwise elements can "jump around" (eg: empty diagram, class outside of top of diagram, click multiple times on diagram -> class jumps back to diagram) diagram.setAutoresizeScrollDrop(this); dropPanel = new FileDropPanel(diagram); this.add(dropPanel); // update size after initialization of gui has finished Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { diagram.redraw(); } }); // also update size everytime the mouse has been released on the scrollbar or the window has been resized // MouseUpHandler handler = new MouseUpHandler() { // @Override // public void onMouseUp(MouseUpEvent event) { // diagram.redraw(); // } // }; // getHorizontalScrollbar().asWidget().addDomHandler(handler, MouseUpEvent.getType()); // getVerticalScrollbar().asWidget().addDomHandler(handler, MouseUpEvent.getType()); Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { diagram.redraw(); } }); }
@Override public void onResize(ResizeEvent event) { if( !isVisible() ) { return; } m_wgtScroll.fireScroll(); }
@Override public void onResize() { super.onResize(); if (isAttached()) { ResizeEvent.fire(this, getElement().getOffsetWidth(), getElement().getOffsetHeight()); } }
private void initializeMapPanel() { getMapWidget().setSize("100%", "100%"); getMapWidget().setUIToDefault(); getMapWidget().addControl(new LargeMapControl()); getMapWidget().setScrollWheelZoomEnabled(true); Window.addResizeHandler(new ResizeHandler() { public void onResize(final ResizeEvent resizeEvent) { if (getMapWidget() != null) { getMapWidget().checkResizeAndCenter(); } } }); }