com.mindfusion.diagramming
Class Overview

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.mindfusion.diagramming.Overview
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener

public class Overview
extends javax.swing.JComponent
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

The Overview control provides a scaled-down view of Diagram contents and allows scrolling and zooming the diagram with the mouse.

To specify which Diagram instance is shown in the overview, call the setDiagramView(com.mindfusion.diagramming.DiagramView) method.

The scale in which the overview control paints items is specified via the setScaleFactor(float) and setFitAll(boolean) methods. If the FitAll mode is enabled, the whole diagram fits into the overview window.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
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
Overview()
          Initializes a new instance of the Overview class.
 
Method Summary
 java.awt.Color getBackgroundColor()
          Gets the background color of the overview control.
 DiagramView getDiagramView()
          Gets the Diagram instance whose contents is displayed in the overview.
 java.awt.Color getDimColor()
          Gets a color used to blend with the part of the diagram that is not visible in the Diagram‘s client rectangle.
 boolean getFitAll()
          Gets a value that specifies whether to fit the whole diagram inside the overview.
 float getScaleFactor()
          Gets the fixed scale factor that is used when the FitAll mode is disabled.
 boolean getShowScrollbars()
          Gets a value indicating whether the overview control should display scrollbars.
 Pen getTrackingRectPen()
          Gets the Pen object used to draw the tracking rectangle border.
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 java.awt.geom.Point2D overviewToDoc(java.awt.Point point)
           
 void paintComponent(java.awt.Graphics g)
           
 void resumeRepaint()
          Resumes repainting the control after a suspendRepaint() call.
 void setBackgroundColor(java.awt.Color value)
          Sets the background color of the overview control.
 void setDiagramView(DiagramView value)
          Sets the Diagram instance whose contents should be displayed in the overview.
 void setDimColor(java.awt.Color value)
          Sets a color used to blend with the part of the diagram that is not visible in the Diagram‘s client rectangle.
 void setFitAll(boolean value)
          Sets a value indicating whether to fit the whole diagram inside the overview.
 void setScaleFactor(float value)
          Sets a fixed scale factor that should be used when the FitAll mode is disabled.
 void setShowScrollbars(boolean value)
          Sets a value indicating whether the overview control should display scrollbars.
 void setTrackingRectPen(Pen value)
          Sets the Pen object used to draw the tracking rectangle border.
 void suspendRepaint()
          Stops repainting the control.
 void update()
          Causes the control to recalculate all its internals and repaint its client area.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, updateUI
 
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

Overview

public Overview()
Initializes a new instance of the Overview class.

Method Detail

update

public void update()
Causes the control to recalculate all its internals and repaint its client area.


mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

suspendRepaint

public void suspendRepaint()
Stops repainting the control. This is useful when using the JDiagram API from JavaScript, where the control would be repainted after each script line executes.


resumeRepaint

public void resumeRepaint()
Resumes repainting the control after a suspendRepaint() call.


paintComponent

public void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent

overviewToDoc

public java.awt.geom.Point2D overviewToDoc(java.awt.Point point)

getDiagramView

public DiagramView getDiagramView()
Gets the Diagram instance whose contents is displayed in the overview.

Returns:
A Diagram object representing the flowchart document.

setDiagramView

public void setDiagramView(DiagramView value)
Sets the Diagram instance whose contents should be displayed in the overview.

Parameters:
value - A Diagram object representing the flowchart document.

getFitAll

public boolean getFitAll()
Gets a value that specifies whether to fit the whole diagram inside the overview.

Returns:
true if the diagram contents should fit the overview window size, otherwise false.

setFitAll

public void setFitAll(boolean value)
Sets a value indicating whether to fit the whole diagram inside the overview.

Parameters:
value - true if the diagram contents should fit the overview window size, otherwise false.

getBackgroundColor

public java.awt.Color getBackgroundColor()
Gets the background color of the overview control.

Returns:
A Color object specifying the overview background color.

setBackgroundColor

public void setBackgroundColor(java.awt.Color value)
Sets the background color of the overview control.

Parameters:
value - A Color object representing the overview background color.

getDimColor

public java.awt.Color getDimColor()
Gets a color used to blend with the part of the diagram that is not visible in the Diagram‘s client rectangle.

Returns:
A Color object representing the blend color.

setDimColor

public void setDimColor(java.awt.Color value)
Sets a color used to blend with the part of the diagram that is not visible in the Diagram‘s client rectangle.

Parameters:
value - A Color object representing the blend color.

getScaleFactor

public float getScaleFactor()
Gets the fixed scale factor that is used when the FitAll mode is disabled.

Returns:
A float value specifying the scale factor as percents of the diagram size.

setScaleFactor

public void setScaleFactor(float value)
Sets a fixed scale factor that should be used when the FitAll mode is disabled.

Parameters:
value - A float value specifying the scale factor as percents of the diagram size.

getShowScrollbars

public boolean getShowScrollbars()
Gets a value indicating whether the overview control should display scrollbars.

Returns:
true if the overview control displays scrollbars, otherwise false.

setShowScrollbars

public void setShowScrollbars(boolean value)
Sets a value indicating whether the overview control should display scrollbars.

Parameters:
value - true to display scrollbars, otherwise false.

setTrackingRectPen

public void setTrackingRectPen(Pen value)
Sets the Pen object used to draw the tracking rectangle border.

Parameters:
value - A Pen instance that should be used to draw the tracking rectangle border lines.

getTrackingRectPen

public Pen getTrackingRectPen()
Gets the Pen object used to draw the tracking rectangle border.

Returns:
A Pen instance used to draw the tracking rectangle border lines.