public class IlvJScrollManagerView extends JComponent
IlvManagerView
and two scrollbars.
The scrollbars help translate the view of the manager.
This component must be used in a Swing Application. Note that
if your application is an AWT application, you should use the class
IlvScrollManagerView
.
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static int |
HORIZONTAL_SCROLLBAR_ALWAYS
Used to set the horizontal scrollbar policy so that
horizontal scrollbars are always displayed.
|
static int |
HORIZONTAL_SCROLLBAR_AS_NEEDED
Used to set the horizontal scrollbar policy so that
horizontal scrollbars are displayed only when needed.
|
static int |
HORIZONTAL_SCROLLBAR_NEVER
Used to set the horizontal scrollbar policy so that
horizontal scrollbars are never displayed.
|
static int |
VERTICAL_SCROLLBAR_ALWAYS
Used to set the vertical scrollbar policy so that
vertical scrollbars are always displayed.
|
static int |
VERTICAL_SCROLLBAR_AS_NEEDED
Used to set the vertical scrollbar policy so that
vertical scrollbars are displayed only when needed.
|
static int |
VERTICAL_SCROLLBAR_NEVER
Used to set the vertical scrollbar policy so that
vertical scrollbars are never displayed.
|
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
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
IlvJScrollManagerView()
Creates a new
IlvJScrollManagerView . |
IlvJScrollManagerView(IlvManager manager,
IlvTransformer t)
Creates a new
IlvJScrollManagerView . |
IlvJScrollManagerView(IlvManagerView view)
Creates a new
IlvJScrollManagerView . |
Modifier and Type | Method and Description |
---|---|
protected void |
addImpl(Component comp,
Object constraints,
int index)
Adds the specified component to this container at the specified index.
|
void |
addNotify()
Notifies the Component that it has been added to a container.
|
void |
adjustScrollBars()
Adjusts the scrollbars so that they reflect the content of
the manager.
|
void |
adjustView()
Translates the view according to the values of the scrollbars.
|
protected IlvManagerView |
createManagerView(IlvManager manager,
IlvTransformer t)
Creates an
IlvManagerView for the
IlvScrollManagerView . |
void |
doLayout()
Performs the layout of the components.
|
JScrollBar |
getHorizontalScrollBar()
Returns the horizontal scrollbar.
|
int |
getHorizontalScrollBarPolicy()
Returns the horizontal scrollbar policy value.
|
int |
getToolTipDelay()
Returns the delay between showing tooltips.
|
String |
getToolTipText(MouseEvent e)
Returns the string to be used as the tooltip.
|
JScrollBar |
getVerticalScrollBar()
Returns the vertical scrollbar.
|
int |
getVerticalScrollBarPolicy()
Returns the vertical scrollbar policy value.
|
IlvManagerView |
getView()
Returns the
IlvManagerView that is scrolled. |
boolean |
isAdjusting()
Returns
true if the view is currently doing
a major modification of its contents. |
boolean |
isHorizontalScrollBarVisible()
Returns
true if the horizontal scrollbar is visible. |
boolean |
isOptimizedDrawingEnabled()
Returns
true because this component's children do not
overlap. |
boolean |
isVerticalScrollBarVisible()
Returns
true if the vertical scrollbar is visible. |
boolean |
isWheelScrollingEnabled()
Indicates whether or not scrolling will take place in response to movement
of the mouse wheel.
|
void |
paintComponent(Graphics g)
Paints the component.
|
void |
processManagerViewKeyEvent(KeyEvent event)
Invoked by the
for any keystrokes that have not been consumed by the view's interactor or
registered key listeners. |
void |
removeNotify()
Notifies the Component that it has been removed from its container.
|
void |
setAdjusting(boolean set)
Tells the view that it is the beginning or the end of a major
modification of its contents.
|
void |
setHorizontalScrollBarPolicy(int policy)
Sets the policy when the horizontal scrollbar appears.
|
void |
setHorizontalScrollBarVisible(boolean set)
Shows or hides the horizontal scrollbar.
|
void |
setToolTipDelay(int delay)
Sets the delay between showing tooltips.
|
void |
setVerticalScrollBarPolicy(int policy)
Sets the policy when the vertical scrollbar appears.
|
void |
setVerticalScrollBarVisible(boolean set)
Shows or hides the vertical scrollbar.
|
void |
setView(IlvManagerView view)
Sets the
IlvManagerView that is scrolled. |
void |
setWheelScrollingEnabled(boolean handleWheel)
Enables/disables scrolling in response to movement of the mouse wheel.
|
void |
updateUI()
Resets the UI property to a value from the current look and feel.
|
addAncestorListener, 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, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, getAccessibleContext, 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 static final int VERTICAL_SCROLLBAR_AS_NEEDED
setVerticalScrollBarPolicy(int)
,
Constant Field Valuespublic static final int VERTICAL_SCROLLBAR_NEVER
setVerticalScrollBarPolicy(int)
,
Constant Field Valuespublic static final int VERTICAL_SCROLLBAR_ALWAYS
setVerticalScrollBarPolicy(int)
,
Constant Field Valuespublic static final int HORIZONTAL_SCROLLBAR_AS_NEEDED
setHorizontalScrollBarPolicy(int)
,
Constant Field Valuespublic static final int HORIZONTAL_SCROLLBAR_NEVER
setHorizontalScrollBarPolicy(int)
,
Constant Field Valuespublic static final int HORIZONTAL_SCROLLBAR_ALWAYS
setHorizontalScrollBarPolicy(int)
,
Constant Field Valuespublic IlvJScrollManagerView()
IlvJScrollManagerView
.
This constructor creates an IlvManager
and an
IlvManagerView
that is added to
the manager by calling the createManagerView
method.public IlvJScrollManagerView(IlvManager manager, IlvTransformer t)
IlvJScrollManagerView
.
This constructor creates an IlvManagerView
that is
added to the manager by calling the createManagerView
method.manager
- The manager to scroll.t
- The initial transformer to draw the content of the manager.
This is the initial transformer of the IlvManagerView
that
is created.public IlvJScrollManagerView(IlvManagerView view)
IlvJScrollManagerView
.view
- The manager view that is scrolled.public void updateUI()
updateUI
in class JComponent
public void setAdjusting(boolean set)
The method must be used in the following way:
scrollManagerView.setAdjusting(true); try { ... many changes in the view ... } finally { scrollManagerView.setAdjusting(false); }
When setAdjusting
is called with true
,
the scrollbars of the view are not anymore updated until it is
called with false
.
Calls to setAdjusting
can be nested, as in the
following code:
scrollManagerView.setAdjusting(true); scrollManagerView.setAdjusting(true); ... many changes in the view ... scrollManagerView.setAdjusting(false); scrollManagerView.setAdjusting(false);The method
isAdjusting
still
returns true
between the two calls to
setAdjusting(false)
. Only the last call
ends the adjustment section and updates the scrollbars of the view.
Contents adjusting sessions on the manager
(see IlvManager.setContentsAdjusting(boolean)
)
will also delay the update of the scrollbars. You need this method
only if you don't use contents adjusting sessions on the manager.
public final boolean isAdjusting()
true
if the view is currently doing
a major modification of its contents.setAdjusting(boolean)
public boolean isOptimizedDrawingEnabled()
true
because this component's children do not
overlap.isOptimizedDrawingEnabled
in class JComponent
public final JScrollBar getVerticalScrollBar()
public final JScrollBar getHorizontalScrollBar()
protected IlvManagerView createManagerView(IlvManager manager, IlvTransformer t)
IlvManagerView
for the
IlvScrollManagerView
.
This method is called by the constructor to create the
IlvManagerView
.public void removeNotify()
removeNotify
in class JComponent
public void addNotify()
addNotify
in class JComponent
public void doLayout()
public final IlvManagerView getView()
IlvManagerView
that is scrolled.public final void setView(IlvManagerView view)
IlvManagerView
that is scrolled.
The view must not be null
.public void adjustScrollBars()
public void adjustView()
public int getVerticalScrollBarPolicy()
setVerticalScrollBarPolicy(int)
public void setVerticalScrollBarPolicy(int policy)
policy
- One of the three values listed above.IllegalArgumentException
- if policy
is not one of the legal values shown abovegetVerticalScrollBarPolicy()
public int getHorizontalScrollBarPolicy()
setHorizontalScrollBarPolicy(int)
public void setHorizontalScrollBarPolicy(int policy)
policy
- One of the three values listed above.IllegalArgumentException
- If policy
is not one of the legal values shown above.getHorizontalScrollBarPolicy()
public boolean isVerticalScrollBarVisible()
true
if the vertical scrollbar is visible.public void setVerticalScrollBarVisible(boolean set)
VERTICAL_SCROLLBAR_AS_NEEDED
calls
this method when necessary to change the visibility.set
- If true
the scrollbar is shown.setVerticalScrollBarPolicy(int)
public boolean isHorizontalScrollBarVisible()
true
if the horizontal scrollbar is visible.public void setHorizontalScrollBarVisible(boolean set)
HORIZONTAL_SCROLLBAR_AS_NEEDED
calls
this method when necessary to change the visibility.set
- If true
the scrollbar is shown.setHorizontalScrollBarPolicy(int)
public boolean isWheelScrollingEnabled()
setWheelScrollingEnabled(boolean)
public void setWheelScrollingEnabled(boolean handleWheel)
handleWheel
- true
if scrolling should be done
automatically for a MouseWheelEvent,
false
otherwise.isWheelScrollingEnabled()
public void processManagerViewKeyEvent(KeyEvent event)
IlvManagerView
for any keystrokes that have not been consumed by the view's interactor or
registered key listeners. This scroll panel simply invokes its own
processKeyEvent
method so that the keystrokes are routed up
the Swing container hierarchy and any registered keyboard actions and/or
menu accelerators are properly handled.
Warning: This method is considered to be part of the scroll panel's internal implementation and is not a public API.
public void paintComponent(Graphics g)
paintComponent
in class JComponent
protected void addImpl(Component comp, Object constraints, int index)
public void setToolTipDelay(int delay)
IlvToolTipManager
.public final int getToolTipDelay()
public String getToolTipText(MouseEvent e)
getToolTipText
in class JComponent
e
- The mouse event that caused the tooltip.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.