Is it possible to extend the AutoVue API to create your own markup entity.
We have been asked to create a button that will allow them to create their own entity which would basically be a compilation of existing entities (dashed and solid lines with arrow heads) but grouped together to form one entity.
We would like to be able to create more than one of these entities too so the group functionality may not help us a great deal here either as it seems to only allow one group of entities. If i try to group another then my first grouping gets undone.
Normally when you select an entity button to draw it, you then hold the left click button and drag across the UI and then let the mouse button go (to complete a line).
We do not have to be able to do this, they could just click a point on the UI and the new entity be created at the point and then allow them to re-size it.
I thought there was documentation to do such a thing but i am unable to locate it if it does exist.
Any help on this would be appreciated as it is not just one custom entity they want and it will also help us in the future to sell AutoVue especially if we can prove such custom things. It also makes it harder to move to another viewer if they come to rely on such custom components.
- The custom markup entity (e.g. UDEPolygon) should implement the UDEDesigner interface and the custom markup entity spec. should extends UDESpec class.
- Register the UDE designer (MarkupBean mrkBean): mrkBean.registerUdeDesigner()
* Register a UDEDesigner class.
* @param udename The UDE name. Should match string returned by
* @param classname The fully qualified classname of the UDEDesigner.
public void registerUdeDesigner(String udename, String classname)
- Register your mouse listener to capture and convert to world coordinates mouse point (mrkBean.deviceToWorld(pt))
- Set the custom markup entity class and enter markup ADD mode:
mrkBean.setMarkupEntityClass("UDEPolygon"); // UDEpolygon is your custom markup entity class name
In the AWTSample (one of the examples provided with AutoVue) the code is using UDEPolygon class BUT no source code is provided for this class. Not sure why!
I'll put a request to publish the complete source code.