Package ghidra.graph.viewer.event.mouse
Class VertexMouseInfo<V extends VisualVertex,E extends VisualEdge<V>>
- java.lang.Object
-
- ghidra.graph.viewer.event.mouse.VertexMouseInfo<V,E>
-
- Type Parameters:
V
- the vertex typeE
- the edge type
public class VertexMouseInfo<V extends VisualVertex,E extends VisualEdge<V>> extends java.lang.Object
A class that knows how and where a given vertex was clicked. Further, this class knows how to get clicked components within a given vertex.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.Component
mousedDestinationComponent
protected V
vertex
-
Constructor Summary
Constructors Constructor Description VertexMouseInfo(java.awt.event.MouseEvent originalMouseEvent, V vertex, java.awt.geom.Point2D vertexBasedClickPoint, GraphViewer<V,E> viewer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forwardEvent()
java.awt.Component
getClickedComponent()
java.awt.Cursor
getCursorForClickedComponent()
java.awt.Point
getDeepestComponentBasedClickPoint()
java.lang.Object
getEventSource()
java.awt.event.MouseEvent
getOriginalMouseEvent()
java.awt.event.MouseEvent
getTranslatedMouseEvent()
V
getVertex()
GraphViewer<V,E>
getViewer()
boolean
isButtonClick()
boolean
isGrabArea()
boolean
isPopupClick()
boolean
isScaledPastInteractionThreshold()
boolean
isVertexSelected()
void
selectVertex(boolean addToSelection)
Selects, or 'pick's the given vertex.void
setClickedComponent(java.awt.Component clickedComponent, java.awt.geom.Point2D vertexBasedPoint)
You can use this method to override which Java component will get the forwarded event.void
simulateMouseEnteredEvent()
void
simulateMouseExitedEvent()
java.lang.String
toString()
-
-
-
Field Detail
-
vertex
protected final V extends VisualVertex vertex
-
mousedDestinationComponent
protected java.awt.Component mousedDestinationComponent
-
-
Constructor Detail
-
VertexMouseInfo
public VertexMouseInfo(java.awt.event.MouseEvent originalMouseEvent, V vertex, java.awt.geom.Point2D vertexBasedClickPoint, GraphViewer<V,E> viewer)
-
-
Method Detail
-
isScaledPastInteractionThreshold
public boolean isScaledPastInteractionThreshold()
-
getCursorForClickedComponent
public java.awt.Cursor getCursorForClickedComponent()
-
isGrabArea
public boolean isGrabArea()
-
isButtonClick
public boolean isButtonClick()
-
isVertexSelected
public boolean isVertexSelected()
-
selectVertex
public void selectVertex(boolean addToSelection)
Selects, or 'pick's the given vertex.- Parameters:
addToSelection
- true signals to add the given vertex to the set of selected vertices; false signals to clear the existing selected vertices before selecting the given vertex
-
getClickedComponent
public java.awt.Component getClickedComponent()
-
getViewer
public GraphViewer<V,E> getViewer()
-
getVertex
public V getVertex()
-
getDeepestComponentBasedClickPoint
public java.awt.Point getDeepestComponentBasedClickPoint()
-
setClickedComponent
public void setClickedComponent(java.awt.Component clickedComponent, java.awt.geom.Point2D vertexBasedPoint)
You can use this method to override which Java component will get the forwarded event. By default, the mouse info will forward the event to the component that is under the point in the event.- Parameters:
clickedComponent
- the component that was clickedvertexBasedPoint
- the point, relative to the vertex's coordinates
-
getEventSource
public java.lang.Object getEventSource()
-
getOriginalMouseEvent
public java.awt.event.MouseEvent getOriginalMouseEvent()
-
getTranslatedMouseEvent
public java.awt.event.MouseEvent getTranslatedMouseEvent()
-
forwardEvent
public void forwardEvent()
-
simulateMouseEnteredEvent
public void simulateMouseEnteredEvent()
-
simulateMouseExitedEvent
public void simulateMouseExitedEvent()
-
isPopupClick
public boolean isPopupClick()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-