public void layoutPerspective( ScreenDockPerspective perspective, ScreenDockStationLayout layout, Map<Integer, PerspectiveDockable> children ){ perspective.read( layout.getPlaceholders(), children ); }
public void write( ScreenDockStationLayout layout, DataOutputStream out ) throws IOException { if( layout instanceof RetroScreenDockStationLayout ){ RetroScreenDockStationLayout retro = (RetroScreenDockStationLayout)layout; Version.write( out, Version.VERSION_1_0_4 ); out.writeInt( retro.size() ); for( int i = 0, n = retro.size(); i<n; i++ ){ out.writeInt( retro.id( i ) ); out.writeInt( retro.x( i ) ); out.writeInt( retro.y( i ) ); out.writeInt( retro.width( i ) ); out.writeInt( retro.height( i ) ); } } else{ PlaceholderMap map = layout.getPlaceholders(); Version.write( out, Version.VERSION_1_0_8 ); map.write( out ); } }
public void setLayout( ScreenDockStation station, ScreenDockStationLayout layout, Map<Integer, Dockable> children, PlaceholderStrategy placeholders ) { for( int i = station.getDockableCount()-1; i >= 0; i-- ) station.removeDockable( i ); if( layout instanceof RetroScreenDockStationLayout ){ RetroScreenDockStationLayout retro = (RetroScreenDockStationLayout) layout; for( int i = 0, n = retro.size(); i<n; i++ ){ Dockable dockable = children.get( retro.id( i ) ); if( dockable != null ){ Rectangle location = new Rectangle( retro.x( i ), retro.y( i ), retro.width( i ), retro.height( i )); station.addDockable( dockable, location, true ); } } } else{ station.setPlaceholders( layout.getPlaceholders().filter( placeholders ), children ); } }
public void write( ScreenDockStationLayout layout, XElement element ) { if( layout instanceof RetroScreenDockStationLayout ){ RetroScreenDockStationLayout retro = (RetroScreenDockStationLayout)layout; for( int i = 0, n = retro.size(); i<n; i++ ){ XElement child = element.addElement( "child" ); child.addInt( "id", retro.id( i ) ); child.addInt( "x", retro.x( i ) ); child.addInt( "y", retro.y( i ) ); child.addInt( "width", retro.width( i ) ); child.addInt( "height", retro.height( i ) ); } } else{ layout.getPlaceholders().write( element.addElement( "placeholders" ) ); } }
DockablePlaceholderList.simulatedRead( layout.getPlaceholders(), new PlaceholderListItemAdapter<Dockable, PlaceholderListItem<Dockable>>() { @Override public PlaceholderListItem<Dockable> convert( ConvertedPlaceholderListItem item ) {