Documentation of 'vmm3d.core.TwoPointInput' Java class
TwoPointInput
vmm3d.core

Class TwoPointInput



  • public abstract class TwoPointInput
    extends MouseTask
    Meant for use as a "one-shot" mouse task that lets the user specify two points by clicking and dragging. The first point is where the mouse is pressed, the second is where the mouse is released.
    • Constructor Detail

      • TwoPointInput

        public TwoPointInput()
    • Method Detail

      • getAllowOutOfBoundsDrag

        public boolean getAllowOutOfBoundsDrag()
      • setAllowOutOfBoundsDrag

        public void setAllowOutOfBoundsDrag(boolean allowOutOfBoundsDrag)
      • getDrawColor

        public java.awt.Color getDrawColor()
      • setDrawColor

        public void setDrawColor(java.awt.Color drawColor)
      • getFigureToDraw

        public int getFigureToDraw()
      • setFigureToDraw

        public void setFigureToDraw(int figureToDraw)
      • getMaximumDrag

        public int getMaximumDrag()
      • setMaximumDrag

        public void setMaximumDrag(int maximumDrag)
      • getMinimumDrag

        public int getMinimumDrag()
      • setMinimumDrag

        public void setMinimumDrag(int minimumDrag)
      • doMouseDown

        public boolean doMouseDown(java.awt.event.MouseEvent evt,
                                   Display display,
                                   View view,
                                   int width,
                                   int height)
        Description copied from class: MouseTask
        Called when the user presses the mouse in the Display in which this MouseTask is installed. The return value indicates whether or not the MouseTask wants to recieve the mouse drag and mouse up events that follow the mouse down event. If the return value is false, then the Display will not call the other two methods. This is an abstract method that must be redefined in a subclass. It should not be necessary to call this method directly.
        Specified by:
        doMouseDown in class MouseTask
        Parameters:
        evt - The mouse-down event, except that the x and y coordinates have been translated so that the top left corner of the View is at coordinates (0,0).
        width - The width the drawing area (not including any insets).
        height - The height the drawing area (not including any insets).
      • doMouseDrag

        public void doMouseDrag(java.awt.event.MouseEvent evt,
                                Display display,
                                View view,
                                int width,
                                int height)
        Description copied from class: MouseTask
        Continue processing a mouse gesture for which doMouseDown returned a value of true. If not redefined in a subclass, this method does nothing.
        Overrides:
        doMouseDrag in class MouseTask
        Parameters:
        evt - The mouse-dragged event, except that the x and y coordinates have been translated by display.getInsets().left and display.getInsets().top to account for any border that has been applied to the display.
        width - The width the drawing area (not including any insets).
        height - The height the drawing area (not including any insets).
      • doMouseUp

        public void doMouseUp(java.awt.event.MouseEvent evt,
                              Display display,
                              View view,
                              int width,
                              int height)
        Description copied from class: MouseTask
        Finish processing a mouse gesture for which doMouseDown returned a value of true. If not redefined in a subclass, does nothing.
        Overrides:
        doMouseUp in class MouseTask
        Parameters:
        evt - The mouse-up event, except that the x and y coordinates have been translated by display.getInsets().left and display.getInsets().top to account for any border that has been applied to the display.
        width - The width the drawing area (not including any insets).
        height - The height the drawing area (not including any insets).
      • drawWhileDragging

        public void drawWhileDragging(org.freehep.graphics2d.VectorGraphics g,
                                      Display display,
                                      View view,
                                      int width,
                                      int height)
        Description copied from class: MouseTask
        When the Display is repainted during a drag operation, this method will be called after the Exhibit is drawn, to give the MouseTask a chance to draw some extra stuff on top of the Exhibit. The graphics context is a newly created one, which has been translated and clipped, if necessary, to account for any border that has been applied to the Display. The width and height parameters give the width and height of the drawing area, in pixels.
        Overrides:
        drawWhileDragging in class MouseTask

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.