Automating equipment additions


In the Advanced course we utilized templates and the template canvas and repeater to view equipment. By doing this, a user in a client with the proper privilege set would be able to add equipment. This works great for the template repeater, but we have a client utilizing floor plans.

My question is, would we be able to script the equipment additions and the user have the ability to drag and drop on the floor plan in a client? One thought was to add the root container Size and position to the script, but a regular user would be guessing at the pixel location.

Any thoughts?

Anyone? Bueller, Bueller?

Would the floor plan be an image?

Sorry for the delay, I am not logged in here a lot. Yes, the floorplan is an image.

Your best bet for adding ‘components’ dynamically in the runtime is the template canvas, hands down. But, if you just need a shape you could probably get something working with the Paintable Canvas if you’re comfortable in Java2D.

So the problem lies in that these templates need to be placed in a specific location on a floorplan.

Unfortunately, I am not familiar with Java 2D


Templates can be places in any specific location using the Template Canvas by using absolute positioning. Does that solve the positioning problem?

Checkout this tutorial about the Template Canvas: … at-runtime