edu.princeton.swing
public class PScrollablePanel extends javax.swing.JPanel implements javax.swing.Scrollable
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static byte |
TRACKING_POLICY_ALWAYS
The tracking policy whereby this PScrollablePanel will never track JViewport's width/height.
|
static byte |
TRACKING_POLICY_IF_WILL_EXPAND
The tracking policy whereby this PScrollablePanel will track JViewport's width/height only
if will cause the panel to expand.
|
static byte |
TRACKING_POLICY_NEVER
The tracking policy whereby this PScrollablePanel will always track JViewport's width/height.
|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
PScrollablePanel()
Creates a new PScrollablePanel.
|
PScrollablePanel(boolean isDoubleBuffered)
Creates a new PScrollablePanel.
|
PScrollablePanel(java.awt.LayoutManager layout)
Creates a new PScrollablePanel.
|
PScrollablePanel(java.awt.LayoutManager layout,
boolean isDoubleBuffered)
Creates a new PScrollablePanel.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Dimension |
getActualPreferredScrollableViewportSize()
Returns the value passed to setPreferredScrollableViewportSize().
|
byte |
getHeightTrackingPolicy()
Returns the height-tracking policy of the PScrollablePanel.
|
java.awt.Dimension |
getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for a view component.
|
int |
getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
Components that display logical rows or columns should compute the scroll increment that
will completely expose one block of rows or columns, depending on the value of orientation.
|
boolean |
getScrollableTracksViewportHeight()
Return true if a viewport should always force the height of this Scrollable to match the
height of the viewport.
|
boolean |
getScrollableTracksViewportWidth()
Return true if a viewport should always force the width of this Scrollable to match the
width of the viewport.
|
int |
getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
Components that display logical rows or columns should compute the scroll increment that will
completely expose one new row or column, depending on the value of orientation.
|
byte |
getWidthTrackingPolicy()
Returns the width-tracking policy of the PScrollablePanel.
|
void |
setHeightTrackingPolicy(byte heightTrackingPolicy)
Sets the height-tracking policy of the PScrollablePanel.
|
void |
setPreferredScrollableViewportSize(java.awt.Dimension preferredScrollableViewportSize)
Allows the user to set what getPreferredScrollableViewportSize() will return.
|
void |
setWidthTrackingPolicy(byte widthTrackingPolicy)
Sets the width-tracking policy of the PScrollablePanel.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final byte TRACKING_POLICY_NEVER
public static final byte TRACKING_POLICY_IF_WILL_EXPAND
public static final byte TRACKING_POLICY_ALWAYS
public PScrollablePanel()
public PScrollablePanel(boolean isDoubleBuffered)
public PScrollablePanel(java.awt.LayoutManager layout)
public PScrollablePanel(java.awt.LayoutManager layout, boolean isDoubleBuffered)
public java.awt.Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface javax.swing.Scrollable
getActualPreferredScrollableViewportSize()
,
setPreferredScrollableViewportSize(Dimension)
public java.awt.Dimension getActualPreferredScrollableViewportSize()
getPreferredScrollableViewportSize()
,
setPreferredScrollableViewportSize(Dimension)
public void setPreferredScrollableViewportSize(java.awt.Dimension preferredScrollableViewportSize)
preferredScrollableViewportSize
- The new preferred size of the viewport. A null
value indicates that such calls will be passed to getPreferredSize().getPreferredScrollableViewportSize()
,
setPreferredScrollableViewportSize(Dimension)
public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
Scrolling containers, like JScrollPane, will use this method each time the user requests a unit scroll.
PScrollablePanel's implementation of this function attempts to see if the relevant child of the panel is a Scrollable. If not, it will default to a tenth of the visible screen.
getScrollableUnitIncrement
in interface javax.swing.Scrollable
visibleRect
- The view area visible within the viewport.orientation
- Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.direction
- Less than zero to scroll up/left, greater than zero for down/right.public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
Scrolling containers, like JScrollPane, will use this method each time the user requests a block scroll.
PScrollablePanel's implementation of this function attempts to see if the relevant child of the panel is a Scrollable. If not, it will default to a full visible screen.
getScrollableBlockIncrement
in interface javax.swing.Scrollable
visibleRect
- The view area visible within the viewport.orientation
- Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.direction
- Less than zero to scroll up/left, greater than zero for down/right.public byte getWidthTrackingPolicy()
TRACKING_POLICY_NEVER
,
TRACKING_POLICY_IF_WILL_EXPAND
,
TRACKING_POLICY_ALWAYS
public void setWidthTrackingPolicy(byte widthTrackingPolicy)
widthTrackingPolicy
- The width-tracking policy of the PScrollablePanel. An
IllegalArgumentException will be thrown if this is not valid.TRACKING_POLICY_NEVER
,
TRACKING_POLICY_IF_WILL_EXPAND
,
TRACKING_POLICY_ALWAYS
public boolean getScrollableTracksViewportWidth()
Scrolling containers, like JViewport, will use this method each time they are validated.
getScrollableTracksViewportWidth
in interface javax.swing.Scrollable
public byte getHeightTrackingPolicy()
TRACKING_POLICY_NEVER
,
TRACKING_POLICY_IF_WILL_EXPAND
,
TRACKING_POLICY_ALWAYS
public void setHeightTrackingPolicy(byte heightTrackingPolicy)
heightTrackingPolicy
- The height-tracking policy of the PScrollablePanel. An
IllegalArgumentException will be thrown if this is not valid.TRACKING_POLICY_NEVER
,
TRACKING_POLICY_IF_WILL_EXPAND
,
TRACKING_POLICY_ALWAYS
public boolean getScrollableTracksViewportHeight()
Scrolling containers, like JViewport, will use this method each time they are validated.
getScrollableTracksViewportHeight
in interface javax.swing.Scrollable