|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.wordpress.tipsforjava.swing.FormScroller
public class FormScroller extends Object
The FormScroller will ensure that when a component gains focus it will always be visible within the viewport of the scrollpane.
| Nested Class Summary | |
|---|---|
enum |
FormScroller.Type
|
| Field Summary | |
|---|---|
private Point |
lastLocation
|
private Insets |
scrollInsets
|
private JScrollPane |
scrollPane
The FormScroller will ensure that when a component gains focus it will always be visible within the viewport of the scrollpane. |
private boolean |
scrollingEnabled
|
private FormScroller.Type |
type
|
| Constructor Summary | |
FormScroller(JScrollPane scrollPane)
Convenience constructor that set the scroll Type to COMPONENT |
|
FormScroller(JScrollPane scrollPane, FormScroller.Type type)
Create a FormScroller for the specified scroll Type |
|
| Method Summary | |
|---|---|
private Rectangle
|
determineChildBounds(Component component, JComponent view)
|
private Rectangle
|
determineComponentBounds(Component component, JComponent view)
|
private Rectangle
|
determineParentBounds(Component component, JComponent view)
|
protected Rectangle
|
determineScrollBounds(Component component, JComponent view)
Determine the bounds that must fit into the viewport of the scrollpane |
Insets
|
getScrollInsets()
Get the scroll insets. |
FormScroller.Type
|
getType()
Get the Type of scrolling to be attempted by the scroller |
boolean
|
isScrollingEnabled()
|
void
|
propertyChange(PropertyChangeEvent evt)
|
private boolean
|
rectangleFits(Rectangle bounds)
|
void
|
setScrollInsets(Insets scrollInsets)
Set the scroll insets. |
void
|
setScrollingEnabled(boolean scrollingEnabled)
Enable automatic scrolling on the form. |
void
|
setType(FormScroller.Type type)
Set the Type of scrolling to be done by the scroller |
FormScroller
|
valueOf(String name)
Returns the enum constant of this type with the specified name. |
FormScroller[]
|
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private Point lastLocation
private Insets scrollInsets
private JScrollPane scrollPane
private boolean scrollingEnabled
private FormScroller.Type type
| Constructor Detail |
|---|
public FormScroller(JScrollPane scrollPane)
public FormScroller(JScrollPane scrollPane, FormScroller.Type type)
| Method Detail |
|---|
private Rectangle determineChildBounds(Component component, JComponent view)
private Rectangle determineComponentBounds(Component component, JComponent view)
private Rectangle determineParentBounds(Component component, JComponent view)
protected Rectangle determineScrollBounds(Component component, JComponent view)
component - the component that currently has focusview - the component added to the viewport of the scrollpane
public Insets getScrollInsets()
public FormScroller.Type getType()
public boolean isScrollingEnabled()
de public public void propertyChange(PropertyChangeEvent evt)
private boolean rectangleFits(Rectangle bounds)
public void setScrollInsets(Insets scrollInsets)
public void setScrollingEnabled(boolean scrollingEnabled)
scrollingEnabled - enable/disable scrolling
public void setType(FormScroller.Type type)
Type - - controls scrolling of the viewport (values given above)
FormScroller valueOf(String name)
FormScroller[] values()
Groovy Documentation