Class AnnotatingGraphMousePlugin<V,E>
java.lang.Object
edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
edu.uci.ics.jung.visualization.annotations.AnnotatingGraphMousePlugin<V,E>
- All Implemented Interfaces:
GraphMousePlugin
,MouseListener
,MouseMotionListener
,EventListener
public class AnnotatingGraphMousePlugin<V,E>
extends AbstractGraphMousePlugin
implements MouseListener, MouseMotionListener
AnnotatingGraphMousePlugin can create Shape and Text annotations
in a layer of the graph visualization.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
the Paintable that draws a Shape annotation only while it is being created -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
set to true when the AnnotationPaintable has been added to the view componentprotected int
additional modifiers for the action of adding to an existing selectionprotected Color
color for annotationsprotected AnnotationManager
a Paintable to store all Annotationsprotected MultiLayerTransformer
holds rendering transformsprotected boolean
protected Annotation.Layer
layer for annotationsprotected VisualizationServer.Paintable
the Paintable for the Shape annotationprotected RenderContext
<V, E> holds rendering settingsprotected RectangularShape
used to draw a Shape annotationFields inherited from class edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
cursor, down, modifiers
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an instance with defaults for primary (button 1) and secondary (button 1 + shift) selection.AnnotatingGraphMousePlugin
(RenderContext<V, E> rc, int selectionModifiers, int additionalModifiers) Create an instance with the specified primary and secondary selection mechanisms. -
Method Summary
Modifier and TypeMethodDescriptiongetLayer()
boolean
isFill()
void
void
Draws the transient Paintable that will become a Shape annotation when the mouse button is releasedvoid
void
void
void
Sets the location for an Annotation.void
Completes the process of adding a Shape annotation and removed the transient paintablevoid
setAnnotationColor
(Color lensColor) void
setFill
(boolean fill) void
setLayer
(Annotation.Layer layer) void
Methods inherited from class edu.uci.ics.jung.visualization.control.AbstractGraphMousePlugin
checkModifiers, getCursor, getModifiers, setCursor, setModifiers
-
Field Details
-
additionalModifiers
protected int additionalModifiersadditional modifiers for the action of adding to an existing selection -
rectangularShape
used to draw a Shape annotation -
lensPaintable
the Paintable for the Shape annotation -
annotationManager
a Paintable to store all Annotations -
annotationColor
color for annotations -
layer
layer for annotations -
fill
protected boolean fill -
basicTransformer
holds rendering transforms -
rc
holds rendering settings -
added
protected boolean addedset to true when the AnnotationPaintable has been added to the view component
-
-
Constructor Details
-
AnnotatingGraphMousePlugin
Create an instance with defaults for primary (button 1) and secondary (button 1 + shift) selection.- Parameters:
rc
- the RenderContext for which this plugin will be used
-
AnnotatingGraphMousePlugin
public AnnotatingGraphMousePlugin(RenderContext<V, E> rc, int selectionModifiers, int additionalModifiers) Create an instance with the specified primary and secondary selection mechanisms.- Parameters:
rc
- the RenderContext for which this plugin will be usedselectionModifiers
- for primary selectionadditionalModifiers
- for additional selection
-
-
Method Details
-
getAnnotationColor
- Returns:
- Returns the lensColor.
-
setAnnotationColor
- Parameters:
lensColor
- The lensColor to set.
-
mousePressed
Sets the location for an Annotation. Will either pop up a dialog to prompt for text input for a text annotation, or begin the process of drawing a Shape annotation- Specified by:
mousePressed
in interfaceMouseListener
- Parameters:
e
- the event
-
mouseReleased
Completes the process of adding a Shape annotation and removed the transient paintable- Specified by:
mouseReleased
in interfaceMouseListener
-
mouseDragged
Draws the transient Paintable that will become a Shape annotation when the mouse button is released- Specified by:
mouseDragged
in interfaceMouseMotionListener
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
- Specified by:
mouseExited
in interfaceMouseListener
-
mouseMoved
- Specified by:
mouseMoved
in interfaceMouseMotionListener
-
getRectangularShape
- Returns:
- the rect
-
setRectangularShape
- Parameters:
rect
- the rect to set
-
getLayer
- Returns:
- the layer
-
setLayer
- Parameters:
layer
- the layer to set
-
isFill
public boolean isFill()- Returns:
- the fill
-
setFill
public void setFill(boolean fill) - Parameters:
fill
- the fill to set
-