java.lang.Object
ij.gui.ImageLayout
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionCreates a new ImageLayout with center alignment. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLayoutComponent(String name, Component comp) Not used by this class.voidignoreNonImageWidths(boolean ignoreNonImageWidths) Determines whether to ignore the width of non-image components when calculating the preferred width (default false, i.e.voidlayoutContainer(Container target) Lays out the container and calls ImageCanvas.resizeCanvas() to adjust the image canvas size as needed.minimumLayoutSize(Container target) Returns the minimum dimensions for this layout.preferredLayoutSize(Container target) Returns the preferred dimensions for this layout.voidNot used by this class.
-
Constructor Details
-
ImageLayout
Creates a new ImageLayout with center alignment.
-
-
Method Details
-
addLayoutComponent
Not used by this class.- Specified by:
addLayoutComponentin interfaceLayoutManager
-
removeLayoutComponent
Not used by this class.- Specified by:
removeLayoutComponentin interfaceLayoutManager
-
preferredLayoutSize
Returns the preferred dimensions for this layout.- Specified by:
preferredLayoutSizein interfaceLayoutManager
-
minimumLayoutSize
Returns the minimum dimensions for this layout.- Specified by:
minimumLayoutSizein 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:
layoutContainerin interfaceLayoutManager
-