Package bibliothek.util

Examples of bibliothek.util.Version


     * Lets all {@link ApplicationResource}s read from <code>in</code>.
     * @param in the stream to read from
     * @throws IOException if the operation can't be completed
     */
    public void readStream( DataInputStream in ) throws IOException{
        Version version = Version.read( in );
        version.checkCurrent();
       
        int size = in.readInt();
        for( int i = 0; i < size; i++ ){
            String key = in.readUTF();
           
View Full Code Here


     * to set the old <code>LookAndFeel</code>.
     * @param in the stream to read from
     * @throws IOException if <code>in</code> can't be read
     */
    public void read( DataInputStream in ) throws IOException {
        Version version = Version.read( in );
        version.checkCurrent();
       
        if( version.equals( Version.VERSION_1_0_4 )){
          int index = in.readInt();
          if( !hasRead || !allowReadOnlyOnce ){
              if( index >= 0 && index < size()+2 ){
                  setLookAndFeel( getFull( index ) );
              }
View Full Code Here

     * from <code>in</code>.
     * @param in the stream to read from
     * @throws IOException if an I/O-error occurs
     */
    public void read( DataInputStream in ) throws IOException{
        Version version = Version.read( in );
        version.checkCurrent();
       
        boolean version7 = Version.VERSION_1_0_7.compareTo( version ) >= 0;
        if( version7 ){
          Version.read( in );
        }
View Full Code Here

    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() );
View Full Code Here

    }
   
    @Override
    public void read( DockSituation situation, PropertyTransformer transformer, boolean entry, DataInputStream in ) throws IOException {
       
        Version version = Version.read( in );
        version.checkCurrent();
       
        boolean version7 = version.compareTo( Version.VERSION_1_0_7 ) >= 0;
        boolean version11 = version.compareTo( Version.VERSION_1_1_1 ) >= 0;
       
        super.read( situation, transformer, entry, in );
       
        // old settings will be converted automatically
        modes.read( in );
View Full Code Here

      layout.setArea( dockable.getWorkingArea() == null ? null : dockable.getWorkingArea().getUniqueId() );
      return layout;
    }

    public CommonSingleDockableLayout read( DataInputStream in, PlaceholderStrategy placeholders ) throws IOException {
        Version version = Version.read( in );
        CommonSingleDockableLayout layout = new CommonSingleDockableLayout();
       
        if( version.equals( Version.VERSION_1_0_4 )){
          layout.setId( in.readUTF() );
        }
        else if( version.equals( Version.VERSION_1_1_0 )){
          layout.setId( in.readUTF() );
          layout.setArea( in.readUTF() );
        }
        else if( version.equals( Version.VERSION_1_1_0a )){
          layout.setId( in.readUTF() );
          if( in.readBoolean() ){
            layout.setArea( in.readUTF() );
          }
          else{
View Full Code Here

        Version.write( out, Version.VERSION_1_0_4 );
        getFrontend().writeBlop( settings, out );
    }
   
    public void read( DataInputStream in ) throws IOException {
        Version version = Version.read( in );
        if( Version.VERSION_1_1_1.compareTo( version ) > 0 ){
          throw new IOException( "The perspective API cannot read files which were written before version 1.1.1" );
        }
        version.checkCurrent();
        settings = getFrontend().readBlop( in );
    }
View Full Code Here

     * when calling {@link #write(DataOutputStream, CPerspective, boolean)}.
     * @return the new perspective
     * @throws IOException if <code>in</code> is not readable or in the wrong format
     */
    public CPerspective read( DataInputStream in, boolean includeWorkingAreas ) throws IOException{
      Version version = Version.read( in );
     
      boolean version111 = version.equals( Version.VERSION_1_1_1 );
      boolean version111a = version.equals( Version.VERSION_1_1_1a );
     
      if( !version111 && !version111a ){
        throw new IOException( "unknown version: " + version );
      }
     
View Full Code Here

                public void write( DataOutputStream out ) throws IOException {
                    Version.write( out, Version.VERSION_1_1_1 );
                    frontend.write( out );
                }
                public void read( DataInputStream in ) throws IOException {
                    Version version = Version.read( in );
                    version.checkCurrent();
                    if( Version.VERSION_1_1_1.compareTo( version ) > 0 && Version.VERSION_1_0_4.compareTo( version ) <= 0 ){
                      readWorkingAreas( in );
                    }
                    frontend.read( in );
                }
                public void writeXML( XElement element ) {
                    frontend.writeXML( element.addElement( "frontend" ) );
                }
                public void readXML( XElement element ) {
                    frontend.readXML( element.getElement( "frontend" ) );
                }
            });

            resources.put( "ccontrol.preferences", new ApplicationResource(){
                public void read( DataInputStream in ) throws IOException {
                    Version version = Version.read( in );
                    version.checkCurrent();
                    preferences.read( in );

                    if( preferenceModel != null ){
                        preferences.load( preferenceModel, false );
                        preferenceModel.write();
View Full Code Here

                public void write( DataOutputStream out ) throws IOException {
                    Version.write( out, Version.VERSION_1_0_4 );
                    getList().write( out );
                }
                public void read( DataInputStream in ) throws IOException {
                    Version version = Version.read( in );
                    version.checkCurrent();
                    getList().read( in );
                }
                public void writeXML( XElement element ) {
                    getList().writeXML( element );
                }
View Full Code Here

TOP

Related Classes of bibliothek.util.Version

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.