ilog.views.swing
Class IlvJScrollManagerView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by ilog.views.swing.IlvJScrollManagerView
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class IlvJScrollManagerView
extends JComponent

A panel containing an 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.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
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.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
IlvJScrollManagerView()
          Creates a new IlvJScrollManagerView.
IlvJScrollManagerView(IlvManager manager, IlvTransformer t)
          Creates a new IlvJScrollManagerView.
IlvJScrollManagerView(IlvManagerView view)
          Creates a new IlvJScrollManagerView.
 
Method Summary
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.
 JScrollBar getVerticalScrollBar()
          Returns the vertical scrollbar.
 int getVerticalScrollBarPolicy()
          Returns the vertical scrollbar policy value.
 IlvManagerView getView()
          Returns the IlvManagerView that is scrolled.
 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 IlvManagerView 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 setHorizontalScrollBarPolicy(int policy)
          Sets the policy when the horizontal scrollbar appears.
 void setHorizontalScrollBarVisible(boolean set)
          Shows or hides the horizontal scrollbar.
 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.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, 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
 
Methods inherited from class java.awt.Container
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERTICAL_SCROLLBAR_AS_NEEDED

public static final int VERTICAL_SCROLLBAR_AS_NEEDED
Used to set the vertical scrollbar policy so that vertical scrollbars are displayed only when needed.

Since:
JViews 7.5
See Also:
setVerticalScrollBarPolicy(int), Constant Field Values

VERTICAL_SCROLLBAR_NEVER

public static final int VERTICAL_SCROLLBAR_NEVER
Used to set the vertical scrollbar policy so that vertical scrollbars are never displayed.

Since:
JViews 7.5
See Also:
setVerticalScrollBarPolicy(int), Constant Field Values

VERTICAL_SCROLLBAR_ALWAYS

public static final int VERTICAL_SCROLLBAR_ALWAYS
Used to set the vertical scrollbar policy so that vertical scrollbars are always displayed.

Since:
JViews 7.5
See Also:
setVerticalScrollBarPolicy(int), Constant Field Values

HORIZONTAL_SCROLLBAR_AS_NEEDED

public static final int HORIZONTAL_SCROLLBAR_AS_NEEDED
Used to set the horizontal scrollbar policy so that horizontal scrollbars are displayed only when needed.

Since:
JViews 7.5
See Also:
setHorizontalScrollBarPolicy(int), Constant Field Values

HORIZONTAL_SCROLLBAR_NEVER

public static final int HORIZONTAL_SCROLLBAR_NEVER
Used to set the horizontal scrollbar policy so that horizontal scrollbars are never displayed.

Since:
JViews 7.5
See Also:
setHorizontalScrollBarPolicy(int), Constant Field Values

HORIZONTAL_SCROLLBAR_ALWAYS

public static final int HORIZONTAL_SCROLLBAR_ALWAYS
Used to set the horizontal scrollbar policy so that horizontal scrollbars are always displayed.

Since:
JViews 7.5
See Also:
setHorizontalScrollBarPolicy(int), Constant Field Values
Constructor Detail

IlvJScrollManagerView

public IlvJScrollManagerView()
Creates a new IlvJScrollManagerView. This constructor creates an IlvManager and an IlvManagerView that is added to the manager by calling the createManagerView method.


IlvJScrollManagerView

public IlvJScrollManagerView(IlvManager manager,
                             IlvTransformer t)
Creates a new IlvJScrollManagerView. This constructor creates an IlvManagerView that is added to the manager by calling the createManagerView method.

Parameters:
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.

IlvJScrollManagerView

public IlvJScrollManagerView(IlvManagerView view)
Creates a new IlvJScrollManagerView.

Parameters:
view - The manager view that is scrolled.
Method Detail

updateUI

public void updateUI()
Resets the UI property to a value from the current look and feel.

Overrides:
updateUI in class JComponent
Since:
JViews 5.0

isOptimizedDrawingEnabled

public boolean isOptimizedDrawingEnabled()
Returns true because this component's children do not overlap.

Overrides:
isOptimizedDrawingEnabled in class JComponent

getVerticalScrollBar

public final JScrollBar getVerticalScrollBar()
Returns the vertical scrollbar.


getHorizontalScrollBar

public final JScrollBar getHorizontalScrollBar()
Returns the horizontal scrollbar.


createManagerView

protected IlvManagerView createManagerView(IlvManager manager,
                                           IlvTransformer t)
Creates an IlvManagerView for the IlvScrollManagerView. This method is called by the constructor to create the IlvManagerView.


removeNotify

public void removeNotify()
Notifies the Component that it has been removed from its container.

Overrides:
removeNotify in class JComponent

addNotify

public void addNotify()
Notifies the Component that it has been added to a container.

Overrides:
addNotify in class JComponent

doLayout

public void doLayout()
Performs the layout of the components.

Overrides:
doLayout in class Container

getView

public final IlvManagerView getView()
Returns the IlvManagerView that is scrolled.


setView

public final void setView(IlvManagerView view)
Sets the IlvManagerView that is scrolled. The view must not be null.

Since:
JViews 7.5

adjustScrollBars

public void adjustScrollBars()
Adjusts the scrollbars so that they reflect the content of the manager.


adjustView

public void adjustView()
Translates the view according to the values of the scrollbars.


getVerticalScrollBarPolicy

public int getVerticalScrollBarPolicy()
Returns the vertical scrollbar policy value.

Since:
JViews 7.5
See Also:
setVerticalScrollBarPolicy(int)

setVerticalScrollBarPolicy

public void setVerticalScrollBarPolicy(int policy)
Sets the policy when the vertical scrollbar appears. Legal values are:

Parameters:
policy - One of the three values listed above.
Throws:
IllegalArgumentException - if policy is not one of the legal values shown above
Since:
JViews 7.5
See Also:
getVerticalScrollBarPolicy()

getHorizontalScrollBarPolicy

public int getHorizontalScrollBarPolicy()
Returns the horizontal scrollbar policy value.

Since:
JViews 7.5
See Also:
setHorizontalScrollBarPolicy(int)

setHorizontalScrollBarPolicy

public void setHorizontalScrollBarPolicy(int policy)
Sets the policy when the horizontal scrollbar appears. Legal values are:

Parameters:
policy - One of the three values listed above.
Throws:
IllegalArgumentException - If policy is not one of the legal values shown above.
Since:
JViews 7.5
See Also:
getHorizontalScrollBarPolicy()

isVerticalScrollBarVisible

public boolean isVerticalScrollBarVisible()
Returns true if the vertical scrollbar is visible.


setVerticalScrollBarVisible

public void setVerticalScrollBarVisible(boolean set)
Shows or hides the vertical scrollbar. This can be used to temporarily change the visibility of the scrollbar. In order to control the visibility permanently, use the scrollbar policy. The policy VERTICAL_SCROLLBAR_AS_NEEDED calls this method when necessary to change the visibility.

Parameters:
set - If true the scrollbar is shown.
See Also:
setVerticalScrollBarPolicy(int)

isHorizontalScrollBarVisible

public boolean isHorizontalScrollBarVisible()
Returns true if the horizontal scrollbar is visible.


setHorizontalScrollBarVisible

public void setHorizontalScrollBarVisible(boolean set)
Shows or hides the horizontal scrollbar. This can be used to temporarily change the visibility of the scrollbar. In order to control the visibility permanently, use the scrollbar policy. The policy HORIZONTAL_SCROLLBAR_AS_NEEDED calls this method when necessary to change the visibility.

Parameters:
set - If true the scrollbar is shown.
See Also:
setHorizontalScrollBarPolicy(int)

isWheelScrollingEnabled

public boolean isWheelScrollingEnabled()
Indicates whether or not scrolling will take place in response to movement of the mouse wheel. Wheel scrolling is disabled by default.

Since:
JViews 6.5
See Also:
setWheelScrollingEnabled(boolean)

setWheelScrollingEnabled

public void setWheelScrollingEnabled(boolean handleWheel)
Enables/disables scrolling in response to movement of the mouse wheel. Wheel scrolling is disabled by default.

Parameters:
handleWheel - true if scrolling should be done automatically for a MouseWheelEvent, false otherwise.
Since:
JViews 6.5
See Also:
isWheelScrollingEnabled()

processManagerViewKeyEvent

public void processManagerViewKeyEvent(KeyEvent event)
Invoked by the 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.

Since:
JViews 4.0

paintComponent

public void paintComponent(Graphics g)
Paints the component. This method overrides the superclass method to fill the corner between two scrollbars.

Overrides:
paintComponent in class JComponent

addImpl

protected void addImpl(Component comp,
                       Object constraints,
                       int index)
Adds the specified component to this container at the specified index. This method is overridden to track every add request.

Overrides:
addImpl in class Container


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.