Closed starsasumi closed 8 years ago
You have AWT and CircleAWT. The names make me think that CircleAWT should extends AWT. But here obviously CircleAWT extends ShapeState so maybe you should change the name or make CircleAWT extend AWT
@anqitong What about AWT
-> AWTFrame
and CircleAWT
-> AWTCircle
?
I think it is better. At least it won't make people think that there is an extension between those two classes.
Thx, I will work on it later
Ok, I don't mind
@anqitong Classes renamed
Because getDrawing in ShapeState is generic, but getDrawing(PencilState) is heavily related to svg and just can not fit the case of awt. Also, awt presentation need to pass the Graphics2D
object around, which is also not related to svg. So these (get xml from pencil, get Graphics2D
object) are presentation related details and should not be share between presentations
I fixed conflits. Can I merge?
@anqitong There's no different, since shape is an instance of Circle, there is nothing to convert (in the convertToCircle method we still need to cast itself to circle and return). In fact I prefer to remove this setShape method because a ShapeState is something too lightweight and we would just use an object one time and then throw it away. So we don't need to call the setShape method.
Ok, then it's fine with me
I got very strange errors when running it:
(eog:23372): GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory. This indicates a bug in someone's code. You must ensure an error is NULL before it's set. The overwriting error message was: Error domain 1 code 73 on line 9 column 31 of file:///home/thomas/Documents/Programs/LangageDessinVectoriel/files/svgAndAwt.svg: Couldn't find end of Start Tag text
(And the drawing is a little strange^^)
@Thomas-dot-G The error is related to SVG? I have no error about the AWT, but I do get this in the SVG version output:
I think that's a bug in our xml implementation. For the other parts of codes, I do it now.
Yes exactly, but as you changed the xml also, it might come from that.
It should be compatible. And can you add some comments also in the main and a test (can be the same as the main)
@Thomas-dot-G I found the bug, there was an extract "
in the TextXML codes. It should be fine now ;)
For adding a JUnit test, I tried it once, but Junit will kill all JFrame immediately after test codes are finished. Do you have any idea how we make Junit not to kill JFrames?
No, not for JFrames... You can just create the object, and then do some assert on the element inside the object to see if they are well here... (some small JUnits, not really on the display...) But, I don't know otherwise
Now xml works, but on the xml, I can't see the ellipse, and the hello world is not really readable... And the polyline is filled in the xml...
I made the DrawAwt now as a test. For xml, I confirm the problems. But I prefer to open another issue to fix the xml implementation (Since I have not work a lot on SVG and I didn't modify anything about xml outputs). Ok?
Ok, fine with me then
50
Use java.awt to implement a second presentation.
Note: I remove
PencilState
and use a delegate to "draw" pencils because the originalPencilState
could not fit this presentation.