Package bibliothek.gui.dock.frontend

Examples of bibliothek.gui.dock.frontend.DockFrontendPerspective


     * (<code>includeWorkingAreas = true</code>) or not (<code>includeWorkingAreas = false</code>)
     */
    public void writeXML( XElement root, CPerspective perspective, boolean includeWorkingAreas ){
      perspective.storeLocations();
     
      DockFrontendPerspective frontend = conversion( perspective, includeWorkingAreas );
      Perspective conversion = frontend.getPerspective();
     
      Map<String, DockLayoutComposition> stations = new HashMap<String, DockLayoutComposition>();
      for( String key : perspective.getStationKeys() ){
        CStationPerspective station = perspective.getStation( key );
        if( station.asDockable() == null || station.asDockable().getParent() == null ){
          stations.put( key, conversion.convert( station.intern() ));
        }
      }
     
      conversion.getSituation().writeCompositionsXML( stations, root.addElement( "stations" ) );
     
      // Store the last location of all known elements
      XElement xinvisible = root.addElement( "invisible" );
      PropertyTransformer transformer = frontend.getPropertyTransformer();
      for( String key : perspective.getDockableKeys() ){
        CDockablePerspective dockable = perspective.getDockable( key );
        Location location = getInvisibleLocation( dockable );
       
        if( location != null ){
View Full Code Here


     */
    public void write( DataOutputStream out, CPerspective perspective, boolean includeWorkingAreas ) throws IOException{
      perspective.storeLocations();
      Version.write( out, Version.VERSION_1_1_1a );
     
      DockFrontendPerspective frontend = conversion( perspective, includeWorkingAreas );
      Perspective conversion = frontend.getPerspective();
     
      Map<String, DockLayoutComposition> stations = new HashMap<String, DockLayoutComposition>();
      for( String key : perspective.getStationKeys() ){
        CStationPerspective station = perspective.getStation( key );
        stations.put( key, conversion.convert( station.intern() ));
      }
     
      conversion.getSituation().writeCompositions( stations, out );
     
      // Store the last location of all known elements
      String[] keys = perspective.getDockableKeys();
      out.writeInt( keys.length );
      PropertyTransformer transformer = frontend.getPropertyTransformer();
     
      for( String key : keys ){
        CDockablePerspective dockable = perspective.getDockable( key );
        Location location = getInvisibleLocation( dockable );
       
View Full Code Here

     */
    public CPerspective readXML( XElement root, boolean includeWorkingAreas ) throws XException{
      CPerspective perspective = createEmptyPerspective();
     
      PerspectiveElementFactory factory = new PerspectiveElementFactory( perspective );
      DockFrontendPerspective frontend = wrap( perspective, includeWorkingAreas, factory );
      Perspective conversion = frontend.getPerspective();
     
      for( Map.Entry<String, MultipleCDockableFactory<?, ?>> item : control.getRegister().getFactories().entrySet() ){
        conversion.getSituation().add( new CommonMultipleDockableFactory( item.getKey(), item.getValue(), control, perspective ) );
      }
     
      XElement xstations = root.getElement( "stations" );
      if( xstations == null ){
        throw new XException( "missing element 'stations'" );
      }
     
      Map<String, DockLayoutComposition> stations = conversion.getSituation().readCompositionsXML( xstations );
      factory.setStations( stations );
     
      for( DockLayoutComposition composition : stations.values() ){
        PerspectiveElement station = conversion.convert( composition );
        if( station instanceof CommonElementPerspective ){
          CStationPerspective stationPerspective = ((CommonElementPerspective)station).getElement().asStation();
          if( stationPerspective != null ){
            perspective.addStation( stationPerspective );
          }
        }
      }
     
      perspective.storeLocations();
     
      // read the last known location of all elements
      XElement xinvisible = root.getElement( "invisible" );
      if( xinvisible != null ){
        PropertyTransformer transformer = frontend.getPropertyTransformer();
        for( XElement xdockable : xinvisible.getElements( "dockable" )){
          String key = xdockable.getString( "key" );
          CDockablePerspective dockable = perspective.getDockable( key );
          if( dockable == null ){
            XElement xcontent = xdockable.getElement( "content" );
View Full Code Here

      }
     
      CPerspective perspective = createEmptyPerspective();
     
      PerspectiveElementFactory factory = new PerspectiveElementFactory( perspective );
      DockFrontendPerspective frontend = wrap( perspective, includeWorkingAreas, factory );
      Perspective conversion = frontend.getPerspective();
     
      for( Map.Entry<String, MultipleCDockableFactory<?, ?>> item : control.getRegister().getFactories().entrySet() ){
        conversion.getSituation().add( new CommonMultipleDockableFactory( item.getKey(), item.getValue(), control, perspective ) );
      }
     
      Map<String, DockLayoutComposition> stations = conversion.getSituation().readCompositions( in );
      factory.setStations( stations );
     
      for( DockLayoutComposition composition : stations.values() ){
        PerspectiveElement station = conversion.convert( composition );
        if( station instanceof CommonElementPerspective ){
          CStationPerspective stationPerspective = ((CommonElementPerspective)station).getElement().asStation();
          if( stationPerspective != null ){
            perspective.addStation( stationPerspective );
          }
        }
      }
     
      if( version111a ){
        perspective.storeLocations();
        PropertyTransformer transformer = frontend.getPropertyTransformer();
        for( int i = 0, n = in.readInt(); i<n; i++ ){
          if( in.readBoolean() ){
            String key = in.readUTF();
            DockLayoutComposition composition = null;
            if( in.readBoolean() ){
View Full Code Here

    }
   
    private CSetting convert( CPerspective perspective, boolean includeWorkingAreas ){
      perspective.storeLocations();
     
      DockFrontendPerspective frontend = conversion( perspective, includeWorkingAreas );
      Perspective conversion = frontend.getPerspective();
      CSetting setting = new CSetting();
     
      // layout
      for( String key : perspective.getStationKeys() ){
        CStationPerspective station = perspective.getStation( key );
View Full Code Here

   
    private CPerspective convert( CSetting setting, boolean includeWorkingAreas ){
      CPerspective cperspective = createEmptyPerspective();
     
      PerspectiveElementFactory factory = new PerspectiveElementFactory( cperspective );
      DockFrontendPerspective frontend = wrap( cperspective, includeWorkingAreas, factory );
      Perspective conversion = frontend.getPerspective();
     
      for( Map.Entry<String, MultipleCDockableFactory<?, ?>> item : control.getRegister().getFactories().entrySet() ){
        conversion.getSituation().add( new CommonMultipleDockableFactory( item.getKey(), item.getValue(), control, cperspective ) );
      }
     
View Full Code Here

     * should be included in the layout or not
     * @return the new builder
     */
    @FrameworkOnly
    public DockFrontendPerspective conversion( CPerspective perspective, boolean includeWorkingAreas ){
      DockFrontendPerspective conversion = wrap( perspective, includeWorkingAreas );
      DockSituation situation = conversion.getPerspective().getSituation();
     
      for( Map.Entry<String, MultipleCDockableFactory<?, ?>> item : control.getRegister().getFactories().entrySet() ){
        situation.add( new CommonMultipleDockableFactory( item.getKey(), item.getValue(), control, perspective ) );
      }
     
View Full Code Here

      PerspectiveElementFactory factory = new PerspectiveElementFactory( perspective );
      return wrap( perspective, includeWorkingAreas, factory );
    }
   
    private DockFrontendPerspective wrap( CPerspective perspective, boolean includeWorkingAreas, PerspectiveElementFactory factory ){
      DockFrontendPerspective frontend = control.getOwner().intern().getPerspective( !includeWorkingAreas, factory );
      Perspective inner = frontend.getPerspective();
     
      factory.setBasePerspective( inner );
     
      CommonSingleDockableFactory singleDockableFactory = new CommonSingleDockableFactory( control.getOwner(), perspective );
      inner.getSituation().add( singleDockableFactory );
View Full Code Here

TOP

Related Classes of bibliothek.gui.dock.frontend.DockFrontendPerspective

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.