|
Attention! Read the forum rules carefully before posting a topic.
Try to find an answer in Wiki before asking a question. Submit programming questions in this forum only. Off topics are strictly forbidden.
Any topics which do not satisfy these rules will be deleted.
Prevent ICustomWidgetChartObject from disappearing |
pminc74
|
Post subject: Prevent ICustomWidgetChartObject from disappearing |
Post rating: 0
|
Posted: Thu 03 Mar, 2022, 22:14
|
|
User rating: 3
Joined: Fri 15 Nov, 2019, 12:54 Posts: 16 Location: Poland,
|
Hi,
My chart widget object (of type ICustomWidgetChartObject), created on chart in my plugin code, disappears everytime, when any other object existing on chart (like line, rectangle) is selected by clicking on it. Is it possible to prevent that behaviour? I'd like to see the widget even if some object on chart is selected.
Thanks in advance.
|
|
|
|
|
pminc74
|
Post subject: Re: Prevent ICustomWidgetChartObject from disappearing |
Post rating: 0
|
Posted: Fri 11 Mar, 2022, 13:16
|
|
User rating: 3
Joined: Fri 15 Nov, 2019, 12:54 Posts: 16 Location: Poland,
|
My workaround for above is as follows:
// ICustomWidgetChartObject widget;
// declare component listener private ComponentListener widgetComponentListener = new ComponentAdapter() { @Override public void componentHidden(ComponentEvent e) { e.getComponent().setVisible(true); // show again }
// add the listener do widget's container
JPanel panel = widget.getContentPanel(); Container container = panel.getParent(); container.addComponentListener(this.widgetComponentListener);
|
|
|
|
|
|
Pages: [
1
]
|
|
|
|
|