Search in sources :

Example 1 with Size

use of org.rstudio.core.client.Size in project rstudio by rstudio.

the class DomMetrics method adjustedElementSize.

public static Size adjustedElementSize(Size contentSize, Size minimumSize, int contentPad, int clientMargin) {
    // add the padding
    contentSize = new Size(contentSize.width + contentPad, contentSize.height + contentPad);
    // enforce the minimum (if specified)
    if (minimumSize != null) {
        contentSize = new Size(Math.max(contentSize.width, minimumSize.width), Math.max(contentSize.height, minimumSize.height));
    }
    // maximum is client area - (margin * 2)
    Size maximumSize = new Size(Window.getClientWidth() - (clientMargin * 2), Window.getClientHeight() - (clientMargin * 2));
    int width = Math.min(contentSize.width, maximumSize.width);
    int height = Math.min(contentSize.height, maximumSize.height);
    return new Size(width, height);
}
Also used : Size(org.rstudio.core.client.Size)

Example 2 with Size

use of org.rstudio.core.client.Size in project rstudio by rstudio.

the class ExportPlotSizeEditor method setPreviewPanelSize.

private void setPreviewPanelSize(int width, int height) {
    Size maxSize = getMaxSize();
    if (width <= maxSize.width && height <= maxSize.height) {
        previewPanel_.setVisible(true);
        previewPanel_.setSize((width + IMAGE_INSET) + "px", (height + IMAGE_INSET) + "px");
    } else {
        previewPanel_.setVisible(false);
    }
}
Also used : Size(org.rstudio.core.client.Size)

Example 3 with Size

use of org.rstudio.core.client.Size in project rstudio by rstudio.

the class GitPresenter method showReviewPane.

private void showReviewPane(boolean showHistory, FileSystemItem historyFileFilter, ArrayList<StatusAndPath> items) {
    // setup params
    VCSApplicationParams params = VCSApplicationParams.create(showHistory, historyFileFilter, items);
    // open the window 
    satelliteManager_.openSatellite("review_changes", params, new Size(1000, 1200));
}
Also used : VCSApplicationParams(org.rstudio.studio.client.vcs.VCSApplicationParams) Size(org.rstudio.core.client.Size)

Example 4 with Size

use of org.rstudio.core.client.Size in project rstudio by rstudio.

the class RmdPreviewParams method getPreferredSize.

public final Size getPreferredSize() {
    int chromeHeight = 100;
    String format = getResult().getFormatName();
    if (format.equals(RmdOutputFormat.OUTPUT_IOSLIDES_PRESENTATION) || format.equals(RmdOutputFormat.OUTPUT_SLIDY_PRESENTATION))
        return new Size(1100, 900 + chromeHeight);
    if (format.endsWith(RmdOutputFormat.OUTPUT_REVEALJS_PRESENTATION))
        return new Size(1100, 900 + chromeHeight);
    // default size (html_document and others)
    return new Size(1100, 1000 + chromeHeight);
}
Also used : Size(org.rstudio.core.client.Size)

Example 5 with Size

use of org.rstudio.core.client.Size in project rstudio by rstudio.

the class Presentation method onTutorialFeedback.

@Handler
void onTutorialFeedback() {
    EditDialog editDialog = new EditDialog("Provide Feedback", "Submit", "", false, true, new Size(450, 300), new ProgressOperationWithInput<String>() {

        @Override
        public void execute(String input, ProgressIndicator indicator) {
            if (input == null) {
                indicator.onCompleted();
                return;
            }
            indicator.onProgress("Saving feedback...");
            server_.tutorialFeedback(input, new VoidServerRequestCallback(indicator));
        }
    });
    editDialog.showModal();
}
Also used : EditDialog(org.rstudio.studio.client.workbench.views.edit.ui.EditDialog) Size(org.rstudio.core.client.Size) ProgressIndicator(org.rstudio.core.client.widget.ProgressIndicator) VoidServerRequestCallback(org.rstudio.studio.client.server.VoidServerRequestCallback) JSONString(com.google.gwt.json.client.JSONString) Handler(org.rstudio.core.client.command.Handler)

Aggregations

Size (org.rstudio.core.client.Size)26 WindowEx (org.rstudio.core.client.dom.WindowEx)5 HTML (com.google.gwt.user.client.ui.HTML)2 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)2 Widget (com.google.gwt.user.client.ui.Widget)2 Point (org.rstudio.core.client.Point)2 Handler (org.rstudio.core.client.command.Handler)2 NativeScreen (org.rstudio.core.client.dom.NativeScreen)2 ProgressIndicator (org.rstudio.core.client.widget.ProgressIndicator)2 NewWindowOptions (org.rstudio.studio.client.common.GlobalDisplay.NewWindowOptions)2 VCSApplicationParams (org.rstudio.studio.client.vcs.VCSApplicationParams)2 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)1 Document (com.google.gwt.dom.client.Document)1 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)1 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)1 ValueChangeEvent (com.google.gwt.event.logical.shared.ValueChangeEvent)1 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)1 JSONString (com.google.gwt.json.client.JSONString)1 Command (com.google.gwt.user.client.Command)1 DockLayoutPanel (com.google.gwt.user.client.ui.DockLayoutPanel)1