Class ScalingGraphMousePlugin

  • All Implemented Interfaces:
    GraphMousePlugin, java.awt.event.MouseWheelListener, java.util.EventListener
    Direct Known Subclasses:
    SatelliteScalingGraphMousePlugin

    public class ScalingGraphMousePlugin
    extends AbstractGraphMousePlugin
    implements java.awt.event.MouseWheelListener
    ScalingGraphMouse applies a scaling transformation to the graph layout. The Vertices get closer or farther apart, but do not themselves change size. ScalingGraphMouse uses MouseWheelEvents to apply the scaling.
    • Field Detail

      • in

        protected float in
        the amount to zoom in by
      • out

        protected float out
        the amount to zoom out by
      • zoomAtMouse

        protected boolean zoomAtMouse
        whether to center the zoom at the current mouse position
    • Constructor Detail

      • ScalingGraphMousePlugin

        public ScalingGraphMousePlugin​(ScalingControl scaler,
                                       int modifiers)
      • ScalingGraphMousePlugin

        public ScalingGraphMousePlugin​(ScalingControl scaler,
                                       int modifiers,
                                       float in,
                                       float out)
    • Method Detail

      • setZoomAtMouse

        public void setZoomAtMouse​(boolean zoomAtMouse)
        Parameters:
        zoomAtMouse - The zoomAtMouse to set.
      • checkModifiers

        public boolean checkModifiers​(java.awt.event.MouseEvent e)
        Description copied from class: AbstractGraphMousePlugin
        check the mouse event modifiers against the instance member modifiers. Default implementation checks equality. Can be overridden to test with a mask
        Specified by:
        checkModifiers in interface GraphMousePlugin
        Overrides:
        checkModifiers in class AbstractGraphMousePlugin
        Parameters:
        e - an event to compare to
        Returns:
        whether the member modifiers match the event modifiers
      • mouseWheelMoved

        public void mouseWheelMoved​(java.awt.event.MouseWheelEvent e)
        zoom the display in or out, depending on the direction of the mouse wheel motion.
        Specified by:
        mouseWheelMoved in interface java.awt.event.MouseWheelListener
      • getIn

        public float getIn()
        Returns:
        Returns the zoom in value.
      • setIn

        public void setIn​(float in)
        Parameters:
        in - The zoom in value to set.
      • getOut

        public float getOut()
        Returns:
        Returns the zoom out value.
      • setOut

        public void setOut​(float out)
        Parameters:
        out - The zoom out value to set.