Code example for DataInputStream

Methods: readBoolean, readByte, readInt, readUTF

0
        CommonMultipleDockableLayout flayout = new CommonMultipleDockableLayout();
        flayout.setLayout( layout );
        String uniqueId = controlAccess.access( element.getDockable() ).getUniqueId();
        uniqueId = controlAccess.getRegister().multiToNormalId( uniqueId );
        flayout.setId( uniqueId );
        if( element.getDockable().getWorkingArea() != null )
            flayout.setArea( element.getDockable().getWorkingArea().getUniqueId() );
         
        return flayout;
    } 
 
    public CommonMultipleDockableLayout getPerspectiveLayout( CommonElementPerspective element, Map<PerspectiveDockable, Integer> children ){
    	MultipleCDockablePerspective dockable = (MultipleCDockablePerspective)element.getElement();
    	 
    	MultipleCDockableLayout layout = dockable.getLayout();
         
        CommonMultipleDockableLayout flayout = new CommonMultipleDockableLayout();
        flayout.setLayout( layout );
        String uniqueId = perspectiveIdentifiers.getUniqueId( dockable );
        flayout.setId( uniqueId );
        if( dockable.getWorkingArea() != null )
            flayout.setArea( dockable.getWorkingArea().getUniqueId() );
         
        return flayout;
    } 
     
	public void layoutPerspective( CommonElementPerspective perspective, CommonMultipleDockableLayout layout, Map<Integer, PerspectiveDockable> children ){
    	MultipleCDockablePerspective multiple = (MultipleCDockablePerspective) perspective.getElement();
    	multiple.setLayout( layout.getLayout() );
        perspectiveIdentifiers.putDockable( layout.getId(), multiple );
         
        // working area 
        String areaId = layout.getArea();
        if( areaId != null ){
        	multiple.setWorkingArea( perspectiveIdentifiers.getPerspective().getStation( areaId ) );
        } 
    } 
     
    public CommonElementPerspective layoutPerspective( CommonMultipleDockableLayout layout, Map<Integer, PerspectiveDockable> children ){
    	MultipleCDockablePerspective perspective = new MultipleCDockablePerspective( getID(), layout.getId(), layout.getLayout() );
    	layoutPerspective( perspective.intern(), layout, children );
    	return perspective.intern();
    } 
     
    public CommonDockable layout( CommonMultipleDockableLayout layout, Map<Integer, Dockable> children, PlaceholderStrategy placeholders ) {
        return layout( layout, placeholders );
    } 
 
    public CommonDockable layout( CommonMultipleDockableLayout layout, PlaceholderStrategy placeholders ) {
        // base 
        MultipleCDockable dockable = delegate.read( layout.getLayout() );
        if( dockable == null )
            return null; 
         
        // id 
        String id = layout.getId();
         
        MultipleCDockable oldDockable = controlAccess.getOwner().getMultipleDockable( id );
         
        if( oldDockable != null ){
        	controlAccess.getOwner().replace( oldDockable, dockable );
        } 
        else{ 
        	controlAccess.getOwner().addDockable( id, dockable );
        } 
         
        // working area 
        String areaId = layout.getArea();
        if( areaId != null ){
        	CStation<?> station = controlAccess.getOwner().getStation( areaId );
        	if( station != null ){
        		if( station.isWorkingArea() ){
        			dockable.setWorkingArea( station );
        		} 
        	} 
        	else{ 
	            for( int i = 0, n = controlAccess.getOwner().getCDockableCount(); i<n; i++ ){
	                CDockable check = controlAccess.getOwner().getCDockable( i );
	                CStation<?> checkStation = check.asStation();
	                 
	                if( checkStation != null && checkStation.isWorkingArea() ){
	                    if( checkStation.getUniqueId().equals( areaId )){
	                        // found 
	                        dockable.setWorkingArea( checkStation );
	                        break; 
	                    } 
	                } 
	            } 
        	} 
        } 
         
        return dockable.intern();
    } 
 
    public void setLayout( CommonDockable element, CommonMultipleDockableLayout layout, Map<Integer, Dockable> children, PlaceholderStrategy placeholders ) {
        // not supported 
    } 
 
    public void setLayout( CommonDockable element, CommonMultipleDockableLayout layout, PlaceholderStrategy placeholders ) {
        // not supported 
    } 
     
    public CommonMultipleDockableLayout read( DataInputStream in, PlaceholderStrategy placeholders ) throws IOException {
        Version version = Version.read( in );
        version.checkCurrent();
         
        CommonMultipleDockableLayout layout = new CommonMultipleDockableLayout();
        layout.setLayout( delegate.create() );
        layout.getLayout().readStream( in );
        layout.setId( in.readUTF() );
        if( in.readBoolean() )
            layout.setArea( in.readUTF() );
        return layout;
    } 
 
    public CommonMultipleDockableLayout read( XElement element, PlaceholderStrategy placeholders ) {
        CommonMultipleDockableLayout layout = new CommonMultipleDockableLayout();