Package org.jgraph.graph
Class EdgeView.EdgeHandle
- java.lang.Object
-
- org.jgraph.graph.EdgeView.EdgeHandle
-
- All Implemented Interfaces:
java.io.Serializable,CellHandle
- Enclosing class:
- EdgeView
public static class EdgeView.EdgeHandle extends java.lang.Object implements CellHandle, java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intcurrentIndexHolds the index of the current (editing) label or point.protected intcurrentLabelHolds the index of the current (editing) label or point.protected java.awt.geom.Point2DcurrentPointprotected EdgeViewedgeprotected booleanedgeModifiedIndicates whether the edge has been modified during the last mouse pressed and dragged operations.protected booleaneditingTrue if the cell is being edited.protected java.awt.geom.Rectangle2D[]extraLabelLocationsprotected booleanfirstOverlayCallprotected JGraphgraphprotected javax.swing.JComponenthighlightComponent that is used for highlighting cells if the graph does not allow XOR painting.protected java.awt.geom.Point2DinitialLabelLocationHolds the initial location of the label.protected booleanisEdgeConnectableprotected booleanlabelprotected java.awt.geom.Rectangle2Dlocprotected EdgeVieworigprotected java.awt.geom.Rectangle2D[]rprotected EdgeViewrelevantEdgeprotected booleansourceprotected booleantarget
-
Constructor Summary
Constructors Constructor Description EdgeHandle(EdgeView edge, GraphContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ConnectionSetcreateConnectionSet(EdgeView view, boolean verbose)protected javax.swing.JComponentcreateHighlight()Creates the component that is used for highlighting cells if the graph does not allow XOR painting.protected java.awt.RectanglegetHighlightBounds(JGraph graph, CellView cellView)Returns the bounds to be used to highlight the given cell view.protected java.awt.geom.Point2DgetRelativeLabelPosition(EdgeView edge, java.awt.geom.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(java.awt.event.MouseEvent event)Returning true signifies a mouse event adds a new point to an edge.booleanisConstrainedMoveEvent(java.awt.event.MouseEvent e)protected booleanisEditing()booleanisRemovePointEvent(java.awt.event.MouseEvent event)Returning true signifies a mouse event removes a given point.protected booleanisSourceEditing()protected booleanisTargetEditing()voidmouseDragged(java.awt.event.MouseEvent event)Messaged when the user drags the selection.voidmouseMoved(java.awt.event.MouseEvent event)Invoked when the mouse pointer has been moved on a component (with no buttons down).voidmousePressed(java.awt.event.MouseEvent event)Messaged when a mouse button is pressed.voidmouseReleased(java.awt.event.MouseEvent e)Messaged when the drag operation has terminated with a drop.voidoverlay(java.awt.Graphics g)Paint the handle on the given graphics object during mouse operations.voidpaint(java.awt.Graphics g)Paint the handle on the given graphics object once.protected voidpaintPort(java.awt.Graphics g, CellView p)protected voidprocessNestedMap(java.util.Map nested, boolean clone)protected voidreloadPoints(EdgeView edge)protected booleansnap(boolean source, java.awt.geom.Point2D point)
-
-
-
Field Detail
-
graph
protected JGraph graph
-
edge
protected EdgeView edge
-
orig
protected EdgeView orig
-
label
protected boolean label
-
source
protected boolean source
-
target
protected boolean target
-
currentLabel
protected int currentLabel
Holds the index of the current (editing) label or point.
-
currentIndex
protected int currentIndex
Holds the index of the current (editing) label or point.
-
currentPoint
protected java.awt.geom.Point2D currentPoint
-
r
protected transient java.awt.geom.Rectangle2D[] r
-
loc
protected transient java.awt.geom.Rectangle2D loc
-
extraLabelLocations
protected transient java.awt.geom.Rectangle2D[] extraLabelLocations
-
firstOverlayCall
protected boolean firstOverlayCall
-
isEdgeConnectable
protected boolean isEdgeConnectable
-
relevantEdge
protected EdgeView relevantEdge
-
editing
protected boolean editing
True if the cell is being edited.
-
initialLabelLocation
protected java.awt.geom.Point2D initialLabelLocation
Holds the initial location of the label.
-
edgeModified
protected boolean edgeModified
Indicates whether the edge has been modified during the last mouse pressed and dragged operations.
-
highlight
protected javax.swing.JComponent highlight
Component that is used for highlighting cells if the graph does not allow XOR painting.
-
-
Constructor Detail
-
EdgeHandle
public EdgeHandle(EdgeView edge, GraphContext ctx)
-
-
Method Detail
-
createHighlight
protected javax.swing.JComponent createHighlight()
Creates the component that is used for highlighting cells if the graph does not allow XOR painting.
-
reloadPoints
protected void reloadPoints(EdgeView edge)
-
paint
public void paint(java.awt.Graphics g)
Description copied from interface:CellHandlePaint the handle on the given graphics object once.- Specified by:
paintin interfaceCellHandle- Parameters:
g- the graphics object to paint the handle on
-
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-
-
getHighlightBounds
protected java.awt.Rectangle getHighlightBounds(JGraph graph, CellView cellView)
Returns the bounds to be used to highlight the given cell view.- Parameters:
graph-cellView-- Returns:
-
overlay
public void overlay(java.awt.Graphics g)
Description copied from interface:CellHandlePaint the handle on the given graphics object during mouse operations.- Specified by:
overlayin interfaceCellHandle- Parameters:
g- the graphics object to paint the handle on
-
paintPort
protected void paintPort(java.awt.Graphics g, CellView p)
-
snap
protected boolean snap(boolean source, java.awt.geom.Point2D point)
-
isConstrainedMoveEvent
public boolean isConstrainedMoveEvent(java.awt.event.MouseEvent e)
-
isAddPointEvent
public boolean isAddPointEvent(java.awt.event.MouseEvent event)
Returning true signifies a mouse event adds a new point to an edge.
-
isRemovePointEvent
public boolean isRemovePointEvent(java.awt.event.MouseEvent event)
Returning true signifies a mouse event removes a given point.
-
isSourceEditing
protected boolean isSourceEditing()
-
isTargetEditing
protected boolean isTargetEditing()
-
isEditing
protected boolean isEditing()
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent event)
Invoked when the mouse pointer has been moved on a component (with no buttons down).- Specified by:
mouseMovedin interfaceCellHandle- Parameters:
event- the mouse event to be processed
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent event)
Description copied from interface:CellHandleMessaged when a mouse button is pressed.- Specified by:
mousePressedin interfaceCellHandle- Parameters:
event- the mouse event to be processed
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent event)
Description copied from interface:CellHandleMessaged when the user drags the selection. The Controller is responsible to determine whether the mouse is inside the parent graph or not.- Specified by:
mouseDraggedin interfaceCellHandle- Parameters:
event- the drag event to be processed
-
getRelativeLabelPosition
protected java.awt.geom.Point2D getRelativeLabelPosition(EdgeView edge, java.awt.geom.Point2D p)
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
Description copied from interface:CellHandleMessaged when the drag operation has terminated with a drop.- Specified by:
mouseReleasedin interfaceCellHandle- Parameters:
e- the drop event to be processed
-
processNestedMap
protected void processNestedMap(java.util.Map nested, boolean clone)
-
createConnectionSet
protected ConnectionSet createConnectionSet(EdgeView view, boolean verbose)
-
invalidate
protected void invalidate()
-
-