Example usage for com.google.gwt.event.logical.shared ResizeEvent getHeight

List of usage examples for com.google.gwt.event.logical.shared ResizeEvent getHeight

Introduction

In this page you can find the example usage for com.google.gwt.event.logical.shared ResizeEvent getHeight.

Prototype

public int getHeight() 

Source Link

Document

Returns the new height.

Usage

From source file:com.appspot.codsallarts.client.Application.java

License:Apache License

public void onResize(ResizeEvent event) {
    onWindowResized(event.getWidth(), event.getHeight());
}

From source file:com.ephesoft.gxt.foldermanager.client.view.FolderManagementUploadedFilesView.java

License:Open Source License

public void resizeGrid(ResizeEvent event) {
    folderUploadedFilesGrid.setWidth(event.getWidth());
    folderUploadedFilesGrid.setHeight(event.getHeight());
}

From source file:com.ephesoft.gxt.systemconfig.client.view.layout.SystemConfigLayout.java

License:Open Source License

public void setCenterPanelView(final SystemConfigInlineView<?> inlineView) {
    centerPanel.clear();/* w w w .  j  ava  2 s  .c om*/
    if (inlineView instanceof HasResizableGrid) {
        final Grid<? extends Selectable> grid = ((HasResizableGrid) inlineView).getGrid();
        if (null != grid) {
            grid.setWidth(centerPanel.getOffsetWidth());
            grid.setHeight((int) (centerPanel.getOffsetHeight() * .90));
            centerPanel.addResizeHandler(new ResizeHandler() {

                @Override
                public void onResize(final ResizeEvent event) {

                    grid.setWidth(event.getWidth());
                    grid.setHeight((int) (event.getHeight() * .90));
                }
            });
        }
    }
    if (inlineView != null) {
        centerPanel.add(inlineView);
    }
}

From source file:com.ephesoft.gxt.uploadbatch.client.view.UploadBatchGridView.java

License:Open Source License

public void reSizeGrid(ResizeEvent event) {
    uploadedFilesGrid.setWidth(event.getWidth());
    uploadedFilesGrid.setHeight((int) (event.getHeight() * .90));
}

From source file:com.google.appinventor.client.editor.youngandroid.YaBlocksEditor.java

License:Open Source License

YaBlocksEditor(YaProjectEditor projectEditor, YoungAndroidBlocksNode blocksNode) {
    super(projectEditor, blocksNode);

    this.blocksNode = blocksNode;
    COMPONENT_DATABASE = SimpleComponentDatabase.getInstance(getProjectId());

    fullFormName = blocksNode.getProjectId() + "_" + blocksNode.getFormName();
    formToBlocksEditor.put(fullFormName, this);
    blocksArea = new BlocklyPanel(this, fullFormName); // [lyn, 2014/10/28] pass in editor so can extract form json from it
    blocksArea.setWidth("100%");
    // This code seems to be using a rather old layout, so we cannot simply pass 100% for height.
    // Instead, it needs to be calculated from the client's window, and a listener added to Window
    // We use VIEWER_WINDOW_OFFSET as an approximation of the size of the top navigation bar
    // New layouts don't need all this messing; see comments on selected answer at:
    // http://stackoverflow.com/questions/86901/creating-a-fluid-panel-in-gwt-to-fill-the-page
    blocksArea.setHeight(Window.getClientHeight() - VIEWER_WINDOW_OFFSET + "px");
    Window.addResizeHandler(new ResizeHandler() {
        public void onResize(ResizeEvent event) {
            int height = event.getHeight();
            blocksArea.setHeight(height - VIEWER_WINDOW_OFFSET + "px");
        }// www . j  a  va  2s. co  m
    });
    initWidget(blocksArea);
    addComponentDatabaseChangeListener(blocksArea);

    // Get references to the source structure explorer
    sourceStructureExplorer = BlockSelectorBox.getBlockSelectorBox().getSourceStructureExplorer();

    // Listen for selection events for built-in drawers
    BlockSelectorBox.getBlockSelectorBox().addBlockDrawerSelectionListener(this);

    // Create palettePanel, which will be used as the content of the PaletteBox.
    myFormEditor = projectEditor.getFormFileEditor(blocksNode.getFormName());
    if (myFormEditor != null) {
        palettePanel = new YoungAndroidPalettePanel(myFormEditor);
        palettePanel.loadComponents(new DropTargetProvider() {
            // TODO(sharon): make the tree in the BlockSelectorBox a drop target
            @Override
            public DropTarget[] getDropTargets() {
                return new DropTarget[0];
            }
        });
        palettePanel.setSize("100%", "100%");
    } else {
        palettePanel = null;
        OdeLog.wlog("Can't get form editor for blocks: " + getFileId());
    }
}

From source file:com.google.gerrit.client.diff.CodeMirrorDemo.java

License:Apache License

private void display(DiffInfo diff) {
    cmA = displaySide(diff.meta_a(), diff.text_a(), diffTable.getCmA());
    cmB = displaySide(diff.meta_b(), diff.text_b(), diffTable.getCmB());
    render(diff);//from   w  ww.  ja v a2  s  .c o m
    resizeHandler = Window.addResizeHandler(new ResizeHandler() {
        @Override
        public void onResize(ResizeEvent event) {
            if (cmA != null) {
                cmA.setHeight(event.getHeight() - HEADER_FOOTER);
                cmA.refresh();
            }
            if (cmB != null) {
                cmB.setHeight(event.getHeight() - HEADER_FOOTER);
                cmB.refresh();
            }
        }
    });
}

From source file:com.googlecode.simplegwt.tbg.client.TbgEntryPoint.java

License:Apache License

/**
 * @see com.google.gwt.core.client.EntryPoint#onModuleLoad()
 *//*from   ww  w  .  j  a v a2s .  co m*/
public void onModuleLoad() {
    final ButtonGrid buttonGrid = new ButtonGrid(DEFAULT_GRID_HEIGHT, DEFAULT_GRID_WIDTH);
    final GridControls gridControls = new GridControls(buttonGrid);

    final DialogBox dialog = new DialogBox(false, false);
    dialog.setWidget(new Label(
            "Click a button to toggle it on/off. " + "Adjacent buttons will also reverse their state.", true));
    dialog.setText("Help - ToggleButtonGame");
    dialog.addStyleName("tbg-help-dialog");
    final FlowPanel gridHeaderBar = new FlowPanel();
    final Label helpLabel = new CommandLabel("Help", new Command() {
        boolean shownOnce = false;

        public void execute() {
            if (dialog.isShowing()) {
                dialog.hide();
            } else {
                if (shownOnce) {
                    dialog.show();
                } else {
                    dialog.center();
                    shownOnce = true;
                }
            }
        }
    });
    helpLabel.setStylePrimaryName("tbg-help");
    gridHeaderBar.add(new LoginWidget(gridControls));
    gridHeaderBar.add(helpLabel);

    final DecoratorPanel decoration = new DecoratorPanel();
    final FlowPanel wrapper = new FlowPanel();

    wrapper.add(gridHeaderBar);
    wrapper.add(gridControls);
    wrapper.add(buttonGrid);

    decoration.add(wrapper);

    RootPanel.get("gwt").add(decoration);

    Window.addResizeHandler(new ResizeHandler() {
        public void onResize(ResizeEvent event) {
            resize(event.getHeight(), event.getWidth());
        }
    });

    resize(Window.getClientHeight(), Window.getClientWidth());
}

From source file:com.gwos.client.context.ClientContext.java

License:Apache License

private ClientContext() {
    browserWidth = Window.getClientWidth();
    browserHeight = Window.getClientHeight() - 30;

    Window.addResizeHandler(new ResizeHandler() {
        @Override//from   w ww . j  av a 2  s  .  c  om
        public void onResize(ResizeEvent event) {
            browserWidth = event.getWidth();
            browserHeight = event.getHeight();
        }
    });
}

From source file:com.gwos.client.ui.desktop.IconsArea.java

License:Apache License

private void setAreaSize() {
    rootPanel.setSize(Window.getClientWidth(), Window.getClientHeight() - Constants.TASK_BAR_HEIGHT_OFFSET);
    Window.addResizeHandler(new ResizeHandler() {
        public void onResize(ResizeEvent event) {
            rootPanel.setSize(event.getWidth(), event.getHeight() - Constants.TASK_BAR_HEIGHT_OFFSET);
        }//w  w  w . j av a  2s  . com
    });
}

From source file:com.gwtcx.extgwt.client.desktop.view.AbstractCalendarView.java

License:Open Source License

@Inject
public AbstractCalendarView(final com.gwtcx.extgwt.client.widgets.ToolBar toolBar, final Calendar calendar) {
    super();//from w  ww  .j a va 2  s  . com

    this.toolBar = toolBar;
    this.calendar = calendar;

    // panel.setStyleName(StyleTokens.contextArea);
    this.panel = new VerticalLayoutContainer();
    this.panel.setSize(CONTEXT_AREA_WIDTH, CONTEXT_AREA_HEIGHT);
    this.toolBar.setSize(CONTEXT_AREA_WIDTH, TOOLBAR_HEIGHT);
    this.calendar.setSize(CONTEXT_AREA_WIDTH, CONTEXT_AREA_HEIGHT);

    this.settings = new CalendarSettings();
    this.settings.setOffsetHourLabels(false); // change hour offset to false to facilitate Google style
    this.settings.setEnableDragDrop(true);
    this.settings.setEnableDragDropCreation(true);
    this.settings.setTimeBlockClickNumber(Click.None);

    this.calendar.setSettings(settings);
    // this.calendar.setView(CalendarViews.DAY, WEEK);
    // this.calendar.scrollToHour(8);  // not implemented :-)

    this.panel.add(this.toolBar, new VerticalLayoutData(1, -1));
    this.panel.add(this.calendar);
    // this.panel.add(this.calendar, new VerticalLayoutData(1, 1));

    // TO DO: there seems to be a sizing bug related to ToolBar.addFill()
    // so we need to use a ResizeHandler rather than a ScheduledCommand.

    /*
            
    Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
      public void execute() {
            
        Log.debug("execute()");
            
        resize();
      }
    });
            
    */

    // /*

    this.panel.addResizeHandler(new ResizeHandler() {
        @Override
        public void onResize(ResizeEvent event) {

            int width = event.getWidth();
            int height = event.getHeight();

            Log.debug("ResizeHandler() - width: " + width + " height: " + height);

            panel.setSize(width + "px", height + "px");
            toolBar.setWidth(width + "px");
            calendar.setWidth(width + "px");
            calendar.setHeight(height - 26 + "px");
        }
    });

    // */

    bindCustomUiHandlers();
}