ilog.views.graphlayout.swing
Class IlvJGraphLayoutProgressBar

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JProgressBar
                  extended by ilog.views.graphlayout.swing.IlvJGraphLayoutProgressBar
All Implemented Interfaces:
GraphLayoutEventListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, SwingConstants

public class IlvJGraphLayoutProgressBar
extends JProgressBar
implements GraphLayoutEventListener

A progress bar for the layout.

This is a JProgressBar which is a layout event listener on a graph layout instance to automatically display the progress of the layout process. The method setGraphLayout(ilog.views.graphlayout.IlvGraphLayout) should be used to connect the progress bar to the layout instance and to register it as layout event listener.

If the layout algorithm supports the percentage complete feature, the progress bar is increasing and shows the real percentage of completion of the layout as text. If the layout algorithm does not support this feature, the progress bar shows only by a blinking effect that the layout algorithm is still running.

By default, a "wait cursor" is set on the top components containing all the views of the grapher attached to the layout instance. (See setWaitOnComponent(java.awt.Component) and setWaitCursorDuringLayout(boolean).)

Since:
JViews 3.0
See Also:
IlvGraphLayout.supportsPercentageComplete(), IlvGraphLayout.addGraphLayoutEventListener(ilog.views.graphlayout.GraphLayoutEventListener), Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JProgressBar
JProgressBar.AccessibleJProgressBar
 
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
 
Fields inherited from class javax.swing.JProgressBar
changeEvent, changeListener, model, orientation, paintBorder, paintString, progressString
 
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 javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
IlvJGraphLayoutProgressBar()
          Creates a horizontal progress bar with the default orientation, minimum and maximum.
IlvJGraphLayoutProgressBar(BoundedRangeModel newModel)
          Creates a horizontal progress bar using the specified model.
IlvJGraphLayoutProgressBar(int orient)
          Creates a progress bar with the specified orientation, which can be either JProgressBar.VERTICAL or JProgressBar.HORIZONTAL and with the default minimum and maximum.
IlvJGraphLayoutProgressBar(int min, int max)
          Creates a horizontal progress bar with the default orientation and the specified minimum and maximum.
IlvJGraphLayoutProgressBar(int orient, int min, int max)
          Creates a progress bar using the specified orientation, minimum, and maximum.
 
Method Summary
 IlvGraphLayout getGraphLayout()
          Returns the layout algorithm for which this progress bar must be used.
 long getMinUpdateDelay()
          Returns the minimum delay, in milliseconds, between two updates of the progress bar.
 Component getWaitOnComponent()
          Returns the component on which the wait cursor can be displayed during the layout process.
 boolean isPaintImmediately()
          Returns true if the progress bar should be painted immediately in each layout step.
 boolean isWaitCursorDuringLayout()
          Returns true if the display during the layout process of a wait cursor on the component specified using the method setWaitOnComponent is enabled.
 void layoutStepPerformed(GraphLayoutEvent event)
          Action performed after each step or iteration of the layout algorithm.
 void setGraphLayout(IlvGraphLayout layout)
          Specifies the layout algorithm for which this progress bar must be used.
 void setMinUpdateDelay(long delay)
          Specifies the minimum delay, in milliseconds, between two updates of the progress bar.
 void setPaintImmediately(boolean immediately)
          Sets whether the progress bar should be painted immediately in each layout step.
 void setWaitCursorDuringLayout(boolean enable)
          Enables or disables the display during the layout process of a wait cursor on the component specified using the method setWaitOnComponent.
 void setWaitOnComponent(Component component)
          Specifies the component on which the wait cursor can be displayed during the layout process.
 
Methods inherited from class javax.swing.JProgressBar
addChangeListener, createChangeListener, fireStateChanged, getAccessibleContext, getChangeListeners, getMaximum, getMinimum, getModel, getOrientation, getPercentComplete, getString, getUI, getUIClassID, getValue, isBorderPainted, isIndeterminate, isStringPainted, paintBorder, paramString, removeChangeListener, setBorderPainted, setIndeterminate, setMaximum, setMinimum, setModel, setOrientation, setString, setStringPainted, setUI, setValue, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, 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
 
Methods inherited from class java.awt.Container
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, 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
 

Constructor Detail

IlvJGraphLayoutProgressBar

public IlvJGraphLayoutProgressBar()
Creates a horizontal progress bar with the default orientation, minimum and maximum.


IlvJGraphLayoutProgressBar

public IlvJGraphLayoutProgressBar(int orient)
Creates a progress bar with the specified orientation, which can be either JProgressBar.VERTICAL or JProgressBar.HORIZONTAL and with the default minimum and maximum.


IlvJGraphLayoutProgressBar

public IlvJGraphLayoutProgressBar(int min,
                                  int max)
Creates a horizontal progress bar with the default orientation and the specified minimum and maximum.


IlvJGraphLayoutProgressBar

public IlvJGraphLayoutProgressBar(int orient,
                                  int min,
                                  int max)
Creates a progress bar using the specified orientation, minimum, and maximum.


IlvJGraphLayoutProgressBar

public IlvJGraphLayoutProgressBar(BoundedRangeModel newModel)
Creates a horizontal progress bar using the specified model.

Method Detail

setWaitCursorDuringLayout

public void setWaitCursorDuringLayout(boolean enable)
Enables or disables the display during the layout process of a wait cursor on the component specified using the method setWaitOnComponent.

The default value is true.

See Also:
isWaitCursorDuringLayout()

setGraphLayout

public void setGraphLayout(IlvGraphLayout layout)
Specifies the layout algorithm for which this progress bar must be used.

If the argument layout is null, the progress bar instance is registered on the layout as a listener for layout events. Otherwise, it is removed from the listeners for layout events.

See Also:
IlvGraphLayout.addGraphLayoutEventListener(ilog.views.graphlayout.GraphLayoutEventListener), IlvGraphLayout.removeGraphLayoutEventListener(ilog.views.graphlayout.GraphLayoutEventListener), getGraphLayout()

getGraphLayout

public IlvGraphLayout getGraphLayout()
Returns the layout algorithm for which this progress bar must be used.


isWaitCursorDuringLayout

public boolean isWaitCursorDuringLayout()
Returns true if the display during the layout process of a wait cursor on the component specified using the method setWaitOnComponent is enabled. Returns false otherwise. The default value is true.

See Also:
setWaitCursorDuringLayout(boolean)

setWaitOnComponent

public void setWaitOnComponent(Component component)
Specifies the component on which the wait cursor can be displayed during the layout process. By default, there is no such component. If this method is not called, the wait cursor is set on all the views of the grapher attached to the layout instance.

Note that the wait cursor is never set if the method isWaitCursorDuringLayout() returns false.

See Also:
getWaitOnComponent(), setWaitCursorDuringLayout(boolean)

getWaitOnComponent

public Component getWaitOnComponent()
Returns the component on which the wait cursor can be displayed during the layout process.

See Also:
setWaitOnComponent(java.awt.Component), setWaitCursorDuringLayout(boolean)

setMinUpdateDelay

public final void setMinUpdateDelay(long delay)
Specifies the minimum delay, in milliseconds, between two updates of the progress bar.

See Also:
getMinUpdateDelay()

getMinUpdateDelay

public final long getMinUpdateDelay()
Returns the minimum delay, in milliseconds, between two updates of the progress bar.

See Also:
setMinUpdateDelay(long)

setPaintImmediately

public final void setPaintImmediately(boolean immediately)
Sets whether the progress bar should be painted immediately in each layout step. The default is true.

In a single-threaded application, this must be set to true because otherwise the progress bar may not be visible. In a multi-threaded application, this can be set to false because the drawing thread will take care of the painting of the progress bar automatically.

Notice that the method paintImmediatelly is not called if the layout runs in a thread which is not the AWT event dispatching thread.

Since:
JViews 3.5
See Also:
isPaintImmediately()

isPaintImmediately

public final boolean isPaintImmediately()
Returns true if the progress bar should be painted immediately in each layout step.

Since:
JViews 3.5
See Also:
setPaintImmediately(boolean)

layoutStepPerformed

public void layoutStepPerformed(GraphLayoutEvent event)
Action performed after each step or iteration of the layout algorithm.

Specified by:
layoutStepPerformed in interface GraphLayoutEventListener
Parameters:
event - The layout event that may contain information about the behavior of the layout algorithm
See Also:
GraphLayoutEvent.getLayoutReport()


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