0

I try to write a program to draw a custom shapes and then execute all mouse events like dragging,clicking,moving etc.I want to know that in other editor when any shape is select or mouse is near to there boundary then its boundary point start to display.I just want the logic not code how corner points displayed like in image? I've done checking that my mouse clicking is inside of shape or not.This is a rounded-rectangle.When I clicked on its rectangle boundary is start displaying and connection points are also start displaying.How do I do that? enter image description here

iostream007
  • 107
  • 1
  • 10

1 Answers1

1

Shape interface has getBounds() and contains() methods. Use contains() to determine whether point belongs to the Shape and then use getBounds() to get rectable and use the rectangle's corners to draw the dragging points.

StanislavL
  • 56,971
  • 9
  • 68
  • 98