MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / setSize

Method setSize

ij/src/main/java/ij/gui/Plot.java:528–543  ·  view source on GitHub ↗

Sets the canvas size in (unscaled) pixels and sets the scale to 1.0. If the scale remains 1.0, this will be the size of the resulting ImageProcessor. When not called, the canvas size is adjusted for the plot size specified by setFrameSize() or setWindowSize(), or otherwise in Edit>Options>Plots. @se

(int width, int height)

Source from the content-addressed store, hash-verified

526 * @see #setWindowSize(int,int)
527 */
528 @AstroImageJ(reason = "Scale plot size", modified = true)
529 public void setSize(int width, int height) {
530 if (ip != null && width == ip.getWidth() && height == ip.getHeight())
531 return;
532 Dimension minSize = getMinimumSize();
533 if (isAijPlot()) {
534 pp.width = (int) Math.round(Math.max(width, minSize.width) * Prefs.getGuiScale());
535 pp.height = (int) Math.round(Math.max(height, minSize.height) * Prefs.getGuiScale());
536 } else {
537 pp.width = Math.max(width, minSize.width);
538 pp.height = Math.max(height, minSize.height);
539 }
540 scale = 1.0f;
541 ip = null;
542 if (plotDrawn) updateImage();
543 }
544
545 /** The size of the plot including borders with axis labels etc., in pixels */
546 public Dimension getSize() {

Callers 15

setFrameSizeMethod · 0.95
setWindowSizeMethod · 0.95
useTemplateMethod · 0.95
updatePlotMethod · 0.95
showTextMethod · 0.45
setTableLocAndSizeMethod · 0.45
LogWindowMethod · 0.45
sizeSavingWindowMethod · 0.45
componentResizedMethod · 0.45
getRoiMethod · 0.45
openTextURLMethod · 0.45
initMethod · 0.45

Calls 8

getMinimumSizeMethod · 0.95
isAijPlotMethod · 0.95
getGuiScaleMethod · 0.95
updateImageMethod · 0.95
getWidthMethod · 0.45
getHeightMethod · 0.45
roundMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected