bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement) job_it.next(); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
3,241,657
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList(job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
3,241,658
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList(); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
3,241,659
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator(); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
3,241,660
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement) ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
3,241,661
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
3,241,662
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
3,241,663
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
3,241,664
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement) arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
3,241,665
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add(arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
3,241,666
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add(new ExecutableFile(ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
3,241,667
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add(new ProcessingJob(job_name, ef_list)); } } return true; }
3,241,668
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
3,241,669
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
private boolean readSpec () { InputStream input; try { input = ResourceManager.getInstance().getInputStream (SPEC_RESOURCE_NAME); } catch (Exception e) { e.printStackTrace(); return false; } StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); try { parser.setReader (new StdXMLReader (input)); this.spec = (XMLElement) parser.parse(); } catch (Exception e) { System.err.println ("Error parsing XML specification for processing."); System.err.println (e.toString ()); return false; } if (! this.spec.hasChildren ()) return false; for (Iterator job_it = this.spec.getChildrenNamed("job").iterator(); job_it.hasNext(); ) { XMLElement job_el = (XMLElement)job_it.next (); // first check OS constraints - skip jobs not suited for this OS List constraints = OsConstraint.getOsList (job_el); if (OsConstraint.oneMatchesCurrentSystem(constraints)) { List ef_list = new ArrayList (); String job_name = job_el.getAttribute("name", ""); for (Iterator ef_it = job_el.getChildrenNamed("executefile").iterator (); ef_it.hasNext(); ) { XMLElement ef = (XMLElement)ef_it.next(); String ef_name = ef.getAttribute("name"); if ((ef_name == null) || (ef_name.length() == 0)) { System.err.println ("missing \"name\" attribute for <executefile>"); return false; } List args = new ArrayList (); for (Iterator arg_it = ef.getChildrenNamed("arg").iterator(); arg_it.hasNext();) { XMLElement arg_el = (XMLElement)arg_it.next(); String arg_val = arg_el.getContent(); args.add (arg_val); } ef_list.add (new ExecutableFile (ef_name, args)); } this.jobs.add (new ProcessingJob (job_name, ef_list)); } } return true; }
3,241,670
public void run () { this.handler.startProcessing (this.jobs.size()); for (Iterator job_it = this.jobs.iterator(); job_it.hasNext(); ) { ProcessingJob pj = (ProcessingJob)job_it.next(); this.handler.startProcess (pj.name); boolean result = pj.run (this.handler, this.vs); this.handler.finishProcess (); if (! result) break; } this.handler.finishProcessing(); }
public void run() { this.handler.startProcessing (this.jobs.size()); for (Iterator job_it = this.jobs.iterator(); job_it.hasNext(); ) { ProcessingJob pj = (ProcessingJob)job_it.next(); this.handler.startProcess (pj.name); boolean result = pj.run (this.handler, this.vs); this.handler.finishProcess (); if (! result) break; } this.handler.finishProcessing(); }
3,241,671
public void run () { this.handler.startProcessing (this.jobs.size()); for (Iterator job_it = this.jobs.iterator(); job_it.hasNext(); ) { ProcessingJob pj = (ProcessingJob)job_it.next(); this.handler.startProcess (pj.name); boolean result = pj.run (this.handler, this.vs); this.handler.finishProcess (); if (! result) break; } this.handler.finishProcessing(); }
public void run () { this.handler.startProcessing (this.jobs.size()); for (Iterator job_it = this.jobs.iterator(); job_it.hasNext(); ) { ProcessingJob pj = (ProcessingJob)job_it.next(); this.handler.startProcess (pj.name); boolean result = pj.run (this.handler, this.vs); this.handler.finishProcess (); if (! result) break; } this.handler.finishProcessing(); }
3,241,672
public void run () { this.handler.startProcessing (this.jobs.size()); for (Iterator job_it = this.jobs.iterator(); job_it.hasNext(); ) { ProcessingJob pj = (ProcessingJob)job_it.next(); this.handler.startProcess (pj.name); boolean result = pj.run (this.handler, this.vs); this.handler.finishProcess (); if (! result) break; } this.handler.finishProcessing(); }
public void run () { this.handler.startProcessing (this.jobs.size()); for (Iterator job_it = this.jobs.iterator(); job_it.hasNext(); ) { ProcessingJob pj = (ProcessingJob)job_it.next(); this.handler.startProcess (pj.name); boolean result = pj.run (this.handler, this.vs); this.handler.finishProcess (); if (! result) break; } this.handler.finishProcessing(); }
3,241,673
public void run () { this.handler.startProcessing (this.jobs.size()); for (Iterator job_it = this.jobs.iterator(); job_it.hasNext(); ) { ProcessingJob pj = (ProcessingJob)job_it.next(); this.handler.startProcess (pj.name); boolean result = pj.run (this.handler, this.vs); this.handler.finishProcess (); if (! result) break; } this.handler.finishProcessing(); }
public void run () { this.handler.startProcessing (this.jobs.size()); for (Iterator job_it = this.jobs.iterator(); job_it.hasNext(); ) { ProcessingJob pj = (ProcessingJob)job_it.next(); this.handler.startProcess (pj.name); boolean result = pj.run (this.handler, this.vs); this.handler.finishProcess (); if (! result) break; } this.handler.finishProcessing(); }
3,241,674
public void startThread () { this.processingThread = new Thread (this, "processing thread"); //will call this.run() this.processingThread.start(); }
public void startThread() { this.processingThread = new Thread (this, "processing thread"); //will call this.run() this.processingThread.start(); }
3,241,675
public void startThread () { this.processingThread = new Thread (this, "processing thread"); //will call this.run() this.processingThread.start(); }
public void startThread () { this.processingThread = new Thread(this, "processing thread"); //will call this.run() this.processingThread.start(); }
3,241,676
public <T extends IObject> T updateObject(T obj) { return iUpdate.saveAndReturnObject( obj ); }
public <T extends IObject> T updateObject(T obj) { return iUpdate.saveAndReturnObject( obj ); }
3,241,677
public IObject updateObject(IObject obj) { update.flush(); return null; }
public IObject updateObject(IObject obj) { update.flush(); return null; }
3,241,678
public <T extends IObject> T updateObject(T obj) { iUpdate.deleteObject( obj ); return null; }
public <T extends IObject> T updateObject(T obj) { iUpdate.deleteObject( obj ); return null; }
3,241,679
Experimenter userProxy( Long userId );
Experimenter userProxy( Long userId );
3,241,680
public ZipOutputStream addPack(int packNumber, String name, boolean required, String description) throws Exception { sendMsg("Adding pack #" + packNumber + " : " + name + " ..."); // Adds it in the packs array Pack pack = new Pack(name, description, required); packs.add(packNumber, pack); // Returns the suiting output stream String entryName = "packs/pack" + packNumber; ZipEntry entry = new ZipEntry(entryName); outJar.putNextEntry(entry); return outJar; }
public ZipOutputStream addPack(int packNumber, String name, String targetOs, boolean required, String description) throws Exception { sendMsg("Adding pack #" + packNumber + " : " + name + " ..."); // Adds it in the packs array Pack pack = new Pack(name, description, required); packs.add(packNumber, pack); // Returns the suiting output stream String entryName = "packs/pack" + packNumber; ZipEntry entry = new ZipEntry(entryName); outJar.putNextEntry(entry); return outJar; }
3,241,682
public ZipOutputStream addPack(int packNumber, String name, boolean required, String description) throws Exception { sendMsg("Adding pack #" + packNumber + " : " + name + " ..."); // Adds it in the packs array Pack pack = new Pack(name, description, required); packs.add(packNumber, pack); // Returns the suiting output stream String entryName = "packs/pack" + packNumber; ZipEntry entry = new ZipEntry(entryName); outJar.putNextEntry(entry); return outJar; }
public ZipOutputStream addPack(int packNumber, String name, boolean required, String description) throws Exception { sendMsg("Adding pack #" + packNumber + " : " + name + " ..."); // Adds it in the packs array Pack pack = new Pack(name, description, targetOs, required); packs.add(packNumber, pack); // Returns the suiting output stream String entryName = "packs/pack" + packNumber; ZipEntry entry = new ZipEntry(entryName); outJar.putNextEntry(entry); return outJar; }
3,241,683
public void menuAboutToShow(IMenuManager manager) { if(fTree.getSelectionCount() > 0) { TreeItem treeItem = fTree.getSelection()[0]; RunInfo testInfo = (RunInfo) treeItem.getData("runinfo"); if(RunInfo.RESULT_TYPE == testInfo.m_type) { manager.add(new OpenTestAction(fTestRunnerPart, testInfo.m_className, testInfo.m_methodName)); } manager.add(new Separator()); manager.add(new ExpandAllAction()); } }
public void menuAboutToShow(IMenuManager manager) { if(fTree.getSelectionCount() > 0) { TreeItem treeItem = fTree.getSelection()[0]; RunInfo testInfo = (RunInfo) treeItem.getData("runinfo"); if(RunInfo.RESULT_TYPE == testInfo.m_type) { manager.add(new OpenTestAction(fTestRunnerPart, testInfo.m_className, testInfo.m_methodName)); } manager.add(new Separator()); manager.add(new ExpandAllAction()); } }
3,241,684
private void createShortcuts () { ShortcutData data; for (int i = 0; i < shortcuts.size (); i++) { data = (ShortcutData)shortcuts.elementAt (i); try { groupName = groupName + data.subgroup; shortcut.setLinkName (data.name); shortcut.setLinkType (data.type); shortcut.setArguments (data.commandLine); shortcut.setDescription (data.description); shortcut.setIconLocation (data.iconFile, data.iconIndex); shortcut.setShowCommand (data.initialState); shortcut.setTargetPath (data.target); shortcut.setWorkingDirectory (data.workingDirectory); if (data.addToGroup) { shortcut.setProgramGroup (groupName); } else { shortcut.setProgramGroup (""); } try { // ---------------------------------------------- // save the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ( (data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut.isSelected ()) ) { // save the shortcut shortcut.save (); // add the file and directory name to the file list String fileName = shortcut.getFileName (); String directoryName = shortcut.getDirectoryCreated (); files.add (fileName); if (!(directoryName == null)) { files.add (directoryName); } } } catch (Exception exception) { } } catch (Throwable exception) { continue; } } parent.unlockNextButton(); }
private void createShortcuts () { ShortcutData data; for (int i = 0; i < shortcuts.size (); i++) { data = (ShortcutData)shortcuts.elementAt (i); try { groupName = groupName + data.subgroup; shortcut.setLinkName (data.name); shortcut.setLinkType (data.type); shortcut.setArguments (data.commandLine); shortcut.setDescription (data.description); shortcut.setIconLocation (data.iconFile, data.iconIndex); shortcut.setShowCommand (data.initialState); shortcut.setTargetPath (data.target); shortcut.setWorkingDirectory (data.workingDirectory); if (data.addToGroup) { shortcut.setProgramGroup (groupName); } else { shortcut.setProgramGroup (""); } try { // ---------------------------------------------- // save the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ( (data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut.isSelected ()) ) { // save the shortcut shortcut.save (); // add the file and directory name to the file list String fileName = shortcut.getFileName (); String directoryName = shortcut.getDirectoryCreated (); files.add (0, fileName); if (!(directoryName == null)) { files.add (directoryName); } } } catch (Exception exception) { } } catch (Throwable exception) { continue; } } parent.unlockNextButton(); }
3,241,685
private RenderingEngine() { cmdProcessor = new AsyncProcessor(); //Integer size = (Integer) registry.lookup(LookupNames.RE_STACK_BUF_SZ), // blockSize = (Integer) registry.lookup( // LookupNames.RE_STACK_BLOCK_SZ); //int sz = size.intValue(), block = blockSize.intValue(); //block = (0 < block ? block : 4096); //if (0 < sz) // stackBuffer = new AsyncByteBuffer(sz*1024*1024, block, // cmdProcessor); //else //stackBuffer = new AsyncByteBuffer(1, 1); //Won't be used b/c we first check if we can cache a stack. }
private RenderingEngine() { cmdProcessor = new AsyncProcessor(); //Integer size = (Integer) registry.lookup(LookupNames.RE_STACK_BUF_SZ), // blockSize = (Integer) registry.lookup( // LookupNames.RE_STACK_BLOCK_SZ); //int sz = size.intValue(), block = blockSize.intValue(); //block = (0 < block ? block : 4096); //if (0 < sz) // stackBuffer = new AsyncByteBuffer(sz*1024*1024, block, // cmdProcessor); //else //stackBuffer = new AsyncByteBuffer(1, 1); //Won't be used b/c we first check if we can cache a stack. }
3,241,687
public void eventFired(AgentEvent e) { //TODO: put event on the queue and remove the following. if (e instanceof LoadImage) handleLoadImage((LoadImage) e); else if (e instanceof RenderImage) handleRenderImage((RenderImage) e); else if (e instanceof RenderingPropChange) handleRenderingPropChange((RenderingPropChange) e); else if (e instanceof RenderImage3D) handleRenderImage3D((RenderImage3D) e); }
public void eventFired(AgentEvent e) { //TODO: put event on the queue and remove the following. if (e instanceof LoadImage) handleLoadImage((LoadImage) e); else if (e instanceof RenderImage) handleRenderImage((RenderImage) e); else if (e instanceof RenderingPropChange) handleRenderingPropChange((RenderingPropChange) e); else if (e instanceof RenderImage3D) handleRenderImage3D((RenderImage3D) e); }
3,241,688
private void handleLoadImage(LoadImage request) { try { rndManager = RenderingManager.makeNew(this, request.getImageID(), request.getPixelsID()); RenderingControlProxy proxy = rndManager.createRenderingControlProxy(); ImageLoaded response = new ImageLoaded(request, proxy); EventBus eventBus = registry.getEventBus(); eventBus.post(response); //TODO: this has to be run w/in Swing thread. } catch (MetadataSourceException mdse) { hanldeException("Can't load image metadata. Image id: "+ request.getImageID(), mdse); } catch (DataSourceException dse) { hanldeException("Can't load image metadata. Image id: "+ request.getImageID(), dse); } }
private void handleLoadImage(LoadImage request) { try { rndManager = RenderingManager.makeNew(this, request.getImageID(), request.getPixelsID()); RenderingControlProxy proxy = rndManager.createRenderingControlProxy(); ImageLoaded response = new ImageLoaded(request, proxy); EventBus eventBus = registry.getEventBus(); eventBus.post(response); //TODO: this has to be run w/in Swing thread. } catch (MetadataSourceException mdse) { hanldeException("Can't load image metadata. Image id: "+ request.getImageID(), mdse); } catch (DataSourceException dse) { hanldeException("Can't load image metadata. Image id: "+ request.getImageID(), dse); } }
3,241,689
private void handleLoadImage(LoadImage request) { try { rndManager = RenderingManager.makeNew(this, request.getImageID(), request.getPixelsID()); RenderingControlProxy proxy = rndManager.createRenderingControlProxy(); ImageLoaded response = new ImageLoaded(request, proxy); EventBus eventBus = registry.getEventBus(); eventBus.post(response); //TODO: this has to be run w/in Swing thread. } catch (MetadataSourceException mdse) { hanldeException("Can't load image metadata. Image id: "+ request.getImageID(), mdse); } catch (DataSourceException dse) { hanldeException("Can't load image metadata. Image id: "+ request.getImageID(), dse); } }
private void handleLoadImage(LoadImage request) { try { rndManager = RenderingManager.makeNew(this, request.getImageID(), request.getPixelsID()); RenderingControlProxy proxy = rndManager.createRenderingControlProxy(); ImageLoaded response = new ImageLoaded(request, proxy); EventBus eventBus = registry.getEventBus(); eventBus.post(response); //TODO: this has to be run w/in Swing thread. } catch (MetadataSourceException mdse) { hanldeException("Can't load image metadata. Image id: "+ request.getImageID(), mdse); } catch (DataSourceException dse) { handleException("Can't load image metadata. Image id: "+ request.getImageID(), dse); } }
3,241,690
private void handleRenderImage(RenderImage request) { if (rndManager == null) return; //TODO: if null, log? try { PlaneDef pd = request.getPlaneDef(); BufferedImage img = rndManager.renderPlane(pd); ImageRendered response = new ImageRendered(request, img); EventBus eventBus = registry.getEventBus(); eventBus.post(response); //TODO: this has to be run w/in Swing thread. } catch (DataSourceException dse) { hanldeException("Can't load pixels data. Pixels id: "+ request.getPixelsID(), dse); } catch (QuantizationException qee) { //TODO: need to post an event to update the GUI. hanldeException("Can't map the wavelength " +qee.getWavelength(), qee); } }
private void handleRenderImage(RenderImage request) { if (rndManager == null) return; //TODO: if null, log? try { PlaneDef pd = request.getPlaneDef(); BufferedImage img = rndManager.renderPlane(pd); ImageRendered response = new ImageRendered(request, img); EventBus eventBus = registry.getEventBus(); eventBus.post(response); //TODO: this has to be run w/in Swing thread. } catch (DataSourceException dse) { handleException("Can't load pixels data. Pixels id: "+ request.getPixelsID(), dse); } catch (QuantizationException qee) { //TODO: need to post an event to update the GUI. hanldeException("Can't map the wavelength " +qee.getWavelength(), qee); } }
3,241,692
private void handleRenderImage(RenderImage request) { if (rndManager == null) return; //TODO: if null, log? try { PlaneDef pd = request.getPlaneDef(); BufferedImage img = rndManager.renderPlane(pd); ImageRendered response = new ImageRendered(request, img); EventBus eventBus = registry.getEventBus(); eventBus.post(response); //TODO: this has to be run w/in Swing thread. } catch (DataSourceException dse) { hanldeException("Can't load pixels data. Pixels id: "+ request.getPixelsID(), dse); } catch (QuantizationException qee) { //TODO: need to post an event to update the GUI. hanldeException("Can't map the wavelength " +qee.getWavelength(), qee); } }
private void handleRenderImage(RenderImage request) { if (rndManager == null) return; //TODO: if null, log? try { PlaneDef pd = request.getPlaneDef(); BufferedImage img = rndManager.renderPlane(pd); ImageRendered response = new ImageRendered(request, img); EventBus eventBus = registry.getEventBus(); eventBus.post(response); //TODO: this has to be run w/in Swing thread. } catch (DataSourceException dse) { hanldeException("Can't load pixels data. Pixels id: "+ request.getPixelsID(), dse); } catch (QuantizationException qee) { //TODO: need to post an event to update the GUI. handleException("Can't map the wavelength " +qee.getWavelength(), qee); } }
3,241,693
private void handleRenderImage3D(RenderImage3D request) { if (rndManager == null) return; //TODO: if null, log? try { PlaneDef xyPD = request.getXYPlaneDef(), xzPD = request.getXZPlaneDef(), zyPD = request.getZYPlaneDef(); BufferedImage xyPlane = null, xzPlane, zyPlane; if (xyPD != null) xyPlane = rndManager.renderPlane(xyPD); xzPlane = rndManager.renderPlane(xzPD); zyPlane = rndManager.renderPlane(zyPD); Image3DRendered response = new Image3DRendered(request, xyPlane, xzPlane, zyPlane); EventBus eventBus = registry.getEventBus(); eventBus.post(response); //TODO: this has to be run w/in Swing thread. } catch (DataSourceException dse) { hanldeException("Can't load pixels data. Pixels id: "+ request.getPixelsID(), dse); } catch (QuantizationException qee) { //TODO: need to post an event to update the GUI. hanldeException("Can't map the wavelength " +qee.getWavelength(), qee); } }
private void handleRenderImage3D(RenderImage3D request) { if (rndManager == null) return; //TODO: if null, log? try { PlaneDef xyPD = request.getXYPlaneDef(), xzPD = request.getXZPlaneDef(), zyPD = request.getZYPlaneDef(); BufferedImage xyPlane = null, xzPlane, zyPlane; if (xyPD != null) xyPlane = rndManager.renderPlane(xyPD); xzPlane = rndManager.renderPlane(xzPD); zyPlane = rndManager.renderPlane(zyPD); Image3DRendered response = new Image3DRendered(request, xyPlane, xzPlane, zyPlane); EventBus eventBus = registry.getEventBus(); eventBus.post(response); //TODO: this has to be run w/in Swing thread. } catch (DataSourceException dse) { handleException("Can't load pixels data. Pixels id: "+ request.getPixelsID(), dse); } catch (QuantizationException qee) { //TODO: need to post an event to update the GUI. hanldeException("Can't map the wavelength " +qee.getWavelength(), qee); } }
3,241,694
private void handleRenderImage3D(RenderImage3D request) { if (rndManager == null) return; //TODO: if null, log? try { PlaneDef xyPD = request.getXYPlaneDef(), xzPD = request.getXZPlaneDef(), zyPD = request.getZYPlaneDef(); BufferedImage xyPlane = null, xzPlane, zyPlane; if (xyPD != null) xyPlane = rndManager.renderPlane(xyPD); xzPlane = rndManager.renderPlane(xzPD); zyPlane = rndManager.renderPlane(zyPD); Image3DRendered response = new Image3DRendered(request, xyPlane, xzPlane, zyPlane); EventBus eventBus = registry.getEventBus(); eventBus.post(response); //TODO: this has to be run w/in Swing thread. } catch (DataSourceException dse) { hanldeException("Can't load pixels data. Pixels id: "+ request.getPixelsID(), dse); } catch (QuantizationException qee) { //TODO: need to post an event to update the GUI. hanldeException("Can't map the wavelength " +qee.getWavelength(), qee); } }
private void handleRenderImage3D(RenderImage3D request) { if (rndManager == null) return; //TODO: if null, log? try { PlaneDef xyPD = request.getXYPlaneDef(), xzPD = request.getXZPlaneDef(), zyPD = request.getZYPlaneDef(); BufferedImage xyPlane = null, xzPlane, zyPlane; if (xyPD != null) xyPlane = rndManager.renderPlane(xyPD); xzPlane = rndManager.renderPlane(xzPD); zyPlane = rndManager.renderPlane(zyPD); Image3DRendered response = new Image3DRendered(request, xyPlane, xzPlane, zyPlane); EventBus eventBus = registry.getEventBus(); eventBus.post(response); //TODO: this has to be run w/in Swing thread. } catch (DataSourceException dse) { hanldeException("Can't load pixels data. Pixels id: "+ request.getPixelsID(), dse); } catch (QuantizationException qee) { //TODO: need to post an event to update the GUI. handleException("Can't map the wavelength " +qee.getWavelength(), qee); } }
3,241,695
protected void setUp() throws Exception { data = (OMEData) factory.ctx.getBean("data"); iPojos = factory.getPojosService(); iQuery = factory.getQueryService(); iUpdate = factory.getUpdateService(); try { iQuery.get(Experimenter.class,0l); } catch (Throwable t){ // TODO no, no, really. This is ok. (And temporary) } iQuery.get(Experimenter.class,0l); // if this one fails, skip rest. }
protected void setUp() throws Exception { data = (OMEData) factory.getContext().getBean("data"); iPojos = factory.getPojosService(); iQuery = factory.getQueryService(); iUpdate = factory.getUpdateService(); try { iQuery.get(Experimenter.class,0l); } catch (Throwable t){ // TODO no, no, really. This is ok. (And temporary) } iQuery.get(Experimenter.class,0l); // if this one fails, skip rest. }
3,241,696
private void putUninstaller() throws Exception { // get the uninstaller base, returning if not found so that // idata.uninstallOutJar remains null InputStream [] in = new InputStream[2]; in[0] = Unpacker.class.getResourceAsStream("/res/IzPack.uninstaller"); if (in[0] == null) return; // The uninstaller extension is facultative; it will be exist only // if a native library was marked for uninstallation. in[1] = Unpacker.class.getResourceAsStream("/res/IzPack.uninstaller-ext"); // Me make the .uninstaller directory String dest = IoHelper.translatePath("$INSTALL_PATH", vs) + File.separator + "Uninstaller"; String jar = dest + File.separator + "uninstaller.jar"; File pathMaker = new File(dest); pathMaker.mkdirs(); // We log the uninstaller deletion information udata.setUninstallerJarFilename(jar); udata.setUninstallerPath(dest); // We open our final jar file FileOutputStream out = new FileOutputStream(jar); ZipOutputStream outJar = new ZipOutputStream(out); idata.uninstallOutJar = outJar; outJar.setLevel(9); udata.addFile(jar); // We copy the uninstallers HashSet doubles = new HashSet(); for( int i = 0; i < in.length; ++i ) { if( in[i] == null ) continue; ZipInputStream inRes = new ZipInputStream(in[i]); ZipEntry zentry = inRes.getNextEntry(); while (zentry != null) { // Puts a new entry, but not twice like META-INF if( ! doubles.contains(zentry.getName())) { doubles.add(zentry.getName()); outJar.putNextEntry(new ZipEntry(zentry.getName())); // Byte to byte copy int unc = inRes.read(); while (unc != -1) { outJar.write(unc); unc = inRes.read(); } // Next one please inRes.closeEntry(); outJar.closeEntry(); } zentry = inRes.getNextEntry(); } inRes.close(); } // We put the langpack InputStream in2 = Unpacker.class.getResourceAsStream("/langpacks/" + idata.localeISO3 + ".xml"); outJar.putNextEntry(new ZipEntry("langpack.xml")); int read = in2.read(); while (read != -1) { outJar.write(read); read = in2.read(); } outJar.closeEntry(); }
private void putUninstaller() throws Exception { // get the uninstaller base, returning if not found so that // idata.uninstallOutJar remains null InputStream [] in = new InputStream[2]; in[0] = Unpacker.class.getResourceAsStream("/res/IzPack.uninstaller"); if (in[0] == null) return; // The uninstaller extension is facultative; it will be exist only // if a native library was marked for uninstallation. in[1] = Unpacker.class.getResourceAsStream("/res/IzPack.uninstaller-ext"); // Me make the .uninstaller directory String dest = IoHelper.translatePath("$INSTALL_PATH", vs) + File.separator + "Uninstaller"; String jar = dest + File.separator + idata.info.getUninstallerName(); File pathMaker = new File(dest); pathMaker.mkdirs(); // We log the uninstaller deletion information udata.setUninstallerJarFilename(jar); udata.setUninstallerPath(dest); // We open our final jar file FileOutputStream out = new FileOutputStream(jar); ZipOutputStream outJar = new ZipOutputStream(out); idata.uninstallOutJar = outJar; outJar.setLevel(9); udata.addFile(jar); // We copy the uninstallers HashSet doubles = new HashSet(); for( int i = 0; i < in.length; ++i ) { if( in[i] == null ) continue; ZipInputStream inRes = new ZipInputStream(in[i]); ZipEntry zentry = inRes.getNextEntry(); while (zentry != null) { // Puts a new entry, but not twice like META-INF if( ! doubles.contains(zentry.getName())) { doubles.add(zentry.getName()); outJar.putNextEntry(new ZipEntry(zentry.getName())); // Byte to byte copy int unc = inRes.read(); while (unc != -1) { outJar.write(unc); unc = inRes.read(); } // Next one please inRes.closeEntry(); outJar.closeEntry(); } zentry = inRes.getNextEntry(); } inRes.close(); } // We put the langpack InputStream in2 = Unpacker.class.getResourceAsStream("/langpacks/" + idata.localeISO3 + ".xml"); outJar.putNextEntry(new ZipEntry("langpack.xml")); int read = in2.read(); while (read != -1) { outJar.write(read); read = in2.read(); } outJar.closeEntry(); }
3,241,697
private static String javaCommand() { // This was stolen (and specialized from much more modular code) from the // jakarta ant classes Os & JavaEnvUtils. Also see the following // org.apache.tools.ant.taskdefs.Java // org.apache.tools.ant.taskdefs.Execute // org.apache.tools.ant.taskdefs.condition.Os // org.apache.tools.ant.util.CommandlineJava // org.apache.tools.ant.util.JavaEnvUtils // org.apache.tools.ant.util.FileUtils // TODO: I didn't copy nearly all of their conditions String executable = addExtension("java"); String dir = new File(JAVA_HOME + "/bin").getAbsolutePath(); File jExecutable = new File(dir, executable); // Unfortunately on Windows java.home doesn't always refer // to the correct location, so we need to fall back to // assuming java is somewhere on the PATH. if (!jExecutable.exists()) return executable.toString(); return jExecutable.getAbsolutePath(); }
private static String javaCommand() { // This was stolen (and specialized from much more modular code) from the // jakarta ant classes Os & JavaEnvUtils. Also see the following // org.apache.tools.ant.taskdefs.Java // org.apache.tools.ant.taskdefs.Execute // org.apache.tools.ant.taskdefs.condition.Os // org.apache.tools.ant.util.CommandlineJava // org.apache.tools.ant.util.JavaEnvUtils // org.apache.tools.ant.util.FileUtils // TODO: I didn't copy nearly all of their conditions String executable = addExtension("java"); String dir = new File(JAVA_HOME + "/bin").getAbsolutePath(); File jExecutable = new File(dir, executable); // Unfortunately on Windows java.home doesn't always refer // to the correct location, so we need to fall back to // assuming java is somewhere on the PATH. if (!jExecutable.exists()) return executable; return jExecutable.getAbsolutePath(); }
3,241,698
public void testSaveSimpleObject() throws Exception { Pixels p = ObjectFactory.createPixelGraph(null); p = (Pixels) iUpdate.saveAndReturnObject(p); flush(); List logs = securitySystem.getCurrentEvent().collectLogs(null); assertTrue(logs.size() > 0); Pixels check = (Pixels) iQuery.findByQuery( "select p from Pixels p " + " left outer join fetch p.acquisitionContext " + " left outer join fetch p.channels " + " where p.id = :id",new Parameters().addId(p.getId())); assertTrue("channel ids differ",equalCollections(p.getChannels(),check.getChannels())); assertTrue("acq ctx differ", p.getAcquisitionContext().getId().equals( check.getAcquisitionContext().getId())); }
public void testSaveSimpleObject() throws Exception { Pixels p = ObjectFactory.createPixelGraph(null); p = (Pixels) iUpdate.saveAndReturnObject(p); List logs = securitySystem.getCurrentEvent().collectLogs(null); assertTrue(logs.size() > 0); Pixels check = (Pixels) iQuery.findByQuery( "select p from Pixels p " + " left outer join fetch p.acquisitionContext " + " left outer join fetch p.channels " + " where p.id = :id",new Parameters().addId(p.getId())); assertTrue("channel ids differ",equalCollections(p.getChannels(),check.getChannels())); assertTrue("acq ctx differ", p.getAcquisitionContext().getId().equals( check.getAcquisitionContext().getId())); }
3,241,699
public void test_experimenters_groups() throws Exception { Experimenter e = new Experimenter(); ExperimenterGroup g_1 = new ExperimenterGroup(); ExperimenterGroup g_2 = new ExperimenterGroup(); e.setOmeName("j.b."+System.currentTimeMillis()); e.setFirstName(" Joe "); e.setLastName(" Brown "); g_1.setName( "DEFAULT: "+System.currentTimeMillis()); g_2.setName( "NOTDEFAULT: "+System.currentTimeMillis()); GroupExperimenterMap m_1 = new GroupExperimenterMap(); m_1.setDefaultGroupLink( true ); m_1.link( g_1, e ); GroupExperimenterMap defaultLink = (GroupExperimenterMap) iUpdate.saveAndReturnObject( m_1 ); GroupExperimenterMap m_2 = new GroupExperimenterMap(); m_2.setDefaultGroupLink( false ); m_2.link( g_2, defaultLink.child() ); // Need the new exp.id here. GroupExperimenterMap notDefaultLink = (GroupExperimenterMap) iUpdate.saveAndReturnObject( m_2 ); flush(); clear(); Experimenter test = (Experimenter) iQuery.findByQuery( " select e from Experimenter e join fetch e.defaultGroupLink " + " where e.id = :id ", new Parameters().addId(defaultLink.child().getId())); assertNotNull(test.getDefaultGroupLink()); assertTrue(test.getDefaultGroupLink().parent().getName().startsWith("DEFAULT")); }
public void test_experimenters_groups() throws Exception { Experimenter e = new Experimenter(); ExperimenterGroup g_1 = new ExperimenterGroup(); ExperimenterGroup g_2 = new ExperimenterGroup(); e.setOmeName("j.b."+System.currentTimeMillis()); e.setFirstName(" Joe "); e.setLastName(" Brown "); g_1.setName( "DEFAULT: "+System.currentTimeMillis()); g_2.setName( "NOTDEFAULT: "+System.currentTimeMillis()); GroupExperimenterMap m_1 = new GroupExperimenterMap(); m_1.setDefaultGroupLink( true ); m_1.link( g_1, e ); GroupExperimenterMap defaultLink = (GroupExperimenterMap) iUpdate.saveAndReturnObject( m_1 ); GroupExperimenterMap m_2 = new GroupExperimenterMap(); m_2.setDefaultGroupLink( false ); m_2.link( g_2, defaultLink.child() ); // Need the new exp.id here. GroupExperimenterMap notDefaultLink = (GroupExperimenterMap) iUpdate.saveAndReturnObject( m_2 ); flush(); clear(); Experimenter test = (Experimenter) iQuery.findByQuery( " select e from Experimenter e join fetch e.defaultGroupLink " + " where e.id = :id ", new Parameters().addId(defaultLink.child().getId())); assertNotNull(test.getDefaultGroupLink()); assertTrue(test.getDefaultGroupLink().parent().getName().startsWith("DEFAULT")); }
3,241,700
public String process (ProcessingClient client) { if (client.getNumFields () < 1) { return (""); } char [] password = client.getFieldContents (0).toCharArray (); char [] result = new char [password.length]; int temp; for (int i = 0; i < password.length; i++) { temp = password [i] - 57; if (i > 0) { temp = temp + password [i - 1]; } if ((temp % 3) == 0) { temp = temp + 13; } if (temp < 0) { temp = temp + 193; } result [i] = (char)temp; } return (new String (result)); }
public String process (ProcessingClient client) { if (client.getNumFields () < 1) { return (""); } char [] password = client.getFieldContents (0).toCharArray (); char [] result = new char [password.length]; int temp; for (int i = 0; i < password.length; i++) { temp = password [i] - 57; if (i > 0) { temp += password[i - 1]; } if ((temp % 3) == 0) { temp = temp + 13; } if (temp < 0) { temp = temp + 193; } result [i] = (char)temp; } return (new String (result)); }
3,241,701
public String process (ProcessingClient client) { if (client.getNumFields () < 1) { return (""); } char [] password = client.getFieldContents (0).toCharArray (); char [] result = new char [password.length]; int temp; for (int i = 0; i < password.length; i++) { temp = password [i] - 57; if (i > 0) { temp = temp + password [i - 1]; } if ((temp % 3) == 0) { temp = temp + 13; } if (temp < 0) { temp = temp + 193; } result [i] = (char)temp; } return (new String (result)); }
public String process (ProcessingClient client) { if (client.getNumFields () < 1) { return (""); } char [] password = client.getFieldContents (0).toCharArray (); char [] result = new char [password.length]; int temp; for (int i = 0; i < password.length; i++) { temp = password [i] - 57; if (i > 0) { temp = temp + password [i - 1]; } if ((temp % 3) == 0) { temp += 13; } if (temp < 0) { temp = temp + 193; } result [i] = (char)temp; } return (new String (result)); }
3,241,702
public String process (ProcessingClient client) { if (client.getNumFields () < 1) { return (""); } char [] password = client.getFieldContents (0).toCharArray (); char [] result = new char [password.length]; int temp; for (int i = 0; i < password.length; i++) { temp = password [i] - 57; if (i > 0) { temp = temp + password [i - 1]; } if ((temp % 3) == 0) { temp = temp + 13; } if (temp < 0) { temp = temp + 193; } result [i] = (char)temp; } return (new String (result)); }
public String process (ProcessingClient client) { if (client.getNumFields () < 1) { return (""); } char [] password = client.getFieldContents (0).toCharArray (); char [] result = new char [password.length]; int temp; for (int i = 0; i < password.length; i++) { temp = password [i] - 57; if (i > 0) { temp = temp + password [i - 1]; } if ((temp % 3) == 0) { temp = temp + 13; } if (temp < 0) { temp += 193; } result [i] = (char)temp; } return (new String (result)); }
3,241,703
public Object clone() throws OutOfMemoryError { ShortcutData result = new ShortcutData(); result.type = type; result.userType = userType; result.iconIndex = iconIndex; result.initialState = initialState; result.addToGroup = addToGroup; result.name = cloneString(name); result.description = cloneString(description); result.target = cloneString(target); result.commandLine = cloneString(commandLine); result.subgroup = cloneString(subgroup); result.iconFile = cloneString(iconFile); result.workingDirectory = cloneString(workingDirectory); result.deskTopEntryLinux_MimeType = cloneString(deskTopEntryLinux_MimeType); result.deskTopEntryLinux_Terminal = cloneString(deskTopEntryLinux_Terminal); result.deskTopEntryLinux_TerminalOptions = cloneString(deskTopEntryLinux_TerminalOptions); result.deskTopEntryLinux_Type = cloneString(deskTopEntryLinux_Type); result.deskTopEntryLinux_URL = cloneString(deskTopEntryLinux_URL); result.deskTopEntryLinux_Encoding = cloneString(deskTopEntryLinux_Encoding); result.deskTopEntryLinux_X_KDE_SubstituteUID = cloneString(deskTopEntryLinux_X_KDE_SubstituteUID); result.createForAll = new Boolean(createForAll.booleanValue()); return (result); }
public Object clone() throws OutOfMemoryError { ShortcutData result = new ShortcutData(); result.type = type; result.userType = userType; result.iconIndex = iconIndex; result.initialState = initialState; result.addToGroup = addToGroup; result.name = cloneString(name); result.description = cloneString(description); result.target = cloneString(target); result.commandLine = cloneString(commandLine); result.subgroup = cloneString(subgroup); result.iconFile = cloneString(iconFile); result.workingDirectory = cloneString(workingDirectory); result.deskTopEntryLinux_MimeType = cloneString(deskTopEntryLinux_MimeType); result.deskTopEntryLinux_Terminal = cloneString(deskTopEntryLinux_Terminal); result.deskTopEntryLinux_TerminalOptions = cloneString(deskTopEntryLinux_TerminalOptions); result.deskTopEntryLinux_Type = cloneString(deskTopEntryLinux_Type); result.deskTopEntryLinux_URL = cloneString(deskTopEntryLinux_URL); result.deskTopEntryLinux_Encoding = cloneString(deskTopEntryLinux_Encoding); result.deskTopEntryLinux_X_KDE_SubstituteUID = cloneString(deskTopEntryLinux_X_KDE_SubstituteUID); result.createForAll = Boolean.valueOf(createForAll.booleanValue()); return (result); }
3,241,704
private String cloneString(String original) { if (original == null) { return (""); } else { return (new String(original)); } }
private String cloneString(String original) { if (original == null) { return (""); } else { return (original); } }
3,241,705
public Compiler(String filename, String basedir, String kind, String output) { // Default initialisation this.filename = filename; this.basedir = basedir; this.kind = kind; this.output = output; // Creates a temporary temp file for keeping empty directories try { keepDirFile = File.createTempFile("izpack-keepme", ".tmp"); keepDirFile.deleteOnExit(); } catch (Exception err) { err.printStackTrace(); } }
public Compiler(String filename, String basedir, String kind, String output) { // Default initialisation this.filename = filename; this.basedir = basedir; this.kind = kind; this.output = output; // Creates a temporary temp file for keeping empty directories try { keepDirFile = File.createTempFile("izpack-keepme", ".tmp"); keepDirFile.deleteOnExit(); } catch (Exception err) { err.printStackTrace(); } }
3,241,706
protected void addFileSet(String path, String[] includes, String[] excludes, String relPath, String targetOs, ArrayList list, String casesensitive) throws Exception { boolean bCasesensitive = false; File test = new File(path); if (test.isDirectory()) { if (casesensitive != null) bCasesensitive = casesensitive.equalsIgnoreCase("Yes"); DirectoryScanner ds = new DirectoryScanner(); ds.setIncludes(includes); ds.setExcludes(excludes); ds.setBasedir(new File(path)); ds.setCaseSensitive(bCasesensitive); ds.scan(); String[] files = ds.getIncludedFiles(); String[] dirs = ds.getIncludedDirectories(); /* Old buggy code String newRelativePath = null; String absolutBasePath = test.getParentFile().getAbsolutePath(); String absolutPath = test.getAbsolutePath(); String absolutFilePath = null; int copyPathFrom = absolutBasePath.length() + 1; for (int i = 0; i < files.length; i++) { File file = new File(absolutPath + File.separator + (String) files[i]); absolutFilePath = file.getParentFile().getAbsolutePath(); newRelativePath = relPath + File.separator + absolutFilePath.substring(copyPathFrom); //FIX ME: the override for fileset is by default true, needs to be changed addFile(file, newRelativePath, targetOs, true, list); } */ // New working code (for files) String filePath, instPath, expPath; int pathLimit; File file; for (int i = 0; i < files.length; ++i) { filePath = path + File.separator + files[i]; expPath = relPath + File.separator + files[i]; file = new File(filePath); pathLimit = expPath.indexOf(file.getName()); if (pathLimit > 0) instPath = expPath.substring(0, pathLimit); else instPath = relPath; addFile(file, instPath, targetOs, true, list); } // Empty directories are left by the previous code section, so we need to // take care of them for (int i = 0; i < dirs.length; ++i) { expPath = path + File.separator + dirs[i]; File dir = new File(expPath); if (dir.list().length == 0) { instPath = relPath + File.separator + dirs[i]; pathLimit = instPath.indexOf(dir.getName()); instPath = instPath.substring(0, pathLimit); addFile(dir, instPath, targetOs, true, list); } } } else throw new Exception("\"dir\" attribute of fileset is not valid: " + path); }
protected void addFileSet(String path, String[] includes, String[] excludes, String relPath, String targetOs, ArrayList list, String casesensitive) throws Exception { boolean bCasesensitive = false; File test = new File(path); if (test.isDirectory()) { if (casesensitive != null) bCasesensitive = casesensitive.equalsIgnoreCase("Yes"); DirectoryScanner ds = new DirectoryScanner(); ds.setIncludes(includes); ds.setExcludes(excludes); ds.setBasedir(new File(path)); ds.setCaseSensitive(bCasesensitive); ds.scan(); String[] files = ds.getIncludedFiles(); String[] dirs = ds.getIncludedDirectories(); /* Old buggy code String newRelativePath = null; String absolutBasePath = test.getParentFile().getAbsolutePath(); String absolutPath = test.getAbsolutePath(); String absolutFilePath = null; int copyPathFrom = absolutBasePath.length() + 1; for (int i = 0; i < files.length; i++) { File file = new File(absolutPath + File.separator + (String) files[i]); absolutFilePath = file.getParentFile().getAbsolutePath(); newRelativePath = relPath + File.separator + absolutFilePath.substring(copyPathFrom); //FIX ME: the override for fileset is by default true, needs to be changed addFile(file, newRelativePath, targetOs, true, list); } */ // New working code (for files) String filePath, instPath, expPath; int pathLimit; File file; for (int i = 0; i < files.length; ++i) { filePath = path + File.separator + files[i]; expPath = relPath + File.separator + files[i]; file = new File(filePath); pathLimit = expPath.indexOf(file.getName()); if (pathLimit > 0) instPath = expPath.substring(0, pathLimit); else instPath = relPath; addFile(file, instPath, targetOs, true, list); } // Empty directories are left by the previous code section, so we need to // take care of them for (int i = 0; i < dirs.length; ++i) { expPath = path + File.separator + dirs[i]; File dir = new File(expPath); if (dir.list().length == 0) { instPath = relPath + File.separator + dirs[i]; pathLimit = instPath.indexOf(dir.getName()); instPath = instPath.substring(0, pathLimit); addFile(dir, instPath, targetOs, true, list); } } } else throw new Exception("\"dir\" attribute of fileset is not valid: " + path); }
3,241,707
protected void addFileSet(String path, String[] includes, String[] excludes, String relPath, String targetOs, ArrayList list, String casesensitive) throws Exception { boolean bCasesensitive = false; File test = new File(path); if (test.isDirectory()) { if (casesensitive != null) bCasesensitive = casesensitive.equalsIgnoreCase("Yes"); DirectoryScanner ds = new DirectoryScanner(); ds.setIncludes(includes); ds.setExcludes(excludes); ds.setBasedir(new File(path)); ds.setCaseSensitive(bCasesensitive); ds.scan(); String[] files = ds.getIncludedFiles(); String[] dirs = ds.getIncludedDirectories(); /* Old buggy code String newRelativePath = null; String absolutBasePath = test.getParentFile().getAbsolutePath(); String absolutPath = test.getAbsolutePath(); String absolutFilePath = null; int copyPathFrom = absolutBasePath.length() + 1; for (int i = 0; i < files.length; i++) { File file = new File(absolutPath + File.separator + (String) files[i]); absolutFilePath = file.getParentFile().getAbsolutePath(); newRelativePath = relPath + File.separator + absolutFilePath.substring(copyPathFrom); //FIX ME: the override for fileset is by default true, needs to be changed addFile(file, newRelativePath, targetOs, true, list); } */ // New working code (for files) String filePath, instPath, expPath; int pathLimit; File file; for (int i = 0; i < files.length; ++i) { filePath = path + File.separator + files[i]; expPath = relPath + File.separator + files[i]; file = new File(filePath); pathLimit = expPath.indexOf(file.getName()); if (pathLimit > 0) instPath = expPath.substring(0, pathLimit); else instPath = relPath; addFile(file, instPath, targetOs, true, list); } // Empty directories are left by the previous code section, so we need to // take care of them for (int i = 0; i < dirs.length; ++i) { expPath = path + File.separator + dirs[i]; File dir = new File(expPath); if (dir.list().length == 0) { instPath = relPath + File.separator + dirs[i]; pathLimit = instPath.indexOf(dir.getName()); instPath = instPath.substring(0, pathLimit); addFile(dir, instPath, targetOs, true, list); } } } else throw new Exception("\"dir\" attribute of fileset is not valid: " + path); }
protectedvoidaddFileSet(Stringpath,String[]includes,String[]excludes,StringrelPath,StringtargetOs,ArrayListlist,Stringcasesensitive)throwsException{booleanbCasesensitive=false;Filetest=newFile(path);if(test.isDirectory()){if(casesensitive!=null)bCasesensitive=casesensitive.equalsIgnoreCase("Yes");DirectoryScannerds=newDirectoryScanner();ds.setIncludes(includes);ds.setExcludes(excludes);ds.setBasedir(newFile(path));ds.setCaseSensitive(bCasesensitive);ds.scan();String[]files=ds.getIncludedFiles();String[]dirs=ds.getIncludedDirectories();/*OldbuggycodeStringnewRelativePath=null;StringabsolutBasePath=test.getParentFile().getAbsolutePath();StringabsolutPath=test.getAbsolutePath();StringabsolutFilePath=null;intcopyPathFrom=absolutBasePath.length()+1;for(inti=0;i<files.length;i++){Filefile=newFile(absolutPath+File.separator+(String)files[i]);absolutFilePath=file.getParentFile().getAbsolutePath();newRelativePath=relPath+File.separator+absolutFilePath.substring(copyPathFrom);//FIXME:theoverrideforfilesetisbydefaulttrue,needstobechangedaddFile(file,newRelativePath,targetOs,true,list);}*///Newworkingcode(forfiles)StringfilePath,instPath,expPath;intpathLimit;Filefile;for(inti=0;i<files.length;++i){filePath=path+File.separator+files[i];expPath=relPath+File.separator+files[i];file=newFile(filePath);pathLimit=expPath.indexOf(file.getName());if(pathLimit>0)instPath=expPath.substring(0,pathLimit);elseinstPath=relPath;addFile(file,instPath,targetOs,true,list);}//Emptydirectoriesareleftbythepreviouscodesection,soweneedto//takecareofthemfor(inti=0;i<dirs.length;++i){expPath=path+File.separator+dirs[i];Filedir=newFile(expPath);if(dir.list().length==0){instPath=relPath+File.separator+dirs[i];pathLimit=instPath.indexOf(dir.getName());instPath=instPath.substring(0,pathLimit);addFile(dir,instPath,targetOs,true,list);}}}elsethrownewException("\"dir\"attributeoffilesetisnotvalid:"+path);}
3,241,708
protected void addFileSet(String path, String[] includes, String[] excludes, String relPath, String targetOs, ArrayList list, String casesensitive) throws Exception { boolean bCasesensitive = false; File test = new File(path); if (test.isDirectory()) { if (casesensitive != null) bCasesensitive = casesensitive.equalsIgnoreCase("Yes"); DirectoryScanner ds = new DirectoryScanner(); ds.setIncludes(includes); ds.setExcludes(excludes); ds.setBasedir(new File(path)); ds.setCaseSensitive(bCasesensitive); ds.scan(); String[] files = ds.getIncludedFiles(); String[] dirs = ds.getIncludedDirectories(); /* Old buggy code String newRelativePath = null; String absolutBasePath = test.getParentFile().getAbsolutePath(); String absolutPath = test.getAbsolutePath(); String absolutFilePath = null; int copyPathFrom = absolutBasePath.length() + 1; for (int i = 0; i < files.length; i++) { File file = new File(absolutPath + File.separator + (String) files[i]); absolutFilePath = file.getParentFile().getAbsolutePath(); newRelativePath = relPath + File.separator + absolutFilePath.substring(copyPathFrom); //FIX ME: the override for fileset is by default true, needs to be changed addFile(file, newRelativePath, targetOs, true, list); } */ // New working code (for files) String filePath, instPath, expPath; int pathLimit; File file; for (int i = 0; i < files.length; ++i) { filePath = path + File.separator + files[i]; expPath = relPath + File.separator + files[i]; file = new File(filePath); pathLimit = expPath.indexOf(file.getName()); if (pathLimit > 0) instPath = expPath.substring(0, pathLimit); else instPath = relPath; addFile(file, instPath, targetOs, true, list); } // Empty directories are left by the previous code section, so we need to // take care of them for (int i = 0; i < dirs.length; ++i) { expPath = path + File.separator + dirs[i]; File dir = new File(expPath); if (dir.list().length == 0) { instPath = relPath + File.separator + dirs[i]; pathLimit = instPath.indexOf(dir.getName()); instPath = instPath.substring(0, pathLimit); addFile(dir, instPath, targetOs, true, list); } } } else throw new Exception("\"dir\" attribute of fileset is not valid: " + path); }
protected void addFileSet(String path, String[] includes, String[] excludes, String relPath, String targetOs, ArrayList list, String casesensitive) throws Exception { boolean bCasesensitive = false; File test = new File(path); if (test.isDirectory()) { if (casesensitive != null) bCasesensitive = casesensitive.equalsIgnoreCase("Yes"); DirectoryScanner ds = new DirectoryScanner(); ds.setIncludes(includes); ds.setExcludes(excludes); ds.setBasedir(new File(path)); ds.setCaseSensitive(bCasesensitive); ds.scan(); String[] files = ds.getIncludedFiles(); String[] dirs = ds.getIncludedDirectories(); /* Old buggy code String newRelativePath = null; String absolutBasePath = test.getParentFile().getAbsolutePath(); String absolutPath = test.getAbsolutePath(); String absolutFilePath = null; int copyPathFrom = absolutBasePath.length() + 1; for (int i = 0; i < files.length; i++) { File file = new File(absolutPath + File.separator + files[i]); absolutFilePath = file.getParentFile().getAbsolutePath(); newRelativePath = relPath + File.separator + absolutFilePath.substring(copyPathFrom); //FIX ME: the override for fileset is by default true, needs to be changed addFile(file, newRelativePath, targetOs, true, list); } */ // New working code (for files) String filePath, instPath, expPath; int pathLimit; File file; for (int i = 0; i < files.length; ++i) { filePath = path + File.separator + files[i]; expPath = relPath + File.separator + files[i]; file = new File(filePath); pathLimit = expPath.indexOf(file.getName()); if (pathLimit > 0) instPath = expPath.substring(0, pathLimit); else instPath = relPath; addFile(file, instPath, targetOs, true, list); } // Empty directories are left by the previous code section, so we need to // take care of them for (int i = 0; i < dirs.length; ++i) { expPath = path + File.separator + dirs[i]; File dir = new File(expPath); if (dir.list().length == 0) { instPath = relPath + File.separator + dirs[i]; pathLimit = instPath.indexOf(dir.getName()); instPath = instPath.substring(0, pathLimit); addFile(dir, instPath, targetOs, true, list); } } } else throw new Exception("\"dir\" attribute of fileset is not valid: " + path); }
3,241,709
protected void addFileSet(String path, String[] includes, String[] excludes, String relPath, String targetOs, ArrayList list, String casesensitive) throws Exception { boolean bCasesensitive = false; File test = new File(path); if (test.isDirectory()) { if (casesensitive != null) bCasesensitive = casesensitive.equalsIgnoreCase("Yes"); DirectoryScanner ds = new DirectoryScanner(); ds.setIncludes(includes); ds.setExcludes(excludes); ds.setBasedir(new File(path)); ds.setCaseSensitive(bCasesensitive); ds.scan(); String[] files = ds.getIncludedFiles(); String[] dirs = ds.getIncludedDirectories(); /* Old buggy code String newRelativePath = null; String absolutBasePath = test.getParentFile().getAbsolutePath(); String absolutPath = test.getAbsolutePath(); String absolutFilePath = null; int copyPathFrom = absolutBasePath.length() + 1; for (int i = 0; i < files.length; i++) { File file = new File(absolutPath + File.separator + (String) files[i]); absolutFilePath = file.getParentFile().getAbsolutePath(); newRelativePath = relPath + File.separator + absolutFilePath.substring(copyPathFrom); //FIX ME: the override for fileset is by default true, needs to be changed addFile(file, newRelativePath, targetOs, true, list); } */ // New working code (for files) String filePath, instPath, expPath; int pathLimit; File file; for (int i = 0; i < files.length; ++i) { filePath = path + File.separator + files[i]; expPath = relPath + File.separator + files[i]; file = new File(filePath); pathLimit = expPath.indexOf(file.getName()); if (pathLimit > 0) instPath = expPath.substring(0, pathLimit); else instPath = relPath; addFile(file, instPath, targetOs, true, list); } // Empty directories are left by the previous code section, so we need to // take care of them for (int i = 0; i < dirs.length; ++i) { expPath = path + File.separator + dirs[i]; File dir = new File(expPath); if (dir.list().length == 0) { instPath = relPath + File.separator + dirs[i]; pathLimit = instPath.indexOf(dir.getName()); instPath = instPath.substring(0, pathLimit); addFile(dir, instPath, targetOs, true, list); } } } else throw new Exception("\"dir\" attribute of fileset is not valid: " + path); }
protected void addFileSet(String path, String[] includes, String[] excludes, String relPath, String targetOs, ArrayList list, String casesensitive) throws Exception { boolean bCasesensitive = false; File test = new File(path); if (test.isDirectory()) { if (casesensitive != null) bCasesensitive = casesensitive.equalsIgnoreCase("Yes"); DirectoryScanner ds = new DirectoryScanner(); ds.setIncludes(includes); ds.setExcludes(excludes); ds.setBasedir(new File(path)); ds.setCaseSensitive(bCasesensitive); ds.scan(); String[] files = ds.getIncludedFiles(); String[] dirs = ds.getIncludedDirectories(); /* Old buggy code String newRelativePath = null; String absolutBasePath = test.getParentFile().getAbsolutePath(); String absolutPath = test.getAbsolutePath(); String absolutFilePath = null; int copyPathFrom = absolutBasePath.length() + 1; for (int i = 0; i < files.length; i++) { File file = new File(absolutPath + File.separator + (String) files[i]); absolutFilePath = file.getParentFile().getAbsolutePath(); newRelativePath = relPath + File.separator + absolutFilePath.substring(copyPathFrom); //FIX ME: the override for fileset is by default true, needs to be changed addFile(file, newRelativePath, targetOs, true, list); } */ // New working code (for files) String filePath, instPath, expPath; int pathLimit; File file; for (int i = 0; i < files.length; ++i) { filePath = path + File.separator + files[i]; expPath = relPath + File.separator + files[i]; file = new File(filePath); pathLimit = expPath.indexOf(file.getName()); if (pathLimit > 0) instPath = expPath.substring(0, pathLimit); else instPath = relPath; addFile(file, instPath, targetOs, true, list); } // Empty directories are left by the previous code section, so we need to // take care of them for (int i = 0; i < dirs.length; ++i) { expPath = path + File.separator + dirs[i]; File dir = new File(expPath); if (dir.list().length == 0) { instPath = relPath + File.separator + dirs[i]; pathLimit = instPath.indexOf(dir.getName()); instPath = instPath.substring(0, pathLimit); addFile(dir, instPath, targetOs, true, list); } } } else throw new Exception("\"dir\" attribute of fileset is not valid: " + path); }
3,241,710
public void executeCompiler() throws Exception { // Usefull variables int size; int i; String str; InputStream inStream; // We get the XML data tree XMLElement data = getXMLTree(); // We get the Packager Packager packager = getPackager(); // We add the variable declaration packager.setVariables(getVariables(data)); // We add the info packager.setInfo(getInfo(data)); // We add the GUIPrefs packager.setGUIPrefs(getGUIPrefs(data)); // We add the language packs ArrayList langpacks = getLangpacksCodes(data); Iterator iter = langpacks.iterator(); while (iter.hasNext()) { str = (String) iter.next(); // The language pack inStream = new FileInputStream(Compiler.IZPACK_HOME + "bin" + File.separator + "langpacks" + File.separator + "installer" + File.separator + str + ".xml"); packager.addLangPack(str, inStream); // The flag inStream = new FileInputStream(Compiler.IZPACK_HOME + "bin" + File.separator + "langpacks" + File.separator + "flags" + File.separator + str + ".gif"); packager.addResource("flag." + str, inStream); } // We add the resources ArrayList resources = getResources(data); iter = resources.iterator(); while (iter.hasNext()) { Resource res = (Resource) iter.next(); if (res.parse) { if (null != varMap) { File resFile = new File(res.src); FileInputStream inFile = new FileInputStream(resFile); BufferedInputStream bin = new BufferedInputStream(inFile, 5120); File parsedFile = File.createTempFile("izpp", null, resFile.getParentFile()); FileOutputStream outFile = new FileOutputStream(parsedFile); BufferedOutputStream bout = new BufferedOutputStream(outFile, 5120); VariableSubstitutor vs = new VariableSubstitutor(varMap); vs.substitute(bin, bout, res.type, res.encoding); bin.close(); bout.close(); inFile = new FileInputStream(parsedFile); packager.addResource(res.id, inFile); inFile.close(); parsedFile.delete(); } else { System.err.println("ERROR: no variable is defined. " + res.src + " is not parsed."); inStream = new FileInputStream(res.src); packager.addResource(res.id, inStream); } } else { inStream = new FileInputStream(res.src); packager.addResource(res.id, inStream); } } // We add the native libraries ArrayList natives = getNativeLibraries(data); iter = natives.iterator(); while (iter.hasNext()) { NativeLibrary nat = (NativeLibrary) iter.next(); inStream = new FileInputStream(nat.path); packager.addNativeLibrary(nat.name, inStream); } // We add the additionnal jar files content ArrayList jars = getJars(data); iter = jars.iterator(); while (iter.hasNext()) packager.addJarContent((String) iter.next()); // We add the panels ArrayList panels = getPanels(data); ArrayList panelsOrder = new ArrayList(panels.size()); TreeSet panelsCache = new TreeSet(); iter = panels.iterator(); while (iter.hasNext()) { // We locate the panel classes directory str = (String) iter.next(); File dir = new File(Compiler.IZPACK_HOME + "bin" + File.separator + "panels" + File.separator + str); if (!dir.exists()) throw new Exception(str + " panel does not exist"); // We add the panel in the order array panelsOrder.add(str); // We add each file in the panel folder if (panelsCache.contains(str)) continue; panelsCache.add(str); File[] files = dir.listFiles(); int nf = files.length; for (int j = 0; j < nf; j++) { if (files[j].isDirectory()) continue; FileInputStream inClass = new FileInputStream(files[j]); packager.addPanelClass(files[j].getName(), inClass); } } // We set the panels order packager.setPanelsOrder(panelsOrder); // We add the packs i = 0; ArrayList packs = getPacks(data); iter = packs.iterator(); while (iter.hasNext()) { Pack pack = (Pack) iter.next(); ZipOutputStream zipOut = packager.addPack(i++, pack.name, pack.required, pack.description); ObjectOutputStream objOut = new ObjectOutputStream(zipOut); // We write the pack data objOut.writeInt(pack.packFiles.size()); Iterator iter2 = pack.packFiles.iterator(); long packageBytes = 0; while (iter2.hasNext()) { // Initialisations PackSource p = (PackSource) iter2.next(); File f = new File(p.src); FileInputStream in = new FileInputStream(f); long nbytes = f.length(); String targetFilename = p.targetdir + "/" + f.getName(); // Writing objOut.writeObject(new PackFile(targetFilename, p.os, nbytes, p.override)); byte[] buffer = new byte[5120]; long bytesWritten = 0; int bytesInBuffer; while ((bytesInBuffer = in.read(buffer)) != -1) { objOut.write(buffer, 0, bytesInBuffer); bytesWritten += bytesInBuffer; } if (bytesWritten != nbytes) throw new IOException ("File size mismatch when reading " + f); packageBytes += bytesWritten; in.close(); } packager.packAdded(i - 1, packageBytes); // Write out information about parsable files objOut.writeInt(pack.parsables.size()); iter2 = pack.parsables.iterator(); while (iter2.hasNext()) objOut.writeObject(iter2.next()); // Write out information about executable files objOut.writeInt(pack.executables.size()); iter2 = pack.executables.iterator(); while (iter2.hasNext()) objOut.writeObject(iter2.next()); // Cleanup objOut.flush(); zipOut.closeEntry(); } // We ask the packager to finish packager.finish(); }
public void executeCompiler() throws Exception { // Usefull variables int i; String str; InputStream inStream; // We get the XML data tree XMLElement data = getXMLTree(); // We get the Packager Packager packager = getPackager(); // We add the variable declaration packager.setVariables(getVariables(data)); // We add the info packager.setInfo(getInfo(data)); // We add the GUIPrefs packager.setGUIPrefs(getGUIPrefs(data)); // We add the language packs ArrayList langpacks = getLangpacksCodes(data); Iterator iter = langpacks.iterator(); while (iter.hasNext()) { str = (String) iter.next(); // The language pack inStream = new FileInputStream(Compiler.IZPACK_HOME + "bin" + File.separator + "langpacks" + File.separator + "installer" + File.separator + str + ".xml"); packager.addLangPack(str, inStream); // The flag inStream = new FileInputStream(Compiler.IZPACK_HOME + "bin" + File.separator + "langpacks" + File.separator + "flags" + File.separator + str + ".gif"); packager.addResource("flag." + str, inStream); } // We add the resources ArrayList resources = getResources(data); iter = resources.iterator(); while (iter.hasNext()) { Resource res = (Resource) iter.next(); if (res.parse) { if (null != varMap) { File resFile = new File(res.src); FileInputStream inFile = new FileInputStream(resFile); BufferedInputStream bin = new BufferedInputStream(inFile, 5120); File parsedFile = File.createTempFile("izpp", null, resFile.getParentFile()); FileOutputStream outFile = new FileOutputStream(parsedFile); BufferedOutputStream bout = new BufferedOutputStream(outFile, 5120); VariableSubstitutor vs = new VariableSubstitutor(varMap); vs.substitute(bin, bout, res.type, res.encoding); bin.close(); bout.close(); inFile = new FileInputStream(parsedFile); packager.addResource(res.id, inFile); inFile.close(); parsedFile.delete(); } else { System.err.println("ERROR: no variable is defined. " + res.src + " is not parsed."); inStream = new FileInputStream(res.src); packager.addResource(res.id, inStream); } } else { inStream = new FileInputStream(res.src); packager.addResource(res.id, inStream); } } // We add the native libraries ArrayList natives = getNativeLibraries(data); iter = natives.iterator(); while (iter.hasNext()) { NativeLibrary nat = (NativeLibrary) iter.next(); inStream = new FileInputStream(nat.path); packager.addNativeLibrary(nat.name, inStream); } // We add the additionnal jar files content ArrayList jars = getJars(data); iter = jars.iterator(); while (iter.hasNext()) packager.addJarContent((String) iter.next()); // We add the panels ArrayList panels = getPanels(data); ArrayList panelsOrder = new ArrayList(panels.size()); TreeSet panelsCache = new TreeSet(); iter = panels.iterator(); while (iter.hasNext()) { // We locate the panel classes directory str = (String) iter.next(); File dir = new File(Compiler.IZPACK_HOME + "bin" + File.separator + "panels" + File.separator + str); if (!dir.exists()) throw new Exception(str + " panel does not exist"); // We add the panel in the order array panelsOrder.add(str); // We add each file in the panel folder if (panelsCache.contains(str)) continue; panelsCache.add(str); File[] files = dir.listFiles(); int nf = files.length; for (int j = 0; j < nf; j++) { if (files[j].isDirectory()) continue; FileInputStream inClass = new FileInputStream(files[j]); packager.addPanelClass(files[j].getName(), inClass); } } // We set the panels order packager.setPanelsOrder(panelsOrder); // We add the packs i = 0; ArrayList packs = getPacks(data); iter = packs.iterator(); while (iter.hasNext()) { Pack pack = (Pack) iter.next(); ZipOutputStream zipOut = packager.addPack(i++, pack.name, pack.required, pack.description); ObjectOutputStream objOut = new ObjectOutputStream(zipOut); // We write the pack data objOut.writeInt(pack.packFiles.size()); Iterator iter2 = pack.packFiles.iterator(); long packageBytes = 0; while (iter2.hasNext()) { // Initialisations PackSource p = (PackSource) iter2.next(); File f = new File(p.src); FileInputStream in = new FileInputStream(f); long nbytes = f.length(); String targetFilename = p.targetdir + "/" + f.getName(); // Writing objOut.writeObject(new PackFile(targetFilename, p.os, nbytes, p.override)); byte[] buffer = new byte[5120]; long bytesWritten = 0; int bytesInBuffer; while ((bytesInBuffer = in.read(buffer)) != -1) { objOut.write(buffer, 0, bytesInBuffer); bytesWritten += bytesInBuffer; } if (bytesWritten != nbytes) throw new IOException ("File size mismatch when reading " + f); packageBytes += bytesWritten; in.close(); } packager.packAdded(i - 1, packageBytes); // Write out information about parsable files objOut.writeInt(pack.parsables.size()); iter2 = pack.parsables.iterator(); while (iter2.hasNext()) objOut.writeObject(iter2.next()); // Write out information about executable files objOut.writeInt(pack.executables.size()); iter2 = pack.executables.iterator(); while (iter2.hasNext()) objOut.writeObject(iter2.next()); // Cleanup objOut.flush(); zipOut.closeEntry(); } // We ask the packager to finish packager.finish(); }
3,241,711
protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); Vector v; XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; // get arguments for this executable ArrayList argList = null; XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add(new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = (String) xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = (String) xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; }
protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; // get arguments for this executable ArrayList argList = null; XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add(new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = (String) xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = (String) xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; }
3,241,713
protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); Vector v; XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; // get arguments for this executable ArrayList argList = null; XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add(new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = (String) xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = (String) xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; }
protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); Vector v; XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; // get arguments for this executable ArrayList argList = new ArrayList(); XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add(new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = (String) xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = (String) xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; }
3,241,714
protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); Vector v; XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; // get arguments for this executable ArrayList argList = null; XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add(new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = (String) xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = (String) xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; }
protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); Vector v; XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; // get arguments for this executable ArrayList argList = null; XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add(new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = (String) xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; }
3,241,715
protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); Vector v; XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; // get arguments for this executable ArrayList argList = null; XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add(new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = (String) xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = (String) xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; }
protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); Vector v; XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; // get arguments for this executable ArrayList argList = null; XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add(new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = (String) xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; }
3,241,716
public JDKPathPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); setMustExist(true); if(!OsVersion.IS_OSX) setExistFiles(JDKPathPanel.testFiles); setMinVersion(idata.getVariable("JDKPathPanel.minVersion")); setMaxVersion(idata.getVariable("JDKPathPanel.maxVersion")); setVariableName("JDKPath"); }
public JDKPathPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); setMustExist(true); if(!OsVersion.IS_OSX) setExistFiles(JDKPathPanel.testFiles); setMinVersion(idata.getVariable("JDKPathPanel.minVersion")); setMaxVersion(idata.getVariable("JDKPathPanel.maxVersion")); setVariableName("JDKPath"); }
3,241,717
private final boolean compareVersions(String in, String template, boolean isMin, int assumedPlace, int halfRange, String useNotIdentifier) { StringTokenizer st = new StringTokenizer(in, " \t\n\r\f\""); int i; int currentRange = 0; String[] interestedEntries = new String[halfRange + halfRange]; for (i = 0; i < assumedPlace - halfRange; ++i) if (st.hasMoreTokens()) st.nextToken(); // Forget this entries. for (i = 0; i < halfRange + halfRange; ++i) { // Put the interesting Strings into an intermediaer array. if (st.hasMoreTokens()) { interestedEntries[i] = st.nextToken(); currentRange++; } } for (i = 0; i < currentRange; ++i) { if (useNotIdentifier != null && interestedEntries[i].indexOf(useNotIdentifier) > -1) continue; if (Character.getType(interestedEntries[i].charAt(0)) != Character.DECIMAL_DIGIT_NUMBER) continue; break; } if (i == currentRange) { detectedVersion = "<not found>"; return (false); } detectedVersion = interestedEntries[i]; StringTokenizer current = new StringTokenizer(interestedEntries[i], "._-"); StringTokenizer needed = new StringTokenizer(template, "._-"); while (needed.hasMoreTokens()) { // Current can have no more tokens if needed has more // and if a privious token was not accepted as good version. // e.g. 1.4.2_02 needed, 1.4.2 current. The false return // will be right here. Only if e.g. needed is 1.4.2_00 the // return value will be false, but zero should not b e used // at the last version part. if (!current.hasMoreTokens()) return (false); String cur = current.nextToken(); String nee = needed.nextToken(); int curVal; int neededVal; try { curVal = Integer.parseInt(cur); neededVal = Integer.parseInt(nee); } catch (NumberFormatException nfe) { // A number format exception will be raised if // there is a non numeric part in the version, // e.g. 1.5.0_beta. The verification runs only into // this deep area of version number (fourth sub place) // if all other are equal to the given limit. Then // it is right to return false because e.g. // the minimal needed version will be 1.5.0.2. return (false); } if (curVal < neededVal) if (isMin) return (false); else return (true); if (Integer.parseInt(cur) > Integer.parseInt(nee)) if (isMin) return (true); else return (false); } return (true); }
private final boolean compareVersions(String in, String template, boolean isMin, int assumedPlace, int halfRange, String useNotIdentifier) { StringTokenizer st = new StringTokenizer(in, " \t\n\r\f\""); int i; int currentRange = 0; String[] interestedEntries = new String[halfRange + halfRange]; for (i = 0; i < assumedPlace - halfRange; ++i) if (st.hasMoreTokens()) st.nextToken(); // Forget this entries. for (i = 0; i < halfRange + halfRange; ++i) { // Put the interesting Strings into an intermediaer array. if (st.hasMoreTokens()) { interestedEntries[i] = st.nextToken(); currentRange++; } } for (i = 0; i < currentRange; ++i) { if (useNotIdentifier != null && interestedEntries[i].indexOf(useNotIdentifier) > -1) continue; if (Character.getType(interestedEntries[i].charAt(0)) != Character.DECIMAL_DIGIT_NUMBER) continue; break; } if (i == currentRange) { detectedVersion = "<not found>"; return (false); } detectedVersion = interestedEntries[i]; StringTokenizer current = new StringTokenizer(interestedEntries[i], "._-"); StringTokenizer needed = new StringTokenizer(template, "._-"); while (needed.hasMoreTokens()) { // Current can have no more tokens if needed has more // and if a privious token was not accepted as good version. // e.g. 1.4.2_02 needed, 1.4.2 current. The false return // will be right here. Only if e.g. needed is 1.4.2_00 the // return value will be false, but zero should not b e used // at the last version part. if (!current.hasMoreTokens()) return (false); String cur = current.nextToken(); String nee = needed.nextToken(); int curVal; int neededVal; try { curVal = Integer.parseInt(cur); neededVal = Integer.parseInt(nee); } catch (NumberFormatException nfe) { // A number format exception will be raised if // there is a non numeric part in the version, // e.g. 1.5.0_beta. The verification runs only into // this deep area of version number (fourth sub place) // if all other are equal to the given limit. Then // it is right to return false because e.g. // the minimal needed version will be 1.5.0.2. return (false); } if (curVal < neededVal) if (isMin) return (false); else return (true); if (Integer.parseInt(cur) > Integer.parseInt(nee)) if (isMin) return (true); else return (false); } return (true); }
3,241,718
public void test_using_ServiceFactory() throws Exception { ServiceFactory basicSF = new ServiceFactory(); ServiceFactory loginSF = new ServiceFactory( new Login( "bar", "ome" )); Properties p = new Properties(); p.setProperty( Login.OMERO_USER, "bax" ); ServiceFactory propsSF = new ServiceFactory( p ); Principal basicP = (Principal) basicSF.getContext().getBean( "principal" ); Principal loginP = (Principal) loginSF.getContext().getBean( "principal" ); Principal propsP = (Principal) propsSF.getContext().getBean( "principal" ); assertTrue( loginP.getName().equals( "bar" )); assertTrue( propsP.getName().equals( "bax" )); // It's difficult to know what the real user name is. assertFalse( basicP.getName().equals( "bar" )); assertFalse( basicP.getName().equals( "bax" )); }
public void test_using_ServiceFactory() throws Exception{ServiceFactory basicSF = new ServiceFactory();ServiceFactory loginSF = new ServiceFactory( new Login( "bar", "ome" ));Properties p = new Properties();p.setProperty( Login.OMERO_USER, "bax" );ServiceFactory propsSF = new ServiceFactory( p );Principal basicP = (Principal) basicSF.getContext().getBean( "principal" );Principal loginP = (Principal) loginSF.getContext().getBean( "principal" );Principal propsP = (Principal) propsSF.getContext().getBean( "principal" );assertTrue( loginP.getName().equals( "bar" ));assertTrue( propsP.getName().equals( "bax" ));// It's difficult to know what the real user name is. assertFalse( basicP.getName().equals( "bar" ));assertFalse( basicP.getName().equals( "bax" ));}
3,241,719
public void stopAction () { CompileResult result = this.worker.getResult (); this.releaseGUI(true); if (result.isContinue()) { parent.lockPrevButton(); packProgressBar.setString(parent.langpack.getString("CompilePanel.progress.finished")); packProgressBar.setEnabled(false); packProgressBar.setValue (packProgressBar.getMaximum()); overallProgressBar.setValue (this.noOfJobs); String no_of_jobs = Integer.toString (this.noOfJobs); overallProgressBar.setString (no_of_jobs + " / " + no_of_jobs); overallProgressBar.setEnabled (false); opLabel.setText(" "); opLabel.setEnabled(false); validated = true; idata.installSuccess = true; if (idata.panels.indexOf(this) != (idata.panels.size() - 1)) parent.unlockNextButton(); } else { idata.installSuccess = false; } }
public void stopAction () { CompileResult result = this.worker.getResult (); this.releaseGUI(result.isReconfigure()); if (result.isContinue()) { parent.lockPrevButton(); packProgressBar.setString(parent.langpack.getString("CompilePanel.progress.finished")); packProgressBar.setEnabled(false); packProgressBar.setValue (packProgressBar.getMaximum()); overallProgressBar.setValue (this.noOfJobs); String no_of_jobs = Integer.toString (this.noOfJobs); overallProgressBar.setString (no_of_jobs + " / " + no_of_jobs); overallProgressBar.setEnabled (false); opLabel.setText(" "); opLabel.setEnabled(false); validated = true; idata.installSuccess = true; if (idata.panels.indexOf(this) != (idata.panels.size() - 1)) parent.unlockNextButton(); } else { idata.installSuccess = false; } }
3,241,720
public ConsoleTextArea() { super(); history = new java.util.Vector(); console1 = new ConsoleWriter(this); console2 = new ConsoleWriter(this); out = new PrintStream(console1); err = new PrintStream(console2); PipedOutputStream outPipe = new PipedOutputStream(); inPipe = new PrintWriter(outPipe); in = new PipedInputStream(); try { outPipe.connect(in); } catch (IOException exc) { exc.printStackTrace(); } getDocument().addDocumentListener(this); addKeyListener(this); setLineWrap(true); setFont(new Font("Monospaced", 0, 12)); }
public ConsoleTextArea() { super(); history = new java.util.Vector(); console1 = new ConsoleWriter(this); ConsoleWriter console2 = new ConsoleWriter(this); out = new PrintStream(console1); err = new PrintStream(console2); PipedOutputStream outPipe = new PipedOutputStream(); inPipe = new PrintWriter(outPipe); in = new PipedInputStream(); try { outPipe.connect(in); } catch (IOException exc) { exc.printStackTrace(); } getDocument().addDocumentListener(this); addKeyListener(this); setLineWrap(true); setFont(new Font("Monospaced", 0, 12)); }
3,241,721
public synchronized void evict() throws Exception { Object key = null; for(int i=0,m=getNumTests();i<m;i++) { if(_poolMap.size() > 0) { // if we don't have a key cursor, then create one, and close any object cursor if(null == _evictionKeyCursor) { _evictionKeyCursor = _poolList.cursor(); key = null; if(null != _evictionCursor) { _evictionCursor.close(); _evictionCursor = null; } } // if we don't have an object cursor if(null == _evictionCursor) { // if the _evictionKeyCursor has a next value, then use it if(_evictionKeyCursor.hasNext()) { key = _evictionKeyCursor.next(); CursorableLinkedList pool = (CursorableLinkedList)(_poolMap.get(key)); _evictionCursor = pool.cursor(pool.size()); } else { // else close the key cursor and loop back around if(null != _evictionKeyCursor) { _evictionKeyCursor.close(); _evictionKeyCursor = _poolList.cursor(); if(null != _evictionCursor) { _evictionCursor.close(); _evictionCursor = null; } } continue; } } // if the _evictionCursor has a previous object, then test it if(_evictionCursor.hasPrevious()) { ObjectTimestampPair pair = (ObjectTimestampPair)(_evictionCursor.previous()); boolean removeObject=false; if(_minEvictableIdleTimeMillis > 0 && System.currentTimeMillis() - pair.tstamp > _minEvictableIdleTimeMillis) { removeObject=true; } else if(_testWhileIdle) { boolean active = false; try { _factory.activateObject(key,pair.value); active = true; } catch(Exception e) { removeObject=true; } if(active) { if(!_factory.validateObject(key,pair.value)) { removeObject=true; } else { try { _factory.passivateObject(key,pair.value); } catch(Exception e) { removeObject=true; } } } } if(removeObject) { try { _evictionCursor.remove(); _totalIdle--; _factory.destroyObject(key,pair.value); // if that was the last object for that key, drop that pool if( ((CursorableLinkedList)(_poolMap.get(key))).isEmpty() ) { _poolMap.remove(key); _poolList.remove(key); } } catch(Exception e) { ; // ignored } } } else { // else the _evictionCursor is done, so close it and loop around if(_evictionCursor != null) { _evictionCursor.close(); _evictionCursor = null; } } } } }
public synchronized void evict() throws Exception { Object key = null; for(int i=0,m=getNumTests();i<m;i++) { if(_poolMap.size() > 0) { // if we don't have a key cursor, then create one, and close any object cursor if(null == _evictionKeyCursor) { _evictionKeyCursor = _poolList.cursor(); key = null; if(null != _evictionCursor) { _evictionCursor.close(); _evictionCursor = null; } } // if we don't have an object cursor if(null == _evictionCursor) { // if the _evictionKeyCursor has a next value, then use it if(_evictionKeyCursor.hasNext()) { key = _evictionKeyCursor.next(); CursorableLinkedList pool = (CursorableLinkedList)(_poolMap.get(key)); _evictionCursor = pool.cursor(pool.size()); } else { // else close the key cursor and loop back around if(null != _evictionKeyCursor) { _evictionKeyCursor.close(); _evictionKeyCursor = _poolList.cursor(); if(null != _evictionCursor) { _evictionCursor.close(); _evictionCursor = null; } } continue; } } // if the _evictionCursor has a previous object, then test it if(_evictionCursor.hasPrevious()) { ObjectTimestampPair pair = (ObjectTimestampPair)(_evictionCursor.previous()); boolean removeObject=false; if(_minEvictableIdleTimeMillis > 0 && System.currentTimeMillis() - pair.tstamp > _minEvictableIdleTimeMillis) { removeObject=true; } else if(_testWhileIdle) { boolean active = false; try { _factory.activateObject(key,pair.value); active = true; } catch(Exception e) { removeObject=true; } if(active) { if(!_factory.validateObject(key,pair.value)) { removeObject=true; } else { try { _factory.passivateObject(key,pair.value); } catch(Exception e) { removeObject=true; } } } } if(removeObject) { try { _evictionCursor.remove(); _totalIdle--; _factory.destroyObject(key,pair.value); // if that was the last object for that key, drop that pool if ((_minIdle == 0) && (((CursorableLinkedList)(_poolMap.get(key))).isEmpty())) { _poolMap.remove(key); _poolList.remove(key); } } catch(Exception e) { ; // ignored } } } else { // else the _evictionCursor is done, so close it and loop around if(_evictionCursor != null) { _evictionCursor.close(); _evictionCursor = null; } } } } }
3,241,723
public void runAutomated(AutomatedInstallData idata, XMLElement panelRoot) { Unpacker unpacker = new Unpacker(idata, this); unpacker.start(); done = false; while (!done && unpacker.isAlive()) { try { Thread.sleep(100); } catch (InterruptedException e) { // ignore it, we're waiting for the unpacker to finish... } } }
public void runAutomated(AutomatedInstallData idata, XMLElement panelRoot) { Unpacker unpacker = new Unpacker(idata, this); unpacker.start(); boolean done = false; while (!done && unpacker.isAlive()) { try { Thread.sleep(100); } catch (InterruptedException e) { // ignore it, we're waiting for the unpacker to finish... } } }
3,241,725
public void stopAction() { System.out.println("[ Unpacking finished. ]"); done = true; }
public void stopAction() { System.out.println("[ Unpacking finished. ]"); boolean done = true; }
3,241,726
public String getDefaultInstallPath (String appName) { String path = null; InputStream input = null; String keyFragment = "/res/" + INSTALL_PATH_RESOURCE_KEY [GENERIC][STANDARD]; // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is specific to the target OS // ---------------------------------------------------- input = getClass ().getResourceAsStream ("/res/" + INSTALL_PATH_RESOURCE_KEY [os][osFlavor]); // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is made specific to the target // OS by using the string returned by // System.getProperty ("os.name").toLowerCase () // ---------------------------------------------------- if (input == null) { String key = osName.replace (' ', '_'); // avoid spaces in file names key = keyFragment + key.toLowerCase (); // for consistency among TargetPanel res files input = getClass ().getResourceAsStream (key); } // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is not specific to any target OS // ---------------------------------------------------- if (input == null) { input = getClass ().getResourceAsStream (keyFragment); } // ---------------------------------------------------- // If we got an input stream try to read the path // from the file // ---------------------------------------------------- if (input != null) { InputStreamReader streamReader = null; BufferedReader reader = null; String line = null; try { streamReader = new InputStreamReader (input); reader = new BufferedReader (streamReader); line = reader.readLine (); while (line != null) { line = line.trim (); if (!line.equals ("")) { break; } line = reader.readLine (); } path = line; } catch (Throwable exception) { } finally { try { reader.close (); } catch (Throwable exception) { } } } // ---------------------------------------------------- // if we were unable to obtain a path from a resource, // use the default for the traget operating system. // ---------------------------------------------------- if ((path == null) || (path.equals (""))) { path = ""; // -------------------------------------------------- // if we run on windows, we need a valid drive letter // to put in front of the path. The drive that // contains the user's home directory is usually the // drive that also contains the install directory, // so this seems the best choice here. // -------------------------------------------------- if (os == WINDOWS) { String home = System.getProperty ("user.home"); // take everything up to and including the first '\' path = home.substring (0, (home.indexOf (File.separatorChar) + 1)); } path = path + INSTALL_PATH_FRAGMENT [os] + appName; } return (path); }
public String getDefaultInstallPath (String appName) { String path = null; InputStream input = null; String keyFragment = "/res/" + INSTALL_PATH_RESOURCE_KEY [GENERIC][STANDARD]; // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is specific to the target OS // ---------------------------------------------------- input = getClass ().getResourceAsStream ("/res/" + INSTALL_PATH_RESOURCE_KEY [os][osFlavor]); // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is made specific to the target // OS by using the string returned by // System.getProperty ("os.name").toLowerCase () // ---------------------------------------------------- if (input == null) { String key = osName.replace (' ', '_'); // avoid spaces in file names key = keyFragment + key.toLowerCase (); // for consistency among TargetPanel res files input = TargetFactory.class.getResourceAsStream (key); } // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is not specific to any target OS // ---------------------------------------------------- if (input == null) { input = getClass ().getResourceAsStream (keyFragment); } // ---------------------------------------------------- // If we got an input stream try to read the path // from the file // ---------------------------------------------------- if (input != null) { InputStreamReader streamReader = null; BufferedReader reader = null; String line = null; try { streamReader = new InputStreamReader (input); reader = new BufferedReader (streamReader); line = reader.readLine (); while (line != null) { line = line.trim (); if (!line.equals ("")) { break; } line = reader.readLine (); } path = line; } catch (Throwable exception) { } finally { try { reader.close (); } catch (Throwable exception) { } } } // ---------------------------------------------------- // if we were unable to obtain a path from a resource, // use the default for the traget operating system. // ---------------------------------------------------- if ((path == null) || (path.equals (""))) { path = ""; // -------------------------------------------------- // if we run on windows, we need a valid drive letter // to put in front of the path. The drive that // contains the user's home directory is usually the // drive that also contains the install directory, // so this seems the best choice here. // -------------------------------------------------- if (os == WINDOWS) { String home = System.getProperty ("user.home"); // take everything up to and including the first '\' path = home.substring (0, (home.indexOf (File.separatorChar) + 1)); } path = path + INSTALL_PATH_FRAGMENT [os] + appName; } return (path); }
3,241,727
public String getDefaultInstallPath (String appName) { String path = null; InputStream input = null; String keyFragment = "/res/" + INSTALL_PATH_RESOURCE_KEY [GENERIC][STANDARD]; // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is specific to the target OS // ---------------------------------------------------- input = getClass ().getResourceAsStream ("/res/" + INSTALL_PATH_RESOURCE_KEY [os][osFlavor]); // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is made specific to the target // OS by using the string returned by // System.getProperty ("os.name").toLowerCase () // ---------------------------------------------------- if (input == null) { String key = osName.replace (' ', '_'); // avoid spaces in file names key = keyFragment + key.toLowerCase (); // for consistency among TargetPanel res files input = getClass ().getResourceAsStream (key); } // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is not specific to any target OS // ---------------------------------------------------- if (input == null) { input = getClass ().getResourceAsStream (keyFragment); } // ---------------------------------------------------- // If we got an input stream try to read the path // from the file // ---------------------------------------------------- if (input != null) { InputStreamReader streamReader = null; BufferedReader reader = null; String line = null; try { streamReader = new InputStreamReader (input); reader = new BufferedReader (streamReader); line = reader.readLine (); while (line != null) { line = line.trim (); if (!line.equals ("")) { break; } line = reader.readLine (); } path = line; } catch (Throwable exception) { } finally { try { reader.close (); } catch (Throwable exception) { } } } // ---------------------------------------------------- // if we were unable to obtain a path from a resource, // use the default for the traget operating system. // ---------------------------------------------------- if ((path == null) || (path.equals (""))) { path = ""; // -------------------------------------------------- // if we run on windows, we need a valid drive letter // to put in front of the path. The drive that // contains the user's home directory is usually the // drive that also contains the install directory, // so this seems the best choice here. // -------------------------------------------------- if (os == WINDOWS) { String home = System.getProperty ("user.home"); // take everything up to and including the first '\' path = home.substring (0, (home.indexOf (File.separatorChar) + 1)); } path = path + INSTALL_PATH_FRAGMENT [os] + appName; } return (path); }
public String getDefaultInstallPath (String appName) { String path = null; InputStream input = null; String keyFragment = "/res/" + INSTALL_PATH_RESOURCE_KEY [GENERIC][STANDARD]; // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is specific to the target OS // ---------------------------------------------------- input = getClass ().getResourceAsStream ("/res/" + INSTALL_PATH_RESOURCE_KEY [os][osFlavor]); // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is made specific to the target // OS by using the string returned by // System.getProperty ("os.name").toLowerCase () // ---------------------------------------------------- if (input == null) { String key = osName.replace (' ', '_'); // avoid spaces in file names key = keyFragment + key.toLowerCase (); // for consistency among TargetPanel res files input = getClass ().getResourceAsStream (key); } // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is not specific to any target OS // ---------------------------------------------------- if (input == null) { input = TargetFactory.class.getResourceAsStream (keyFragment); } // ---------------------------------------------------- // If we got an input stream try to read the path // from the file // ---------------------------------------------------- if (input != null) { InputStreamReader streamReader = null; BufferedReader reader = null; String line = null; try { streamReader = new InputStreamReader (input); reader = new BufferedReader (streamReader); line = reader.readLine (); while (line != null) { line = line.trim (); if (!line.equals ("")) { break; } line = reader.readLine (); } path = line; } catch (Throwable exception) { } finally { try { reader.close (); } catch (Throwable exception) { } } } // ---------------------------------------------------- // if we were unable to obtain a path from a resource, // use the default for the traget operating system. // ---------------------------------------------------- if ((path == null) || (path.equals (""))) { path = ""; // -------------------------------------------------- // if we run on windows, we need a valid drive letter // to put in front of the path. The drive that // contains the user's home directory is usually the // drive that also contains the install directory, // so this seems the best choice here. // -------------------------------------------------- if (os == WINDOWS) { String home = System.getProperty ("user.home"); // take everything up to and including the first '\' path = home.substring (0, (home.indexOf (File.separatorChar) + 1)); } path = path + INSTALL_PATH_FRAGMENT [os] + appName; } return (path); }
3,241,728
public ProcessPanel(InstallerFrame parent, InstallData idata) throws IOException { super(parent, idata); this.worker = new ProcessPanelWorker(idata, this); JLabel heading = new JLabel(); Font font = heading.getFont(); font = font.deriveFont(Font.BOLD, font.getSize() * 2.0f); heading.setFont(font); heading.setHorizontalAlignment(SwingConstants.CENTER); heading.setText(parent.langpack.getString("ProcessPanel.heading")); heading.setVerticalAlignment(SwingConstants.TOP); setLayout(new BorderLayout()); add(heading, BorderLayout.NORTH); // put everything but the heading into it's own panel // (to center it vertically) JPanel subpanel = new JPanel(); subpanel.setAlignmentX(0.5f); subpanel.setLayout(new BoxLayout(subpanel, BoxLayout.Y_AXIS)); this.processLabel = new JLabel(); this.processLabel.setAlignmentX(0.5f); this.processLabel.setText(" "); subpanel.add(this.processLabel); this.overallProgressBar = new JProgressBar(); this.overallProgressBar.setAlignmentX(0.5f); this.overallProgressBar.setStringPainted(true); subpanel.add(this.overallProgressBar); this.outputPane = new JTextArea(); this.outputPane.setEditable(false); this.outputScrollPane = new JScrollPane(this.outputPane); subpanel.add(this.outputScrollPane); add(subpanel, BorderLayout.CENTER); }
public ProcessPanel(InstallerFrame parent, InstallData idata) throws IOException { super(parent, idata); this.worker = new ProcessPanelWorker(idata, this); JLabel heading = new JLabel(); Font font = heading.getFont(); font = font.deriveFont(Font.BOLD, font.getSize() * 2.0f); heading.setFont(font); heading.setHorizontalAlignment(SwingConstants.CENTER); heading.setText(parent.langpack.getString("ProcessPanel.heading")); heading.setVerticalAlignment(SwingConstants.TOP); setLayout(new BorderLayout()); add(heading, BorderLayout.NORTH); // put everything but the heading into it's own panel // (to center it vertically) JPanel subpanel = new JPanel(); subpanel.setAlignmentX(0.5f); subpanel.setLayout(new BoxLayout(subpanel, BoxLayout.Y_AXIS)); this.processLabel = new JLabel(); this.processLabel.setAlignmentX(0.5f); this.processLabel.setText(" "); subpanel.add(this.processLabel); this.overallProgressBar = new JProgressBar(); this.overallProgressBar.setAlignmentX(0.5f); this.overallProgressBar.setStringPainted(true); subpanel.add(this.overallProgressBar); this.outputPane = new JTextArea(); this.outputPane.setEditable(false); this.outputScrollPane = new JScrollPane(this.outputPane); subpanel.add(this.outputScrollPane); add(subpanel, BorderLayout.CENTER); }
3,241,729
public void panelActivate() { // We clip the panel Dimension dim = parent.getPanelsContainerSize(); dim.width = dim.width - (dim.width / 4); dim.height = 150; setMinimumSize(dim); setMaximumSize(dim); setPreferredSize(dim); parent.lockNextButton(); this.worker.startThread(); }
public void panelActivate() { // We clip the panel Dimension dim = parent.getPanelsContainerSize(); dim.width -= (dim.width / 4); dim.height = 150; setMinimumSize(dim); setMaximumSize(dim); setPreferredSize(dim); parent.lockNextButton(); this.worker.startThread(); }
3,241,730
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
private static void computeLocationStats(Pixels pixels, List<ChannelBinding> cbs, PlaneDef planeDef, PixelBuffer buf) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
3,241,731
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
public void computeLocationStats(PlaneDef pd) { if (planeDef == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
3,241,732
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
3,241,733
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; List<Channel> channels = pixels.getChannels(); for (Channel channel : channels) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
3,241,734
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
3,241,735
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(pixels, buf, planeDef, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
3,241,736
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
3,241,737
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
3,241,738
public PlaneDef getDefaultPlaneDef() { PlaneDef pd = new PlaneDef(PlaneDef.XY, rndDef.getDefaultT().intValue()); pd.setZ(rndDef.getDefaultZ().intValue()); return pd; }
public PlaneDef getDefaultPlaneDef() { PlaneDef pd = new PlaneDef(PlaneDef.XY, rndDef.getDefaultT().intValue()); pd.setZ(rndDef.getDefaultZ().intValue()); return pd; }
3,241,739
private static void resetChannelBindings(RenderingDef def, Pixels pixels, IPixels iPixels) { // The actual channel bindings we are returning List<ChannelBinding> channelBindings = def.getWaveRendering(); List<Channel> channels = pixels.getChannels(); int i = 0; for (Channel channel : channels) { StatsInfo stats = channel.getStatsInfo(); Family family = QuantumFactory.getFamily(iPixels, QuantumFactory.LINEAR); ChannelBinding channelBinding = channelBindings.get(i); channelBinding.setFamily(family); channelBinding.setCoefficient(new Double(1)); // FIXME: Lost of precision, downcast from Double to Float channelBinding.setInputStart(new Float(stats.getGlobalMin())); channelBinding.setInputEnd(new Float(stats.getGlobalMax())); // If we have more than one channel set each of the first three // active, otherwise only activate the first. if (i < 3) channelBinding.setActive(true); channelBinding.setColor(ColorsFactory.getColor(i, channel)); channelBinding.setNoiseReduction(false); i++; } }
private static void resetChannelBindings(RenderingDef def, Pixels pixels, IPixels iPixels, PixelBuffer buffer) { // The actual channel bindings we are returning List<ChannelBinding> channelBindings = def.getWaveRendering(); List<Channel> channels = pixels.getChannels(); int i = 0; for (Channel channel : channels) { StatsInfo stats = channel.getStatsInfo(); Family family = QuantumFactory.getFamily(iPixels, QuantumFactory.LINEAR); ChannelBinding channelBinding = channelBindings.get(i); channelBinding.setFamily(family); channelBinding.setCoefficient(new Double(1)); // FIXME: Lost of precision, downcast from Double to Float channelBinding.setInputStart(new Float(stats.getGlobalMin())); channelBinding.setInputEnd(new Float(stats.getGlobalMax())); // If we have more than one channel set each of the first three // active, otherwise only activate the first. if (i < 3) channelBinding.setActive(true); channelBinding.setColor(ColorsFactory.getColor(i, channel)); channelBinding.setNoiseReduction(false); i++; } }
3,241,740
private static void resetChannelBindings(RenderingDef def, Pixels pixels, IPixels iPixels) { // The actual channel bindings we are returning List<ChannelBinding> channelBindings = def.getWaveRendering(); List<Channel> channels = pixels.getChannels(); int i = 0; for (Channel channel : channels) { StatsInfo stats = channel.getStatsInfo(); Family family = QuantumFactory.getFamily(iPixels, QuantumFactory.LINEAR); ChannelBinding channelBinding = channelBindings.get(i); channelBinding.setFamily(family); channelBinding.setCoefficient(new Double(1)); // FIXME: Lost of precision, downcast from Double to Float channelBinding.setInputStart(new Float(stats.getGlobalMin())); channelBinding.setInputEnd(new Float(stats.getGlobalMax())); // If we have more than one channel set each of the first three // active, otherwise only activate the first. if (i < 3) channelBinding.setActive(true); channelBinding.setColor(ColorsFactory.getColor(i, channel)); channelBinding.setNoiseReduction(false); i++; } }
privatestaticvoidresetChannelBindings(RenderingDefdef,Pixelspixels,IPixelsiPixels){//TheactualchannelbindingswearereturningList<ChannelBinding>channelBindings=def.getWaveRendering();List<Channel>channels=pixels.getChannels();inti=0;for(Channelchannel:channels){StatsInfostats=channel.getStatsInfo();Familyfamily= QuantumFactory.getFamily(iPixels,QuantumFactory.LINEAR);ChannelBindingchannelBinding=channelBindings.get(i);channelBinding.setFamily(family);channelBinding.setCoefficient(newDouble(1));//FIXME:Lostofprecision,downcastfromDoubletoFloatchannelBinding.setInputStart(newFloat(stats.getGlobalMin()));channelBinding.setInputEnd(newFloat(stats.getGlobalMax()));//Ifwehavemorethanonechannelseteachofthefirstthree//active,otherwiseonlyactivatethefirst.if(i<3) channelBinding.setActive(true);channelBinding.setColor(ColorsFactory.getColor(i,channel)); channelBinding.setNoiseReduction(false);i++;}}
3,241,741
private static void resetChannelBindings(RenderingDef def, Pixels pixels, IPixels iPixels) { // The actual channel bindings we are returning List<ChannelBinding> channelBindings = def.getWaveRendering(); List<Channel> channels = pixels.getChannels(); int i = 0; for (Channel channel : channels) { StatsInfo stats = channel.getStatsInfo(); Family family = QuantumFactory.getFamily(iPixels, QuantumFactory.LINEAR); ChannelBinding channelBinding = channelBindings.get(i); channelBinding.setFamily(family); channelBinding.setCoefficient(new Double(1)); // FIXME: Lost of precision, downcast from Double to Float channelBinding.setInputStart(new Float(stats.getGlobalMin())); channelBinding.setInputEnd(new Float(stats.getGlobalMax())); // If we have more than one channel set each of the first three // active, otherwise only activate the first. if (i < 3) channelBinding.setActive(true); channelBinding.setColor(ColorsFactory.getColor(i, channel)); channelBinding.setNoiseReduction(false); i++; } }
private static void resetChannelBindings(RenderingDef def, Pixels pixels, IPixels iPixels) { // The actual channel bindings we are returning List<ChannelBinding> channelBindings = def.getWaveRendering(); List<Channel> channels = pixels.getChannels(); int i = 0; for (Channel channel : channels) { Family family = QuantumFactory.getFamily(iPixels, QuantumFactory.LINEAR); ChannelBinding channelBinding = channelBindings.get(i); channelBinding.setFamily(family); channelBinding.setCoefficient(new Double(1)); // FIXME: Lost of precision, downcast from Double to Float channelBinding.setInputStart(new Float(stats.getGlobalMin())); channelBinding.setInputEnd(new Float(stats.getGlobalMax())); // If we have more than one channel set each of the first three // active, otherwise only activate the first. if (i < 3) channelBinding.setActive(true); channelBinding.setColor(ColorsFactory.getColor(i, channel)); channelBinding.setNoiseReduction(false); i++; } }
3,241,742
private static void resetChannelBindings(RenderingDef def, Pixels pixels, IPixels iPixels) { // The actual channel bindings we are returning List<ChannelBinding> channelBindings = def.getWaveRendering(); List<Channel> channels = pixels.getChannels(); int i = 0; for (Channel channel : channels) { StatsInfo stats = channel.getStatsInfo(); Family family = QuantumFactory.getFamily(iPixels, QuantumFactory.LINEAR); ChannelBinding channelBinding = channelBindings.get(i); channelBinding.setFamily(family); channelBinding.setCoefficient(new Double(1)); // FIXME: Lost of precision, downcast from Double to Float channelBinding.setInputStart(new Float(stats.getGlobalMin())); channelBinding.setInputEnd(new Float(stats.getGlobalMax())); // If we have more than one channel set each of the first three // active, otherwise only activate the first. if (i < 3) channelBinding.setActive(true); channelBinding.setColor(ColorsFactory.getColor(i, channel)); channelBinding.setNoiseReduction(false); i++; } }
private static void resetChannelBindings(RenderingDef def, Pixels pixels, IPixels iPixels) { // The actual channel bindings we are returning List<ChannelBinding> channelBindings = def.getWaveRendering(); List<Channel> channels = pixels.getChannels(); int i = 0; for (Channel channel : channels) { StatsInfo stats = channel.getStatsInfo(); Family family = QuantumFactory.getFamily(iPixels, QuantumFactory.LINEAR); ChannelBinding channelBinding = channelBindings.get(i); channelBinding.setFamily(family); channelBinding.setCoefficient(new Double(1)); // FIXME: Lost of precision, downcast from Double to Float channelBinding.setInputStart(new Float(stats.getGlobalMin())); channelBinding.setInputEnd(new Float(stats.getGlobalMax())); // If we have more than one channel set each of the first three // active, otherwise only activate the first. if (i < 3) channelBinding.setActive(true); channelBinding.setColor(ColorsFactory.getColor(i, channel)); channelBinding.setNoiseReduction(false); i++; } }
3,241,743
public PacksPanelBase(InstallerFrame parent, InstallData idata) { super(parent, idata); // Load langpack. try { this.langpack = parent.langpack; } catch (Throwable exception) {} // init the map computePacks(idata.availablePacks); createNormalLayout(); }
public PacksPanelBase(InstallerFrame parent, InstallData idata) { super(parent, idata); // Load langpack. try { this.langpack = parent.langpack; } catch (Throwable exception) { Debug.trace(exception); } // init the map computePacks(idata.availablePacks); createNormalLayout(); }
3,241,745
public LanguageDialog(JFrame frame, Object[] items) { super(frame); try { loadLookAndFeel(); } catch (Exception err) { err.printStackTrace(); } // We build the GUI addWindowListener(new WindowHandler()); JPanel contentPane = (JPanel) getContentPane(); setTitle("Language selection"); GridBagLayout layout = new GridBagLayout(); contentPane.setLayout(layout); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.anchor = GridBagConstraints.CENTER; gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.gridx = 0; gbConstraints.weightx = 1.0; gbConstraints.weighty = 1.0; ImageIcon img = getImage(); JLabel imgLabel = new JLabel(img); gbConstraints.gridy = 0; contentPane.add(imgLabel); gbConstraints.fill = GridBagConstraints.HORIZONTAL; String firstMessage = "Please select your language"; if (getLangType().equals(LANGUAGE_DISPLAY_TYPES[0])) // iso3 firstMessage = "Please select your language (ISO3 code)"; JLabel label1 = new JLabel(firstMessage, SwingConstants.CENTER); gbConstraints.gridy = 1; gbConstraints.insets = new Insets(5, 5, 0, 5); layout.addLayoutComponent(label1, gbConstraints); contentPane.add(label1); JLabel label2 = new JLabel("for install instructions:", SwingConstants.CENTER); gbConstraints.gridy = 2; gbConstraints.insets = new Insets(0, 5, 5, 5); layout.addLayoutComponent(label2, gbConstraints); contentPane.add(label2); gbConstraints.insets = new Insets(5, 5, 5, 5); items = reviseItems(items); comboBox = new JComboBox(items); if (useFlags()) comboBox.setRenderer(new FlagRenderer()); gbConstraints.fill = GridBagConstraints.HORIZONTAL; gbConstraints.gridy = 3; layout.addLayoutComponent(comboBox, gbConstraints); contentPane.add(comboBox); okButton = new JButton("OK"); okButton.addActionListener(this); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.gridy = 4; gbConstraints.anchor = GridBagConstraints.CENTER; layout.addLayoutComponent(okButton, gbConstraints); contentPane.add(okButton); getRootPane().setDefaultButton(okButton); // Packs and centers // Fix for bug "Installer won't show anything on OSX" if (System.getProperty("mrj.version") == null) pack(); else setSize(getPreferredSize()); Dimension frameSize = getSize(); Point center = GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint(); setLocation(center.x - frameSize.width / 2, center.y - frameSize.height / 2 - 10); setResizable(true); }
public LanguageDialog(JFrame frame, Object[] items) { super(frame); try { loadLookAndFeel(); } catch (Exception err) { err.printStackTrace(); } // We build the GUI addWindowListener(new WindowHandler()); JPanel contentPane = (JPanel) getContentPane(); setTitle("Language selection"); GridBagLayout layout = new GridBagLayout(); contentPane.setLayout(layout); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.anchor = GridBagConstraints.CENTER; gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.gridx = 0; gbConstraints.weightx = 1.0; gbConstraints.weighty = 1.0; ImageIcon img = getImage(); JLabel imgLabel = new JLabel(img); gbConstraints.gridy = 0; contentPane.add(imgLabel); gbConstraints.fill = GridBagConstraints.HORIZONTAL; String firstMessage = "Please select your language"; if (getLangType().equals(LANGUAGE_DISPLAY_TYPES[0])) // iso3 firstMessage = "Please select your language (ISO3 code)"; JLabel label1 = new JLabel(firstMessage, SwingConstants.CENTER); gbConstraints.gridy = 1; gbConstraints.insets = new Insets(5, 5, 0, 5); layout.addLayoutComponent(label1, gbConstraints); contentPane.add(label1); JLabel label2 = new JLabel("for install instructions:", SwingConstants.CENTER); gbConstraints.gridy = 2; gbConstraints.insets = new Insets(0, 5, 5, 5); layout.addLayoutComponent(label2, gbConstraints); contentPane.add(label2); gbConstraints.insets = new Insets(5, 5, 5, 5); items = reviseItems(items); comboBox = new JComboBox(items); if (useFlags()) comboBox.setRenderer(new FlagRenderer()); gbConstraints.fill = GridBagConstraints.HORIZONTAL; gbConstraints.gridy = 3; layout.addLayoutComponent(comboBox, gbConstraints); contentPane.add(comboBox); JButton okButton = new JButton("OK"); okButton.addActionListener(this); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.gridy = 4; gbConstraints.anchor = GridBagConstraints.CENTER; layout.addLayoutComponent(okButton, gbConstraints); contentPane.add(okButton); getRootPane().setDefaultButton(okButton); // Packs and centers // Fix for bug "Installer won't show anything on OSX" if (System.getProperty("mrj.version") == null) pack(); else setSize(getPreferredSize()); Dimension frameSize = getSize(); Point center = GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint(); setLocation(center.x - frameSize.width / 2, center.y - frameSize.height / 2 - 10); setResizable(true); }
3,241,746
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
3,241,747
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
3,241,748
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!"mac".equals(syskey)) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
3,241,749
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if ("kunststoff".equals(laf)) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
3,241,750
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if ("liquid".equals(laf)) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
3,241,751
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if ("yes".equals(value)) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if ("yes".equals(value)) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
3,241,752
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if ("yes".equals(value)) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if ("yes".equals(value)) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
3,241,753
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if ("metouia".equals(laf)) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
3,241,754
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if (installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if (installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because // useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String) params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String) params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if ("looks".equals(laf)) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel"); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String) variants.get("plasticXP"); Map params = (Map) installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String) params.get("variant"); if (variants.containsKey(param)) { variant = (String) variants.get(param); } } UIManager.setLookAndFeel(variant); } }
3,241,755
protected boolean useFlags() { if (installdata.guiPrefs.modifier.containsKey("useFlags") && ((String) installdata.guiPrefs.modifier.get("useFlags")).equalsIgnoreCase("no")) return (false); return (true); }
protected boolean useFlags() { if (installdata.guiPrefs.modifier.containsKey("useFlags") && "no".equalsIgnoreCase((String) installdata.guiPrefs.modifier.get("useFlags"))) return (false); return (true); }
3,241,756
public CustomSuite(final String projectName, final String suiteName, final Map parameters, final String annotationType) { super(true); m_projectName= projectName; m_suiteName= suiteName; m_parameters= parameters; if("1.4".equals(annotationType) || TestNG.JAVADOC_ANNOTATION_TYPE.equals(annotationType)) { m_annotationType= TestNG.JAVADOC_ANNOTATION_TYPE; } else { m_annotationType= TestNG.JDK_ANNOTATION_TYPE; } }
public CustomSuite(final String projectName, final String suiteName, final Map parameters, final String annotationType) { super(true); m_projectName= projectName; m_suiteName= suiteName; m_parameters= parameters; if("1.4".equals(annotationType) || TestNG.JAVADOC_ANNOTATION_TYPE.equals(annotationType)) { m_annotationType= TestNG.JAVADOC_ANNOTATION_TYPE; } else { m_annotationType= TestNG.JDK_ANNOTATION_TYPE; } }
3,241,757
public CustomSuite(final String projectName, final String suiteName, final Map parameters, final String annotationType) { super(true); m_projectName= projectName; m_suiteName= suiteName; m_parameters= parameters; if("1.4".equals(annotationType) || TestNG.JAVADOC_ANNOTATION_TYPE.equals(annotationType)) { m_annotationType= TestNG.JAVADOC_ANNOTATION_TYPE; } else { m_annotationType= TestNG.JDK_ANNOTATION_TYPE; } }
public CustomSuite(final String projectName, final String suiteName, final Map parameters, final String annotationType) { super(true); m_projectName= projectName; m_suiteName= suiteName; m_parameters= parameters; if("1.4".equals(annotationType) || TestNG.JAVADOC_ANNOTATION_TYPE.equals(annotationType)) { m_annotationType= TestNG.JAVADOC_ANNOTATION_TYPE; } else { m_annotationType= TestNG.JDK_ANNOTATION_TYPE; } }
3,241,758
protected XMLStringBuffer createContentBuffer() { XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs); if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); } } initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }
protected XMLStringBuffer createContentBuffer() { XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs); if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); } } initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }
3,241,760
protected XMLStringBuffer createContentBuffer() { XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs); if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); } } initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }
protected XMLStringBuffer createContentBuffer() { XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs); if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); } } initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }
3,241,761
protected XMLStringBuffer createContentBuffer() { XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs); if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); } } initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }
protected XMLStringBuffer createContentBuffer() { XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs); if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); } } initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }
3,241,762
protected XMLStringBuffer createContentBuffer() { XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs); if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); } } initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }
protected XMLStringBuffer createContentBuffer() { XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs); if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); } } initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }
3,241,763
protected XMLStringBuffer createContentBuffer() { XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs); if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); } } initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }
protected XMLStringBuffer createContentBuffer() { XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs); if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); } } initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }
3,241,764