JGraph X 1.3.0.0

## com.mxgraph.swing
Class mxGraphComponent

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  javax.swing.JScrollPane
                      com.mxgraph.swing.mxGraphComponent

All Implemented Interfaces:
  java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable, javax.accessibility.Accessible, javax.swing.ScrollPaneConstants

    public class mxGraphComponent

extends javax.swing.JScrollPane
implements java.awt.print.Printable

For setting the preferred size of the viewport for scrolling, use mxGraph.setMinimumGraphSize. This component is a combined scrollpane with an inner mxGraphControl. The control contains the actual graph display. To set the background color of the graph, use the following code:

     graphComponent.getViewport().setOpaque(false);
     graphComponent.setBackground(newColor);

This class fires the following events: mxEvent.START_EDITING fires before starting the in-place editor for an existing cell in startEditingAtCell. The `cell` property contains the cell that is being edit and the `event` property contains optional EventObject which was passed to startEditingAtCell. mxEvent.LABEL_CHANGED fires between begin- and endUpdate after the call to mxGraph.cellLabelChanged in labelChanged. The `cell` property contains the cell, the `value` property contains the new value for the cell and the optional `event` property contains the EventObject that started the edit. mxEvent.ADD_OVERLAY and mxEvent.REMOVE_OVERLAY fire afer an overlay was added or removed using add-/removeOverlay. The `cell` property contains the cell for which the overlay was added or removed and the `overlay` property contain the mxOverlay. mxEvent.BEFORE_PAINT and mxEvent.AFTER_PAINT fire before and after the paint method is called on the component. The `g` property contains the graphics context which is used for painting.

See Also:
  Serialized Form

Nested Class Summary
`class` `mxGraphComponent.mxGraphControl`
`static class` `mxGraphComponent.mxMouseRedirector`

Nested classes/interfaces inherited from class javax.swing.JScrollPane
`javax.swing.JScrollPane.AccessibleJScrollPane, javax.swing.JScrollPane.ScrollBar`

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
`protected boolean` `antiAlias`
`protected javax.swing.ImageIcon` `backgroundImage` Specifies the <mxImage> to be returned by <getBackgroundImage>.
`protected mxInteractiveCanvas` `canvas`
`protected mxICellEditor` `cellEditor`
`protected boolean` `centerPage` Specifies if the background page should be centered by automatically setting the translate in the view.
`protected boolean` `centerZoom` Specifies if the zoom operations should go into the center of the actual diagram rather than going from top, left.
`protected javax.swing.ImageIcon` `collapsedIcon`
`protected java.util.Hashtable<java.lang.Object,java.awt.Component[]>` `components` Maps from cells to lists of heavyweights.
`protected mxConnectionHandler` `connectionHandler`
`static javax.swing.ImageIcon` `DEFAULT_COLLAPSED_ICON`
`static javax.swing.ImageIcon` `DEFAULT_EXPANDED_ICON`
`static double` `DEFAULT_PAGESCALE` Specifies the default page scale.
`static javax.swing.ImageIcon` `DEFAULT_WARNING_ICON`
`protected boolean` `dragEnabled`
`protected boolean` `enterStopsCellEditing` If true, pressing the enter key without pressing control will stop editing and accept the new value.
`protected boolean` `escapeEnabled` Specifies <escape> should be invoked when the escape key is pressed.
`protected mxEventSource` `eventSource`
`protected javax.swing.ImageIcon` `expandedIcon`
`protected boolean` `exportEnabled`
`protected boolean` `foldingEnabled` Specifies if folding (collapse and expand via an image icon in the graph should be enabled).
`protected mxGraph` `graph`
`protected mxGraphComponent.mxGraphControl` `graphControl`
`protected mxGraphHandler` `graphHandler`
`static int` `GRID_STYLE_CROSS`
`static int` `GRID_STYLE_DASHED`
`static int` `GRID_STYLE_DOT`
`static int` `GRID_STYLE_LINE`
`protected java.awt.Color` `gridColor`
`protected int` `gridStyle`
`protected boolean` `gridVisible` Specifies if the grid is visible.
`protected int` `horizontalPageCount` Specifies the number of pages in the horizontal direction.
`protected boolean` `importEnabled`
`protected boolean` `invokesStopCellEditing` If true, when editing is to be stopped by way of selection changing, data in diagram changing or other means stopCellEditing is invoked, and changes are saved.
`protected boolean` `keepSelectionVisibleOnZoom` Specifies if the viewport should automatically contain the selection cells after a zoom operation.
`protected java.util.Hashtable<java.lang.Object,mxICellOverlay[]>` `overlays` Maps from cells to lists of overlays.
`protected java.awt.Color` `pageBackgroundColor` Color of the background area if layout view.
`protected java.awt.Color` `pageBorderColor`
`protected boolean` `pageBreakVisible` Specifies if a dashed line should be drawn between multiple pages.
`protected java.awt.print.PageFormat` `pageFormat` Background page format.
`protected double` `pageScale` Defines the scaling for the background page metrics.
`protected java.awt.Color` `pageShadowColor`
`protected boolean` `pageVisible` Specifies if the background page should be visible.
`protected mxPanningHandler` `panningHandler`
`protected boolean` `preferPageSize` If the pageFormat should be used to determine the minimal graph bounds even if the page is not visible (see pageVisible).
`protected mxEventSource.mxIEventListener` `repaintHandler`
`protected mxEventSource.mxIEventListener` `scaleHandler` Resets the zoom policy if the scale is changed manually.
`boolean` `showDirtyRectangle` Used for debugging the dirty region.
`protected mxSubHandler` `subHandler`
`protected boolean` `swimlaneSelectionEnabled` Specifies if swimlanes are selected when the mouse is released over the swimlanes content area.
`protected boolean` `textAntiAlias`
`protected int` `tolerance` Specifies the tolerance for mouse clicks.
`protected boolean` `transparentSwimlaneContent` Specifies if the content area should be transparent to events.
`protected java.awt.image.BufferedImage` `tripleBuffer`
`protected boolean` `tripleBuffered` Specifies if an image buffer should be used for painting the component.
`protected java.awt.Graphics2D` `tripleBufferGraphics`
`protected mxEventSource.mxIEventListener` `updateHandler` Updates the heavyweight component structure after any changes.
`protected int` `verticalPageCount` Specifies the number of pages in the vertical direction.
`protected java.beans.PropertyChangeListener` `viewChangeHandler`
`protected javax.swing.ImageIcon` `warningIcon`
`static int` `ZOOM_POLICY_NONE`
`static int` `ZOOM_POLICY_PAGE`
`static int` `ZOOM_POLICY_WIDTH`
`protected double` `zoomFactor` Specifies the factor used for zoomIn and zoomOut.
`protected int` `zoomPolicy` Specifies the zoom policy.

Fields inherited from class javax.swing.JScrollPane
`columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport`

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.print.Printable
`NO_SUCH_PAGE, PAGE_EXISTS`

Fields inherited from interface javax.swing.ScrollPaneConstants

`COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT`

Fields inherited from interface java.awt.image.ImageObserver
`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

Constructor Summary
`mxGraphComponent(mxGraph graph)`

Method Summary
`mxICellOverlay` `addCellOverlay(java.lang.Object cell, mxICellOverlay overlay)` Adds an overlay for the specified cell.
`void` `addListener(java.lang.String eventName, mxEventSource.mxIEventListener listener)`
`boolean` `canExportCell(java.lang.Object cell)` Returns true if the given cell can be exported via datatransfer.
`boolean` `canImportCell(java.lang.Object cell)` Returns true if the given cell can be imported via datatransfer.
`void` `checkTripleBuffer()` Checks if the triple buffer exists and creates a new one if it does not.
`void` `clearCellOverlays()` Removes all overlays in the graph.
`void` `clearCellOverlays(java.lang.Object cell)` Removes all overlays in the graph for the given cell and all its descendants.
`mxInteractiveCanvas` `createCanvas()` Hook for subclassers to replace the graphics canvas for rendering and and printing.
`protected mxCellEditor` `createCellEditor()`
`java.awt.Component[]` `createComponents(mxCellState state)` Hook for subclassers to create the array of heavyweights for the given state.
`protected mxConnectionHandler` `createConnectionHandler()`
`protected mxGraphComponent.mxGraphControl` `createGraphControl()` Creates the inner control that handles tooltips, preferred size and can draw cells onto a canvas.
`protected mxGraphHandler` `createGraphHandler()`
`mxCellHandler` `createHandler(mxCellState state)`
`protected void` `createHandlers()` Creates the connection-, panning and graphhandler (in this order).
`protected mxPanningHandler` `createPanningHandler()`
`protected mxSubHandler` `createSubHandler()`
`protected javax.swing.TransferHandler` `createTransferHandler()`
`protected void` `createTripleBuffer(int width, int height)` Creates the tripleBufferGraphics and tripleBuffer for the given dimension and draws the complete graph onto the triplebuffer.
`void` `destroyTripleBuffer()` Destroys the tripleBuffer and tripleBufferGraphics objects.
`void` `escape(java.awt.event.KeyEvent e)` Callback to process an escape keystroke.
`javax.swing.ImageIcon` `getBackgroundImage()`
`mxInteractiveCanvas` `getCanvas()`
`java.lang.Object` `getCellAt(int x, int y)`
`java.lang.Object` `getCellAt(int x, int y, boolean hitSwimlaneContent)`
`java.lang.Object` `getCellAt(int x, int y, boolean hitSwimlaneContent, java.lang.Object parent)` Returns the bottom-most cell that intersects the given point (x, y) in the cell hierarchy starting at the given parent.
`mxICellEditor` `getCellEditor()`
`mxICellOverlay[]` `getCellOverlays(java.lang.Object cell)` Returns the array of overlays for the given cell or null, if no overlays are defined.
`java.lang.Object[]` `getCells(java.awt.Rectangle rect)` Returns the cells inside the given rectangle.
`java.lang.Object[]` `getCells(java.awt.Rectangle rect, java.lang.Object parent)` Returns the children of the given parent that are contained in the given rectangle (x, y, width, height).
`mxConnectionHandler` `getConnectionHandler()`
`java.lang.String` `getEditingValue(java.lang.Object cell, java.util.EventObject trigger)`
`java.lang.Object[]` `getExportableCells(java.lang.Object[] cells)` Returns all cells which may be exported via datatransfer.
`javax.swing.ImageIcon` `getFoldingIcon(mxCellState state)` Returns the icon used to display the collapsed state of the specified cell state.
`java.awt.Rectangle` `getFoldingIconBounds(mxCellState state, javax.swing.ImageIcon icon)`
`mxGraph` `getGraph()`
`mxGraphComponent.mxGraphControl` `getGraphControl()`
`mxGraphHandler` `getGraphHandler()`
`java.awt.Color` `getGridColor()`
`int` `getGridStyle()`
`int` `getHorizontalPageBorder()` Returns the horizontal border between the page and the control.
`int` `getHorizontalPageCount()`
`java.lang.Object[]` `getImportableCells(java.lang.Object[] cells)` Returns all cells which may be imported via datatransfer.
`mxRectangle` `getLayoutAreaSize()` Returns the size of the area that layouts can operate in.
`java.awt.Color` `getPageBackgroundColor()`
`java.awt.Color` `getPageBorderColor()`
`java.awt.print.PageFormat` `getPageFormat()`
`double` `getPageScale()`
`java.awt.Color` `getPageShadowColor()`
`protected mxPoint` `getPageTranslate(double scale)` Should be called by a hook inside mxGraphView/mxGraph
`mxPanningHandler` `getPanningHandler()`
`mxPoint` `getPointForEvent(java.awt.event.MouseEvent e)` Returns an mxPoint representing the given event in the unscaled, non-translated coordinate space and applies the grid.
`protected java.awt.Dimension` `getPreferredSizeForPage()` Returns the (unscaled) preferred size for the current page format (scaled by pageScale).
`protected java.awt.Dimension` `getScaledPreferredSizeForGraph()` Returns the scaled preferred size for the current graph.
`mxSubHandler` `getSubHandler()`
`int` `getTolerance()`
`java.awt.image.BufferedImage` `getTripleBuffer()`
`int` `getVerticalPageBorder()` Returns the vertical border between the page and the control.
`int` `getVerticalPageCount()`
`double` `getZoomFactor()`
`int` `getZoomPolicy()`
`boolean` `hitFoldingIcon(java.lang.Object cell, int x, int y)`
`java.lang.Object[]` `importCells(java.lang.Object[] cells, double dx, double dy, java.lang.Object target, java.awt.Point location)` Clones and inserts the given cells into the graph using the move method and returns the inserted cells.
`void` `insertComponent(mxCellState state, java.awt.Component c)`
`boolean` `isAntiAlias()`
`boolean` `isCenterPage()`
`boolean` `isCenterZoom()`
`boolean` `isCloneEvent(java.awt.event.MouseEvent event)`
`boolean` `isConnectable()`
`boolean` `isConstrainedEvent(java.awt.event.MouseEvent event)` Note: This is not used during drag and drop operations due to limitations of the underlying API.
`boolean` `isDragEnabled()`
`boolean` `isEditEvent(java.awt.event.MouseEvent e)`
`boolean` `isEditing()`
`boolean` `isEnterStopsCellEditing()`
`boolean` `isEscapeEnabled()`
`boolean` `isEventsEnabled()`
`boolean` `isExportEnabled()`
`boolean` `isFoldingEnabled()`
`boolean` `isForceMarqueeEvent(java.awt.event.MouseEvent event)` Note: This is not used during drag and drop operations due to limitations of the underlying API.
`boolean` `isForceTripleBuffered()` Hook for dynamic triple buffering condition.
`boolean` `isGridEnabledEvent(java.awt.event.MouseEvent event)`
`boolean` `isGridVisible()`
`boolean` `isImportEnabled()` Returns importEnabled.
`boolean` `isInvokesStopCellEditing()`
`boolean` `isKeepSelectionVisibleOnZoom()`
`boolean` `isPageBreakVisible()`
`boolean` `isPageVisible()`
`boolean` `isPanning()`
`boolean` `isPanningEvent(java.awt.event.MouseEvent event)` Note: This is not used during drag and drop operations due to limitations of the underlying API.
`boolean` `isPreferPageSize()`
`boolean` `isSignificant(double dx, double dy)` Returns true if the absolute value of one of the given parameters is greater than the tolerance.
`boolean` `isSwimlaneSelectionEnabled()`
`boolean` `isTextAntiAlias()`
`boolean` `isToggleEvent(java.awt.event.MouseEvent event)`
`boolean` `isTripleBuffered()`
`java.lang.Object` `labelChanged(java.lang.Object cell, java.lang.Object value, java.util.EventObject evt)` Sets the label of the specified cell to the given value using mxGraph.cellLabelChanged and fires mxEvent.LABEL_CHANGED while the transaction is in progress.
`protected void` `maintainScrollBar(boolean horizontal, double factor, boolean center)`
`protected void` `paintBackground(java.awt.Graphics g)`
`protected void` `paintBackgroundImage(java.awt.Graphics g)`
`protected java.awt.Rectangle` `paintBackgroundPage(java.awt.Graphics g)`
`void` `paintGraph(java.awt.Graphics2D g, boolean drawLabels)`
`protected void` `paintGrid(java.awt.Graphics g)` Paints the grid onto the given graphics object.
`int` `print(java.awt.Graphics g, java.awt.print.PageFormat printFormat, int page)` Prints the specified page on the specified graphics using `pageFormat` for the page format.
`void` `redraw(mxCellState state)` Updates the buffer (if one exists) and repaints the given cell state.
`void` `refresh()` Refreshes the display and handles.
`void` `removeAllComponents(java.util.Hashtable<java.lang.Object,java.awt.Component[]> map)`
`void` `removeAllOverlays(java.util.Hashtable<java.lang.Object,mxICellOverlay[]> map)`
`mxICellOverlay` `removeCellOverlay(java.lang.Object cell, mxICellOverlay overlay)` Removes and returns the given overlay from the given cell.
`protected void` `removeCellOverlayComponent(mxICellOverlay overlay, java.lang.Object cell)` Notified when an overlay has been removed from the graph.
`mxICellOverlay[]` `removeCellOverlays(java.lang.Object cell)` Removes all overlays from the given cell.
`void` `removeComponent(java.awt.Component c, java.lang.Object cell)`
`void` `removeListener(mxEventSource.mxIEventListener listener)`
`void` `removeListener(mxEventSource.mxIEventListener listener, java.lang.String eventName)`
`void` `repaintTripleBuffer(java.awt.Rectangle dirty)` Clears and repaints the triple buffer at the given rectangle or repaints the complete buffer if no rectangle is specified.
`void` `scrollCellToVisible(java.lang.Object cell)` Scrolls the graph so that it shows the given cell.
`void` `scrollCellToVisible(java.lang.Object cell, boolean center)` Scrolls the graph so that it shows the given cell.
`void` `scrollToCenter(boolean horizontal)`
`void` `selectCellForEvent(java.lang.Object cell, java.awt.event.MouseEvent e)` Selects the cell for the given event.
`void` `selectCellsForEvent(java.lang.Object[] cells, java.awt.event.MouseEvent event)` Selects the cells for the given event.
`java.lang.Object[]` `selectRegion(java.awt.Rectangle rect, java.awt.event.MouseEvent e)`
`void` `setAntiAlias(boolean antiAlias)` Fires a property change event for `antiAlias`.
`void` `setBackgroundImage(javax.swing.ImageIcon image)`
`void` `setCellEditor(mxICellEditor editor)`
`mxICellOverlay` `setCellWarning(java.lang.Object cell, java.lang.String warning)` Creates an overlay for the given cell using the warning and image or warningImage and returns the new overlay.
`mxICellOverlay` `setCellWarning(java.lang.Object cell, java.lang.String warning, javax.swing.ImageIcon icon)` Creates an overlay for the given cell using the warning and image or warningImage and returns the new overlay.
`mxICellOverlay` `setCellWarning(java.lang.Object cell, java.lang.String warning, javax.swing.ImageIcon icon, boolean select)` Creates an overlay for the given cell using the warning and image or warningImage and returns the new overlay.
`void` `setCenterPage(boolean centerPage)` zoomAndCenter should be called if this is set to true.
`void` `setCenterZoom(boolean centerZoom)`
`void` `setConnectable(boolean connectable)`
`void` `setDragEnabled(boolean dragEnabled)`
`void` `setEnterStopsCellEditing(boolean enterStopsCellEditing)`
`void` `setEscapeEnabled(boolean escapeEnabled)`
`void` `setEventsEnabled(boolean eventsEnabled)`
`void` `setExportEnabled(boolean value)`
`void` `setFoldingEnabled(boolean foldingEnabled)`
`void` `setGraph(mxGraph graph)`
`void` `setGridColor(java.awt.Color gridColor)` Fires a property change event for `gridColor`.
`void` `setGridStyle(int gridStyle)` Fires a property change event for `gridStyle`.
`void` `setGridVisible(boolean gridVisible)` Fires a property change event for `gridVisible`.
`void` `setHorizontalPageCount(int horizontalPageCount)`
`void` `setImportEnabled(boolean value)` Sets importEnabled.
`void` `setInvokesStopCellEditing(boolean invokesStopCellEditing)`
`void` `setKeepSelectionVisibleOnZoom(boolean keepSelectionVisibleOnZoom)`
`void` `setPageBackgroundColor(java.awt.Color pageBackgroundColor)` Sets the color that appears behind the page.
`void` `setPageBorderColor(java.awt.Color pageBorderColor)`
`void` `setPageBreakVisible(boolean pageBreakVisible)`
`void` `setPageFormat(java.awt.print.PageFormat pageFormat)`
`void` `setPageScale(double pageScale)`
`void` `setPageShadowColor(java.awt.Color pageShadowColor)`
`void` `setPageVisible(boolean pageVisible)` Fires a property change event for `pageVisible`.
`void` `setPanning(boolean enabled)`
`void` `setPreferPageSize(boolean preferPageSize)` Fires a property change event for `preferPageSize`.
`void` `setSwimlaneSelectionEnabled(boolean swimlaneSelectionEnabled)`
`void` `setTextAntiAlias(boolean textAntiAlias)` Fires a property change event for `textAntiAlias`.
`void` `setTolerance(int tolerance)`
`void` `setToolTips(boolean enabled)`
`void` `setTripleBuffered(boolean tripleBuffered)`
`void` `setVerticalPageCount(int verticalPageCount)`
`void` `setZoomFactor(double zoomFactor)`
`void` `setZoomPolicy(int zoomPolicy)`
`mxPoint` `snapScaledPoint(mxPoint pt)`
`mxPoint` `snapScaledPoint(mxPoint pt, double dx, double dy)`
`void` `startEditing()`
`void` `startEditingAtCell(java.lang.Object cell)`
`void` `startEditingAtCell(java.lang.Object cell, java.util.EventObject evt)`
`void` `stopEditing(boolean cancel)`
`protected void` `updateCellOverlayComponent(mxCellState state, mxICellOverlay overlay)` Notified when an overlay has been removed from the graph.
`java.util.Hashtable<java.lang.Object,mxICellOverlay[]>` `updateCellOverlays(java.lang.Object cell)` Returns a hashtable with all entries from the overlays variable where a cell still exists in the model.
`void` `updateComponent(mxCellState state, java.awt.Component c)`
`void` `updateComponents()`
`java.util.Hashtable<java.lang.Object,java.awt.Component[]>` `updateComponents(java.lang.Object cell)`
`java.lang.String` `validateGraph()` Validates the graph by validating each descendant of the given cell or the root of the model.
`java.lang.String` `validateGraph(java.lang.Object cell, java.util.Hashtable<java.lang.Object,java.lang.Object> context)` Validates the graph by validating each descendant of the given cell or the root of the model.
`void` `zoom(boolean page, boolean center)`
`void` `zoom(double factor)`
`void` `zoomActual()` Function: zoomActual Resets the zoom and panning in the view.
`void` `zoomAndCenter()` Invoked after the component was resized to update the zoom if the zoom policy is not none and/or update the translation of the diagram if pageVisible and centerPage are true.
`void` `zoomIn()` Zooms into the graph by zoomFactor.
`void` `zoomOut()` Function: zoomOut Zooms out of the graph by <zoomFactor>.
`void` `zoomTo(double newScale, boolean center)`

Methods inherited from class javax.swing.JScrollPane

`createHorizontalScrollBar, createVerticalScrollBar, createViewport, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, getViewportBorderBounds, isValidateRoot, isWheelScrollingEnabled, paramString, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView, setWheelScrollingEnabled, 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, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, 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`

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, 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, 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

### GRID_STYLE_DOT

    public static final int GRID_STYLE_DOT

See Also:
  Constant Field Values

### GRID_STYLE_CROSS

    public static final int GRID_STYLE_CROSS

See Also:
  Constant Field Values

### GRID_STYLE_LINE

    public static final int GRID_STYLE_LINE

See Also:
  Constant Field Values

### GRID_STYLE_DASHED

    public static final int GRID_STYLE_DASHED

See Also:
  Constant Field Values

### ZOOM_POLICY_NONE

    public static final int ZOOM_POLICY_NONE

See Also:
  Constant Field Values

### ZOOM_POLICY_PAGE

    public static final int ZOOM_POLICY_PAGE

See Also:
  Constant Field Values

### ZOOM_POLICY_WIDTH

    public static final int ZOOM_POLICY_WIDTH

See Also:
  Constant Field Values

### DEFAULT_EXPANDED_ICON

    public static javax.swing.ImageIcon DEFAULT_EXPANDED_ICON

### DEFAULT_COLLAPSED_ICON

    public static javax.swing.ImageIcon DEFAULT_COLLAPSED_ICON

### DEFAULT_WARNING_ICON

    public static javax.swing.ImageIcon DEFAULT_WARNING_ICON

### DEFAULT_PAGESCALE

    public static final double DEFAULT_PAGESCALE

  Specifies the default page scale. Default is 1.4

  See Also:
    Constant Field Values

### graph

    protected mxGraph graph

### graphControl

    protected mxGraphComponent.mxGraphControl graphControl

### eventSource

    protected mxEventSource eventSource

### cellEditor

    protected mxICellEditor cellEditor

### connectionHandler

    protected mxConnectionHandler connectionHandler

### panningHandler

    protected mxPanningHandler panningHandler

### subHandler

    protected mxSubHandler subHandler

### graphHandler

    protected mxGraphHandler graphHandler

### backgroundImage

    protected javax.swing.ImageIcon backgroundImage

  Specifies the <mxImage> to be returned by <getBackgroundImage>. Default is null.

### pageFormat

    protected java.awt.print.PageFormat pageFormat

  Background page format.

### canvas

    protected mxInteractiveCanvas canvas

### tripleBuffer

    protected java.awt.image.BufferedImage tripleBuffer

### tripleBufferGraphics

    protected java.awt.Graphics2D tripleBufferGraphics

### pageScale

    protected double pageScale

  Defines the scaling for the background page metrics. Default is `DEFAULT_PAGESCALE`.

### pageVisible

    protected boolean pageVisible

  Specifies if the background page should be visible. Default is false.

### preferPageSize

    protected boolean preferPageSize

  If the pageFormat should be used to determine the minimal graph bounds even if the page is not visible (see pageVisible). Default is false.

### pageBreakVisible

    protected boolean pageBreakVisible

  Specifies if a dashed line should be drawn between multiple pages.

### horizontalPageCount

    protected int horizontalPageCount

  Specifies the number of pages in the horizontal direction.

### verticalPageCount

    protected int verticalPageCount

  Specifies the number of pages in the vertical direction.

### centerPage

    protected boolean centerPage

  Specifies if the background page should be centered by automatically setting the translate in the view. Default is true. This does only apply if pageVisible is true.

### pageBackgroundColor

    protected java.awt.Color pageBackgroundColor

  Color of the background area if layout view.

### pageShadowColor

    protected java.awt.Color pageShadowColor

### pageBorderColor

    protected java.awt.Color pageBorderColor

### gridVisible

    protected boolean gridVisible

  Specifies if the grid is visible. Default is false.

### gridColor

    protected java.awt.Color gridColor

### dragEnabled

    protected boolean dragEnabled

### importEnabled

    protected boolean importEnabled

### exportEnabled

    protected boolean exportEnabled

### foldingEnabled

    protected boolean foldingEnabled

  Specifies if folding (collapse and expand via an image icon in the graph should be enabled). Default is true.

### tolerance

    protected int tolerance

  Specifies the tolerance for mouse clicks. Default is 4.

### swimlaneSelectionEnabled

    protected boolean swimlaneSelectionEnabled

  Specifies if swimlanes are selected when the mouse is released over the swimlanes content area. Default is true.

### transparentSwimlaneContent

    protected boolean transparentSwimlaneContent

  Specifies if the content area should be transparent to events. Default is true.

### gridStyle

    protected int gridStyle

### expandedIcon

    protected javax.swing.ImageIcon expandedIcon

### collapsedIcon

    protected javax.swing.ImageIcon collapsedIcon

### warningIcon

    protected javax.swing.ImageIcon warningIcon

### antiAlias

    protected boolean antiAlias

### textAntiAlias

    protected boolean textAntiAlias

### escapeEnabled

    protected boolean escapeEnabled

  Specifies <escape> should be invoked when the escape key is pressed. Default is true.

### invokesStopCellEditing

    protected boolean invokesStopCellEditing

  If true, when editing is to be stopped by way of selection changing, data in diagram changing or other means stopCellEditing is invoked, and changes are saved. This is implemented in a mouse listener in this class. Default is true.

### enterStopsCellEditing

    protected boolean enterStopsCellEditing

  If true, pressing the enter key without pressing control will stop editing and accept the new value. This is used in <mxKeyHandler> to stop cell editing. Default is false.

### zoomPolicy

    protected int zoomPolicy

  Specifies the zoom policy. Default is ZOOM_POLICY_PAGE. The zoom policy does only apply if pageVisible is true.

### zoomFactor

    protected double zoomFactor

  Specifies the factor used for zoomIn and zoomOut. Default is 1.2 (120%).

### keepSelectionVisibleOnZoom

    protected boolean keepSelectionVisibleOnZoom

  Specifies if the viewport should automatically contain the selection cells after a zoom operation. Default is false.

### centerZoom

    protected boolean centerZoom

  Specifies if the zoom operations should go into the center of the actual diagram rather than going from top, left. Default is true.

### tripleBuffered

    protected boolean tripleBuffered

  Specifies if an image buffer should be used for painting the component. Default is false.

### showDirtyRectangle

    public boolean showDirtyRectangle

  Used for debugging the dirty region.

### components

    protected java.util.Hashtable<java.lang.Object,java.awt.Component[]> components

  Maps from cells to lists of heavyweights.

### overlays

    protected java.util.Hashtable<java.lang.Object,mxICellOverlay[]> overlays

  Maps from cells to lists of overlays.

### updateHandler

    protected mxEventSource.mxIEventListener updateHandler

  Updates the heavyweight component structure after any changes.

### repaintHandler

    protected mxEventSource.mxIEventListener repaintHandler

### viewChangeHandler

    protected java.beans.PropertyChangeListener viewChangeHandler

### scaleHandler

    protected mxEventSource.mxIEventListener scaleHandler

  Resets the zoom policy if the scale is changed manually.

Constructor Detail

### mxGraphComponent

    public mxGraphComponent(mxGraph graph)

Parameters:
  `graph` -

Method Detail

### createCellEditor

    protected mxCellEditor createCellEditor()

### setGraph

    public void setGraph(mxGraph graph)

### getGraph

    public mxGraph getGraph()

  Returns:
    Returns the object that contains the graph.

### createGraphControl

    protected mxGraphComponent.mxGraphControl createGraphControl()

  Creates the inner control that handles tooltips, preferred size and can draw cells onto a canvas.

### getGraphControl

    public mxGraphComponent.mxGraphControl getGraphControl()

  Returns:
    Returns the control that renders the graph.

### createHandlers

    protected void createHandlers()

  Creates the connection-, panning and graphhandler (in this order).

### createTransferHandler

    protected javax.swing.TransferHandler createTransferHandler()

### createSubHandler

    protected mxSubHandler createSubHandler()

### createGraphHandler

    protected mxGraphHandler createGraphHandler()

### getSubHandler

    public mxSubHandler getSubHandler()

### getGraphHandler

    public mxGraphHandler getGraphHandler()

### createConnectionHandler

    protected mxConnectionHandler createConnectionHandler()

### getConnectionHandler

    public mxConnectionHandler getConnectionHandler()

### createPanningHandler

    protected mxPanningHandler createPanningHandler()

### getPanningHandler

    public mxPanningHandler getPanningHandler()

### isEditing

    public boolean isEditing()

### getCellEditor

    public mxICellEditor getCellEditor()

### setCellEditor

    public void setCellEditor(mxICellEditor editor)

### getTolerance

    public int getTolerance()

  Returns:
    the tolerance

### setTolerance

    public void setTolerance(int tolerance)

  Parameters:
    `tolerance` - the tolerance to set

### getPageFormat

    public java.awt.print.PageFormat getPageFormat()

### setPageFormat

    public void setPageFormat(java.awt.print.PageFormat pageFormat)

### getPageScale

    public double getPageScale()

### setPageScale

    public void setPageScale(double pageScale)

### getLayoutAreaSize

    public mxRectangle getLayoutAreaSize()

  Returns the size of the area that layouts can operate in.

### getBackgroundImage

    public javax.swing.ImageIcon getBackgroundImage()

### setBackgroundImage

    public void setBackgroundImage(javax.swing.ImageIcon image)

### isPageVisible

    public boolean isPageVisible()

  Returns:
    the pageVisible

### setPageVisible

    public void setPageVisible(boolean pageVisible)

  Fires a property change event for `pageVisible`. zoomAndCenter should be called if this is set to true.

  Parameters:
    `pageVisible` - the pageVisible to set

### isPreferPageSize

    public boolean isPreferPageSize()

  Returns:
    the preferPageSize

### setPreferPageSize

    public void setPreferPageSize(boolean preferPageSize)

  Fires a property change event for `preferPageSize`.

  Parameters:
    `preferPageSize` - the preferPageSize to set

### isPageBreakVisible

    public boolean isPageBreakVisible()

  Returns:
    the pageVisible

### setPageBreakVisible

    public void setPageBreakVisible(boolean pageBreakVisible)

  Parameters:
    `pageBreakVisible` - the pageBreakVisible to set

### setHorizontalPageCount

    public void setHorizontalPageCount(int horizontalPageCount)

  Parameters:
    `horizontalPageCount` - the horizontalPageCount to set

### getHorizontalPageCount

    public int getHorizontalPageCount()

### setVerticalPageCount

    public void setVerticalPageCount(int verticalPageCount)

  Parameters:
    `verticalPageCount` - the verticalPageCount to set

### getVerticalPageCount

    public int getVerticalPageCount()

### isCenterPage

    public boolean isCenterPage()

  Returns:
    the centerPage

### setCenterPage

    public void setCenterPage(boolean centerPage)

  zoomAndCenter should be called if this is set to true.

  Parameters:
    `centerPage` - the centerPage to set

### getPageBackgroundColor

    public java.awt.Color getPageBackgroundColor()

  Returns:
    the pageBackgroundColor

### setPageBackgroundColor

    public void setPageBackgroundColor(java.awt.Color pageBackgroundColor)

  Sets the color that appears behind the page.

  Parameters:
    `pageBackgroundColor` - the pageBackgroundColor to set

### getPageShadowColor

    public java.awt.Color getPageShadowColor()

  Returns:
    the pageShadowColor

### setPageShadowColor

    public void setPageShadowColor(java.awt.Color pageShadowColor)

  Parameters:
    `pageShadowColor` - the pageShadowColor to set

### getPageBorderColor

    public java.awt.Color getPageBorderColor()

  Returns:
    the pageShadowColor

### setPageBorderColor

    public void setPageBorderColor(java.awt.Color pageBorderColor)

  Parameters:
    `pageBorderColor` - the pageBorderColor to set

### isKeepSelectionVisibleOnZoom

    public boolean isKeepSelectionVisibleOnZoom()

  Returns:
    the keepSelectionVisibleOnZoom

### setKeepSelectionVisibleOnZoom

    public void setKeepSelectionVisibleOnZoom(boolean keepSelectionVisibleOnZoom)

  Parameters:
    `keepSelectionVisibleOnZoom` - the keepSelectionVisibleOnZoom to set

### getZoomFactor

    public double getZoomFactor()

  Returns:
    the zoomFactor

### setZoomFactor

    public void setZoomFactor(double zoomFactor)

  Parameters:
    `zoomFactor` - the zoomFactor to set

### isCenterZoom

    public boolean isCenterZoom()

  Returns:
    the centerZoom

### setCenterZoom

    public void setCenterZoom(boolean centerZoom)

  Parameters:
    `centerZoom` - the centerZoom to set

### setZoomPolicy

    public void setZoomPolicy(int zoomPolicy)

### getZoomPolicy

    public int getZoomPolicy()

### escape

    public void escape(java.awt.event.KeyEvent e)

  Callback to process an escape keystroke.

  Parameters:
    `e` -

### importCells

    public java.lang.Object[] importCells(java.lang.Object[] cells,
                                          double dx,
                                          double dy,
                                          java.lang.Object target,
                                          java.awt.Point location)

  Clones and inserts the given cells into the graph using the move method and returns the inserted cells. This shortcut is used if cells are inserted via datatransfer.

### refresh

    public void refresh()

  Refreshes the display and handles.

### getPointForEvent

    public mxPoint getPointForEvent(java.awt.event.MouseEvent e)

  Returns an mxPoint representing the given event in the unscaled, non-translated coordinate space and applies the grid.

### startEditing

    public void startEditing()

### startEditingAtCell

    public void startEditingAtCell(java.lang.Object cell)

### startEditingAtCell

    public void startEditingAtCell(java.lang.Object cell,
                                   java.util.EventObject evt)

### getEditingValue

    public java.lang.String getEditingValue(java.lang.Object cell,
                                            java.util.EventObject trigger)

### stopEditing

    public void stopEditing(boolean cancel)

### labelChanged

    public java.lang.Object labelChanged(java.lang.Object cell,
                                         java.lang.Object value,
                                         java.util.EventObject evt)

  Sets the label of the specified cell to the given value using mxGraph.cellLabelChanged and fires mxEvent.LABEL_CHANGED while the transaction is in progress. Returns the cell whose label was changed.

  Parameters:
    `cell` - Cell whose label should be changed.
    `value` - New value of the label.
    `evt` - Optional event that triggered the change.

### getPreferredSizeForPage

    protected java.awt.Dimension getPreferredSizeForPage()

  Returns the (unscaled) preferred size for the current page format (scaled by pageScale).

### getVerticalPageBorder

    public int getVerticalPageBorder()

  Returns the vertical border between the page and the control.

### getHorizontalPageBorder

    public int getHorizontalPageBorder()

  Returns the horizontal border between the page and the control.

### getScaledPreferredSizeForGraph

    protected java.awt.Dimension getScaledPreferredSizeForGraph()

  Returns the scaled preferred size for the current graph.

### getPageTranslate

    protected mxPoint getPageTranslate(double scale)

  Should be called by a hook inside mxGraphView/mxGraph

### zoomAndCenter

    public void zoomAndCenter()

  Invoked after the component was resized to update the zoom if the zoom policy is not none and/or update the translation of the diagram if pageVisible and centerPage are true.

### zoomIn

    public void zoomIn()

  Zooms into the graph by zoomFactor.

### zoomOut

    public void zoomOut()

  Function: zoomOut Zooms out of the graph by <zoomFactor>.

### zoom

    public void zoom(double factor)

### zoomTo

    public void zoomTo(double newScale,
                       boolean center)

### zoomActual

    public void zoomActual()

  Function: zoomActual Resets the zoom and panning in the view.

### zoom

    public void zoom(boolean page,
                     boolean center)

### maintainScrollBar

    protected void maintainScrollBar(boolean horizontal,
                                     double factor,
                                     boolean center)

### scrollToCenter

    public void scrollToCenter(boolean horizontal)

### scrollCellToVisible

    public void scrollCellToVisible(java.lang.Object cell)

  Scrolls the graph so that it shows the given cell.

  Parameters:
    `cell` -

### scrollCellToVisible

    public void scrollCellToVisible(java.lang.Object cell,
                                    boolean center)

  Scrolls the graph so that it shows the given cell.

  Parameters:
    `cell` -

### getCellAt

    public java.lang.Object getCellAt(int x,
                                      int y)

  Parameters:
    `x` -
    `y` -
  Returns:
    Returns the cell at the given location.

### getCellAt

    public java.lang.Object getCellAt(int x,
                                      int y,
                                      boolean hitSwimlaneContent)

  Parameters:
    `x` -
    `y` -
    `hitSwimlaneContent` -
  Returns:
    Returns the cell at the given location.

### getCellAt

    public java.lang.Object getCellAt(int x,
                                      int y,
                                      boolean hitSwimlaneContent,
                                      java.lang.Object parent)

  Returns the bottom-most cell that intersects the given point (x, y) in the cell hierarchy starting at the given parent.

  Parameters:
    `x` - X-coordinate of the location to be checked.
    `y` - Y-coordinate of the location to be checked.
    `parent` - <mxCell> that should be used as the root of the recursion. Default is <defaultParent>.
  Returns:
    Returns the child at the given location.

### setSwimlaneSelectionEnabled

    public void setSwimlaneSelectionEnabled(boolean swimlaneSelectionEnabled)

### isSwimlaneSelectionEnabled

    public boolean isSwimlaneSelectionEnabled()

### selectRegion

    public java.lang.Object[] selectRegion(java.awt.Rectangle rect,
                                           java.awt.event.MouseEvent e)

### getCells

    public java.lang.Object[] getCells(java.awt.Rectangle rect)

  Returns the cells inside the given rectangle.

  Returns:
    Returns the cells inside the given rectangle.

### getCells

    public java.lang.Object[] getCells(java.awt.Rectangle rect,
                                       java.lang.Object parent)

  Returns the children of the given parent that are contained in the given rectangle (x, y, width, height). The result is added to the optional result array, which is returned from the function. If no result array is specified then a new array is created and returned.

  Returns:
    Returns the children inside the given rectangle.

### selectCellsForEvent

    public void selectCellsForEvent(java.lang.Object[] cells,
                                    java.awt.event.MouseEvent event)

  Selects the cells for the given event.

### selectCellForEvent

    public void selectCellForEvent(java.lang.Object cell,
                                   java.awt.event.MouseEvent e)

  Selects the cell for the given event.

### isSignificant

    public boolean isSignificant(double dx,
                                 double dy)

  Returns true if the absolute value of one of the given parameters is greater than the tolerance.

### getFoldingIcon

    public javax.swing.ImageIcon getFoldingIcon(mxCellState state)

  Returns the icon used to display the collapsed state of the specified cell state.

### getFoldingIconBounds

    public java.awt.Rectangle getFoldingIconBounds(mxCellState state,
                                                   javax.swing.ImageIcon icon)

### hitFoldingIcon

    public boolean hitFoldingIcon(java.lang.Object cell,
                                  int x,
                                  int y)

### setToolTips

    public void setToolTips(boolean enabled)

  Parameters:
    `enabled` -

### isConnectable

    public boolean isConnectable()

### setConnectable

    public void setConnectable(boolean connectable)

  Parameters:
    `connectable` -

### isPanning

    public boolean isPanning()

### setPanning

    public void setPanning(boolean enabled)

  Parameters:
    `enabled` -

### isEscapeEnabled

    public boolean isEscapeEnabled()

  Returns:
    the escapeEnabled

### setEscapeEnabled

    public void setEscapeEnabled(boolean escapeEnabled)

  Parameters:
    `escapeEnabled` - the escapeEnabled to set

### isInvokesStopCellEditing

    public boolean isInvokesStopCellEditing()

  Returns:
    the escapeEnabled

### setInvokesStopCellEditing

    public void setInvokesStopCellEditing(boolean invokesStopCellEditing)

  Parameters:
    `invokesStopCellEditing` - the invokesStopCellEditing to set

### isEnterStopsCellEditing

    public boolean isEnterStopsCellEditing()

  Returns:
    the enterStopsCellEditing

### setEnterStopsCellEditing

    public void setEnterStopsCellEditing(boolean enterStopsCellEditing)

  Parameters:
    `enterStopsCellEditing` - the enterStopsCellEditing to set

### isDragEnabled

    public boolean isDragEnabled()

  Returns:
    the dragEnabled

### setDragEnabled

    public void setDragEnabled(boolean dragEnabled)

  Parameters:
    `dragEnabled` - the dragEnabled to set

### isGridVisible

    public boolean isGridVisible()

  Returns:
    the gridVisible

### setGridVisible

    public void setGridVisible(boolean gridVisible)

  Fires a property change event for `gridVisible`.

  Parameters:
    `gridVisible` - the gridVisible to set

### isAntiAlias

    public boolean isAntiAlias()

  Returns:
    the gridVisible

### setAntiAlias

    public void setAntiAlias(boolean antiAlias)

  Fires a property change event for `antiAlias`.

  Parameters:
    `antiAlias` - the antiAlias to set

### isTextAntiAlias

    public boolean isTextAntiAlias()

  Returns:
    the gridVisible

### setTextAntiAlias

    public void setTextAntiAlias(boolean textAntiAlias)

  Fires a property change event for `textAntiAlias`.

  Parameters:
    `textAntiAlias` - the textAntiAlias to set

### isTripleBuffered

    public boolean isTripleBuffered()

  Returns:
    the tripleBuffered

### isForceTripleBuffered

    public boolean isForceTripleBuffered()

  Hook for dynamic triple buffering condition.

### setTripleBuffered

    public void setTripleBuffered(boolean tripleBuffered)

  Parameters:
    `tripleBuffered` - the tripleBuffered to set

### getGridColor

    public java.awt.Color getGridColor()

  Returns:
    the gridColor

### setGridColor

    public void setGridColor(java.awt.Color gridColor)

  Fires a property change event for `gridColor`.

  Parameters:
    `gridColor` - the gridColor to set

### getGridStyle

    public int getGridStyle()

  Returns:
    the gridStyle

### setGridStyle

    public void setGridStyle(int gridStyle)

  Fires a property change event for `gridStyle`.

  Parameters:
    `gridStyle` - the gridStyle to set

### isImportEnabled

    public boolean isImportEnabled()

  Returns importEnabled.

### setImportEnabled

    public void setImportEnabled(boolean value)

  Sets importEnabled.

### getImportableCells

    public java.lang.Object[] getImportableCells(java.lang.Object[] cells)

  Returns all cells which may be imported via datatransfer.

### canImportCell

    public boolean canImportCell(java.lang.Object cell)

  Returns true if the given cell can be imported via datatransfer. This returns importEnabled.

### isExportEnabled

    public boolean isExportEnabled()

  Returns:
    the exportEnabled

### setExportEnabled

    public void setExportEnabled(boolean value)

  Parameters:
    `value` - the exportEnabled to set

### getExportableCells

    public java.lang.Object[] getExportableCells(java.lang.Object[] cells)

  Returns all cells which may be exported via datatransfer.

### canExportCell

    public boolean canExportCell(java.lang.Object cell)

  Returns true if the given cell can be exported via datatransfer.

### isFoldingEnabled

    public boolean isFoldingEnabled()

  Returns:
    the foldingEnabled

### setFoldingEnabled

    public void setFoldingEnabled(boolean foldingEnabled)

  Parameters:
    `foldingEnabled` - the foldingEnabled to set

### isEditEvent

    public boolean isEditEvent(java.awt.event.MouseEvent e)

### isCloneEvent

    public boolean isCloneEvent(java.awt.event.MouseEvent event)

  Parameters:
    `event` -
  Returns:
    Returns true if the given event should toggle selected cells.

### isToggleEvent

    public boolean isToggleEvent(java.awt.event.MouseEvent event)

  Parameters:
    `event` -
  Returns:
    Returns true if the given event should toggle selected cells.

### isGridEnabledEvent

    public boolean isGridEnabledEvent(java.awt.event.MouseEvent event)

  Parameters:
    `event` -
  Returns:
    Returns true if the given event allows the grid to be applied.

### isPanningEvent

    public boolean isPanningEvent(java.awt.event.MouseEvent event)

  Note: This is not used during drag and drop operations due to limitations of the underlying API. To enable this for move operations set dragEnabled to false.

  Parameters:
    `event` -
  Returns:
    Returns true if the given event is a panning event.

### isConstrainedEvent

    public boolean isConstrainedEvent(java.awt.event.MouseEvent event)

  Note: This is not used during drag and drop operations due to limitations of the underlying API. To enable this for move operations set dragEnabled to false.

  Parameters:
    `event` -
  Returns:
    Returns true if the given event is constrained.

### isForceMarqueeEvent

    public boolean isForceMarqueeEvent(java.awt.event.MouseEvent event)

  Note: This is not used during drag and drop operations due to limitations of the underlying API. To enable this for move operations set dragEnabled to false.

  Parameters:
    `event` -
  Returns:
    Returns true if the given event is constrained.

### snapScaledPoint

    public mxPoint snapScaledPoint(mxPoint pt)

### snapScaledPoint

    public mxPoint snapScaledPoint(mxPoint pt,
                                   double dx,
                                   double dy)

### print

    public int print(java.awt.Graphics g,
                     java.awt.print.PageFormat printFormat,
                     int page)

  Prints the specified page on the specified graphics using `pageFormat` for the page format.

  Specified by:
    `print` in interface `java.awt.print.Printable`
  Parameters:
    `g` - The graphics to paint the graph on.
    `printFormat` - The page format to use for printing.
    `page` - The page to print
  Returns:
    Returns `Printable.PAGE_EXISTS` or `Printable.NO_SUCH_PAGE`.

### getCanvas

    public mxInteractiveCanvas getCanvas()

### getTripleBuffer

    public java.awt.image.BufferedImage getTripleBuffer()

### createCanvas

    public mxInteractiveCanvas createCanvas()

  Hook for subclassers to replace the graphics canvas for rendering and and printing. This must be overridden to return a custom canvas if there are any custom shapes.

### createHandler

    public mxCellHandler createHandler(mxCellState state)

  Parameters:
    `state` - Cell state for which a handler should be created.
  Returns:
    Returns the handler to be used for the given cell state.

### createComponents

    public java.awt.Component[] createComponents(mxCellState state)

  Hook for subclassers to create the array of heavyweights for the given state.

### insertComponent

    public void insertComponent(mxCellState state,
                                java.awt.Component c)

### removeComponent

    public void removeComponent(java.awt.Component c,
                                java.lang.Object cell)

### updateComponent

    public void updateComponent(mxCellState state,
                                java.awt.Component c)

### updateComponents

    public void updateComponents()

### removeAllComponents

    public void removeAllComponents(java.util.Hashtable<java.lang.Object,java.awt.Component[]> map)

### removeAllOverlays

    public void removeAllOverlays(java.util.Hashtable<java.lang.Object,mxICellOverlay[]> map)

### updateComponents

    public java.util.Hashtable<java.lang.Object,java.awt.Component[]> updateComponents(java.lang.Object cell)

### validateGraph

    public java.lang.String validateGraph()

  Validates the graph by validating each descendant of the given cell or the root of the model. Context is an object that contains the validation state for the complete validation run. The validation errors are attached to their cells using <setWarning>. This function returns true if no validation errors exist in the graph.

### validateGraph

    public java.lang.String validateGraph(java.lang.Object cell,
                                          java.util.Hashtable<java.lang.Object,java.lang.Object> context)

  Validates the graph by validating each descendant of the given cell or the root of the model. Context is an object that contains the validation state for the complete validation run. The validation errors are attached to their cells using <setWarning>. This function returns true if no validation errors exist in the graph.

  Parameters:
    `cell` - Cell to start the validation recursion.
    `context` - Object that represents the global validation state.

### addCellOverlay

    public mxICellOverlay addCellOverlay(java.lang.Object cell,
                                         mxICellOverlay overlay)

  Adds an overlay for the specified cell. This method fires an addoverlay event and returns the new overlay.

  Parameters:
    `cell` - Cell to add the overlay for.
    `overlay` - Overlay to be added for the cell.

### getCellOverlays

    public mxICellOverlay[] getCellOverlays(java.lang.Object cell)

  Returns the array of overlays for the given cell or null, if no overlays are defined.

  Parameters:
    `cell` - Cell whose overlays should be returned.

### removeCellOverlay

    public mxICellOverlay removeCellOverlay(java.lang.Object cell,
                                            mxICellOverlay overlay)

  Removes and returns the given overlay from the given cell. This method fires a removeoverlay event. If no overlay is given, then all overlays are removed using removeOverlays.

  Parameters:
    `cell` - Cell whose overlay should be removed.
    `overlay` - Optional overlay to be removed.

### removeCellOverlays

    public mxICellOverlay[] removeCellOverlays(java.lang.Object cell)

  Removes all overlays from the given cell. This method fires a removeoverlay event for each removed overlay and returns the array of overlays that was removed from the cell.

  Parameters:
    `cell` - Cell whose overlays should be removed.

### removeCellOverlayComponent

    protected void removeCellOverlayComponent(mxICellOverlay overlay,
                                              java.lang.Object cell)

  Notified when an overlay has been removed from the graph. This implementation removes the given overlay from its parent if it is a component inside a component hierarchy.

### updateCellOverlayComponent

    protected void updateCellOverlayComponent(mxCellState state,
                                              mxICellOverlay overlay)

  Notified when an overlay has been removed from the graph. This implementation removes the given overlay from its parent if it is a component inside a component hierarchy.

### clearCellOverlays

    public void clearCellOverlays()

  Removes all overlays in the graph.

### clearCellOverlays

    public void clearCellOverlays(java.lang.Object cell)

  Removes all overlays in the graph for the given cell and all its descendants. If no cell is specified then all overlays are removed from the graph. This implementation uses removeOverlays to remove the overlays from the individual cells.

  Parameters:
    `cell` - Optional cell that represents the root of the subtree to remove the overlays from. Default is the root in the model.

### setCellWarning

    public mxICellOverlay setCellWarning(java.lang.Object cell,
                                         java.lang.String warning)

  Creates an overlay for the given cell using the warning and image or warningImage and returns the new overlay. If the warning is null or a zero length string, then all overlays are removed from the cell instead.

  Parameters:
    `cell` - Cell whose warning should be set.
    `warning` - String that represents the warning to be displayed.

### setCellWarning

    public mxICellOverlay setCellWarning(java.lang.Object cell,
                                         java.lang.String warning,
                                         javax.swing.ImageIcon icon)

  Creates an overlay for the given cell using the warning and image or warningImage and returns the new overlay. If the warning is null or a zero length string, then all overlays are removed from the cell instead.

  Parameters:
    `cell` - Cell whose warning should be set.
    `warning` - String that represents the warning to be displayed.
    `icon` - Optional image to be used for the overlay. Default is warningImageBasename.

### setCellWarning

    public mxICellOverlay setCellWarning(java.lang.Object cell,
                                         java.lang.String warning,
                                         javax.swing.ImageIcon icon,
                                         boolean select)

  Creates an overlay for the given cell using the warning and image or warningImage and returns the new overlay. If the warning is null or a zero length string, then all overlays are removed from the cell instead.

  Parameters:
    `cell` - Cell whose warning should be set.
    `warning` - String that represents the warning to be displayed.
    `icon` - Optional image to be used for the overlay. Default is warningImageBasename.
    `select` - Optional boolean indicating if a click on the overlay should select the corresponding cell. Default is false.

### updateCellOverlays

    public java.util.Hashtable<java.lang.Object,mxICellOverlay[]> updateCellOverlays(java.lang.Object cell)

  Returns a hashtable with all entries from the overlays variable where a cell still exists in the model. The entries are removed from the global hashtable so that the remaining entries reflect those whose cell have been removed from the model. If no state is available for a given cell then its overlays are temporarly removed from the rendering control, but kept in the result.

### paintBackground

    protected void paintBackground(java.awt.Graphics g)

### paintBackgroundPage

    protected java.awt.Rectangle paintBackgroundPage(java.awt.Graphics g)

### paintBackgroundImage

    protected void paintBackgroundImage(java.awt.Graphics g)

### paintGrid

    protected void paintGrid(java.awt.Graphics g)

  Paints the grid onto the given graphics object.

### redraw

    public void redraw(mxCellState state)

  Updates the buffer (if one exists) and repaints the given cell state.

### checkTripleBuffer

    public void checkTripleBuffer()

  Checks if the triple buffer exists and creates a new one if it does not. Also compares the size of the buffer with the size of the graph and drops the buffer if it has a different size.

### createTripleBuffer

    protected void createTripleBuffer(int width,
                                      int height)

  Creates the tripleBufferGraphics and tripleBuffer for the given dimension and draws the complete graph onto the triplebuffer.

  Parameters:
    `width` -
    `height` -

### destroyTripleBuffer

    public void destroyTripleBuffer()

  Destroys the tripleBuffer and tripleBufferGraphics objects.

### repaintTripleBuffer

    public void repaintTripleBuffer(java.awt.Rectangle dirty)

  Clears and repaints the triple buffer at the given rectangle or repaints the complete buffer if no rectangle is specified.

  Parameters:
    `dirty` -

### paintGraph

    public void paintGraph(java.awt.Graphics2D g,
                           boolean drawLabels)

### isEventsEnabled

    public boolean isEventsEnabled()

  Returns:
    Returns true if event dispatching is enabled in the event source.
  See Also:
    `mxEventSource.isEventsEnabled()`

### setEventsEnabled

    public void setEventsEnabled(boolean eventsEnabled)

  Parameters:
    `eventsEnabled` -
  See Also:
    `mxEventSource.setEventsEnabled(boolean)`

### addListener

    public void addListener(java.lang.String eventName,
                            mxEventSource.mxIEventListener listener)

  Parameters:
    `eventName` -
    `listener` -
  See Also:
    `mxEventSource.addListener(java.lang.String, com.mxgraph.util.mxEventSource.mxIEventListener)`

### removeListener

    public void removeListener(mxEventSource.mxIEventListener listener)

  Parameters:
    `listener` - Listener instance.

### removeListener

    public void removeListener(mxEventSource.mxIEventListener listener,
                               java.lang.String eventName)

  Parameters:
    `eventName` - Name of the event.
    `listener` - Listener instance.

JGraph X 1.3.0.0

Copyright (c) 2008 Gaudenz Alder. All rights reserved.