Vision Component Size restrictions

You'll have to blaze the trail for the rest of us. :man_shrugging:

Of course, it has only been four days, two of which were weekend days, and we are right at the major holiday boundary. Might want to let this simmer a bit more.

Maybe you can "just" have your component implement Bounds2DComponent?

Would you have an example of Bounds2DComponent being used?

Nope. You're on uncharted territory. But implementing the interface directly might be easier than subclassing one of the existing Vision shapes, which are currently the one things that implement the interface.

I got it mostly figured out now using AbstractVisionShape. My component automatically resizes depending on the properties entered.
The one issue I still have is that when I grab the component from the Palette and drop it on the screen, it initially goes to a predefined x,y location. I want it to show up wherever I click with the mouse instead. How do I access the mouse coordinates from within the component java code?

I hope the video is visible to everyone.
So defining the component's outline based on properties is possible with the AbstractVisionShape class.
Thanks to @pturmel for pointing me towards vision shapes!

The three key functions under that class are:

setBoundingRect(Rectangle2D rd)
/* rd is the bounding rectangle that is sent down from ignition, either when
 * the component is initially dropped on the window or when it is resized or moved.
 * Define the component's area in here by using the given rectangle and then modifying
 * it as needed.
 */

getShapeBounds(Rectangle2D rd)
/* this function determines the size of the boundary to show around the component.
 * Use a clone of the component's area that was created under setBoundingRect()
 */

getArea()
/* this function determines the area of the component that will allow the component to be
 * selected by the mouse.
 */
2 Likes