public static class EdgeView.EdgeHandle extends java.lang.Object implements CellHandle, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected int |
currentIndex
Holds the index of the current (editing) label or point.
|
protected int |
currentLabel
Holds the index of the current (editing) label or point.
|
protected java.awt.geom.Point2D |
currentPoint |
protected EdgeView |
edge |
protected boolean |
edgeModified
Indicates whether the edge has been modified during the last mouse
pressed and dragged operations.
|
protected boolean |
editing
True if the cell is being edited.
|
protected java.awt.geom.Rectangle2D[] |
extraLabelLocations |
protected boolean |
firstOverlayCall |
protected JGraph |
graph |
protected javax.swing.JComponent |
highlight
Component that is used for highlighting cells if
the graph does not allow XOR painting.
|
protected java.awt.geom.Point2D |
initialLabelLocation
Holds the initial location of the label.
|
protected boolean |
isEdgeConnectable |
protected boolean |
label |
protected java.awt.geom.Rectangle2D |
loc |
protected EdgeView |
orig |
protected java.awt.geom.Rectangle2D[] |
r |
protected EdgeView |
relevantEdge |
protected boolean |
source |
protected boolean |
target |
Constructor and Description |
---|
EdgeHandle(EdgeView edge,
GraphContext ctx) |
Modifier and Type | Method and Description |
---|---|
protected ConnectionSet |
createConnectionSet(EdgeView view,
boolean verbose) |
protected javax.swing.JComponent |
createHighlight()
Creates the component that is used for highlighting cells if
the graph does not allow XOR painting.
|
protected java.awt.Rectangle |
getHighlightBounds(JGraph graph,
CellView cellView)
Returns the bounds to be used to highlight the given cell view.
|
protected java.awt.geom.Point2D |
getRelativeLabelPosition(EdgeView edge,
java.awt.geom.Point2D p) |
protected void |
highlight(JGraph graph,
CellView cellView)
Highlights the given cell view or removes the highlight if
no cell view is specified.
|
protected void |
invalidate() |
boolean |
isAddPointEvent(java.awt.event.MouseEvent event)
Returning true signifies a mouse event adds a new point to an edge.
|
boolean |
isConstrainedMoveEvent(java.awt.event.MouseEvent e) |
protected boolean |
isEditing() |
boolean |
isRemovePointEvent(java.awt.event.MouseEvent event)
Returning true signifies a mouse event removes a given point.
|
protected boolean |
isSourceEditing() |
protected boolean |
isTargetEditing() |
void |
mouseDragged(java.awt.event.MouseEvent event)
Messaged when the user drags the selection.
|
void |
mouseMoved(java.awt.event.MouseEvent event)
Invoked when the mouse pointer has been moved on a component (with no
buttons down).
|
void |
mousePressed(java.awt.event.MouseEvent event)
Messaged when a mouse button is pressed.
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Messaged when the drag operation has
terminated with a drop.
|
void |
overlay(java.awt.Graphics g)
Paint the handle on the given graphics object during mouse
operations.
|
void |
paint(java.awt.Graphics g)
Paint the handle on the given graphics object once.
|
protected void |
paintPort(java.awt.Graphics g,
CellView p) |
protected void |
processNestedMap(java.util.Map nested,
boolean clone) |
protected void |
reloadPoints(EdgeView edge) |
protected boolean |
snap(boolean source,
java.awt.geom.Point2D point) |
protected JGraph graph
protected EdgeView edge
protected EdgeView orig
protected boolean label
protected boolean source
protected boolean target
protected int currentLabel
protected int currentIndex
protected java.awt.geom.Point2D currentPoint
protected transient java.awt.geom.Rectangle2D[] r
protected transient java.awt.geom.Rectangle2D loc
protected transient java.awt.geom.Rectangle2D[] extraLabelLocations
protected boolean firstOverlayCall
protected boolean isEdgeConnectable
protected EdgeView relevantEdge
protected boolean editing
protected java.awt.geom.Point2D initialLabelLocation
protected boolean edgeModified
protected javax.swing.JComponent highlight
public EdgeHandle(EdgeView edge, GraphContext ctx)
protected javax.swing.JComponent createHighlight()
protected void reloadPoints(EdgeView edge)
public void paint(java.awt.Graphics g)
CellHandle
paint
in interface CellHandle
g
- the graphics object to paint the handle onprotected void highlight(JGraph graph, CellView cellView)
graph
- cellView
- protected java.awt.Rectangle getHighlightBounds(JGraph graph, CellView cellView)
graph
- cellView
- public void overlay(java.awt.Graphics g)
CellHandle
overlay
in interface CellHandle
g
- the graphics object to paint the handle onprotected void paintPort(java.awt.Graphics g, CellView p)
protected boolean snap(boolean source, java.awt.geom.Point2D point)
public boolean isConstrainedMoveEvent(java.awt.event.MouseEvent e)
public boolean isAddPointEvent(java.awt.event.MouseEvent event)
public boolean isRemovePointEvent(java.awt.event.MouseEvent event)
protected boolean isSourceEditing()
protected boolean isTargetEditing()
protected boolean isEditing()
public void mouseMoved(java.awt.event.MouseEvent event)
mouseMoved
in interface CellHandle
event
- the mouse event to be processedpublic void mousePressed(java.awt.event.MouseEvent event)
CellHandle
mousePressed
in interface CellHandle
event
- the mouse event to be processedpublic void mouseDragged(java.awt.event.MouseEvent event)
CellHandle
mouseDragged
in interface CellHandle
event
- the drag event to be processedprotected java.awt.geom.Point2D getRelativeLabelPosition(EdgeView edge, java.awt.geom.Point2D p)
public void mouseReleased(java.awt.event.MouseEvent e)
CellHandle
mouseReleased
in interface CellHandle
e
- the drop event to be processedprotected void processNestedMap(java.util.Map nested, boolean clone)
protected ConnectionSet createConnectionSet(EdgeView view, boolean verbose)
protected void invalidate()
Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.