public ScreenDockStationLayout getPerspectiveLayout( ScreenDockPerspective element, Map<PerspectiveDockable, Integer> children ){ return new ScreenDockStationLayout( element.toMap( children ) ); }
public ScreenDockStationLayout getLayout( ScreenDockStation station, Map<Dockable, Integer> children ) { return new ScreenDockStationLayout( station.getPlaceholders( children ) ); }
public ScreenDockStationLayout read( DataInputStream in, PlaceholderStrategy placeholders ) throws IOException{ Version version = Version.read( in ); version.checkCurrent(); boolean version8 = version.compareTo( Version.VERSION_1_0_8 ) >= 0; if( version8 ){ PlaceholderMap map = new PlaceholderMap( in, placeholders ); return new ScreenDockStationLayout( map ); } else{ RetroScreenDockStationLayout layout = new RetroScreenDockStationLayout(); int count = in.readInt(); for( int i = 0; i < count; i++ ){ int id = in.readInt(); int x = in.readInt(); int y = in.readInt(); int width = in.readInt(); int height = in.readInt(); layout.add( id, x, y, width, height ); } return layout; } }
public ScreenDockStationLayout read( XElement element, PlaceholderStrategy placeholders ){ XElement xplaceholders = element.getElement( "placeholders" ); if( xplaceholders != null ){ return new ScreenDockStationLayout( new PlaceholderMap( xplaceholders, placeholders ) ); } else{ RetroScreenDockStationLayout layout = new RetroScreenDockStationLayout(); for( XElement child : element.getElements( "child" )){ layout.add( child.getInt( "id" ), child.getInt( "x" ), child.getInt( "y" ), child.getInt( "width" ), child.getInt( "height" ) ); } return layout; } }