org.jgraph.graph

Class EdgeView.EdgeHandle

public static class EdgeView.EdgeHandle extends Object implements CellHandle, Serializable

Field Summary
protected intcurrentIndex
Holds the index of the current (editing) label or point.
protected intcurrentLabel
Holds the index of the current (editing) label or point.
protected Point2DcurrentPoint
protected EdgeViewedge
protected booleanedgeModified
Indicates whether the edge has been modified during the last mouse pressed and dragged operations.
protected booleanediting
True if the cell is being edited.
protected Rectangle2D[]extraLabelLocations
protected booleanfirstOverlayCall
protected JGraphgraph
protected JComponenthighlight
Component that is used for highlighting cells if the graph does not allow XOR painting.
protected Point2DinitialLabelLocation
Holds the initial location of the label.
protected booleanisEdgeConnectable
protected booleanlabel
protected Rectangle2Dloc
protected EdgeVieworig
protected Rectangle2D[]r
protected EdgeViewrelevantEdge
protected booleansource
protected booleantarget
Constructor Summary
EdgeHandle(EdgeView edge, GraphContext ctx)
Method Summary
protected ConnectionSetcreateConnectionSet(EdgeView view, boolean verbose)
protected JComponentcreateHighlight()
Creates the component that is used for highlighting cells if the graph does not allow XOR painting.
protected RectanglegetHighlightBounds(JGraph graph, CellView cellView)
Returns the bounds to be used to highlight the given cell view.
protected Point2DgetRelativeLabelPosition(EdgeView edge, Point2D p)
protected voidhighlight(JGraph graph, CellView cellView)
Highlights the given cell view or removes the highlight if no cell view is specified.
protected voidinvalidate()
booleanisAddPointEvent(MouseEvent event)
Returning true signifies a mouse event adds a new point to an edge.
booleanisConstrainedMoveEvent(MouseEvent e)
protected booleanisEditing()
booleanisRemovePointEvent(MouseEvent event)
Returning true signifies a mouse event removes a given point.
protected booleanisSourceEditing()
protected booleanisTargetEditing()
voidmouseDragged(MouseEvent event)
voidmouseMoved(MouseEvent event)
Invoked when the mouse pointer has been moved on a component (with no buttons down).
voidmousePressed(MouseEvent event)
voidmouseReleased(MouseEvent e)
voidoverlay(Graphics g)
voidpaint(Graphics g)
protected voidpaintPort(Graphics g, CellView p)
protected voidprocessNestedMap(Map nested, boolean clone)
protected voidreloadPoints(EdgeView edge)
protected booleansnap(boolean source, Point2D point)

Field Detail

currentIndex

protected int currentIndex
Holds the index of the current (editing) label or point.

currentLabel

protected int currentLabel
Holds the index of the current (editing) label or point.

currentPoint

protected Point2D currentPoint

edge

protected EdgeView edge

edgeModified

protected boolean edgeModified
Indicates whether the edge has been modified during the last mouse pressed and dragged operations.

editing

protected boolean editing
True if the cell is being edited.

extraLabelLocations

protected transient Rectangle2D[] extraLabelLocations

firstOverlayCall

protected boolean firstOverlayCall

graph

protected JGraph graph

highlight

protected JComponent highlight
Component that is used for highlighting cells if the graph does not allow XOR painting.

initialLabelLocation

protected Point2D initialLabelLocation
Holds the initial location of the label.

isEdgeConnectable

protected boolean isEdgeConnectable

label

protected boolean label

loc

protected transient Rectangle2D loc

orig

protected EdgeView orig

r

protected transient Rectangle2D[] r

relevantEdge

protected EdgeView relevantEdge

source

protected boolean source

target

protected boolean target

Constructor Detail

EdgeHandle

public EdgeHandle(EdgeView edge, GraphContext ctx)

Method Detail

createConnectionSet

protected ConnectionSet createConnectionSet(EdgeView view, boolean verbose)

createHighlight

protected JComponent createHighlight()
Creates the component that is used for highlighting cells if the graph does not allow XOR painting.

getHighlightBounds

protected Rectangle getHighlightBounds(JGraph graph, CellView cellView)
Returns the bounds to be used to highlight the given cell view.

Parameters: graph cellView

Returns:

getRelativeLabelPosition

protected Point2D getRelativeLabelPosition(EdgeView edge, Point2D p)

highlight

protected void highlight(JGraph graph, CellView cellView)
Highlights the given cell view or removes the highlight if no cell view is specified.

Parameters: graph cellView

invalidate

protected void invalidate()

isAddPointEvent

public boolean isAddPointEvent(MouseEvent event)
Returning true signifies a mouse event adds a new point to an edge.

isConstrainedMoveEvent

public boolean isConstrainedMoveEvent(MouseEvent e)

isEditing

protected boolean isEditing()

isRemovePointEvent

public boolean isRemovePointEvent(MouseEvent event)
Returning true signifies a mouse event removes a given point.

isSourceEditing

protected boolean isSourceEditing()

isTargetEditing

protected boolean isTargetEditing()

mouseDragged

public void mouseDragged(MouseEvent event)

mouseMoved

public void mouseMoved(MouseEvent event)
Invoked when the mouse pointer has been moved on a component (with no buttons down).

mousePressed

public void mousePressed(MouseEvent event)

mouseReleased

public void mouseReleased(MouseEvent e)

overlay

public void overlay(Graphics g)

paint

public void paint(Graphics g)

paintPort

protected void paintPort(Graphics g, CellView p)

processNestedMap

protected void processNestedMap(Map nested, boolean clone)

reloadPoints

protected void reloadPoints(EdgeView edge)

snap

protected boolean snap(boolean source, Point2D point)
Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.