Package sc.fiji.snt.gui
Class GuiUtils.VisitingZoom
java.lang.Object
sc.fiji.snt.gui.GuiUtils.VisitingZoom
- Enclosing class:
GuiUtils
Stateful "visiting zoom" helper used by widgets that navigate the canvas with "GoTo"-type of actions
The default zoom is roughly two zoom steps above the current canvas magnification, falling back to
600% when no image is loaded.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds aJSpinnerbound to this state.intdefaultPercentageFor(ij.ImagePlus imp) doublefraction()intvoidresetFor(ij.ImagePlus imp) Resets the percentage to roughly two zoom steps above the image canvas's current magnification, or 600% whenimp == nullor has no canvas yet.voidsetPercentage(int p) Sets the percentage, clamped to the allowed range.zoomControls(String title, String description)
-
Field Details
-
MIN_PERCENT
public static final int MIN_PERCENT- See Also:
-
MAX_PERCENT
public static final int MAX_PERCENT- See Also:
-
DEFAULT_PERCENT
public static final int DEFAULT_PERCENT- See Also:
-
-
Constructor Details
-
VisitingZoom
public VisitingZoom() -
VisitingZoom
public VisitingZoom(int initialPercentage)
-
-
Method Details
-
percentage
public int percentage()- Returns:
- current zoom level in percent (in
[25, 3200]).
-
fraction
public double fraction()- Returns:
- current zoom level as a fraction (e.g.
6.0for 600%).
-
setPercentage
public void setPercentage(int p) Sets the percentage, clamped to the allowed range. -
resetFor
public void resetFor(ij.ImagePlus imp) Resets the percentage to roughly two zoom steps above the image canvas's current magnification, or 600% whenimp == nullor has no canvas yet. -
buildSpinner
-
defaultPercentageFor
public int defaultPercentageFor(ij.ImagePlus imp) -
zoomControls
-