diff --git a/Sd1/Ref/Fig/svgGeometry.png b/Sd1/Ref/Fig/svgGeometry.png new file mode 100644 index 0000000000000000000000000000000000000000..f0f4e97ad929482b05e75e90765e81d94c3a5a22 Binary files /dev/null and b/Sd1/Ref/Fig/svgGeometry.png differ diff --git a/Sd1/swd1.xml b/Sd1/swd1.xml index 4f239053821b3c682633c5b6121f684431a1ed00..129a8a38c99925ea6c4a25deef91863f1e5057e0 100644 --- a/Sd1/swd1.xml +++ b/Sd1/swd1.xml @@ -1574,13 +1574,12 @@ public class Circle { <qandaentry> <question> - <para> Our current Circle and Rectangle instances are only - shapes yet and do not allow to be moved in a coordinate - system:</para> + <para>Our current Circle and Rectangle instances are only shapes + yet and do not allow to be moved in a coordinate system:</para> <itemizedlist> <listitem> - <para> Add two more instance variables x and y and + <para>Add two more instance variables x and y and corresponding setter methods to account for a shapes origin being different from (0,0). The following hint may be helpful:</para> @@ -1646,7 +1645,29 @@ public class Circle { <para>Implement the method <methodname>void writeSvg()</methodname> in both classes <classname>Rectangle</classname> and - <classname>Circle</classname>.</para> + <classname>Circle</classname>. This should produce an output + result like:</para> + + <programlisting><!DOCTYPE html> +<html> + <body> + <svg width='300' height='200' > + <emphasis role="bold"><rect width='100.0' height='80.0' x='40.0' y='20.0'' style='fill:rgb(0,255,0);stroke-width:3;stroke:rgb(0,0,0)'/></emphasis> + <emphasis role="bold"><circle r='60.0' cx='60.0' cy='20.0' style='fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)'/></emphasis> + </svg > + </body> +</html></programlisting> + + <para>You may enter this output into a file sfg.html. A web + browser should visualize this output as:</para> + + <informalfigure> + <mediaobject> + <imageobject> + <imagedata fileref="Ref/Fig/svgGeometry.png"/> + </imageobject> + </mediaobject> + </informalfigure> </question> <answer>