ij.gui
Class ImageLayout

java.lang.Object
  extended by ij.gui.ImageLayout
All Implemented Interfaces:
java.awt.LayoutManager

public class ImageLayout
extends java.lang.Object
implements java.awt.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
ImageLayout(ImageCanvas ic)
          Creates a new ImageLayout with center alignment and 5 pixel horizontal and vertical gaps.
 
Method Summary
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Not used by this class.
 void layoutContainer(java.awt.Container target)
          Lays out the container and calls ImageCanvas.resizeCanvas() to adjust the image canvas size as needed.
 java.awt.Dimension minimumLayoutSize(java.awt.Container target)
          Returns the minimum dimensions for this layout.
 java.awt.Dimension preferredLayoutSize(java.awt.Container target)
          Returns the preferred dimensions for this layout.
 void removeLayoutComponent(java.awt.Component comp)
          Not used by this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageLayout

public ImageLayout(ImageCanvas ic)
Creates a new ImageLayout with center alignment and 5 pixel horizontal and vertical gaps.

Method Detail

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Not used by this class.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Not used by this class.

Specified by:
removeLayoutComponent in interface java.awt.LayoutManager

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container target)
Returns the preferred dimensions for this layout.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
Returns the minimum dimensions for this layout.

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager

layoutContainer

public void layoutContainer(java.awt.Container target)
Lays out the container and calls ImageCanvas.resizeCanvas() to adjust the image canvas size as needed.

Specified by:
layoutContainer in interface java.awt.LayoutManager