Mon 21 Jul 22:43:21 CEST 2025
This commit is contained in:
		
							parent
							
								
									02766b6ae7
								
							
						
					
					
						commit
						16be5ca0a1
					
				
							
								
								
									
										42
									
								
								js/ui/mxgraph/src/js/io/mxTerminalChangeCodec.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								js/ui/mxgraph/src/js/io/mxTerminalChangeCodec.js
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,42 @@
 | 
			
		|||
/**
 | 
			
		||||
 * Copyright (c) 2006-2015, JGraph Ltd
 | 
			
		||||
 * Copyright (c) 2006-2015, Gaudenz Alder
 | 
			
		||||
 */
 | 
			
		||||
mxCodecRegistry.register(function()
 | 
			
		||||
{
 | 
			
		||||
	/**
 | 
			
		||||
	 * Class: mxTerminalChangeCodec
 | 
			
		||||
	 *
 | 
			
		||||
	 * Codec for <mxTerminalChange>s. This class is created and registered
 | 
			
		||||
	 * dynamically at load time and used implicitely via <mxCodec> and
 | 
			
		||||
	 * the <mxCodecRegistry>.
 | 
			
		||||
	 *
 | 
			
		||||
	 * Transient Fields:
 | 
			
		||||
	 *
 | 
			
		||||
	 * - model
 | 
			
		||||
	 * - previous
 | 
			
		||||
	 *
 | 
			
		||||
	 * Reference Fields:
 | 
			
		||||
	 *
 | 
			
		||||
	 * - cell
 | 
			
		||||
	 * - terminal
 | 
			
		||||
	 */
 | 
			
		||||
	var codec = new mxObjectCodec(new mxTerminalChange(),
 | 
			
		||||
		['model', 'previous'], ['cell', 'terminal']);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Function: afterDecode
 | 
			
		||||
	 *
 | 
			
		||||
	 * Restores the state by assigning the previous value.
 | 
			
		||||
	 */
 | 
			
		||||
	codec.afterDecode = function(dec, node, obj)
 | 
			
		||||
	{
 | 
			
		||||
		obj.previous = obj.terminal;
 | 
			
		||||
		
 | 
			
		||||
		return obj;
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	// Returns the codec into the registry
 | 
			
		||||
	return codec;
 | 
			
		||||
 | 
			
		||||
}());
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user