@Override public SplitDockStationLayout read( DataInputStream in, PlaceholderStrategy placeholders ) throws IOException{ SplitDockStationLayout layout = super.read( in, placeholders ); Version version = Version.read( in ); if( !version.equals( Version.VERSION_1_1_1 )){ throw new IOException( "trying to read a format from the future: " + version ); } int count = in.readInt(); Column[] columns = new WizardSplitDockStationLayout.Column[ count ]; for( int i = 0; i < count; i++ ){ int size = in.readInt(); int length = in.readInt(); int[] keys = new int[ length ]; int[] sizes = new int[ length ]; for( int j = 0; j < length; j++ ){ keys[j] = in.readInt(); sizes[j] = in.readInt(); } columns[i] = new Column( size, keys, sizes ); } ((WizardSplitDockStationLayout)layout).setColumns( columns ); return layout; }
public SplitDockStationLayout read( XElement element, PlaceholderStrategy placeholders ){ SplitDockStationLayout layout = super.read( element.getElement( "split" ), placeholders ); element = element.getElement( "wizard" ); XElement[] xcolumns = element.getElements( "column" ); Column[] columns = new Column[ xcolumns.length ]; for( int i = 0; i < columns.length; i++ ){ XElement xcolumn = xcolumns[i]; int size = xcolumn.getInt("size"); XElement[] xcells = xcolumn.getElements( "cell" ); int[] keys = new int[ xcells.length ]; int[] sizes = new int[ xcells.length ]; for( int j = 0; j < xcells.length; j++ ){ keys[j] = xcells[j].getInt( "key" ); sizes[j] = xcells[j].getInt( "size" ); } columns[i] = new Column( size, keys, sizes ); } ((WizardSplitDockStationLayout)layout).setColumns( columns ); return layout; } }