JBotSim icon indicating copy to clipboard operation
JBotSim copied to clipboard

Is there an expected behavior regarding Topology/window resizing when importing a Topology?

Open remikey opened this issue 6 years ago • 0 comments

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 the Topology's width and height and don't change the provided dimensions of the provided Topology during 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" Topology object (i.e., not matching the default width and height), the dimensions are not updated in the Topology (and also the window, when present) although they should.
  • Some Serializers (e.g. DotTopologySerializer) don't export the Topology's width and height but change the Topology'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.

remikey avatar Jun 13 '19 13:06 remikey