You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by le...@apache.org on 2002/03/05 10:41:41 UTC

cvs commit: jakarta-avalon-excalibur/examples/altprofile/src/java/org/apache/avalon/examples/altprofile Main.java

leif        02/03/05 01:41:41

  Modified:    examples/altprofile/src/java/org/apache/avalon/examples/altprofile
                        Main.java
  Added:       examples/altprofile/conf altprofile.desktop
  Log:
  Added the ability to save the desktop state of the ProfilerFrame.
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-excalibur/examples/altprofile/conf/altprofile.desktop
  
  Index: altprofile.desktop
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <profiler-frame height="555" x="13" width="1216" y="37">
  <inner-frame height="120" x="0" type="sample-frame" width="600" sample="example-profilable.doaction-counter.counter.1000.600" y="0"/>
  <inner-frame height="120" x="600" type="sample-frame" width="600" sample="profiler.total-memory.max.1000.600" y="0"/>
  <inner-frame height="120" x="601" type="sample-frame" width="600" sample="profiler.memory.max.1000.600" y="120"/>
  <inner-frame height="120" x="1" type="sample-frame" width="600" sample="example-profilable.counter-quick.counter.1000.600" y="120"/>
  <inner-frame height="212" x="1" type="sample-frame" width="1200" sample="example-profilable.random-random.minimum.1000.600" y="240"/>
  </profiler-frame>
  
  
  
  1.2       +15 -3     jakarta-avalon-excalibur/examples/altprofile/src/java/org/apache/avalon/examples/altprofile/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/examples/altprofile/src/java/org/apache/avalon/examples/altprofile/Main.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Main.java	4 Mar 2002 09:02:10 -0000	1.1
  +++ Main.java	5 Mar 2002 09:41:41 -0000	1.2
  @@ -8,8 +8,7 @@
   package org.apache.avalon.examples.altprofile;
   
   import java.io.BufferedReader;
  -import java.io.FileInputStream;
  -import java.io.IOException;
  +import java.io.File;
   import java.io.InputStreamReader;
   
   import org.apache.avalon.excalibur.altprofile.component.ProfilerComponentManager;
  @@ -41,7 +40,7 @@
    * Note, this code ignores exceptions to keep the code simple.
    *
    * @author <a href="mailto:leif@silveregg.co.jp">Leif Mortenson</a>
  - * @version CVS $Revision: 1.1 $ $Date: 2002/03/04 09:02:10 $
  + * @version CVS $Revision: 1.2 $ $Date: 2002/03/05 09:41:41 $
    * @since 4.1
    */
   public class Main
  @@ -113,6 +112,19 @@
           // Set up the ProfilerFrame
           m_profilerFrame = new ProfilerFrame( m_profilerManager, "Example Profiler" );
           m_profilerFrame.setVisible( true );
  +        
  +        try
  +        {
  +            File desktopFile = new File( "../conf/altprofile.desktop" );
  +            if ( desktopFile.exists() )
  +            {
  +                m_profilerFrame.loadDesktopStateFromFile( desktopFile, false );
  +            }
  +        }
  +        catch ( Exception e )
  +        {
  +            System.out.println( "Unable to load desktop file: " + e );
  +        }
       }
       
       /*---------------------------------------------------------------
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>