public class ScrollablePanel
extends javax.swing.JPanel
implements javax.swing.Scrollable, javax.swing.SwingConstants
https://tips4java.wordpress.com/2009/12/20/scrollable-panel/
http://stackoverflow.com/questions/5174070/wrapping-html-text-in-a-jeditorpane-inside-a-jscrollpane
Modifier and Type | Class and Description |
---|---|
static class |
ScrollablePanel.IncrementType |
static class |
ScrollablePanel.ScrollableSizeHint |
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
ScrollablePanel()
Default constructor that uses a FlowLayout
|
ScrollablePanel(java.awt.LayoutManager layout)
Constuctor for specifying the LayoutManager of the panel.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Dimension |
getPreferredScrollableViewportSize() |
org.processmining.servicelevelagreements.util.ScrollablePanel.IncrementInfo |
getScrollableBlockIncrement(int orientation)
Get the block IncrementInfo for the specified orientation
|
int |
getScrollableBlockIncrement(java.awt.Rectangle visible,
int orientation,
int direction) |
ScrollablePanel.ScrollableSizeHint |
getScrollableHeight()
Get the height ScrollableSizeHint enum
|
protected int |
getScrollableIncrement(org.processmining.servicelevelagreements.util.ScrollablePanel.IncrementInfo info,
int distance) |
boolean |
getScrollableTracksViewportHeight() |
boolean |
getScrollableTracksViewportWidth() |
org.processmining.servicelevelagreements.util.ScrollablePanel.IncrementInfo |
getScrollableUnitIncrement(int orientation)
Get the unit IncrementInfo for the specified orientation
|
int |
getScrollableUnitIncrement(java.awt.Rectangle visible,
int orientation,
int direction) |
ScrollablePanel.ScrollableSizeHint |
getScrollableWidth()
Get the width ScrollableSizeHint enum
|
void |
setScrollableBlockIncrement(int orientation,
org.processmining.servicelevelagreements.util.ScrollablePanel.IncrementInfo info)
Specify the information needed to do block scrolling.
|
void |
setScrollableBlockIncrement(int orientation,
ScrollablePanel.IncrementType type,
int amount)
Specify the information needed to do block scrolling.
|
void |
setScrollableHeight(ScrollablePanel.ScrollableSizeHint scrollableHeight)
Set the ScrollableSizeHint enum for the height.
|
void |
setScrollableUnitIncrement(int orientation,
org.processmining.servicelevelagreements.util.ScrollablePanel.IncrementInfo info)
Specify the information needed to do unit scrolling.
|
void |
setScrollableUnitIncrement(int orientation,
ScrollablePanel.IncrementType type,
int amount)
Specify the information needed to do unit scrolling.
|
void |
setScrollableWidth(ScrollablePanel.ScrollableSizeHint scrollableWidth)
Set the ScrollableSizeHint enum for the width.
|
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, 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 ScrollablePanel()
public ScrollablePanel(java.awt.LayoutManager layout)
layout
- the LayountManger for the panelpublic ScrollablePanel.ScrollableSizeHint getScrollableHeight()
public void setScrollableHeight(ScrollablePanel.ScrollableSizeHint scrollableHeight)
scrollableHeight
- as represented by the ScrollableSizeHint enum.public ScrollablePanel.ScrollableSizeHint getScrollableWidth()
public void setScrollableWidth(ScrollablePanel.ScrollableSizeHint scrollableWidth)
scrollableWidth
- as represented by the ScrollableSizeHint enum.public org.processmining.servicelevelagreements.util.ScrollablePanel.IncrementInfo getScrollableBlockIncrement(int orientation)
public void setScrollableBlockIncrement(int orientation, ScrollablePanel.IncrementType type, int amount)
orientation
- specify the scrolling orientation. Must be either:
SwingContants.HORIZONTAL or SwingContants.VERTICAL.amount
- a value used with the IncrementType to determine the
scrollable amountpublic void setScrollableBlockIncrement(int orientation, org.processmining.servicelevelagreements.util.ScrollablePanel.IncrementInfo info)
orientation
- specify the scrolling orientation. Must be either:
SwingContants.HORIZONTAL or SwingContants.VERTICAL.info
- An IncrementInfo object containing information of how to
calculate the scrollable amount.public org.processmining.servicelevelagreements.util.ScrollablePanel.IncrementInfo getScrollableUnitIncrement(int orientation)
public void setScrollableUnitIncrement(int orientation, ScrollablePanel.IncrementType type, int amount)
orientation
- specify the scrolling orientation. Must be either:
SwingContants.HORIZONTAL or SwingContants.VERTICAL.amount
- a value used with the IncrementType to determine the
scrollable amountpublic void setScrollableUnitIncrement(int orientation, org.processmining.servicelevelagreements.util.ScrollablePanel.IncrementInfo info)
orientation
- specify the scrolling orientation. Must be either:
SwingContants.HORIZONTAL or SwingContants.VERTICAL.info
- An IncrementInfo object containing information of how to
calculate the scrollable amount.public java.awt.Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface javax.swing.Scrollable
public int getScrollableUnitIncrement(java.awt.Rectangle visible, int orientation, int direction)
getScrollableUnitIncrement
in interface javax.swing.Scrollable
public int getScrollableBlockIncrement(java.awt.Rectangle visible, int orientation, int direction)
getScrollableBlockIncrement
in interface javax.swing.Scrollable
protected int getScrollableIncrement(org.processmining.servicelevelagreements.util.ScrollablePanel.IncrementInfo info, int distance)
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface javax.swing.Scrollable
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface javax.swing.Scrollable