Documentation of 'edu.uci.ics.jung.visualization.picking.ShapePickSupport' Java class
ShapePickSupport
edu.uci.ics.jung.visualization.picking

Class ShapePickSupport<V,E>

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  ShapePickSupport.Style
      The available picking heuristics: Style.CENTERED: returns the element whose center is closest to the pick point.
    • Constructor Summary

      Constructors 
      Constructor and Description
      ShapePickSupport(VisualizationServer<V,E> vv)
      Create a ShapePickSupport for the specified VisualizationServer with a default pick footprint.
      ShapePickSupport(VisualizationServer<V,E> vv, float pickSize)
      Creates a ShapePickSupport for the vv VisualizationServer, with the specified pick footprint and the default pick style.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      E getEdge(Layout<V,E> layout, double x, double y)
      Returns an edge whose shape intersects the 'pickArea' footprint of the passed x,y, coordinates.
      float getPickSize()
      Returns the size of the edge picking area.
      ShapePickSupport.Style getStyle()
      Returns the style of picking used by this instance.
      V getVertex(Layout<V,E> layout, double x, double y)
      Returns the vertex, if any, whose shape contains (x, y).
      java.util.Collection<V> getVertices(Layout<V,E> layout, java.awt.Shape shape)
      Returns the vertices whose layout coordinates are contained in Shape.
      void setPickSize(float pickSize)
      Sets the size of the edge picking area.
      void setStyle(ShapePickSupport.Style style)
      Specifies the style of picking to be used by this instance.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ShapePickSupport

        public ShapePickSupport(VisualizationServer<V,E> vv,
                                float pickSize)
        Creates a ShapePickSupport for the vv VisualizationServer, with the specified pick footprint and the default pick style. The VisualizationServer is used to access properties of the current visualization (layout, renderer, coordinate transformations, vertex/edge shapes, etc.).
        Parameters:
        vv - source of the current Layout.
        pickSize - the size of the pick footprint for line edges
      • ShapePickSupport

        public ShapePickSupport(VisualizationServer<V,E> vv)
        Create a ShapePickSupport for the specified VisualizationServer with a default pick footprint. of size 2.
        Parameters:
        vv - the visualization server used for rendering
    • Method Detail

      • getStyle

        public ShapePickSupport.Style getStyle()
        Returns the style of picking used by this instance. This specifies which of the elements, among those whose shapes contain the pick point, is returned. The available styles are:
        • Style.CENTERED: returns the element whose center is closest to the pick point.
        • Style.LOWEST: returns the first such element encountered. (If the element collection has a consistent ordering, this will also be the element "on the bottom", that is, the one which is rendered first.)
        • Style.HIGHEST: returns the last such element encountered. (If the element collection has a consistent ordering, this will also be the element "on the top", that is, the one which is rendered last.)
        Returns:
        the style of picking used by this instance
      • setStyle

        public void setStyle(ShapePickSupport.Style style)
        Specifies the style of picking to be used by this instance. This specifies which of the elements, among those whose shapes contain the pick point, will be returned. The available styles are:
        • Style.CENTERED: returns the element whose center is closest to the pick point.
        • Style.LOWEST: returns the first such element encountered. (If the element collection has a consistent ordering, this will also be the element "on the bottom", that is, the one which is rendered first.)
        • Style.HIGHEST: returns the last such element encountered. (If the element collection has a consistent ordering, this will also be the element "on the top", that is, the one which is rendered last.)
        Parameters:
        style - the style to set
      • getVertex

        public V getVertex(Layout<V,E> layout,
                           double x,
                           double y)
        Returns the vertex, if any, whose shape contains (x, y). If (x,y) is contained in more than one vertex's shape, returns the vertex whose center is closest to the pick point.
        Specified by:
        getVertex in interface GraphElementAccessor<V,E>
        Parameters:
        layout - the layout instance that records the positions for all vertices
        x - the x coordinate of the pick point
        y - the y coordinate of the pick point
        Returns:
        the vertex whose shape contains (x,y), and whose center is closest to the pick point
      • getVertices

        public java.util.Collection<V> getVertices(Layout<V,E> layout,
                                                   java.awt.Shape shape)
        Returns the vertices whose layout coordinates are contained in Shape. The shape is in screen coordinates, and the graph vertices are transformed to screen coordinates before they are tested for inclusion.
        Specified by:
        getVertices in interface GraphElementAccessor<V,E>
        Parameters:
        layout - the layout instance that records the positions for all vertices
        shape - the region in which the returned vertices are located
        Returns:
        the Collection of vertices whose layout coordinates are contained in shape.
      • getEdge

        public E getEdge(Layout<V,E> layout,
                         double x,
                         double y)
        Returns an edge whose shape intersects the 'pickArea' footprint of the passed x,y, coordinates.
        Specified by:
        getEdge in interface GraphElementAccessor<V,E>
        Parameters:
        layout - the context in which the location is defined
        x - the x coordinate of the location
        y - the y coordinate of the location
        Returns:
        an edge whose shape intersects the pick area centered on the location (x,y)
      • getPickSize

        public float getPickSize()
        Returns the size of the edge picking area. The picking area is square; the size is specified as the length of one side, in view coordinates.
        Returns:
        the size of the edge picking area
      • setPickSize

        public void setPickSize(float pickSize)
        Sets the size of the edge picking area.
        Parameters:
        pickSize - the length of one side of the (square) picking area, in view coordinates

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.