One more shortcoming is that when I double click on Text figure, (JXlayer forward double click event to default drawing view, and default drawing view forward event to text figure?) the text figure doesn't seem to be in editable mode. I type from keyboard, the text wont change.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
>(1) When I move my mouse across the figure, the cursor is not turning into hand cursor. I do some println, the mouse move event >is already forwarded to defaultDrawingView, but how come the cursor is not turning into hand cursor?
The cursors is determined by the component under the mouse location.
I guess, this is JXLayer, or some other component than DefaultDrawingView.
>(2) I click on a figure, there are no sign indicated the figures is being selected (There should be 4 small rectangles around the >figure to indicate it is being selected). Again, the mouse click event is already forwarded to defaultDrawingView.
I guess this happens, because the focus is not transferred to DefaultDrawingView.
> One more shortcoming is that when I double click on Text figure, (JXlayer forward double click event to default drawing view, and
> default drawing view forward event to text figure?) the text figure doesn't seem to be in editable mode. I type from keyboard, the
> text wont change.
This happens because the focus is not transferred to the JTextComponent which is used to edit the text figure.
>Is there any other hacks I had missed out?
Almost certainly: yes.
Overall, this is a very fragile approach.
I doubt that you will succeed with this approach.
Best,
Werner
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Apart from previous post, I try another alternative. This time, I came quite close, but still has some shortcoming.
Step 1 :
Then, I apply Proxy Pattern on ChartLayerUI :
to
Add all forwarding methods :
Add event forwarding code.
Here is how it look like :
One more shortcoming is that when I double click on Text figure, (JXlayer forward double click event to default drawing view, and default drawing view forward event to text figure?) the text figure doesn't seem to be in editable mode. I type from keyboard, the text wont change.
>(1) When I move my mouse across the figure, the cursor is not turning into hand cursor. I do some println, the mouse move event >is already forwarded to defaultDrawingView, but how come the cursor is not turning into hand cursor?
The cursors is determined by the component under the mouse location.
I guess, this is JXLayer, or some other component than DefaultDrawingView.
>(2) I click on a figure, there are no sign indicated the figures is being selected (There should be 4 small rectangles around the >figure to indicate it is being selected). Again, the mouse click event is already forwarded to defaultDrawingView.
I guess this happens, because the focus is not transferred to DefaultDrawingView.
> One more shortcoming is that when I double click on Text figure, (JXlayer forward double click event to default drawing view, and
> default drawing view forward event to text figure?) the text figure doesn't seem to be in editable mode. I type from keyboard, the
> text wont change.
This happens because the focus is not transferred to the JTextComponent which is used to edit the text figure.
>Is there any other hacks I had missed out?
Almost certainly: yes.
Overall, this is a very fragile approach.
I doubt that you will succeed with this approach.
Best,
Werner