|
UC Berkeley Group for User Interface Research Updated November 17, 2000 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.FlowLayout | +--edu.berkeley.guir.lib.gesture.util.FlowScrollLayout
This class is a replacement for a FlowLayout inside a JScrollPane. It can be used as a plain FlowLayout, but it is intended to be used on a container inside a JScrollPane. If it is the layout for a Container that is the view of a JViewport inside a JScrollPane, then it will cause the Container's children to be wrapped so that the JScrollPane only scrolls vertically.
It can optionally resize all children on each row to be as tall as the tallest one. IMHO, this often looks better, but is off by default for compatiblity with FlowLayout.
Note:Each FlowScrollLayout should be used for only one Container.
This software is distributed under the Berkeley Software License.
Fields inherited from class java.awt.FlowLayout |
CENTER, LEADING, LEFT, RIGHT, TRAILING |
Constructor Summary | |
FlowScrollLayout()
|
|
FlowScrollLayout(Container target)
|
|
FlowScrollLayout(JScrollPane scrollPane)
|
|
FlowScrollLayout(JScrollPane scrollPane,
Container target)
|
|
FlowScrollLayout(JScrollPane scrollPane,
Container target,
boolean uniformHeight)
|
Method Summary | |
void |
componentAdded(ContainerEvent e)
|
void |
componentHidden(ComponentEvent e)
|
void |
componentMoved(ComponentEvent e)
|
void |
componentRemoved(ContainerEvent e)
|
void |
componentResized(ComponentEvent e)
|
void |
componentShown(ComponentEvent e)
|
protected Dimension |
computeDesiredSize()
Follow the layout algorithm that FlowLayout uses to compute how big we would like to be, given the size of the containing JScrollPane. |
boolean |
isUniformHeight()
|
void |
layoutContainer(Container c)
|
static void |
setHeights(Container container,
int height,
int startIndex,
int endIndex)
Set the preferred size of all JComponents inside container to have height height, starting at the startIndex'th child and going up to endIndex-1. |
static void |
setPreferredHeight(JComponent comp,
int height)
Set preferredSize of comp to be Dimension(current preferredSize.width, height) |
void |
setScrollPane(JScrollPane scrollPane)
|
void |
setUniformHeight(boolean on)
If uniformHeight is turned on, all widgets on each row will have their preferred height set to the height of the tallest one (based on preferredSize). |
protected void |
updateLayout()
Update the layout of the managed widget and the containing scrollbar (only if the current size doesn't match the desired size) |
Methods inherited from class java.awt.FlowLayout |
addLayoutComponent, getAlignment, getHgap, getVgap, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent, setAlignment, setHgap, setVgap, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public FlowScrollLayout()
public FlowScrollLayout(Container target)
public FlowScrollLayout(JScrollPane scrollPane)
public FlowScrollLayout(JScrollPane scrollPane, Container target)
public FlowScrollLayout(JScrollPane scrollPane, Container target, boolean uniformHeight)
Method Detail |
public void setScrollPane(JScrollPane scrollPane)
public void setUniformHeight(boolean on)
public boolean isUniformHeight()
protected Dimension computeDesiredSize()
public static void setHeights(Container container, int height, int startIndex, int endIndex)
public static void setPreferredHeight(JComponent comp, int height)
protected void updateLayout()
public void layoutContainer(Container c)
layoutContainer
in class FlowLayout
public void componentResized(ComponentEvent e)
componentResized
in interface ComponentListener
public void componentMoved(ComponentEvent e)
componentMoved
in interface ComponentListener
public void componentShown(ComponentEvent e)
componentShown
in interface ComponentListener
public void componentHidden(ComponentEvent e)
componentHidden
in interface ComponentListener
public void componentAdded(ContainerEvent e)
componentAdded
in interface ContainerListener
public void componentRemoved(ContainerEvent e)
componentRemoved
in interface ContainerListener
|
Copyright Information | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |