javax.swing.text
Class DefaultEditorKit.VerticalPageAction

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byjavax.swing.text.TextAction
          extended byjavax.swing.text.DefaultEditorKit.VerticalPageAction
All Implemented Interfaces:
Action, ActionListener, Cloneable, EventListener, Serializable
Enclosing class:
DefaultEditorKit

static class DefaultEditorKit.VerticalPageAction
extends TextAction

Scrolls up/down vertically. The select version of this action extends the selection, instead of simply moving the caret.

See Also:
DefaultEditorKit.pageUpAction, DefaultEditorKit#selectPageUpAction, DefaultEditorKit.getActions()

Nested Class Summary
 
Nested classes inherited from class javax.swing.AbstractAction
 
Field Summary
private  int direction
          Direction to scroll, 1 is down, -1 is up.
private  boolean select
          Adjusts the Rectangle to contain the bounds of the character at index in response to a page up.
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
DefaultEditorKit.VerticalPageAction(String nm, int direction, boolean select)
          Create this object with the appropriate identifier.
 
Method Summary
 void actionPerformed(ActionEvent e)
          The operation to perform when this action is triggered.
private  void adjustScrollIfNecessary(JTextComponent text, Rectangle visible, int initialY, int index)
          Adjusts the rectangle that indicates the location to scroll to after selecting index.
private  int constrainOffset(JTextComponent text, int offset)
          Ensures that offset is a valid offset into the model for text.
private  int constrainY(JTextComponent target, int y, int vis)
          Makes sure y is a valid location in target.
 
Methods inherited from class javax.swing.text.TextAction
augmentList, getFocusedComponent, getTextComponent
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

select

private boolean select
Adjusts the Rectangle to contain the bounds of the character at index in response to a page up.


direction

private int direction
Direction to scroll, 1 is down, -1 is up.

Constructor Detail

DefaultEditorKit.VerticalPageAction

public DefaultEditorKit.VerticalPageAction(String nm,
                                           int direction,
                                           boolean select)
Create this object with the appropriate identifier.

Method Detail

actionPerformed

public void actionPerformed(ActionEvent e)
The operation to perform when this action is triggered.


constrainY

private int constrainY(JTextComponent target,
                       int y,
                       int vis)
Makes sure y is a valid location in target.


constrainOffset

private int constrainOffset(JTextComponent text,
                            int offset)
Ensures that offset is a valid offset into the model for text.


adjustScrollIfNecessary

private void adjustScrollIfNecessary(JTextComponent text,
                                     Rectangle visible,
                                     int initialY,
                                     int index)
Adjusts the rectangle that indicates the location to scroll to after selecting index.