Yes. This is why JHotDraw uses the SVG file format.
You can wrap calls to JHotDraw SVGInputFormat.read() and SVGOutputFormat.write() into an implementation of com.thoughtworks.xstream.converters.Converter.
Hi Julien, Which version of JHotDraw are you using? (They are quite different). Here is an example program with JHotDraw 7: package ch.randelshofer.demo; import org.jhotdraw.draw.Drawing; import org.jhotdraw.samples.svg.SVGDrawingPanel; import org.jhotdraw.samples.svg.io.SVGInputFormat; import org.jhotdraw.samples.svg.io.SVGOutputFormat; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.SwingUtilities; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent;...
Hi Julien, Which version of JHotDraw are you using? (They are quite different). Here is an example program with JHotDraw 7: package ch.randelshofer.demo; import org.jhotdraw.draw.Drawing; import org.jhotdraw.samples.svg.SVGDrawingPanel; import org.jhotdraw.samples.svg.io.SVGInputFormat; import org.jhotdraw.samples.svg.io.SVGOutputFormat; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.SwingUtilities; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent;...
Adds CombinedPathFigure.
Fixes bug in Polynomials.
Fixes bug in Polynomials.
Formats source code.
Performs now two layout passes instead of one.
Changes LABEL_OFFSET default value.
Provides a help text.
Provides a help text, and now consistently uses...
Renames STROKE_COLOR to STROKE.
Adds support for connecting label figures to ot...
Implements special mode "listenOnDrawing".
Cleans up imports.
HierarchyInspector does not need special tricks...
Handles IllegalPathStateException.
Adds ModifiableObservableSet.
Adds AbstractObservable.
Fixes NPE.
Adds setters.
SimpleFigureFactory uses now Styleable.getId() ...
HierarchyInspector updates the id of a figure, ...
Adds connectedNotify() and disconnectedNotify()...
Fixes bug when removing a grouped figure: the g...
Makes dock items resizable.
Improves handles for LineConnectionFigure.
Supports AnchorableFigure in tools and handles.
Improves AbstractTool.
Moves code from updatePathElements out of Abstr...
Improves line connection handling.
Fixes parsing of SVG-path relative arc command.
Adds createReshapeTransform methods.
DockRoot may not consume DnD events that are no...
Tweaks view.
Tweaks toolbar.
Tweaks docking framework.
Adds missing error handler.
Tweaks the docking framework.
Adds a docking framework.
Adds a docking framework.
Renames "Groupable" to "Grouping".
Organizes members and imports.
Renames Group to Groupable to avoid frequent na...
Minor works on the docs.
SelectionTool did some times draw the wrong cur...
Fixes handle tolerance.
Replaces "Chop" connectors by connectors which ...
Moves documents around.
Moves documents around.
Moves documents around.
Moves documents around.
Moves documents around.
Moves documents around.
Moves documents around.
Moves documents around.
Moves documents around.
Moves documents around.
Moves documents around.
Moves documents around.
Implements intersection of lines with cubic bez...
Implements intersection of lines with quadratic...
Implements intersection of lines with quadratic...
Adds ConnectableFigure interface.
Adds documentation.
Adds documentation.
Improves SVG output.
Improves performance of bounds() method,
Removes need for LayoutTransformableDrawingMode...
Refactors Figure API.
Refactors Figure API.
Fixes persistency issues.
Fixes persistency of LineConnectionWithMarkersF...
Reworks part of the docbook documentation.
Reworks part of the docbook documentation.
Fixes JavaDoc errors.
Removes Bezier class.
Improves support for line end markers and line ...
Adds LineConnectionWithMarkersFigure.
Adds tool for creating BezierFigures.
Figure provides default implementations for isL...
Adds AbstractCreationTool.
Minor changes.
Fixes javadoc comments.
Fixes bug in build script.
DesignPatternTaglet must cleanup white spaces w...
Fixes Javadoc errors.
Fixes Javadoc errors.
Fixes Javadoc errors.
Removes unused import.
Adds more classes to the geom package.
Improves performance of immutable collections.
Both applyFontableFigureProperties methods take...
Adds more utility methods.
Adds more conversion methods.
print method must not suppress IOExceptions.
Adds constructor without Project parameter.