com.partnersoft.gui
Class NewspaperLayout

java.lang.Object
  extended by com.partnersoft.gui.NewspaperLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.awt.LayoutManager2

public class NewspaperLayout
extends java.lang.Object
implements java.awt.LayoutManager2

A layout manager that lays its components top to bottom, then right to left in columns, much like articles in a newspaper.

This layout is specifically designed to work well with JScrollPane; it adapts to larger widths by adding columns and to narrower widths by removing them, eliminating the necessity for the oft-annoying horizontal scroll bar.

Copyright 2007 Partner Software, Inc.

Version:
$Id: NewspaperLayout.java 2069 2009-09-01 18:31:31Z paul $
Author:
Paul Reavis

Constructor Summary
NewspaperLayout()
           
NewspaperLayout(boolean stretchHorizontally, boolean stretchVertically)
           
 
Method Summary
 void addLayoutComponent(java.awt.Component component, java.lang.Object constraints)
           
 void addLayoutComponent(java.lang.String constraints, java.awt.Component component)
           
 float getLayoutAlignmentX(java.awt.Container container)
           
 float getLayoutAlignmentY(java.awt.Container container)
           
 boolean getStretchHorizontally()
           
 boolean getStretchVertically()
           
 void invalidateLayout(java.awt.Container container)
           
 void layoutContainer(java.awt.Container container)
           
static void main(java.lang.String[] argv)
           
 java.awt.Dimension maximumLayoutSize(java.awt.Container container)
           
 java.awt.Dimension minimumLayoutSize(java.awt.Container container)
           
 java.awt.Dimension preferredLayoutSize(java.awt.Container container)
           
 void removeLayoutComponent(java.awt.Component component)
           
 void setStretchHorizontally(boolean tizit)
           
 void setStretchVertically(boolean tizit)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewspaperLayout

public NewspaperLayout()

NewspaperLayout

public NewspaperLayout(boolean stretchHorizontally,
                       boolean stretchVertically)
Method Detail

addLayoutComponent

public void addLayoutComponent(java.awt.Component component,
                               java.lang.Object constraints)
Specified by:
addLayoutComponent in interface java.awt.LayoutManager2

getLayoutAlignmentX

public float getLayoutAlignmentX(java.awt.Container container)
Specified by:
getLayoutAlignmentX in interface java.awt.LayoutManager2

getLayoutAlignmentY

public float getLayoutAlignmentY(java.awt.Container container)
Specified by:
getLayoutAlignmentY in interface java.awt.LayoutManager2

invalidateLayout

public void invalidateLayout(java.awt.Container container)
Specified by:
invalidateLayout in interface java.awt.LayoutManager2

maximumLayoutSize

public java.awt.Dimension maximumLayoutSize(java.awt.Container container)
Specified by:
maximumLayoutSize in interface java.awt.LayoutManager2

addLayoutComponent

public void addLayoutComponent(java.lang.String constraints,
                               java.awt.Component component)
Specified by:
addLayoutComponent in interface java.awt.LayoutManager

layoutContainer

public void layoutContainer(java.awt.Container container)
Specified by:
layoutContainer in interface java.awt.LayoutManager

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container container)
Specified by:
minimumLayoutSize in interface java.awt.LayoutManager

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container container)
Specified by:
preferredLayoutSize in interface java.awt.LayoutManager

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component component)
Specified by:
removeLayoutComponent in interface java.awt.LayoutManager

getStretchVertically

public boolean getStretchVertically()

setStretchVertically

public void setStretchVertically(boolean tizit)

getStretchHorizontally

public boolean getStretchHorizontally()

setStretchHorizontally

public void setStretchHorizontally(boolean tizit)

main

public static void main(java.lang.String[] argv)