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(); } }
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 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(); } }); }
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"); } }); }
public TwitterTimelineWindow(String title, String href, String dataWidgetId) { this.href = href; this.dataWidgetId = dataWidgetId; fireHideEvent = true; window = new Window(); window.setHeadingText(title); window.setWidth(450); window.setHeight(490); window.setCollapsible(false); window.setResizable(true); window.addResizeHandler(new ResizeHandler() { public void onResize(ResizeEvent event) { if (timelineWidget != null) { timelineWidget.setSize(event.getWidth(), event.getHeight()); } } }); window.show(); window.center(); loadTimeline(); }
@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); }
@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(); }
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(); }
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(); } }
/** * Construct a "Header" for the provided DecoratedGridWidget * @param resources * @param eventBus * @param isReadOnly */ public TemplateDataHeaderWidget( final ResourcesProvider<TemplateDataColumn> resources, final boolean isReadOnly, final EventBus eventBus ) { super( resources, isReadOnly, eventBus ); //Wire-up event handlers eventBus.addHandler( SetInternalTemplateDataModelEvent.TYPE, this ); addResizeHandler( new ResizeHandler() { @Override public void onResize( final ResizeEvent event ) { final int width = event.getWidth(); panel.setWidth( width + "px" ); } } ); }
private void initialiseHeaderWidget() { eventBus.addHandler( ColumnResizeEvent.TYPE, this ); this.headerWidget.addResizeHandler( new ResizeHandler() { public void onResize( ResizeEvent event ) { final int scrollPanelHeight = height - event.getHeight(); if ( scrollPanelHeight > 0 ) { scrollPanel.setHeight( scrollPanelHeight + "px" ); assertDimensions(); } } } ); bodyPanel.add( headerWidget ); bodyPanel.add( scrollPanel ); }
@Inject public RolesView(final Binder binder) { initWidget(binder.createAndBindUi(this)); Window.addResizeHandler(new ResizeHandler() { Timer resizeTimer = new Timer() { @Override public void run() { update(); } }; @Override public void onResize(ResizeEvent event) { resizeTimer.cancel(); resizeTimer.schedule(300); } }); LOG.info("RolesView: instantiated"); }
public CircleCollisionPane() { initWidget(uiBinder.createAndBindUi(this)); LOG.info("CircleCollisionPane: instantiated"); Window.addResizeHandler(new ResizeHandler() { Timer resizeTimer = new Timer() { @Override public void run() { pause(); gameScene = null; reset(); } }; @Override public void onResize(ResizeEvent event) { resizeTimer.cancel(); resizeTimer.schedule(300); } }); }
@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(); } }); }
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(); } }); }
private void load(boolean showIntro) { css.ensureInjected(); resizeRegistration = Window.addResizeHandler(new ResizeHandler(){ public void onResize(ResizeEvent event) { IPhoneIURQ.this.onResize(); } }); layout = new AbsolutePanel(); layout.setSize("100%", "100%"); layout.getElement().getStyle().setBackgroundColor("#474541"); background = new HTML(); layout.add(background,0,0); initScrollPanel(); layout.add(scrollPanel,10,10); initListeners(); verticalOrientation = !getOrientaton(); Scheduler.get().scheduleDeferred(new Command() { public void execute() { onResize(); background.setHTML(IPhoneDataService.getInstance().getBackground()); loadPlayer(); } }); }
private void load(boolean showIntro) { css.ensureInjected(); resizeRegistration = Window.addResizeHandler(new ResizeHandler(){ public void onResize(ResizeEvent event) { IPhoneViewerOldBookSkin.this.onResize(); } }); layout = new AbsolutePanel(); layout.setSize("100%", "100%"); layout.getElement().getStyle().setBackgroundColor("#474541"); initialize(showIntro); }
private void load(boolean showIntro) { css.ensureInjected(); resizeRegistration = Window.addResizeHandler(new ResizeHandler(){ public void onResize(ResizeEvent event) { IPhoneViewerBook.this.onResize(); } }); layout = new AbsolutePanel(); layout.setSize("100%", "100%"); layout.getElement().getStyle().setBackgroundColor("#474541"); initialize(showIntro); }
private void load(boolean showIntro) { css.ensureInjected(); resizeRegistration = Window.addResizeHandler(new ResizeHandler(){ public void onResize(ResizeEvent event) { IPhoneViewerOldBookSkinCopy.this.onResize(); } }); layout = new AbsolutePanel(); layout.setSize("100%", "100%"); layout.getElement().getStyle().setBackgroundColor("#474541"); initialize(showIntro); }
/** * This can be called to adjust the size of the dialog glass. It * is implemented using JSNI to bypass the "private" keyword on * the glassResizer. */ public void adjustGlassSize() { if (isGlassEnabled()) { ResizeHandler handler = getGlassResizer(); if (handler != null) handler.onResize(null); } }
@Override public void reloadView(ContactDTO contactDTO, ContactRelationshipsPresenter.AnchorHandler anchorHandler) { container.remove(buttonsContainer); container.remove(grid); container.layout(); outboundToggleButton = new ToggleButton(I18N.CONSTANTS.contactRelationshipOwnedByToggleButtonLabel()); inboundToggleButton = new ToggleButton(I18N.CONSTANTS.contactRelationshipOwnerOfToggleButtonLabel()); buttonsContainer = Layouts.hBox(HBoxLayout.HBoxLayoutAlign.MIDDLE); buttonsContainer.add(outboundToggleButton); buttonsContainer.add(inboundToggleButton); buttonsContainer.setHeight(BUTTONS_PANEL_HEIGHT); grid = new Grid<ContactRelationship>(new ListStore<ContactRelationship>(), generateColumnModel(contactDTO, anchorHandler)); grid.getView().setForceFit(true); grid.setAutoHeight(true); grid.addListener(Events.ViewReady, new Listener<BaseEvent>() { @Override public void handleEvent(BaseEvent be) { resizeGrid(grid, container, true); } }); Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { resizeGrid(grid, container, true); } }); container.add(buttonsContainer); container.add(grid); container.layout(); }
protected void onLoad() { super.onLoad(); resizeHandler = Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { getElement().getParentElement().getStyle().setPropertyPx("width", (int)(Window.getClientWidth() - 31)); getElement().getParentElement().getStyle().setPropertyPx("height", CommonHeaderController.getContentHeight() - 50); resizeCanvas(); } }); }