JBotSim
JBotSim copied to clipboard
Is there an expected behavior regarding Topology/window resizing when importing a Topology?
After investigating #60, I don't think that we have an expected behavior when importing a Topology. Indeed:
- some Serializers (e.g.
PlainTopologySerializer) don't export theTopology's width and height and don't change the provided dimensions of the providedTopologyduring the import. - some Serializers (e.g.
XMLTopologySerializer) take width and height into account but choose not to write those data when they match the default values. As a result, when importing a "default" topology file into a "custom"Topologyobject (i.e., not matching the default width and height), the dimensions are not updated in theTopology(and also the window, when present) although they should. - Some Serializers (e.g.
DotTopologySerializer) don't export theTopology's width and height but change theTopology's size to give a proper rendering according to what was read.
I am not sure there is a right answer to this issue. Some leads:
- specify that we don't specify anything, although it can be strange for UI user's to have to resize plain topologies by hand.
- force a "resize topology to match content" when loading from the
JViewer. With this, we would likely loose appreciable padding. - force Serializer to always take the width and height into account; or at least give the user the choice.