Class PolygonPainter

    • Field Detail

      • m_Color

        protected Color m_Color
        the color to use.
      • m_MinDistance

        protected int m_MinDistance
        the minimum distance in pixels that the trace pixels must be apart.
    • Constructor Detail

      • PolygonPainter

        public PolygonPainter()
    • Method Detail

      • colorTipText

        public String colorTipText()
        Returns the tip text for this property.
        Specified by:
        colorTipText in interface ColorSelectionShapePainter
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setMinDistance

        public void setMinDistance​(int value)
        Sets the minimum distance in pixels that a new point must be away from the last trace point.
        Parameters:
        value - the distance
      • getMinDistance

        public int getMinDistance()
        Returns the minimum distance in pixels that a new point must be away from the last trace point.
        Returns:
        the distance
      • minDistanceTipText

        public String minDistanceTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • canAddTracePoint

        public boolean canAddTracePoint​(ImagePanel.PaintPanel owner,
                                        List<Point> trace,
                                        Point p)
        Returns whether the current point is at leats the specified distance away from the last one.
        Specified by:
        canAddTracePoint in interface SelectionShapePainter
        Parameters:
        owner - the panel this shape is used with
        trace - the trace so far
        p - the point to check
        Returns:
        true if can be added
      • canPaint

        protected boolean canPaint​(ImagePanel.PaintPanel owner,
                                   Graphics g,
                                   Point topLeft,
                                   Point bottomRight,
                                   List<Point> trace)
        Checks whether painting is possible.
        Specified by:
        canPaint in class AbstractSelectionShapePainter
        Parameters:
        owner - the panel this shape is used with
        g - the graphics context
        topLeft - the top-left corner
        bottomRight - the bottom-right corner
        trace - the mouse movement trace
        Returns:
        true if painting is possible