Home › Forums › Development › example of subclassing Canvas2D? › Reply To: example of subclassing Canvas2D?

#66386

Yeah the idea is that you can add new Canvas from plugin. In you want to handle specific format of Sequence then you may detect them using if (sequence instanceof myClass) and enable special feature / view when that is the case otherwise they stay grayed.
About you text label, well you have the choice, you can extends / customize the default setting panel from Canvas2D (called panel in the Canvas2D class, it’s protected so you can access it) in which case your text label will appears in the inspector (where we have the minimap view of the image). Or you can also override the customizeToolbar(JToolBar toolBar) method from Canvas2D (you can see how it’s done in Canvas2D class to add a specific button) so it will directly appear just above the view (which may be easier to set it up).

Best,

– Stephane