|
JGraph X 0.15.0.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JScrollPane
com.mxgraph.swing.mxGraphComponent
public class mxGraphComponent
Nested Class Summary | |
---|---|
class |
mxGraphComponent.mxGraphControl
|
Nested classes/interfaces inherited from class javax.swing.JScrollPane |
---|
JScrollPane.AccessibleJScrollPane, JScrollPane.ScrollBar |
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 | |
---|---|
protected boolean |
antiAlias
|
protected ImageIcon |
backgroundImage
Specifies the |
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 ImageIcon |
collapsedIcon
|
protected Hashtable |
components
Maps from cells to lists of heavyweights. |
protected mxConnectionHandler |
connectionHandler
|
protected mxGraphComponent.mxGraphControl |
control
|
static ImageIcon |
DEFAULT_COLLAPSED_ICON
|
static ImageIcon |
DEFAULT_EXPANDED_ICON
|
static double |
DEFAULT_PAGESCALE
Specifies the default page scale. |
static ImageIcon |
DEFAULT_WARNING_ICON
|
protected boolean |
dragEnabled
|
protected boolean |
dropEnabled
|
protected boolean |
escapeEnabled
|
static String |
EVENT_ADDOVERLAY
|
static String |
EVENT_AFTER_LABELCHANGED
|
static String |
EVENT_AFTERPAINT
|
static String |
EVENT_BEFORE_LABELCHANGED
|
static String |
EVENT_BEFOREPAINT
|
static String |
EVENT_LABELCHANGED
|
static String |
EVENT_REMOVEOVERLAY
|
protected mxEventSource |
eventSource
|
protected ImageIcon |
expandedIcon
|
protected boolean |
foldingEnabled
Specifies if folding (collapse and expand via an image icon in the graph should be enabled). |
protected mxGraph |
graph
|
protected mxGraphHandler |
graphHandler
|
static int |
GRID_STYLE_CROSS
|
static int |
GRID_STYLE_DASHED
|
static int |
GRID_STYLE_DOT
|
static int |
GRID_STYLE_LINE
|
protected 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 |
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 Hashtable |
overlays
Maps from cells to lists of overlays. |
protected Color |
pageBackgroundColor
Color of the background area if layout view. |
protected boolean |
pageBreakVisible
Specifies if a dashed line should be drawn between multiple pages. |
protected PageFormat |
pageFormat
Background page format. |
protected double |
pageScale
Defines the scaling for the background page metrics. |
protected 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.mxEventListener |
repaintHandler
|
protected mxEventSource.mxEventListener |
scaleHandler
Resets the zoom policy if the scale is changed manually. |
boolean |
showDirtyRectangle
Used for debugging the dirty region. |
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 BufferedImage |
tripleBuffer
|
protected boolean |
tripleBuffered
Specifies if an image buffer should be used for painting the component. |
protected Graphics2D |
tripleBufferGraphics
|
protected mxEventSource.mxEventListener |
updateHandler
Updates the heavyweight component structure after any changes. |
protected int |
verticalPageCount
Specifies the number of pages in the vertical direction. |
protected PropertyChangeListener |
viewChangeHandler
|
protected 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 java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
mxGraphComponent(mxGraph graph)
|
Method Summary | |
---|---|
void |
addListener(String eventName,
mxEventSource.mxEventListener listener)
|
mxIOverlay |
addOverlay(Object cell,
mxIOverlay overlay)
Adds an overlay for the specified cell. |
void |
checkTripleBuffer()
Checks if the triple buffer exists and creates a new one if it does not. |
void |
clearOverlays()
Removes all overlays in the graph. |
void |
clearOverlays(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. |
Component[] |
createComponents(mxCellState state)
Hook for subclassers to create the array of heavyweights for the given state. |
protected mxConnectionHandler |
createConnectionHandler()
|
protected mxGraphComponent.mxGraphControl |
createControl()
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()
Create the connection-, panning and graphhandler (in this order). |
protected mxPanningHandler |
createPanningHandler()
|
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 |
edit()
|
void |
edit(EventObject trigger)
|
void |
edit(Object cell,
EventObject trigger)
|
void |
escape(KeyEvent e)
Callback to process an escape keystroke. |
ImageIcon |
getBackgroundImage()
|
mxInteractiveCanvas |
getCanvas()
|
Object |
getCellAt(int x,
int y)
|
Object |
getCellAt(int x,
int y,
boolean hitSwimlaneContent)
|
Object |
getCellAt(int x,
int y,
boolean hitSwimlaneContent,
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()
|
Object[] |
getCells(Rectangle rect)
|
Object[] |
getCells(Rectangle rect,
Object parent)
Returns the children of the given parent that are contained in the given rectangle (x, y, width, height). |
mxConnectionHandler |
getConnectionHandler()
|
mxGraphComponent.mxGraphControl |
getControl()
|
String |
getEditingValue(Object cell,
EventObject trigger)
|
ImageIcon |
getFoldingIcon(mxCellState state)
Returns the icon used to display the collapsed state of the specified cell state. |
Rectangle |
getFoldingIconBounds(mxCellState state,
ImageIcon icon)
|
mxGraph |
getGraph()
|
mxGraphHandler |
getGraphHandler()
|
Color |
getGridColor()
|
int |
getGridStyle()
|
int |
getHorizontalPageBorder()
Returns the horizontal border between the page and the control. |
int |
getHorizontalPageCount()
|
mxRectangle |
getLayoutAreaSize()
Returns the size of the area that layouts can operate in. |
mxIOverlay[] |
getOverlays(Object cell)
Returns the array of overlays for the given cell or null, if no overlays are defined. |
Color |
getPageBackgroundColor()
|
PageFormat |
getPageFormat()
|
double |
getPageScale()
|
Color |
getPageShadowColor()
|
protected mxPoint |
getPageTranslate(double scale)
Should be called by a hook inside mxGraphView/mxGraph |
mxPanningHandler |
getPanningHandler()
|
mxPoint |
getPointForEvent(MouseEvent e)
Returns an mxPoint representing the given event in the unscaled, non-translated coordinate space and applies the grid. |
protected Dimension |
getPreferredSizeForPage()
Returns the (unscaled) preferred size for the current page format (scaled by pageScale). |
protected Dimension |
getScaledPreferredSizeForGraph()
Returns the scaled preferred size for the current graph. |
int |
getTolerance()
|
BufferedImage |
getTripleBuffer()
|
int |
getVerticalPageBorder()
Returns the vertical border between the page and the control. |
int |
getVerticalPageCount()
|
double |
getZoomFactor()
|
int |
getZoomPolicy()
|
boolean |
hitFoldingIcon(Object cell,
int x,
int y)
|
Object[] |
importCells(Object[] cells,
double dx,
double dy,
Object target,
Point location)
Clones and inserts the given cells into the graph using the move method and returns the inserted cells. |
void |
insertComponent(mxCellState state,
Component c)
|
boolean |
isAntiAlias()
|
boolean |
isCenterPage()
|
boolean |
isCenterZoom()
|
boolean |
isConnectable()
|
boolean |
isConstrainedEvent(MouseEvent event)
Note: This is not used during drag and drop operations due to limitations of the underlying API. |
boolean |
isDragEnabled()
|
boolean |
isDropEnabled()
|
boolean |
isEditEvent(MouseEvent e)
|
boolean |
isEscapeEnabled()
|
boolean |
isEventsEnabled()
|
boolean |
isFoldingEnabled()
|
boolean |
isForceTripleBuffered()
Hook for dynamic triple buffering condition. |
boolean |
isGridEnabledEvent(MouseEvent event)
|
boolean |
isGridVisible()
|
boolean |
isInvokesStopCellEditing()
|
boolean |
isKeepSelectionVisibleOnZoom()
|
boolean |
isPageBreakVisible()
|
boolean |
isPageVisible()
|
boolean |
isPanning()
|
boolean |
isPanningEvent(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(MouseEvent event)
|
boolean |
isTripleBuffered()
|
void |
labelChanged(Object cell,
Object newValue,
EventObject trigger)
|
protected void |
maintainScrollBar(boolean horizontal,
double factor,
boolean center)
|
protected void |
paintBackground(Graphics g)
|
protected void |
paintBackgroundImage(Graphics g)
|
protected Rectangle |
paintBackgroundPage(Graphics g)
|
void |
paintGraph(Graphics2D g,
boolean drawLabels)
|
protected void |
paintGrid(Graphics g)
Paints the grid onto the given graphics object. |
int |
print(Graphics g,
PageFormat printFormat,
int page)
Prints the specified page on the specified graphics using pageForm 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(Hashtable map)
|
void |
removeAllOverlays(Hashtable map)
|
void |
removeComponent(Component c,
Object cell)
|
void |
removeListener(mxEventSource.mxEventListener listener)
|
void |
removeListener(String eventName,
mxEventSource.mxEventListener listener)
|
mxIOverlay |
removeOverlay(Object cell,
mxIOverlay overlay)
Removes and returns the given overlay from the given cell. |
protected void |
removeOverlayComponent(mxIOverlay overlay,
Object cell)
Notified when an overlay has been removed from the graph. |
mxIOverlay[] |
removeOverlays(Object cell)
Removes all overlays from the given cell. |
void |
repaintTripleBuffer(Rectangle dirty)
Clears and repaints the triple buffer at the given rectangle or repaints the complete buffer if no rectangle is specified. |
void |
scrollCellToVisible(Object cell)
Scrolls the graph so that it shows the given cell. |
void |
scrollToCenter(boolean horizontal)
|
void |
selectCellForEvent(Object cell,
MouseEvent e)
|
void |
selectCellsForEvent(Object[] cells,
MouseEvent event)
|
Object[] |
selectRegion(Rectangle rect,
MouseEvent e)
|
void |
setAntiAlias(boolean antiAlias)
Fires a property change event for antiAlias . |
void |
setBackgroundImage(ImageIcon image)
|
void |
setCellEditor(mxICellEditor editor)
|
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 |
setDropEnabled(boolean dropEnabled)
|
void |
setEscapeEnabled(boolean escapeEnabled)
|
void |
setEventsEnabled(boolean eventsEnabled)
|
void |
setFoldingEnabled(boolean foldingEnabled)
|
void |
setGraph(mxGraph graph)
|
void |
setGridColor(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 |
setInvokesStopCellEditing(boolean invokesStopCellEditing)
|
void |
setKeepSelectionVisibleOnZoom(boolean keepSelectionVisibleOnZoom)
|
void |
setPageBackgroundColor(Color pageBackgroundColor)
Sets the color that appears behind the page. |
void |
setPageBreakVisible(boolean pageBreakVisible)
|
void |
setPageFormat(PageFormat pageFormat)
|
void |
setPageScale(double pageScale)
|
void |
setPageShadowColor(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)
|
mxIOverlay |
setWarning(Object cell,
String warning)
Creates an overlay for the given cell using the warning and image or warningImage and returns the new overlay. |
mxIOverlay |
setWarning(Object cell,
String warning,
ImageIcon icon)
Creates an overlay for the given cell using the warning and image or warningImage and returns the new overlay. |
mxIOverlay |
setWarning(Object cell,
String warning,
ImageIcon icon,
boolean select)
Creates an overlay for the given cell using the warning and image or warningImage and returns the new overlay. |
void |
setZoomFactor(double zoomFactor)
|
void |
setZoomPolicy(int zoomPolicy)
|
mxPoint |
snapScaledPoint(mxPoint pt)
|
mxPoint |
snapScaledPoint(mxPoint pt,
double dx,
double dy)
|
void |
startEditingAtCell(Object cell,
EventObject trigger)
|
void |
stopEditing(boolean cancel)
|
void |
updateComponent(mxCellState state,
Component c)
|
void |
updateComponents()
|
Hashtable |
updateComponents(Object cell)
|
protected void |
updateOverlayComponent(mxCellState state,
mxIOverlay overlay)
Notified when an overlay has been removed from the graph. |
Hashtable |
updateOverlays(Object cell)
Returns a hashtable with all entries from the overlays variable where a cell still exists in the model. |
void |
zoom(boolean page,
boolean center)
|
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 |
void |
zoomTo(double newScale,
boolean center)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String EVENT_BEFORE_LABELCHANGED
public static final String EVENT_LABELCHANGED
public static final String EVENT_AFTER_LABELCHANGED
public static final String EVENT_ADDOVERLAY
public static final String EVENT_REMOVEOVERLAY
public static final String EVENT_BEFOREPAINT
public static final String EVENT_AFTERPAINT
public static final int GRID_STYLE_DOT
public static final int GRID_STYLE_CROSS
public static final int GRID_STYLE_LINE
public static final int GRID_STYLE_DASHED
public static final int ZOOM_POLICY_NONE
public static final int ZOOM_POLICY_PAGE
public static final int ZOOM_POLICY_WIDTH
public static ImageIcon DEFAULT_EXPANDED_ICON
public static ImageIcon DEFAULT_COLLAPSED_ICON
public static ImageIcon DEFAULT_WARNING_ICON
public static final double DEFAULT_PAGESCALE
protected mxGraph graph
protected mxGraphComponent.mxGraphControl control
protected mxEventSource eventSource
protected mxICellEditor cellEditor
protected mxConnectionHandler connectionHandler
protected mxPanningHandler panningHandler
protected mxGraphHandler graphHandler
protected ImageIcon backgroundImage
protected PageFormat pageFormat
protected mxInteractiveCanvas canvas
protected BufferedImage tripleBuffer
protected Graphics2D tripleBufferGraphics
protected double pageScale
DEFAULT_PAGESCALE
.
protected boolean pageVisible
protected boolean preferPageSize
protected boolean pageBreakVisible
protected int horizontalPageCount
protected int verticalPageCount
protected boolean centerPage
protected Color pageBackgroundColor
protected Color pageShadowColor
protected boolean gridVisible
protected Color gridColor
protected boolean dragEnabled
protected boolean dropEnabled
protected boolean foldingEnabled
protected int tolerance
protected boolean swimlaneSelectionEnabled
protected boolean transparentSwimlaneContent
protected int gridStyle
protected ImageIcon expandedIcon
protected ImageIcon collapsedIcon
protected ImageIcon warningIcon
protected boolean antiAlias
protected boolean textAntiAlias
protected boolean escapeEnabled
protected boolean invokesStopCellEditing
protected int zoomPolicy
protected double zoomFactor
protected boolean keepSelectionVisibleOnZoom
protected boolean centerZoom
protected boolean tripleBuffered
public boolean showDirtyRectangle
protected Hashtable components
protected Hashtable overlays
protected mxEventSource.mxEventListener updateHandler
protected mxEventSource.mxEventListener repaintHandler
protected PropertyChangeListener viewChangeHandler
protected mxEventSource.mxEventListener scaleHandler
Constructor Detail |
---|
public mxGraphComponent(mxGraph graph)
graph
- Method Detail |
---|
public void setGraph(mxGraph graph)
public mxGraph getGraph()
protected mxGraphComponent.mxGraphControl createControl()
public mxGraphComponent.mxGraphControl getControl()
protected void createHandlers()
protected mxGraphHandler createGraphHandler()
public mxGraphHandler getGraphHandler()
protected mxConnectionHandler createConnectionHandler()
public mxConnectionHandler getConnectionHandler()
protected mxPanningHandler createPanningHandler()
public mxPanningHandler getPanningHandler()
public mxICellEditor getCellEditor()
public void setCellEditor(mxICellEditor editor)
public int getTolerance()
public void setTolerance(int tolerance)
tolerance
- the tolerance to setpublic PageFormat getPageFormat()
public void setPageFormat(PageFormat pageFormat)
public double getPageScale()
public void setPageScale(double pageScale)
public mxRectangle getLayoutAreaSize()
public ImageIcon getBackgroundImage()
public void setBackgroundImage(ImageIcon image)
public boolean isPageVisible()
public void setPageVisible(boolean pageVisible)
pageVisible
.
zoomAndCenter should be called if this is set to true.
pageVisible
- the pageVisible to setpublic boolean isPreferPageSize()
public void setPreferPageSize(boolean preferPageSize)
preferPageSize
.
preferPageSize
- the preferPageSize to setpublic boolean isPageBreakVisible()
public void setPageBreakVisible(boolean pageBreakVisible)
pageBreakVisible
- the pageBreakVisible to setpublic void setHorizontalPageCount(int horizontalPageCount)
horizontalPageCount
- the horizontalPageCount to setpublic int getHorizontalPageCount()
public void setVerticalPageCount(int verticalPageCount)
verticalPageCount
- the verticalPageCount to setpublic int getVerticalPageCount()
public boolean isCenterPage()
public void setCenterPage(boolean centerPage)
centerPage
- the centerPage to setpublic Color getPageBackgroundColor()
public void setPageBackgroundColor(Color pageBackgroundColor)
pageBackgroundColor
- the pageBackgroundColor to setpublic Color getPageShadowColor()
public void setPageShadowColor(Color pageShadowColor)
pageShadowColor
- the pageShadowColor to setpublic boolean isKeepSelectionVisibleOnZoom()
public void setKeepSelectionVisibleOnZoom(boolean keepSelectionVisibleOnZoom)
keepSelectionVisibleOnZoom
- the keepSelectionVisibleOnZoom to setpublic double getZoomFactor()
public void setZoomFactor(double zoomFactor)
zoomFactor
- the zoomFactor to setpublic boolean isCenterZoom()
public void setCenterZoom(boolean centerZoom)
centerZoom
- the centerZoom to setpublic void setZoomPolicy(int zoomPolicy)
public int getZoomPolicy()
public void escape(KeyEvent e)
e
- public Object[] importCells(Object[] cells, double dx, double dy, Object target, Point location)
public void refresh()
public mxPoint getPointForEvent(MouseEvent e)
public void edit()
public void edit(EventObject trigger)
public void edit(Object cell, EventObject trigger)
public void startEditingAtCell(Object cell, EventObject trigger)
public String getEditingValue(Object cell, EventObject trigger)
public void stopEditing(boolean cancel)
public void labelChanged(Object cell, Object newValue, EventObject trigger)
cell
- newValue
- trigger
- protected Dimension getPreferredSizeForPage()
public int getVerticalPageBorder()
public int getHorizontalPageBorder()
protected Dimension getScaledPreferredSizeForGraph()
protected mxPoint getPageTranslate(double scale)
public void zoomAndCenter()
public void zoomIn()
public void zoomOut()
public void zoomTo(double newScale, boolean center)
public void zoomActual()
public void zoom(boolean page, boolean center)
protected void maintainScrollBar(boolean horizontal, double factor, boolean center)
public void scrollToCenter(boolean horizontal)
public void scrollCellToVisible(Object cell)
cell
- public Object getCellAt(int x, int y)
x
- y
-
public Object getCellAt(int x, int y, boolean hitSwimlaneContent)
x
- y
- hitSwimlaneContent
-
public Object getCellAt(int x, int y, boolean hitSwimlaneContent, Object parent)
x
- X-coordinate of the location to be checked.y
- Y-coordinate of the location to be checked.parent
- public void setSwimlaneSelectionEnabled(boolean swimlaneSelectionEnabled)
public boolean isSwimlaneSelectionEnabled()
public Object[] selectRegion(Rectangle rect, MouseEvent e)
public Object[] getCells(Rectangle rect)
x
- y
- width
- height
-
public Object[] getCells(Rectangle rect, Object parent)
x
- X-coordinate of the rectangle.y
- Y-coordinate of the rectangle.width
- Width of the rectangle.height
- Height of the rectangle.parent
- public void selectCellsForEvent(Object[] cells, MouseEvent event)
cells
- event
- public void selectCellForEvent(Object cell, MouseEvent e)
cell
- e
- public boolean isSignificant(double dx, double dy)
public ImageIcon getFoldingIcon(mxCellState state)
public Rectangle getFoldingIconBounds(mxCellState state, ImageIcon icon)
public boolean hitFoldingIcon(Object cell, int x, int y)
public void setToolTips(boolean enabled)
enabled
- public boolean isConnectable()
public void setConnectable(boolean connectable)
connectable
- public boolean isPanning()
public void setPanning(boolean enabled)
enabled
- public boolean isEscapeEnabled()
public void setEscapeEnabled(boolean escapeEnabled)
escapeEnabled
- the escapeEnabled to setpublic boolean isInvokesStopCellEditing()
public void setInvokesStopCellEditing(boolean invokesStopCellEditing)
invokesStopCellEditing
- the invokesStopCellEditing to setpublic boolean isDragEnabled()
public void setDragEnabled(boolean dragEnabled)
dragEnabled
- the dragEnabled to setpublic boolean isGridVisible()
public void setGridVisible(boolean gridVisible)
gridVisible
.
gridVisible
- the gridVisible to setpublic boolean isAntiAlias()
public void setAntiAlias(boolean antiAlias)
antiAlias
.
antiAlias
- the antiAlias to setpublic boolean isTextAntiAlias()
public void setTextAntiAlias(boolean textAntiAlias)
textAntiAlias
.
textAntiAlias
- the textAntiAlias to setpublic boolean isTripleBuffered()
public boolean isForceTripleBuffered()
public void setTripleBuffered(boolean tripleBuffered)
tripleBuffered
- the tripleBuffered to setpublic Color getGridColor()
public void setGridColor(Color gridColor)
gridColor
.
gridColor
- the gridColor to setpublic int getGridStyle()
public void setGridStyle(int gridStyle)
gridStyle
.
gridStyle
- the gridStyle to setpublic boolean isDropEnabled()
public void setDropEnabled(boolean dropEnabled)
dropEnabled
- the dropEnabled to setpublic boolean isFoldingEnabled()
public void setFoldingEnabled(boolean foldingEnabled)
foldingEnabled
- the foldingEnabled to setpublic boolean isEditEvent(MouseEvent e)
public boolean isToggleEvent(MouseEvent event)
event
-
public boolean isGridEnabledEvent(MouseEvent event)
event
-
public boolean isPanningEvent(MouseEvent event)
event
-
public boolean isConstrainedEvent(MouseEvent event)
event
-
public mxPoint snapScaledPoint(mxPoint pt)
public mxPoint snapScaledPoint(mxPoint pt, double dx, double dy)
public int print(Graphics g, PageFormat printFormat, int page)
pageForm
for the page format.
print
in interface Printable
g
- The graphics to paint the graph on.printFormat
- The page format to use for printing.page
- The page to print
Printable.PAGE_EXISTS
or
Printable.NO_SUCH_PAGE
.public mxInteractiveCanvas getCanvas()
public BufferedImage getTripleBuffer()
public mxInteractiveCanvas createCanvas()
public mxCellHandler createHandler(mxCellState state)
state
- Cell state for which a handler should be created.
public Component[] createComponents(mxCellState state)
public void insertComponent(mxCellState state, Component c)
public void removeComponent(Component c, Object cell)
public void updateComponent(mxCellState state, Component c)
public void updateComponents()
public void removeAllComponents(Hashtable map)
public void removeAllOverlays(Hashtable map)
public Hashtable updateComponents(Object cell)
public mxIOverlay addOverlay(Object cell, mxIOverlay overlay)
cell
- Cell to add the overlay for.overlay
- Overlay to be added for the cell.public mxIOverlay[] getOverlays(Object cell)
cell
- Cell whose overlays should be returned.public mxIOverlay removeOverlay(Object cell, mxIOverlay overlay)
cell
- Cell whose overlay should be removed.overlay
- Optional overlay to be removed.public mxIOverlay[] removeOverlays(Object cell)
cell
- Cell whose overlays should be removed.protected void removeOverlayComponent(mxIOverlay overlay, Object cell)
protected void updateOverlayComponent(mxCellState state, mxIOverlay overlay)
public void clearOverlays()
public void clearOverlays(Object cell)
cell
- Optional cell that represents the root of the subtree to
remove the overlays from. Default is the root in the model.public mxIOverlay setWarning(Object cell, String warning)
cell
- Cell whose warning should be set.warning
- String that represents the warning to be displayed.public mxIOverlay setWarning(Object cell, String warning, ImageIcon icon)
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.public mxIOverlay setWarning(Object cell, String warning, ImageIcon icon, boolean select)
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.public Hashtable updateOverlays(Object cell)
protected void paintBackground(Graphics g)
protected Rectangle paintBackgroundPage(Graphics g)
protected void paintBackgroundImage(Graphics g)
protected void paintGrid(Graphics g)
public void redraw(mxCellState state)
public void checkTripleBuffer()
protected void createTripleBuffer(int width, int height)
width
- height
- public void destroyTripleBuffer()
public void repaintTripleBuffer(Rectangle dirty)
dirty
- public void paintGraph(Graphics2D g, boolean drawLabels)
public boolean isEventsEnabled()
mxEventSource.isEventsEnabled()
public void setEventsEnabled(boolean eventsEnabled)
eventsEnabled
- mxEventSource.setEventsEnabled(boolean)
public void addListener(String eventName, mxEventSource.mxEventListener listener)
eventName
- listener
- mxEventSource.addListener(java.lang.String, com.mxgraph.util.mxEventSource.mxEventListener)
public void removeListener(mxEventSource.mxEventListener listener)
listener
- mxEventSource.removeListener(com.mxgraph.util.mxEventSource.mxEventListener)
public void removeListener(String eventName, mxEventSource.mxEventListener listener)
eventName
- listener
- mxEventSource.removeListener(java.lang.String, com.mxgraph.util.mxEventSource.mxEventListener)
|
JGraph X 0.15.0.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |