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);
}
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);
}
}
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));
}
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);
}
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();
}
Aggregations