Package javax.swing.plaf.synth

Examples of javax.swing.plaf.synth.SynthLookAndFeel$AATextListener


   * Install the look and feel
   */
  public static void installLaf()
  {
    try {
      SynthLookAndFeel synth = new SynthLookAndFeel();
      XProject currentProject = XProjectManager.getCurrentProject();
      String synthConfigFile = currentProject.getStartupParam( "SynthConfigFile" );
      String synthResourceLoader = currentProject.getStartupParam( "SynthResourceLoader" );
      if (( synthResourceLoader == null ) || ( synthResourceLoader.length() == 0 ))
        synthResourceLoader = "net.xoetrope.optional.laf.synth.SynthStub";
      SynthLafInstaller.class.getClassLoader().getResource( synthResourceLoader );
      Class resourceLoader = null;
      try {
        SynthClassLoader scl = new SynthClassLoader( SynthLafInstaller.class.getClassLoader());
        resourceLoader = scl.findClass( synthResourceLoader );
        String s = currentProject.getStartupParam( "SynthImageConveter" );
        if (( s != null ) && ( s.length() > 0 ))
          scl.setConvertClassName( s );
 
        s = currentProject.getStartupParam( "SynthOverwriteImages" );
        if (( s != null ) && ( s.length() > 0 ))
          scl.setOverwriteImages( Boolean.parseBoolean( s ));
      }
      catch ( Throwable e ) {
        resourceLoader = Class.forName( synthResourceLoader.trim() );
      }
      //loadStubClass( "net.xoetrope.optional.laf.synth.SynthStub" );

      BufferedInputStream bis = null;


      // Does the file need processing?
      int pos;
      if (( pos = synthConfigFile.indexOf( ".xsynth" )) > 0 ) {
        String outputFile = synthConfigFile.substring( 0, pos ) + ".synth";

          // Try to find a preprocessor for the file, at runtime this load should fail as the preprocessor
          // will not be present.
          try {
              FilePreprocessor processor = (FilePreprocessor)Class.forName( "net.xoetrope.optional.laf.synth.SynthPreprocessor" ).newInstance();
              DebugLogger.trace( currentProject.findResourceAsString( synthConfigFile ));
              bis = currentProject.getBufferedInputStream ( synthConfigFile );
              String processedStr = processor.process( bis );
              ByteArrayInputStream bais = new ByteArrayInputStream( processedStr.getBytes() );
              bis = new BufferedInputStream( bais );

              // Save the config file
              outputFile = getOutputPath( currentProject, "resources", synthConfigFile.substring( 0, pos ), ".synth" );
              FileWriter fw = new FileWriter( outputFile  );
              fw.write ( processedStr );
              fw.flush();
              fw.close();
          }
          catch ( Exception e )
          {
              // Assume that the file has previously been processed
              bis = currentProject.getBufferedInputStream ( outputFile );
          }
      }
      else
         bis = currentProject.getBufferedInputStream ( synthConfigFile );

      DebugLogger.log( "Synth config file: " + currentProject.findResourceAsString( synthConfigFile ));
      synth.load( bis, resourceLoader );
      UIManager.setLookAndFeel( synth );
    }
    catch ( Exception ex ) {
      ex.printStackTrace();
    }
View Full Code Here


public class bug6604281 {
    public static void main(String[] args) throws InvocationTargetException, InterruptedException {
        SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
                SynthLookAndFeel laf = new SynthLookAndFeel();
                try {
                    UIManager.setLookAndFeel(laf);
                } catch (Exception e) {
                    fail(e.getMessage());
                }
View Full Code Here

import javax.swing.text.html.ImageView;
import java.io.StringReader;

public class Test6933784 {
    public static void main(String[] args) throws Exception {
        UIManager.setLookAndFeel(new SynthLookAndFeel());

        checkImages();

        setNimbusLookAndFeel();
View Full Code Here

TOP

Related Classes of javax.swing.plaf.synth.SynthLookAndFeel$AATextListener

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.