@@ -704,15 +704,33 @@ public void propagateDirectionality(BidirPort root) {
704704 * Called by XMLReader and copy routines. Default behaviour is no-op.
705705 * @param data Structure containing state to load (module-defined elements)
706706 */
707- public void dataIn (HashMap <String , String > data ) {}
707+ public void dataIn (HashMap <String , String > data ) {
708+ if (data .containsKey ("label" )) {
709+ label = data .get ("label" );
710+ }
711+ if (data .containsKey ("label_size" )) {
712+ String sizeStr = data .get ("label_size" );
713+ try {
714+ labelSize = Integer .parseInt (sizeStr );
715+ } catch (NumberFormatException e ) {
716+ System .err .println ("Warning: unable to parse label_size:" );
717+ e .printStackTrace ();
718+ }
719+ }
720+ }
708721
709722 /**
710723 * Fill a string-string hash map with module-specific data for retrieval with dataIn.
711724 * Called by XMLWriter and the copy routines. Default behaviour is to return null, indicating that no relevant
712725 * data is contained in the module.
713726 * @return A filled hash map structure, or null if no state is stored
714727 */
715- public HashMap <String , String > dataOut () { return null ; }
728+ public HashMap <String , String > dataOut () {
729+ HashMap <String , String > dataMap = new HashMap <>();
730+ dataMap .put ("label" , label );
731+ dataMap .put ("label_size" , Integer .toString (labelSize ));
732+ return dataMap ;
733+ }
716734
717735 public enum AvailableModules {
718736 // Enum members should not be renamed!
0 commit comments