Class VertexMouseInfo<V extends VisualVertex,​E extends VisualEdge<V>>

  • Type Parameters:
    V - the vertex type
    E - 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 Detail

      • 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()
      • 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 clicked
        vertexBasedPoint - 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 class java.lang.Object