Package ij.gui
Class ImageLayout
java.lang.Object
ij.gui.ImageLayout
- All Implemented Interfaces:
LayoutManager
public class ImageLayout extends Object implements LayoutManager
This is a custom layout manager that supports resizing of zoomed
images. It's based on FlowLayout, but with vertical and centered flow.
-
Constructor Summary
Constructors Constructor Description ImageLayout(ImageCanvas ic)
Creates a new ImageLayout with center alignment. -
Method Summary
Modifier and Type Method Description void
addLayoutComponent(String name, Component comp)
Not used by this class.void
ignoreNonImageWidths(boolean ignoreNonImageWidths)
Determines whether to ignore the width of non-image components when calculating the preferred width (default false, i.e.void
layoutContainer(Container target)
Lays out the container and calls ImageCanvas.resizeCanvas() to adjust the image canvas size as needed.Dimension
minimumLayoutSize(Container target)
Returns the minimum dimensions for this layout.Dimension
preferredLayoutSize(Container target)
Returns the preferred dimensions for this layout.void
removeLayoutComponent(Component comp)
Not used by this class.
-
Constructor Details
-
ImageLayout
Creates a new ImageLayout with center alignment.
-
-
Method Details
-
addLayoutComponent
Not used by this class.- Specified by:
addLayoutComponent
in interfaceLayoutManager
-
removeLayoutComponent
Not used by this class.- Specified by:
removeLayoutComponent
in interfaceLayoutManager
-
preferredLayoutSize
Returns the preferred dimensions for this layout.- Specified by:
preferredLayoutSize
in interfaceLayoutManager
-
minimumLayoutSize
Returns the minimum dimensions for this layout.- Specified by:
minimumLayoutSize
in interfaceLayoutManager
-
ignoreNonImageWidths
public void ignoreNonImageWidths(boolean ignoreNonImageWidths)Determines whether to ignore the width of non-image components when calculating the preferred width (default false, i.e. the maximum of the widths of all components is used). When true, components that do not fit the window will be truncated at the right. The width of the 0th component (the ImageCanvas) is always taken into account. -
layoutContainer
Lays out the container and calls ImageCanvas.resizeCanvas() to adjust the image canvas size as needed.- Specified by:
layoutContainer
in interfaceLayoutManager
-