Example usage for com.google.gwt.user.client Window getClientWidth

List of usage examples for com.google.gwt.user.client Window getClientWidth

Introduction

In this page you can find the example usage for com.google.gwt.user.client Window getClientWidth.

Prototype

public static int getClientWidth() 

Source Link

Usage

From source file:com.objetdirect.gwt.umldrawer.client.StartPanel.java

License:Open Source License

/**
 * Constructor of the {@link StartPanel}
 *///  w w w  . j  av  a  2s .  c  om
public StartPanel() {
    super();
    this.loadingScreen = new LoadingScreen();
    this.loadingScreen.show();
    Log.trace("Starting App");

    this.setWidth("100%");
    this.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    this.setSpacing(20);

    this.gfxEnginePanel.setSpacing(5);
    this.geometryStylePanel.setSpacing(5);
    this.themePanel.setSpacing(5);
    this.resolutionPanel.setSpacing(5);
    this.gfxEngineListBox.addItem("Tatami GFX");
    this.gfxEngineListBox.addItem("Incubator Canvas GFX");
    this.gfxEngineListBox.addItem("GWT Canvas GFX");
    this.geometryStyleListBox.addItem("Linear");
    this.geometryStyleListBox.addItem("Shape Based");

    for (final Theme theme : Theme.values()) {
        this.themeListBox.addItem(ThemeManager.getThemeName(theme));
    }
    this.isResolutionAutoChkBox.setValue(true);
    this.widthTxtBox.setEnabled(false);
    this.heightTxtBox.setEnabled(false);
    this.isResolutionAutoChkBox.addClickHandler(new ClickHandler() {
        public void onClick(final ClickEvent event) {
            StartPanel.this.widthTxtBox.setEnabled(!StartPanel.this.isResolutionAutoChkBox.getValue());
            StartPanel.this.heightTxtBox.setEnabled(!StartPanel.this.isResolutionAutoChkBox.getValue());

        }
    });

    this.widthTxtBox.setText("" + (Window.getClientWidth() - 50));
    this.heightTxtBox.setText("" + (Window.getClientHeight() - 50));

    this.widthTxtBox.setWidth("50px");
    this.heightTxtBox.setWidth("50px");
    for (final QualityLevel qlvl : QualityLevel.values()) {
        this.qualityListBox.addItem(qlvl.toString());
    }
    this.qualityListBox.setSelectedIndex(1); // High quality

    this.add(this.logoImg);
    for (final DiagramType type : DiagramType.values()) {
        final Button startBtn = new Button("Start new UML " + type.getName() + " diagram...");
        this.add(startBtn);
        startBtn.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(final ClickEvent event) {
                StartPanel.this.setOptions("Drawer", type);
            }
        });
    }
    this.add(this.startDemoBtn);
    this.startDemoBtn.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(final ClickEvent event) {
            StartPanel.this.setOptions("Demo", OBJECT);
        }
    });
    //      this.add(this.startAnimateDemoBtn);
    //      this.startAnimateDemoBtn.addClickHandler(new ClickHandler() {
    //         @Override
    //         public void onClick(final ClickEvent event) {
    //            StartPanel.this.setOptions("AnimatedDemo", HYBRID);
    //         }
    //      });

    if (OptionsManager.get("Advanced") == 1) {
        this.gfxEnginePanel.add(this.gfxEngineLbl);
        this.gfxEnginePanel.add(this.gfxEngineListBox);
        this.add(this.gfxEnginePanel);
        this.geometryStylePanel.add(this.geometryStyleLbl);
        this.geometryStylePanel.add(this.geometryStyleListBox);
        this.add(this.geometryStylePanel);
    }

    this.themePanel.add(this.themeLbl);
    this.themePanel.add(this.themeListBox);
    this.add(this.themePanel);
    if (OptionsManager.get("Advanced") == 1) {
        this.resolutionAutoPanel.add(this.isResolutionAutoChkBox);
        this.add(this.resolutionAutoPanel);

        this.resolutionPanel.add(this.resolutionLbl);
        this.resolutionPanel.add(this.widthTxtBox);
        this.resolutionPanel.add(this.crossLbl);
        this.resolutionPanel.add(this.heightTxtBox);
        this.add(this.resolutionPanel);
    }
    this.qualityPanel.add(this.qualityLbl);
    this.qualityPanel.add(this.qualityListBox);
    this.add(this.qualityPanel);
    this.loadingScreen.hide();
    this.addStyleName("verticalTable");
}

From source file:com.objetdirect.tatami.demo.client.GfxDemo.java

License:Open Source License

/**
 * Show some properties about a <code>GraphicObjectw</code>
 * @param object the <code>GraphicObject</code> to show the properties
 * TODO change the layout of the dialog/*from   ww w  .  j  a  va 2 s . c  o  m*/
 */
private void showProperties(GraphicObject object) {
    final DialogBox dialog = new DialogBox(false);
    dialog.setText("Properties");
    Grid panel = new Grid(5, 4);
    panel.setCellPadding(5);
    panel.setCellSpacing(10);
    panel.setWidget(0, 0, new HTML("<b>Position</b>"));
    panel.setWidget(0, 1, new Label(object.getX() + "," + object.getY()));
    panel.setWidget(0, 2, new HTML("<b>Center</b>"));
    panel.setWidget(0, 3, new Label(object.getCenterX() + "," + object.getCenterY()));
    panel.setWidget(1, 0, new HTML("<b>Size</b>"));
    panel.setWidget(1, 1, new Label("? x ? px"));
    panel.setWidget(2, 0, new HTML("<b>Color of the stroke</b>"));
    final String color = lastStrokeColor.toHex();
    final Label label = new Label(color);
    label.setTitle(color);
    DOM.setStyleAttribute(label.getElement(), "color", color);
    panel.setWidget(2, 1, label);
    panel.setWidget(2, 2, new HTML("<b>Size of the stroke</b>"));
    panel.setWidget(2, 3, new Label(lastStrokeSize + "px"));
    panel.setWidget(3, 0, new HTML("<b>Fill color</b>"));
    final String fillColor = object.getFillColor().toHex();
    final Label labelFill = new Label(fillColor);
    labelFill.setTitle(fillColor);
    panel.setWidget(3, 1, labelFill);
    DOM.setStyleAttribute(labelFill.getElement(), "color", fillColor);

    Button close = new Button("Close");
    close.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
            dialog.hide();
        }
    });
    panel.setWidget(4, 0, close);

    dialog.setPopupPosition(Window.getClientWidth() / 2, Window.getClientHeight() / 2);
    dialog.addStyleName("GfxDemo-properties");
    dialog.setWidget(panel);
    dialog.show();
    System.out.println("bounds " + object.getBounds());
}

From source file:com.openkm.extension.frontend.client.widget.openmeetings.finddocument.FindDocumentSelectPopup.java

License:Open Source License

/**
 * Shows the popup /*from   w ww.  j  av a  2 s  .c  om*/
 */
public void show(long roomId) {
    this.roomId = roomId;
    initButtons();
    int left = (Window.getClientWidth() - 700) / 2;
    int top = (Window.getClientHeight() - 350) / 2;
    setPopupPosition(left, top);
    setText(GeneralComunicator.i18n("search.document.filter"));

    // Resets to initial tree value
    removeAllRows();
    keyword.setText("");
    evaluateEnableAction();
    super.show();
    keyword.setFocus(true);
}

From source file:com.openkm.frontend.client.widget.ErrorPopup.java

License:Open Source License

/**
 * Show the popup error//from w w w  .ja  v  a2  s. c o  m
 * 
 * @param msg Error message
 */
public void show(String msg) {
    //TODO: aqui pueden haber problemas de concurrencia al ser llamado simultaneamente este mtodo
    // cabe la posibilidad de perder algun mensaje de error.
    if (!text.getHTML().equals("")) {
        text.setHTML(text.getHTML() + "<br><br>" + msg);
    } else {
        text.setHTML(msg);
    }
    setText(Main.i18n("error.label"));
    int left = (Window.getClientWidth() - 380) / 2;
    int top = (Window.getClientHeight() - 200) / 2;
    setPopupPosition(left, top);
    super.show();
}

From source file:com.openkm.frontend.client.widget.findsimilar.FindSimilarDocumentSelectPopup.java

License:Open Source License

/**
 * Shows the popup //  w w  w.j a va 2 s.c o  m
 */
public void show() {
    initButtons();
    int left = (Window.getClientWidth() - 700) / 2;
    int top = (Window.getClientHeight() - 350) / 2;
    setPopupPosition(left, top);
    setText(Main.i18n("search.similar.document"));

    // Resets to initial tree value
    removeAllRows();
    evaluateEnableAction();
    super.show();
}

From source file:com.openkm.frontend.client.widget.form.FolderSelectPopup.java

License:Open Source License

/**
 * Shows the popup //from  w  w w  .  j  av  a  2  s .  co  m
 */
public void show(TextBox textBox, HasPropertyHandler propertyHandler) {
    this.textBox = textBox;
    this.propertyHandler = propertyHandler;
    int left = (Window.getClientWidth() - 300) / 2;
    int top = (Window.getClientHeight() - 200) / 2;
    setPopupPosition(left, top);

    // Resets to initial tree value
    folderSelectTree.reset();

    GWTWorkspace workspace = Main.get().workspaceUserProperties.getWorkspace();
    categoriesVisible = workspace.isStackCategoriesVisible();
    thesaurusVisible = workspace.isStackThesaurusVisible();
    templatesVisible = workspace.isStackTemplatesVisible();
    personalVisible = workspace.isStackPersonalVisible();
    mailVisible = workspace.isStackMailVisible();

    removeAllContextListItems();
    contextListBox.addItem(Main.i18n("leftpanel.label.taxonomy"), "" + UIDesktopConstants.NAVIGATOR_TAXONOMY);
    if (categoriesVisible) {
        contextListBox.addItem(Main.i18n("leftpanel.label.categories"),
                "" + UIDesktopConstants.NAVIGATOR_CATEGORIES);
    }
    if (thesaurusVisible) {
        contextListBox.addItem(Main.i18n("leftpanel.label.thesaurus"),
                "" + UIDesktopConstants.NAVIGATOR_THESAURUS);
    }
    if (templatesVisible) {
        contextListBox.addItem(Main.i18n("leftpanel.label.templates"),
                "" + UIDesktopConstants.NAVIGATOR_TEMPLATES);
    }
    if (personalVisible) {
        contextListBox.addItem(Main.i18n("leftpanel.label.my.documents"),
                "" + UIDesktopConstants.NAVIGATOR_PERSONAL);
    }
    if (mailVisible) {
        contextListBox.addItem(Main.i18n("leftpanel.label.mail"), "" + UIDesktopConstants.NAVIGATOR_MAIL);
    }

    super.show();
}

From source file:com.openkm.frontend.client.widget.MsgPopup.java

License:Open Source License

@Override
public void show() {
    setPopupPosition(Window.getClientWidth() - (550 + 20), Window.getClientHeight() - (290 + 80));
    evaluateButtons();/*from   w ww.  j a  v a  2 s . c  om*/
    super.show();
}

From source file:com.openkm.frontend.client.widget.PropertyGroupPopup.java

License:Open Source License

/**
 * Show the popup error//from  ww  w .  jav  a2  s  .c  om
 * 
 * @param msg Error message
 */
public void show() {
    setText(Main.i18n("group.label"));
    getAllGroups(); // Gets all groups
    addButton.setEnabled(false);
    int left = (Window.getClientWidth() - 300) / 2;
    int top = (Window.getClientHeight() - 100) / 2;
    setPopupPosition(left, top);
    super.show();
}

From source file:com.openkm.frontend.client.widget.searchin.FolderSelectPopup.java

License:Open Source License

/**
 * Shows the popup /*from  w w w .  ja  v  a 2s  .  c om*/
 */
public void show(boolean categories) {
    this.categories = categories;
    int left = (Window.getClientWidth() - 450) / 2;
    int top = (Window.getClientHeight() - 300) / 2;
    setPopupPosition(left, top);

    if (categories) {
        setText(Main.i18n("search.category.filter"));
    } else {
        setText(Main.i18n("search.folder.filter"));
    }

    // Resets to initial tree value
    folderSelectTree.reset(categories);
    super.show();
}

From source file:com.openkm.frontend.client.widget.security.SecurityPopup.java

License:Open Source License

/**
 * Show the security popup/*from  w ww. jav  a  2  s .  c  o  m*/
 */
public void show(String uuid) {
    this.uuid = uuid;
    int left = (Window.getClientWidth() - width) / 2;
    int top = (Window.getClientHeight() - 400) / 2;
    setPopupPosition(left, top);
    setText(Main.i18n("security.label"));
    securityPanel.reset(uuid);
    change.setEnabled(false);
    super.show();

    // TODO:Solves minor bug with IE
    if (Util.getUserAgent().startsWith("ie")) {
        securityPanel.tabPanel.setWidth(String.valueOf(width));
        securityPanel.tabPanel.setWidth(String.valueOf((width + 1)));
    }

    // Fill width must be done on visible widgets
    securityPanel.fillWidth();
}