/** * Writes all locations and relationships of the {@link DockStation DockStations} * <code>stations</code> and their children into the stream <code>out</code>. * @param stations The stations to store, only the roots are needed. * @param out the stream to write in * @throws IOException if the stream throws an exception */ public void write( Map<String, DockStation> stations, DataOutputStream out ) throws IOException{ Map<String, DockLayoutComposition> map = new HashMap<String, DockLayoutComposition>(); for( Map.Entry<String, DockStation> entry : stations.entrySet() ){ DockLayoutComposition composition = convert( entry.getValue() ); if( composition != null ){ map.put( entry.getKey(), composition ); } } writeCompositions( map, out ); }
/** * Writes all locations and relationships of the {@link DockStation}s * <code>stations</code> and their children as xml. * @param stations The stations to store, only the roots are needed. * @param element the element to write into, attributes of <code>element</code> will * not be changed */ public void writeXML( Map<String, DockStation> stations, XElement element ) { Map<String, DockLayoutComposition> map = new HashMap<String, DockLayoutComposition>(); for( Map.Entry<String, DockStation> entry : stations.entrySet() ){ DockLayoutComposition composition = convert( entry.getValue() ); if( composition != null ){ map.put( entry.getKey(), composition ); } } writeCompositionsXML( map, element ); }
/** * Reads <code>in</code> and returns the roots of the * {@link DockElement DockElements} which were found. * @param in the stream to read * @return the roots of all elements that were found * @throws IOException if the stream can't be read */ public Map<String, DockStation> read( DataInputStream in ) throws IOException{ Version version = Version.read( in ); version.checkCurrent(); int count = in.readInt(); Map<String, DockStation> result = new HashMap<String, DockStation>(); for( int i = 0; i < count; i++ ){ String key = in.readUTF(); DockLayoutComposition composition = readComposition( in ); DockElement element = composition == null ? null : convert( composition ); DockStation station = element == null ? null : element.asDockStation(); if( station != null ){ result.put( key, station ); } } return result; }
/** * Reads a set of {@link DockStation}s that were stored earlier. * @param root the xml element from which to read * @return the set of station */ public Map<String, DockStation> readXML( XElement root ){ Map<String, DockStation> result = new HashMap<String, DockStation>(); for( XElement xelement : root.getElements( "element" )){ String name = xelement.getString( "name" ); DockLayoutComposition composition = readCompositionXML( xelement ); DockElement element = composition == null ? null : convert( composition ); DockStation station = element == null ? null : element.asDockStation(); if( station != null ) result.put( name, station ); } return result; }
situation.convert( layout ); info.setLayout( null );
for( int i = 0, n = station.getDockableCount(); i<n; i++ ){ Dockable dockable = station.getDockable( i ); DockLayoutComposition composition = convert( dockable ); if( composition != null ){ children.add( composition );
DockElement element = situation.convert( entry.getLayout() ); Dockable dockable = element == null ? null : element.asDockable(); if( dockable != null ){
DockStation station = info.getStation(); if( station.asDockable() == null || station.asDockable().getDockParent() == null ){ DockLayoutComposition layout = situation.convert( station ); setting.putRoot( info.getName(), layout ); if( !entry || info.isEntryLayout() ){ if( dockable != null ){ layout = situation.convert( dockable );
situation.convert( layout );
layout = situation.fillMissing( layout ); if( info.getDockable() != null ){ situation.convert( layout ); layout = null;