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 Details

    • ImageLayout

      public ImageLayout(ImageCanvas ic)
      Creates a new ImageLayout with center alignment.
  • Method Details

    • addLayoutComponent

      public void addLayoutComponent(String name, Component comp)
      Not used by this class.
      Specified by:
      addLayoutComponent in interface LayoutManager
    • removeLayoutComponent

      public void removeLayoutComponent(Component comp)
      Not used by this class.
      Specified by:
      removeLayoutComponent in interface LayoutManager
    • preferredLayoutSize

      public Dimension preferredLayoutSize(Container target)
      Returns the preferred dimensions for this layout.
      Specified by:
      preferredLayoutSize in interface LayoutManager
    • minimumLayoutSize

      public Dimension minimumLayoutSize(Container target)
      Returns the minimum dimensions for this layout.
      Specified by:
      minimumLayoutSize in interface LayoutManager
    • 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

      public void layoutContainer(Container target)
      Lays out the container and calls ImageCanvas.resizeCanvas() to adjust the image canvas size as needed.
      Specified by:
      layoutContainer in interface LayoutManager