bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
private String checkFileType(File f){ String suff = f.getPath().substring(f.getPath().length()-3, f.getPath().length()); Debug.print(suff); if (suff.equalsIgnoreCase(".rec")) return "promash"; // let's open it up and have a peek // we'll only read 10 lines try { FileReader in = new FileReader(f); BufferedReader inb = new BufferedReader(in); String c; int i = 0; while ((c = inb.readLine()) != null && i<10){ if (c.indexOf("BeerXML Format") > -1) return "beerxml"; if (c.indexOf("STRANGEBREWRECIPE") > -1) return "sb"; if (c.indexOf("generator=\"qbrew\"") > -1) return "qbrew"; i++; } } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return ""; }
private String checkFileType(File f){ String suff = f.getPath().substring(f.getPath().length()-3, f.getPath().length()); Debug.print(suff); if (suff.equalsIgnoreCase(".rec")) return "promash"; // let's open it up and have a peek // we'll only read 10 lines try { FileReader in = new FileReader(f); BufferedReader inb = new BufferedReader(in); String c; int i = 0; while ((c = inb.readLine()) != null && i<10){ if (c.indexOf("BeerXML Format") > -1) return "beerxml"; if (c.indexOf("STRANGEBREWRECIPE") > -1) return "sb"; if (c.indexOf("generator=\"qbrew\"") > -1) return "qbrew"; i++; } } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return ""; }
1,116,394
public Recipe openFile(File f){ String type = checkFileType(f); Debug.print("File type: " + type); if (type.equalsIgnoreCase("")){ Debug.print("Unrecognized file"); JOptionPane.showMessageDialog( null, "The file you've tried to open isn't a recognized format. \n" + "You can open: \n" + "StrangeBrew 1.x and Java files (.xml)\n" + "QBrew files (.qbrew)\n" + "BeerXML files (.xml)\n" + "Promash files (.rec)", "Unrecognized Format!", JOptionPane.INFORMATION_MESSAGE); myRecipe = new Recipe(); } if (type.equals("promash")){ PromashImport imp = new PromashImport(); myRecipe = imp.readRecipe(f); } if (type.equals("sb") || type.equals("qbrew")){ ImportXml imp = new ImportXml(f.toString(), "recipe"); myRecipe = imp.handler.getRecipe(); } if (type.equals("beerxml")){ ImportXml imp = new ImportXml(f.toString(), "beerXML"); myRecipe = imp.beerXmlHandler.getRecipe(); } return myRecipe; }
public Recipe openFile(File f){ String type = checkFileType(f); Debug.print("File type: " + type); if (type.equalsIgnoreCase("")){ Debug.print("Unrecognized file"); JOptionPane.showMessageDialog( null, "The file you've tried to open isn't a recognized format. \n" + "You can open: \n" + "StrangeBrew 1.x and Java files (.xml)\n" + "QBrew files (.qbrew)\n" + "BeerXML files (.xml)\n" + "Promash files (.rec)", "Unrecognized Format!", JOptionPane.INFORMATION_MESSAGE); myRecipe = new Recipe(); } if (type.equals("promash")){ PromashImport imp = new PromashImport(); myRecipe = imp.readRecipe(f); } if (type.equals("sb") || type.equals("qbrew")){ ImportXml imp = new ImportXml(f.toString(), "recipe"); myRecipe = imp.handler.getRecipe(); } if (type.equals("beerxml")){ ImportXml imp = new ImportXml(f.toString(), "beerXML"); myRecipe = imp.beerXmlHandler.getRecipe(); } return myRecipe; }
1,116,395
public Recipe openFile(File f){ String type = checkFileType(f); Debug.print("File type: " + type); if (type.equalsIgnoreCase("")){ Debug.print("Unrecognized file"); JOptionPane.showMessageDialog( null, "The file you've tried to open isn't a recognized format. \n" + "You can open: \n" + "StrangeBrew 1.x and Java files (.xml)\n" + "QBrew files (.qbrew)\n" + "BeerXML files (.xml)\n" + "Promash files (.rec)", "Unrecognized Format!", JOptionPane.INFORMATION_MESSAGE); myRecipe = new Recipe(); } if (type.equals("promash")){ PromashImport imp = new PromashImport(); myRecipe = imp.readRecipe(f); } if (type.equals("sb") || type.equals("qbrew")){ ImportXml imp = new ImportXml(f.toString(), "recipe"); myRecipe = imp.handler.getRecipe(); } if (type.equals("beerxml")){ ImportXml imp = new ImportXml(f.toString(), "beerXML"); myRecipe = imp.beerXmlHandler.getRecipe(); } return myRecipe; }
public Recipe openFile(File f){ String type = checkFileType(f); Debug.print("File type: " + type); if (type.equalsIgnoreCase("")){ Debug.print("Unrecognized file"); JOptionPane.showMessageDialog( null, "The file you've tried to open isn't a recognized format. \n" + "You can open: \n" + "StrangeBrew 1.x and Java files (.xml)\n" + "QBrew files (.qbrew)\n" + "BeerXML files (.xml)\n" + "Promash files (.rec)", "Unrecognized Format!", JOptionPane.INFORMATION_MESSAGE); myRecipe = new Recipe(); } if (type.equals("promash")){ PromashImport imp = new PromashImport(); myRecipe = imp.readRecipe(f); } if (type.equals("sb") || type.equals("qbrew")){ ImportXml imp = new ImportXml(f.toString(), "recipe"); myRecipe = imp.handler.getRecipe(); } if (type.equals("beerxml")){ ImportXml imp = new ImportXml(f.toString(), "beerXML"); myRecipe = imp.beerXmlHandler.getRecipe(); } return myRecipe; }
1,116,396
public Recipe openFile(File f){ String type = checkFileType(f); Debug.print("File type: " + type); if (type.equalsIgnoreCase("")){ Debug.print("Unrecognized file"); JOptionPane.showMessageDialog( null, "The file you've tried to open isn't a recognized format. \n" + "You can open: \n" + "StrangeBrew 1.x and Java files (.xml)\n" + "QBrew files (.qbrew)\n" + "BeerXML files (.xml)\n" + "Promash files (.rec)", "Unrecognized Format!", JOptionPane.INFORMATION_MESSAGE); myRecipe = new Recipe(); } if (type.equals("promash")){ PromashImport imp = new PromashImport(); myRecipe = imp.readRecipe(f); } if (type.equals("sb") || type.equals("qbrew")){ ImportXml imp = new ImportXml(f.toString(), "recipe"); myRecipe = imp.handler.getRecipe(); } if (type.equals("beerxml")){ ImportXml imp = new ImportXml(f.toString(), "beerXML"); myRecipe = imp.beerXmlHandler.getRecipe(); } return myRecipe; }
public Recipe openFile(File f){ String type = checkFileType(f); Debug.print("File type: " + type); if (type.equalsIgnoreCase("")){ Debug.print("Unrecognized file"); JOptionPane.showMessageDialog( null, "The file you've tried to open isn't a recognized format. \n" + "You can open: \n" + "StrangeBrew 1.x and Java files (.xml)\n" + "QBrew files (.qbrew)\n" + "BeerXML files (.xml)\n" + "Promash files (.rec)", "Unrecognized Format!", JOptionPane.INFORMATION_MESSAGE); myRecipe = new Recipe(); } if (type.equals("promash")){ PromashImport imp = new PromashImport(); myRecipe = imp.readRecipe(f); } if (type.equals("sb") || type.equals("qbrew")){ ImportXml imp = new ImportXml(f.toString(), "recipe"); myRecipe = imp.handler.getRecipe(); } if (type.equals("beerxml")){ ImportXml imp = new ImportXml(f.toString(), "beerXML"); myRecipe = imp.beerXmlHandler.getRecipe(); } return myRecipe; }
1,116,397
public synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException { if(!Hudson.adminCheck(req,rsp)) return; useSecurity = req.getParameter("use_security")!=null; numExecutors = Integer.parseInt(req.getParameter("numExecutors")); quietPeriod = Integer.parseInt(req.getParameter("quiet_period")); {// update slave list slaves.clear(); String [] names = req.getParameterValues("slave_name"); String [] cmds = req.getParameterValues("slave_command"); String [] rfs = req.getParameterValues("slave_remoteFS"); String [] lfs = req.getParameterValues("slave_localFS"); if(names!=null && cmds!=null && rfs!=null && lfs!=null) { int len = Math.min( Math.min(names.length,cmds.length), Math.min(rfs.length, lfs.length) ); for(int i=0;i<len;i++) { slaves.add(new Slave(names[i],cmds[i],rfs[i],new File(lfs[i]))); } } } {// update JDK installations jdks.clear(); String[] names = req.getParameterValues("jdk_name"); String[] homes = req.getParameterValues("jdk_home"); if(names!=null && homes!=null) { int len = Math.min(names.length,homes.length); for(int i=0;i<len;i++) { jdks.add(new JDK(names[i],homes[i])); } } } for( Executor e : executors ) if(e.getCurrentBuild()==null) e.interrupt(); while(executors.size()<numExecutors) executors.add(new Executor(this)); boolean result = true; for( BuildStepDescriptor d : BuildStep.BUILDERS ) result &= d.configure(req); for( BuildStepDescriptor d : BuildStep.PUBLISHERS ) result &= d.configure(req); for( SCMDescriptor scmd : SCMManager.getSupportedSCMs() ) result &= scmd.configure(req); save(); if(result) rsp.sendRedirect("."); // go to the top page else rsp.sendRedirect("configure"); // back to config }
public synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException { if(!Hudson.adminCheck(req,rsp)) return; useSecurity = req.getParameter("use_security")!=null; numExecutors = Integer.parseInt(req.getParameter("numExecutors")); quietPeriod = Integer.parseInt(req.getParameter("quiet_period")); {// update slave list slaves.clear(); String [] names = req.getParameterValues("slave_name"); String [] cmds = req.getParameterValues("slave_command"); String [] rfs = req.getParameterValues("slave_remoteFS"); String [] lfs = req.getParameterValues("slave_localFS"); if(names!=null && cmds!=null && rfs!=null && lfs!=null) { int len = Math.min( Math.min(names.length,cmds.length), Math.min(rfs.length, lfs.length) ); for(int i=0;i<len;i++) { slaves.add(new Slave(names[i],cmds[i],rfs[i],new File(lfs[i]))); } } } {// update JDK installations jdks.clear(); String[] names = req.getParameterValues("jdk_name"); String[] homes = req.getParameterValues("jdk_home"); if(names!=null && homes!=null) { int len = Math.min(names.length,homes.length); for(int i=0;i<len;i++) { jdks.add(new JDK(names[i],homes[i])); } } } for( Executor e : executors ) if(e.getCurrentBuild()==null) e.interrupt(); while(executors.size()<numExecutors) executors.add(new Executor(this)); boolean result = true; for( BuildStepDescriptor d : BuildStep.BUILDERS ) result &= d.configure(req); for( BuildStepDescriptor d : BuildStep.PUBLISHERS ) result &= d.configure(req); for( SCMDescriptor scmd : SCMManager.getSupportedSCMs() ) result &= scmd.configure(req); save(); if(result) rsp.sendRedirect("."); // go to the top page else rsp.sendRedirect("configure"); // back to config }
1,116,398
public synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException { if(!Hudson.adminCheck(req,rsp)) return; useSecurity = req.getParameter("use_security")!=null; numExecutors = Integer.parseInt(req.getParameter("numExecutors")); quietPeriod = Integer.parseInt(req.getParameter("quiet_period")); {// update slave list slaves.clear(); String [] names = req.getParameterValues("slave_name"); String [] cmds = req.getParameterValues("slave_command"); String [] rfs = req.getParameterValues("slave_remoteFS"); String [] lfs = req.getParameterValues("slave_localFS"); if(names!=null && cmds!=null && rfs!=null && lfs!=null) { int len = Math.min( Math.min(names.length,cmds.length), Math.min(rfs.length, lfs.length) ); for(int i=0;i<len;i++) { slaves.add(new Slave(names[i],cmds[i],rfs[i],new File(lfs[i]))); } } } {// update JDK installations jdks.clear(); String[] names = req.getParameterValues("jdk_name"); String[] homes = req.getParameterValues("jdk_home"); if(names!=null && homes!=null) { int len = Math.min(names.length,homes.length); for(int i=0;i<len;i++) { jdks.add(new JDK(names[i],homes[i])); } } } for( Executor e : executors ) if(e.getCurrentBuild()==null) e.interrupt(); while(executors.size()<numExecutors) executors.add(new Executor(this)); boolean result = true; for( BuildStepDescriptor d : BuildStep.BUILDERS ) result &= d.configure(req); for( BuildStepDescriptor d : BuildStep.PUBLISHERS ) result &= d.configure(req); for( SCMDescriptor scmd : SCMManager.getSupportedSCMs() ) result &= scmd.configure(req); save(); if(result) rsp.sendRedirect("."); // go to the top page else rsp.sendRedirect("configure"); // back to config }
public synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException { if(!Hudson.adminCheck(req,rsp)) return; useSecurity = req.getParameter("use_security")!=null; numExecutors = Integer.parseInt(req.getParameter("numExecutors")); quietPeriod = Integer.parseInt(req.getParameter("quiet_period")); {// update slave list slaves.clear(); String [] names = req.getParameterValues("slave_name"); String [] cmds = req.getParameterValues("slave_command"); String [] rfs = req.getParameterValues("slave_remoteFS"); String [] lfs = req.getParameterValues("slave_localFS"); if(names!=null && cmds!=null && rfs!=null && lfs!=null) { int len = Math.min( Math.min(names.length,cmds.length), Math.min(rfs.length, lfs.length) ); for(int i=0;i<len;i++) { slaves.add(new Slave(names[i],descriptions[i],cmds[i],rfs[i],new File(lfs[i]))); } } } {// update JDK installations jdks.clear(); String[] names = req.getParameterValues("jdk_name"); String[] homes = req.getParameterValues("jdk_home"); if(names!=null && homes!=null) { int len = Math.min(names.length,homes.length); for(int i=0;i<len;i++) { jdks.add(new JDK(names[i],homes[i])); } } } for( Executor e : executors ) if(e.getCurrentBuild()==null) e.interrupt(); while(executors.size()<numExecutors) executors.add(new Executor(this)); boolean result = true; for( BuildStepDescriptor d : BuildStep.BUILDERS ) result &= d.configure(req); for( BuildStepDescriptor d : BuildStep.PUBLISHERS ) result &= d.configure(req); for( SCMDescriptor scmd : SCMManager.getSupportedSCMs() ) result &= scmd.configure(req); save(); if(result) rsp.sendRedirect("."); // go to the top page else rsp.sendRedirect("configure"); // back to config }
1,116,399
Shape(String url, Point point) { this.url = url; this.point = point; }
Shape(String url, Point point, Dimension size) { this.url = url; this.point = point; }
1,116,400
public String createCriteriaAsString(IdentityFilter filter) { StringBuilder criteria = new StringBuilder(); if (!filter.getPrincipalSearch().isEmpty()) { criteria.append("lower(identity.principal) like '%") .append(filter.getPrincipalSearch().toLowerCase()) .append("%' "); } if (!filter.getNameOrAliasSearch().isEmpty()) { String nameOrAliasSearch = filter.getNameOrAliasSearch().toLowerCase(); if (!criteria.toString().isEmpty()) { criteria.append("or "); } criteria.append("lower(identity.optionalAlias) like '%") .append(nameOrAliasSearch) .append("%' ") .append("or ") .append("lower(identity.firstName) like '%") .append(nameOrAliasSearch) .append("%' ") .append("or ") .append("lower(identity.lastName) like '%") .append(nameOrAliasSearch) .append("%' "); } if (criteria.toString().isEmpty()) { return ""; } return criteria.insert(0, "where ").toString(); }
public String createCriteriaAsString(IdentityFilter filter) { StringBuilder criteria = new StringBuilder(); if (!filter.getPrincipalSearch().equals("")) { criteria.append("lower(identity.principal) like '%") .append(filter.getPrincipalSearch().toLowerCase()) .append("%' "); } if (!filter.getNameOrAliasSearch().isEmpty()) { String nameOrAliasSearch = filter.getNameOrAliasSearch().toLowerCase(); if (!criteria.toString().isEmpty()) { criteria.append("or "); } criteria.append("lower(identity.optionalAlias) like '%") .append(nameOrAliasSearch) .append("%' ") .append("or ") .append("lower(identity.firstName) like '%") .append(nameOrAliasSearch) .append("%' ") .append("or ") .append("lower(identity.lastName) like '%") .append(nameOrAliasSearch) .append("%' "); } if (criteria.toString().isEmpty()) { return ""; } return criteria.insert(0, "where ").toString(); }
1,116,402
public String createCriteriaAsString(IdentityFilter filter) { StringBuilder criteria = new StringBuilder(); if (!filter.getPrincipalSearch().isEmpty()) { criteria.append("lower(identity.principal) like '%") .append(filter.getPrincipalSearch().toLowerCase()) .append("%' "); } if (!filter.getNameOrAliasSearch().isEmpty()) { String nameOrAliasSearch = filter.getNameOrAliasSearch().toLowerCase(); if (!criteria.toString().isEmpty()) { criteria.append("or "); } criteria.append("lower(identity.optionalAlias) like '%") .append(nameOrAliasSearch) .append("%' ") .append("or ") .append("lower(identity.firstName) like '%") .append(nameOrAliasSearch) .append("%' ") .append("or ") .append("lower(identity.lastName) like '%") .append(nameOrAliasSearch) .append("%' "); } if (criteria.toString().isEmpty()) { return ""; } return criteria.insert(0, "where ").toString(); }
public String createCriteriaAsString(IdentityFilter filter) { StringBuilder criteria = new StringBuilder(); if (!filter.getPrincipalSearch().isEmpty()) { criteria.append("lower(identity.principal) like '%") .append(filter.getPrincipalSearch().toLowerCase()) .append("%' "); } if (!filter.getNameOrAliasSearch().equals("")) { String nameOrAliasSearch = filter.getNameOrAliasSearch().toLowerCase(); if (!criteria.toString().isEmpty()) { criteria.append("or "); } criteria.append("lower(identity.optionalAlias) like '%") .append(nameOrAliasSearch) .append("%' ") .append("or ") .append("lower(identity.firstName) like '%") .append(nameOrAliasSearch) .append("%' ") .append("or ") .append("lower(identity.lastName) like '%") .append(nameOrAliasSearch) .append("%' "); } if (criteria.toString().isEmpty()) { return ""; } return criteria.insert(0, "where ").toString(); }
1,116,403
public String createCriteriaAsString(IdentityFilter filter) { StringBuilder criteria = new StringBuilder(); if (!filter.getPrincipalSearch().isEmpty()) { criteria.append("lower(identity.principal) like '%") .append(filter.getPrincipalSearch().toLowerCase()) .append("%' "); } if (!filter.getNameOrAliasSearch().isEmpty()) { String nameOrAliasSearch = filter.getNameOrAliasSearch().toLowerCase(); if (!criteria.toString().isEmpty()) { criteria.append("or "); } criteria.append("lower(identity.optionalAlias) like '%") .append(nameOrAliasSearch) .append("%' ") .append("or ") .append("lower(identity.firstName) like '%") .append(nameOrAliasSearch) .append("%' ") .append("or ") .append("lower(identity.lastName) like '%") .append(nameOrAliasSearch) .append("%' "); } if (criteria.toString().isEmpty()) { return ""; } return criteria.insert(0, "where ").toString(); }
public String createCriteriaAsString(IdentityFilter filter) { StringBuilder criteria = new StringBuilder(); if (!filter.getPrincipalSearch().isEmpty()) { criteria.append("lower(identity.principal) like '%") .append(filter.getPrincipalSearch().toLowerCase()) .append("%' "); } if (!filter.getNameOrAliasSearch().isEmpty()) { String nameOrAliasSearch = filter.getNameOrAliasSearch().toLowerCase(); if (!criteria.toString().equals("")) { criteria.append("or "); } criteria.append("lower(identity.optionalAlias) like '%") .append(nameOrAliasSearch) .append("%' ") .append("or ") .append("lower(identity.firstName) like '%") .append(nameOrAliasSearch) .append("%' ") .append("or ") .append("lower(identity.lastName) like '%") .append(nameOrAliasSearch) .append("%' "); } if (criteria.toString().isEmpty()) { return ""; } return criteria.insert(0, "where ").toString(); }
1,116,404
public String createCriteriaAsString(IdentityFilter filter) { StringBuilder criteria = new StringBuilder(); if (!filter.getPrincipalSearch().isEmpty()) { criteria.append("lower(identity.principal) like '%") .append(filter.getPrincipalSearch().toLowerCase()) .append("%' "); } if (!filter.getNameOrAliasSearch().isEmpty()) { String nameOrAliasSearch = filter.getNameOrAliasSearch().toLowerCase(); if (!criteria.toString().isEmpty()) { criteria.append("or "); } criteria.append("lower(identity.optionalAlias) like '%") .append(nameOrAliasSearch) .append("%' ") .append("or ") .append("lower(identity.firstName) like '%") .append(nameOrAliasSearch) .append("%' ") .append("or ") .append("lower(identity.lastName) like '%") .append(nameOrAliasSearch) .append("%' "); } if (criteria.toString().isEmpty()) { return ""; } return criteria.insert(0, "where ").toString(); }
public String createCriteriaAsString(IdentityFilter filter) { StringBuilder criteria = new StringBuilder(); if (!filter.getPrincipalSearch().isEmpty()) { criteria.append("lower(identity.principal) like '%") .append(filter.getPrincipalSearch().toLowerCase()) .append("%' "); } if (!filter.getNameOrAliasSearch().isEmpty()) { String nameOrAliasSearch = filter.getNameOrAliasSearch().toLowerCase(); if (!criteria.toString().isEmpty()) { criteria.append("or "); } criteria.append("lower(identity.optionalAlias) like '%") .append(nameOrAliasSearch) .append("%' ") .append("or ") .append("lower(identity.firstName) like '%") .append(nameOrAliasSearch) .append("%' ") .append("or ") .append("lower(identity.lastName) like '%") .append(nameOrAliasSearch) .append("%' "); } if (criteria.toString().equals("")) { return ""; } return criteria.insert(0, "where ").toString(); }
1,116,405
public boolean configure(HttpServletRequest req) { boolean r = true; int i; String[] names = req.getParameterValues("maven_name"); String[] homes = req.getParameterValues("maven_home"); int len; if(names!=null && homes!=null) len = Math.min(names.length,homes.length); else len = 0; MavenInstallation[] insts = new MavenInstallation[len]; for( i=0; i<len; i++ ) { if(names[i].length()==0) continue; insts[i] = new MavenInstallation(names[i],homes[i]); } getProperties().put("installations",insts); save(); return r; }
public boolean configure(HttpServletRequest req) { boolean r = true; int i; String[] names = req.getParameterValues("maven_name"); String[] homes = req.getParameterValues("maven_home"); int len; if(names!=null && homes!=null) len = Math.min(names.length,homes.length); else len = 0; MavenInstallation[] insts = new MavenInstallation[len]; for( i=0; i<len; i++ ) { if(Util.nullify(names[i])==null) continue; if(Util.nullify(homes[i])==null) continue; insts[i] = new MavenInstallation(names[i],homes[i]); } getProperties().put("installations",insts); save(); return r; }
1,116,406
public EditType getEditType() { // see issue #73. Can't do much better right now if(revision.equals("1.1")) return EditType.ADD; if(dead) return EditType.DELETE; return EditType.EDIT; }
public EditType getEditType() { // see issue #73. Can't do much better right now if(revision.equals("1.1")) return EditType.ADD; if(dead) return EditType.DELETE; return EditType.EDIT; }
1,116,407
public void actionPerformed(ActionEvent e) { Object o = e.getSource(); if (o == okBtn) { scaleRecipe(); setVisible(false); dispose(); } else if (o == cancelButton){ setVisible(false); dispose(); } }
public void actionPerformed(ActionEvent e) { Object o = e.getSource(); if (o == okBtn) { scaleRecipe(); setVisible(false); dispose(); } else if (o == cancelButton) { setVisible(false); dispose(); } else if (o == cancelButton){ setVisible(false); dispose(); } }
1,116,408
public void actionPerformed(ActionEvent e) { Object o = e.getSource(); if (o == okBtn) { scaleRecipe(); setVisible(false); dispose(); } else if (o == cancelButton){ setVisible(false); dispose(); } }
public void actionPerformed(ActionEvent e) { Object o = e.getSource(); if (o == okBtn) { scaleRecipe(); setVisible(false); dispose(); } else if (o == cancelButton){ setVisible(false); dispose(); } }
1,116,409
private void initGUI() { try { this.setTitle("Resize Recipe"); jPanel1 = new JPanel(); GridBagLayout jPanel1Layout = new GridBagLayout(); jPanel1Layout.rowWeights = new double[] {0.1, 0.1}; jPanel1Layout.rowHeights = new int[] {7, 7}; jPanel1Layout.columnWeights = new double[] {0.1, 0.1, 0.1}; jPanel1Layout.columnWidths = new int[] {7, 7, 7}; jPanel1.setLayout(jPanel1Layout); getContentPane().add(jPanel1, BorderLayout.CENTER); jLabel1 = new JLabel(); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("New Size:"); sizeTxt = new JTextField(); jPanel1.add(sizeTxt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); sizeTxt.setText("" + myRecipe.getPostBoilVol(myRecipe.getVolUnits())); sizeUnitsComboModel = new ComboModel(); sizeUnitsComboModel.setList(new Quantity().getListofUnits("vol")); sizeUnitsComboModel.addOrInsert(myRecipe.getVolUnits()); sizeUnitsCombo = new JComboBox(); jPanel1.add(sizeUnitsCombo, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); sizeUnitsCombo.setModel(sizeUnitsComboModel); jPanel2 = new JPanel(); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); getContentPane().add(jPanel2, BorderLayout.SOUTH); cancelButton = new JButton(); cancelButton.addActionListener(this); jPanel2.add(cancelButton); cancelButton.setText("Cancel"); okBtn = new JButton(); okBtn.addActionListener(this); jPanel2.add(okBtn); okBtn.setText("OK"); this.setSize(306, 135); } catch (Exception e) { e.printStackTrace(); } }
private void initGUI() { try { jPanel1 = new JPanel(); GridBagLayout jPanel1Layout = new GridBagLayout(); jPanel1Layout.rowWeights = new double[] {0.1, 0.1}; jPanel1Layout.rowHeights = new int[] {7, 7}; jPanel1Layout.columnWeights = new double[] {0.1, 0.1, 0.1}; jPanel1Layout.columnWidths = new int[] {7, 7, 7}; jPanel1.setLayout(jPanel1Layout); getContentPane().add(jPanel1, BorderLayout.CENTER); jLabel1 = new JLabel(); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("New Size:"); sizeTxt = new JTextField(); jPanel1.add(sizeTxt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); sizeTxt.setText("" + myRecipe.getPostBoilVol(myRecipe.getVolUnits())); sizeUnitsComboModel = new ComboModel(); sizeUnitsComboModel.setList(new Quantity().getListofUnits("vol")); sizeUnitsComboModel.addOrInsert(myRecipe.getVolUnits()); sizeUnitsCombo = new JComboBox(); jPanel1.add(sizeUnitsCombo, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); sizeUnitsCombo.setModel(sizeUnitsComboModel); jPanel2 = new JPanel(); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); getContentPane().add(jPanel2, BorderLayout.SOUTH); cancelButton = new JButton(); cancelButton.addActionListener(this); jPanel2.add(cancelButton); cancelButton.setText("Cancel"); okBtn = new JButton(); okBtn.addActionListener(this); jPanel2.add(okBtn); okBtn.setText("OK"); this.setSize(306, 135); } catch (Exception e) { e.printStackTrace(); } }
1,116,410
private void initGUI() { try { this.setTitle("Resize Recipe"); jPanel1 = new JPanel(); GridBagLayout jPanel1Layout = new GridBagLayout(); jPanel1Layout.rowWeights = new double[] {0.1, 0.1}; jPanel1Layout.rowHeights = new int[] {7, 7}; jPanel1Layout.columnWeights = new double[] {0.1, 0.1, 0.1}; jPanel1Layout.columnWidths = new int[] {7, 7, 7}; jPanel1.setLayout(jPanel1Layout); getContentPane().add(jPanel1, BorderLayout.CENTER); jLabel1 = new JLabel(); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("New Size:"); sizeTxt = new JTextField(); jPanel1.add(sizeTxt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); sizeTxt.setText("" + myRecipe.getPostBoilVol(myRecipe.getVolUnits())); sizeUnitsComboModel = new ComboModel(); sizeUnitsComboModel.setList(new Quantity().getListofUnits("vol")); sizeUnitsComboModel.addOrInsert(myRecipe.getVolUnits()); sizeUnitsCombo = new JComboBox(); jPanel1.add(sizeUnitsCombo, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); sizeUnitsCombo.setModel(sizeUnitsComboModel); jPanel2 = new JPanel(); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); getContentPane().add(jPanel2, BorderLayout.SOUTH); cancelButton = new JButton(); cancelButton.addActionListener(this); jPanel2.add(cancelButton); cancelButton.setText("Cancel"); okBtn = new JButton(); okBtn.addActionListener(this); jPanel2.add(okBtn); okBtn.setText("OK"); this.setSize(306, 135); } catch (Exception e) { e.printStackTrace(); } }
private void initGUI() { try { this.setTitle("Resize Recipe"); jPanel1 = new JPanel(); GridBagLayout jPanel1Layout = new GridBagLayout(); jPanel1Layout.rowWeights = new double[] {0.1, 0.1}; jPanel1Layout.rowHeights = new int[] {7, 7}; jPanel1Layout.columnWeights = new double[] {0.1, 0.1, 0.1}; jPanel1Layout.columnWidths = new int[] {7, 7, 7}; jPanel1.setLayout(jPanel1Layout); getContentPane().add(jPanel1, BorderLayout.CENTER); jLabel1 = new JLabel(); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("New Size:"); sizeTxt = new JTextField(); jPanel1.add(sizeTxt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); sizeTxt.setText("" + myRecipe.getPostBoilVol(myRecipe.getVolUnits())); sizeUnitsComboModel = new ComboModel(); sizeUnitsComboModel.setList(new Quantity().getListofUnits("vol")); sizeUnitsComboModel.addOrInsert(myRecipe.getVolUnits()); sizeUnitsCombo = new JComboBox(); jPanel1.add(sizeUnitsCombo, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); sizeUnitsCombo.setModel(sizeUnitsComboModel); jPanel2 = new JPanel(); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); getContentPane().add(jPanel2, BorderLayout.SOUTH); cancelButton = new JButton(); cancelButton.addActionListener(this); jPanel2.add(cancelButton); cancelButton.setText("Cancel"); okBtn = new JButton(); okBtn.addActionListener(this); jPanel2.add(okBtn); okBtn.setText("OK"); this.setSize(306, 135); } catch (Exception e) { e.printStackTrace(); } }
1,116,411
private void initGUI() { try { this.setTitle("Resize Recipe"); jPanel1 = new JPanel(); GridBagLayout jPanel1Layout = new GridBagLayout(); jPanel1Layout.rowWeights = new double[] {0.1, 0.1}; jPanel1Layout.rowHeights = new int[] {7, 7}; jPanel1Layout.columnWeights = new double[] {0.1, 0.1, 0.1}; jPanel1Layout.columnWidths = new int[] {7, 7, 7}; jPanel1.setLayout(jPanel1Layout); getContentPane().add(jPanel1, BorderLayout.CENTER); jLabel1 = new JLabel(); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("New Size:"); sizeTxt = new JTextField(); jPanel1.add(sizeTxt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); sizeTxt.setText("" + myRecipe.getPostBoilVol(myRecipe.getVolUnits())); sizeUnitsComboModel = new ComboModel(); sizeUnitsComboModel.setList(new Quantity().getListofUnits("vol")); sizeUnitsComboModel.addOrInsert(myRecipe.getVolUnits()); sizeUnitsCombo = new JComboBox(); jPanel1.add(sizeUnitsCombo, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); sizeUnitsCombo.setModel(sizeUnitsComboModel); jPanel2 = new JPanel(); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); getContentPane().add(jPanel2, BorderLayout.SOUTH); cancelButton = new JButton(); cancelButton.addActionListener(this); jPanel2.add(cancelButton); cancelButton.setText("Cancel"); okBtn = new JButton(); okBtn.addActionListener(this); jPanel2.add(okBtn); okBtn.setText("OK"); this.setSize(306, 135); } catch (Exception e) { e.printStackTrace(); } }
private void initGUI() { try { this.setTitle("Resize Recipe"); jPanel1 = new JPanel(); GridBagLayout jPanel1Layout = new GridBagLayout(); jPanel1Layout.rowWeights = new double[] {0.1, 0.1}; jPanel1Layout.rowHeights = new int[] {7, 7}; jPanel1Layout.columnWeights = new double[] {0.1, 0.1, 0.1}; jPanel1Layout.columnWidths = new int[] {7, 7, 7}; jPanel1.setLayout(jPanel1Layout); getContentPane().add(jPanel1, BorderLayout.CENTER); jLabel1 = new JLabel(); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("New Size:"); sizeTxt = new JTextField(); jPanel1.add(sizeTxt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); sizeTxt.setText("" + myRecipe.getPostBoilVol(myRecipe.getVolUnits())); sizeUnitsComboModel = new ComboModel(); sizeUnitsComboModel.setList(new Quantity().getListofUnits("vol")); sizeUnitsComboModel.addOrInsert(myRecipe.getVolUnits()); sizeUnitsCombo = new JComboBox(); jPanel1.add(sizeUnitsCombo, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); sizeUnitsCombo.setModel(sizeUnitsComboModel); jPanel2 = new JPanel(); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); getContentPane().add(jPanel2, BorderLayout.SOUTH); cancelButton = new JButton(); cancelButton.addActionListener(this); jPanel2.add(cancelButton); cancelButton.setText("Cancel"); okBtn = new JButton(); okBtn.addActionListener(this); jPanel2.add(okBtn); okBtn.setText("OK"); this.setSize(306, 135); } catch (Exception e) { e.printStackTrace(); } }
1,116,412
private void initGUI() { try { this.setTitle("Resize Recipe"); jPanel1 = new JPanel(); GridBagLayout jPanel1Layout = new GridBagLayout(); jPanel1Layout.rowWeights = new double[] {0.1, 0.1}; jPanel1Layout.rowHeights = new int[] {7, 7}; jPanel1Layout.columnWeights = new double[] {0.1, 0.1, 0.1}; jPanel1Layout.columnWidths = new int[] {7, 7, 7}; jPanel1.setLayout(jPanel1Layout); getContentPane().add(jPanel1, BorderLayout.CENTER); jLabel1 = new JLabel(); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("New Size:"); sizeTxt = new JTextField(); jPanel1.add(sizeTxt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); sizeTxt.setText("" + myRecipe.getPostBoilVol(myRecipe.getVolUnits())); sizeUnitsComboModel = new ComboModel(); sizeUnitsComboModel.setList(new Quantity().getListofUnits("vol")); sizeUnitsComboModel.addOrInsert(myRecipe.getVolUnits()); sizeUnitsCombo = new JComboBox(); jPanel1.add(sizeUnitsCombo, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); sizeUnitsCombo.setModel(sizeUnitsComboModel); jPanel2 = new JPanel(); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); getContentPane().add(jPanel2, BorderLayout.SOUTH); cancelButton = new JButton(); cancelButton.addActionListener(this); jPanel2.add(cancelButton); cancelButton.setText("Cancel"); okBtn = new JButton(); okBtn.addActionListener(this); jPanel2.add(okBtn); okBtn.setText("OK"); this.setSize(306, 135); } catch (Exception e) { e.printStackTrace(); } }
private void initGUI() { try { this.setTitle("Resize Recipe"); jPanel1 = new JPanel(); GridBagLayout jPanel1Layout = new GridBagLayout(); jPanel1Layout.rowWeights = new double[] {0.1, 0.1}; jPanel1Layout.rowHeights = new int[] {7, 7}; jPanel1Layout.columnWeights = new double[] {0.1, 0.1, 0.1}; jPanel1Layout.columnWidths = new int[] {7, 7, 7}; jPanel1.setLayout(jPanel1Layout); getContentPane().add(jPanel1, BorderLayout.CENTER); jLabel1 = new JLabel(); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("New Size:"); sizeTxt = new JTextField(); jPanel1.add(sizeTxt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); sizeTxt.setText("" + myRecipe.getPostBoilVol(myRecipe.getVolUnits())); sizeUnitsComboModel = new ComboModel(); sizeUnitsComboModel.setList(new Quantity().getListofUnits("vol")); sizeUnitsComboModel.addOrInsert(myRecipe.getVolUnits()); sizeUnitsCombo = new JComboBox(); jPanel1.add(sizeUnitsCombo, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); sizeUnitsCombo.setModel(sizeUnitsComboModel); jPanel2 = new JPanel(); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); getContentPane().add(jPanel2, BorderLayout.SOUTH); cancelButton = new JButton(); cancelButton.addActionListener(this); jPanel2.add(cancelButton); cancelButton.setText("Cancel"); okBtn = new JButton(); okBtn.addActionListener(this); jPanel2.add(okBtn); okBtn.setText("OK"); this.setSize(306, 135); } catch (Exception e) { e.printStackTrace(); } }
1,116,413
private void initGUI() { try { this.setTitle("Resize Recipe"); jPanel1 = new JPanel(); GridBagLayout jPanel1Layout = new GridBagLayout(); jPanel1Layout.rowWeights = new double[] {0.1, 0.1}; jPanel1Layout.rowHeights = new int[] {7, 7}; jPanel1Layout.columnWeights = new double[] {0.1, 0.1, 0.1}; jPanel1Layout.columnWidths = new int[] {7, 7, 7}; jPanel1.setLayout(jPanel1Layout); getContentPane().add(jPanel1, BorderLayout.CENTER); jLabel1 = new JLabel(); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("New Size:"); sizeTxt = new JTextField(); jPanel1.add(sizeTxt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); sizeTxt.setText("" + myRecipe.getPostBoilVol(myRecipe.getVolUnits())); sizeUnitsComboModel = new ComboModel(); sizeUnitsComboModel.setList(new Quantity().getListofUnits("vol")); sizeUnitsComboModel.addOrInsert(myRecipe.getVolUnits()); sizeUnitsCombo = new JComboBox(); jPanel1.add(sizeUnitsCombo, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); sizeUnitsCombo.setModel(sizeUnitsComboModel); jPanel2 = new JPanel(); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); getContentPane().add(jPanel2, BorderLayout.SOUTH); cancelButton = new JButton(); cancelButton.addActionListener(this); jPanel2.add(cancelButton); cancelButton.setText("Cancel"); okBtn = new JButton(); okBtn.addActionListener(this); jPanel2.add(okBtn); okBtn.setText("OK"); this.setSize(306, 135); } catch (Exception e) { e.printStackTrace(); } }
private void initGUI() { try { this.setTitle("Resize Recipe"); jPanel1 = new JPanel(); GridBagLayout jPanel1Layout = new GridBagLayout(); jPanel1Layout.rowWeights = new double[] {0.1, 0.1}; jPanel1Layout.rowHeights = new int[] {7, 7}; jPanel1Layout.columnWeights = new double[] {0.1, 0.1, 0.1}; jPanel1Layout.columnWidths = new int[] {7, 7, 7}; jPanel1.setLayout(jPanel1Layout); getContentPane().add(jPanel1, BorderLayout.CENTER); jLabel1 = new JLabel(); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("New Size:"); sizeTxt = new JTextField(); jPanel1.add(sizeTxt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); sizeTxt.setText("" + myRecipe.getPostBoilVol(myRecipe.getVolUnits())); sizeUnitsComboModel = new ComboModel(); sizeUnitsComboModel.setList(new Quantity().getListofUnits("vol")); sizeUnitsComboModel.addOrInsert(myRecipe.getVolUnits()); sizeUnitsCombo = new JComboBox(); jPanel1.add(sizeUnitsCombo, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); sizeUnitsCombo.setModel(sizeUnitsComboModel); jPanel2 = new JPanel(); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); getContentPane().add(jPanel2, BorderLayout.SOUTH); cancelButton = new JButton(); cancelButton.addActionListener(this); jPanel2.add(cancelButton); cancelButton.setText("Cancel"); okBtn = new JButton(); okBtn.addActionListener(this); jPanel2.add(okBtn); okBtn.setText("OK"); this.setSize(306, 135); } catch (Exception e) { e.printStackTrace(); } }
1,116,414
private void initGUI() { try { this.setTitle("Resize Recipe"); jPanel1 = new JPanel(); GridBagLayout jPanel1Layout = new GridBagLayout(); jPanel1Layout.rowWeights = new double[] {0.1, 0.1}; jPanel1Layout.rowHeights = new int[] {7, 7}; jPanel1Layout.columnWeights = new double[] {0.1, 0.1, 0.1}; jPanel1Layout.columnWidths = new int[] {7, 7, 7}; jPanel1.setLayout(jPanel1Layout); getContentPane().add(jPanel1, BorderLayout.CENTER); jLabel1 = new JLabel(); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("New Size:"); sizeTxt = new JTextField(); jPanel1.add(sizeTxt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); sizeTxt.setText("" + myRecipe.getPostBoilVol(myRecipe.getVolUnits())); sizeUnitsComboModel = new ComboModel(); sizeUnitsComboModel.setList(new Quantity().getListofUnits("vol")); sizeUnitsComboModel.addOrInsert(myRecipe.getVolUnits()); sizeUnitsCombo = new JComboBox(); jPanel1.add(sizeUnitsCombo, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); sizeUnitsCombo.setModel(sizeUnitsComboModel); jPanel2 = new JPanel(); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); getContentPane().add(jPanel2, BorderLayout.SOUTH); cancelButton = new JButton(); cancelButton.addActionListener(this); jPanel2.add(cancelButton); cancelButton.setText("Cancel"); okBtn = new JButton(); okBtn.addActionListener(this); jPanel2.add(okBtn); okBtn.setText("OK"); this.setSize(306, 135); } catch (Exception e) { e.printStackTrace(); } }
private void initGUI() { try { this.setTitle("Resize Recipe"); jPanel1 = new JPanel(); GridBagLayout jPanel1Layout = new GridBagLayout(); jPanel1Layout.rowWeights = new double[] {0.1, 0.1}; jPanel1Layout.rowHeights = new int[] {7, 7}; jPanel1Layout.columnWeights = new double[] {0.1, 0.1, 0.1}; jPanel1Layout.columnWidths = new int[] {7, 7, 7}; jPanel1.setLayout(jPanel1Layout); getContentPane().add(jPanel1, BorderLayout.CENTER); jLabel1 = new JLabel(); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("New Size:"); sizeTxt = new JTextField(); jPanel1.add(sizeTxt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); sizeTxt.setText("" + myRecipe.getPostBoilVol(myRecipe.getVolUnits())); sizeUnitsComboModel = new ComboModel(); sizeUnitsComboModel.setList(new Quantity().getListofUnits("vol")); sizeUnitsComboModel.addOrInsert(myRecipe.getVolUnits()); sizeUnitsCombo = new JComboBox(); jPanel1.add(sizeUnitsCombo, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); sizeUnitsCombo.setModel(sizeUnitsComboModel); jPanel2 = new JPanel(); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); getContentPane().add(jPanel2, BorderLayout.SOUTH); cancelButton = new JButton(); cancelButton.addActionListener(this); jPanel2.add(cancelButton); cancelButton.setText("Cancel"); okBtn = new JButton(); okBtn.addActionListener(this); jPanel2.add(okBtn); okBtn.setText("OK"); this.setSize(306, 135); } catch (Exception e) { e.printStackTrace(); } }
1,116,415
private void initGUI() { try { this.setTitle("Resize Recipe"); jPanel1 = new JPanel(); GridBagLayout jPanel1Layout = new GridBagLayout(); jPanel1Layout.rowWeights = new double[] {0.1, 0.1}; jPanel1Layout.rowHeights = new int[] {7, 7}; jPanel1Layout.columnWeights = new double[] {0.1, 0.1, 0.1}; jPanel1Layout.columnWidths = new int[] {7, 7, 7}; jPanel1.setLayout(jPanel1Layout); getContentPane().add(jPanel1, BorderLayout.CENTER); jLabel1 = new JLabel(); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("New Size:"); sizeTxt = new JTextField(); jPanel1.add(sizeTxt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); sizeTxt.setText("" + myRecipe.getPostBoilVol(myRecipe.getVolUnits())); sizeUnitsComboModel = new ComboModel(); sizeUnitsComboModel.setList(new Quantity().getListofUnits("vol")); sizeUnitsComboModel.addOrInsert(myRecipe.getVolUnits()); sizeUnitsCombo = new JComboBox(); jPanel1.add(sizeUnitsCombo, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); sizeUnitsCombo.setModel(sizeUnitsComboModel); jPanel2 = new JPanel(); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); getContentPane().add(jPanel2, BorderLayout.SOUTH); cancelButton = new JButton(); cancelButton.addActionListener(this); jPanel2.add(cancelButton); cancelButton.setText("Cancel"); okBtn = new JButton(); okBtn.addActionListener(this); jPanel2.add(okBtn); okBtn.setText("OK"); this.setSize(306, 135); } catch (Exception e) { e.printStackTrace(); } }
private void initGUI() { try { this.setTitle("Resize Recipe"); jPanel1 = new JPanel(); GridBagLayout jPanel1Layout = new GridBagLayout(); jPanel1Layout.rowWeights = new double[] {0.1, 0.1}; jPanel1Layout.rowHeights = new int[] {7, 7}; jPanel1Layout.columnWeights = new double[] {0.1, 0.1, 0.1}; jPanel1Layout.columnWidths = new int[] {7, 7, 7}; jPanel1.setLayout(jPanel1Layout); getContentPane().add(jPanel1, BorderLayout.CENTER); jLabel1 = new JLabel(); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("New Size:"); sizeTxt = new JTextField(); jPanel1.add(sizeTxt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); sizeTxt.setText("" + myRecipe.getPostBoilVol(myRecipe.getVolUnits())); sizeUnitsComboModel = new ComboModel(); sizeUnitsComboModel.setList(new Quantity().getListofUnits("vol")); sizeUnitsComboModel.addOrInsert(myRecipe.getVolUnits()); sizeUnitsCombo = new JComboBox(); jPanel1.add(sizeUnitsCombo, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); sizeUnitsCombo.setModel(sizeUnitsComboModel); jPanel2 = new JPanel(); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); getContentPane().add(jPanel2, BorderLayout.SOUTH); cancelButton = new JButton(); cancelButton.addActionListener(this); jPanel2.add(cancelButton); cancelButton.setText("Cancel"); okBtn = new JButton(); okBtn.addActionListener(this); jPanel2.add(okBtn); okBtn.setText("OK"); this.setSize(306, 135); } catch (Exception e) { e.printStackTrace(); } }
1,116,416
public void run(Stack inStack) throws ParseException { checkStack(inStack);// check the stack Object param2 = inStack.pop(); Object param1 = inStack.pop(); if ((param1 instanceof Number) && (param2 instanceof Number)) { double x = ((Number)param1).doubleValue(); double y = ((Number)param2).doubleValue(); int r; switch (id) { case LT: r = (x<y) ? 1 : 0; break; case GT: r = (x>y) ? 1 : 0; break; case LE: r = (x<=y) ? 1 : 0; break; case GE: r = (x>=y) ? 1 : 0; break; case NE: r = (x!=y) ? 1 : 0; break; case EQ: r = (x==y) ? 1 : 0; break; default: throw new ParseException("Unknown relational operator"); } inStack.push(new Double(r));//push the result on the inStack } else if ((param1 instanceof Complex) && (param2 instanceof Complex)) { int r; switch (id) { case NE: r = ((Complex)param1).equals((Complex)param2,tolerance) ? 0 : 1; break; case EQ: r = ((Complex)param1).equals((Complex)param2,tolerance) ? 1 : 0; break; default: throw new ParseException("Relational operator type error"); } inStack.push(new Double(r));//push the result on the inStack } else if ((param1 instanceof String) && (param2 instanceof String)) { int r; switch (id) { case NE: r = ((String)param1).equals((String)param2) ? 0 : 1; break; case EQ: r = ((String)param1).equals((String)param2) ? 1 : 0; break; default: throw new ParseException("Relational operator type error"); } inStack.push(new Double(r));//push the result on the inStack } else { throw new ParseException("Invalid parameter type"); } return; }
public void run(Stack inStack) throws ParseException { checkStack(inStack);// check the stack Object param2 = inStack.pop(); Object param1 = inStack.pop(); if ((param1 instanceof Complex) && (param2 instanceof Complex)) { int r; switch (id) { case NE: r = ((Complex)param1).equals((Complex)param2,tolerance) ? 0 : 1; break; case EQ: r = ((Complex)param1).equals((Complex)param2,tolerance) ? 1 : 0; break; default: throw new ParseException("Relational operator type error"); } inStack.push(new Double(r)); } else if ((param1 instanceof Number) && (param2 instanceof Number)) { double x = ((Number)param1).doubleValue(); double y = ((Number)param2).doubleValue(); int r; switch (id) { case LT: r = (x<y) ? 1 : 0; break; case GT: r = (x>y) ? 1 : 0; break; case LE: r = (x<=y) ? 1 : 0; break; case GE: r = (x>=y) ? 1 : 0; break; case NE: r = (x!=y) ? 1 : 0; break; case EQ: r = (x==y) ? 1 : 0; break; default: throw new ParseException("Unknown relational operator"); } inStack.push(new Double(r));//push the result on the inStack } else if ((param1 instanceof Complex) && (param2 instanceof Complex)) { int r; switch (id) { case NE: r = ((Complex)param1).equals((Complex)param2,tolerance) ? 0 : 1; break; case EQ: r = ((Complex)param1).equals((Complex)param2,tolerance) ? 1 : 0; break; default: throw new ParseException("Relational operator type error"); } inStack.push(new Double(r));//push the result on the inStack } else if ((param1 instanceof String) && (param2 instanceof String)) { int r; switch (id) { case NE: r = ((String)param1).equals((String)param2) ? 0 : 1; break; case EQ: r = ((String)param1).equals((String)param2) ? 1 : 0; break; default: throw new ParseException("Relational operator type error"); } inStack.push(new Double(r));//push the result on the inStack } else { throw new ParseException("Invalid parameter type"); } return; }
1,116,418
public void run(Stack inStack) throws ParseException { checkStack(inStack);// check the stack Object param2 = inStack.pop(); Object param1 = inStack.pop(); if ((param1 instanceof Number) && (param2 instanceof Number)) { double x = ((Number)param1).doubleValue(); double y = ((Number)param2).doubleValue(); int r; switch (id) { case LT: r = (x<y) ? 1 : 0; break; case GT: r = (x>y) ? 1 : 0; break; case LE: r = (x<=y) ? 1 : 0; break; case GE: r = (x>=y) ? 1 : 0; break; case NE: r = (x!=y) ? 1 : 0; break; case EQ: r = (x==y) ? 1 : 0; break; default: throw new ParseException("Unknown relational operator"); } inStack.push(new Double(r));//push the result on the inStack } else if ((param1 instanceof Complex) && (param2 instanceof Complex)) { int r; switch (id) { case NE: r = ((Complex)param1).equals((Complex)param2,tolerance) ? 0 : 1; break; case EQ: r = ((Complex)param1).equals((Complex)param2,tolerance) ? 1 : 0; break; default: throw new ParseException("Relational operator type error"); } inStack.push(new Double(r));//push the result on the inStack } else if ((param1 instanceof String) && (param2 instanceof String)) { int r; switch (id) { case NE: r = ((String)param1).equals((String)param2) ? 0 : 1; break; case EQ: r = ((String)param1).equals((String)param2) ? 1 : 0; break; default: throw new ParseException("Relational operator type error"); } inStack.push(new Double(r));//push the result on the inStack } else { throw new ParseException("Invalid parameter type"); } return; }
public void run(Stack inStack) throws ParseException { checkStack(inStack);// check the stack Object param2 = inStack.pop(); Object param1 = inStack.pop(); if ((param1 instanceof Number) && (param2 instanceof Number)) { double x = ((Number)param1).doubleValue(); double y = ((Number)param2).doubleValue(); int r; switch (id) { case LT: r = (x<y) ? 1 : 0; break; case GT: r = (x>y) ? 1 : 0; break; case LE: r = (x<=y) ? 1 : 0; break; case GE: r = (x>=y) ? 1 : 0; break; case NE: r = (x!=y) ? 1 : 0; break; case EQ: r = (x==y) ? 1 : 0; break; default: throw new ParseException("Unknown relational operator"); } inStack.push(new Double(r));//push the result on the inStack } else if ((param1 instanceof Complex) && (param2 instanceof Complex)) { int r; switch (id) { case NE: r = ((Complex)param1).equals((Complex)param2,tolerance) ? 0 : 1; break; case EQ: r = ((Complex)param1).equals((Complex)param2,tolerance) ? 1 : 0; break; default: throw new ParseException("Relational operator type error"); } inStack.push(new Double(r));//push the result on the inStack } else if ((param1 instanceof String) && (param2 instanceof String)) { int r; switch (id) { case NE: r = ((String)param1).equals((String)param2) ? 0 : 1; break; case EQ: r = ((String)param1).equals((String)param2) ? 1 : 0; break; default: throw new ParseException("Relational operator type error"); } inStack.push(new Double(r));//push the result on the inStack } else { throw new ParseException("Invalid parameter type"); } return; }
1,116,419
public Dimensions calcDim(Dimensions ldim,Dimensions rdim) { if(ldim.equals(rdim)) return ldim; else return null; }
public Dimensions calcDim(Dimensions ldim,Dimensions rdim) { if(ldim.equals(rdim)) return ldim; return null; }
1,116,420
public SubversionChangeLogSet parse(File changelogFile) throws IOException, SAXException { // http://svn.collab.net/repos/svn/trunk/subversion/svn/schema/ Digester digester = new Digester(); ArrayList<LogEntry> r = new ArrayList<LogEntry>(); digester.push(r); digester.addObjectCreate("*/logentry", LogEntry.class); digester.addSetProperties("*/logentry"); digester.addBeanPropertySetter("*/logentry/author"); digester.addBeanPropertySetter("*/logentry/date"); digester.addBeanPropertySetter("*/logentry/msg"); digester.addSetNext("*/logentry","add"); digester.addObjectCreate("*/logentry/paths/path", Path.class); digester.addSetProperties("*/logentry/paths/path"); digester.addBeanPropertySetter("*/logentry/paths/path","value"); digester.addSetNext("*/logentry/paths/path","addPath"); digester.parse(changelogFile); return new SubversionChangeLogSet(r); }
public SubversionChangeLogSet parse(Build build, File changelogFile) throws IOException, SAXException { // http://svn.collab.net/repos/svn/trunk/subversion/svn/schema/ Digester digester = new Digester(); ArrayList<LogEntry> r = new ArrayList<LogEntry>(); digester.push(r); digester.addObjectCreate("*/logentry", LogEntry.class); digester.addSetProperties("*/logentry"); digester.addBeanPropertySetter("*/logentry/author"); digester.addBeanPropertySetter("*/logentry/date"); digester.addBeanPropertySetter("*/logentry/msg"); digester.addSetNext("*/logentry","add"); digester.addObjectCreate("*/logentry/paths/path", Path.class); digester.addSetProperties("*/logentry/paths/path"); digester.addBeanPropertySetter("*/logentry/paths/path","value"); digester.addSetNext("*/logentry/paths/path","addPath"); digester.parse(changelogFile); return new SubversionChangeLogSet(r); }
1,116,421
public SubversionChangeLogSet parse(File changelogFile) throws IOException, SAXException { // http://svn.collab.net/repos/svn/trunk/subversion/svn/schema/ Digester digester = new Digester(); ArrayList<LogEntry> r = new ArrayList<LogEntry>(); digester.push(r); digester.addObjectCreate("*/logentry", LogEntry.class); digester.addSetProperties("*/logentry"); digester.addBeanPropertySetter("*/logentry/author"); digester.addBeanPropertySetter("*/logentry/date"); digester.addBeanPropertySetter("*/logentry/msg"); digester.addSetNext("*/logentry","add"); digester.addObjectCreate("*/logentry/paths/path", Path.class); digester.addSetProperties("*/logentry/paths/path"); digester.addBeanPropertySetter("*/logentry/paths/path","value"); digester.addSetNext("*/logentry/paths/path","addPath"); digester.parse(changelogFile); return new SubversionChangeLogSet(r); }
public SubversionChangeLogSet parse(File changelogFile) throws IOException, SAXException { // http://svn.collab.net/repos/svn/trunk/subversion/svn/schema/ Digester digester = new Digester(); ArrayList<LogEntry> r = new ArrayList<LogEntry>(); digester.push(r); digester.addObjectCreate("*/logentry", LogEntry.class); digester.addSetProperties("*/logentry"); digester.addBeanPropertySetter("*/logentry/author"); digester.addBeanPropertySetter("*/logentry/date"); digester.addBeanPropertySetter("*/logentry/msg"); digester.addSetNext("*/logentry","add"); digester.addObjectCreate("*/logentry/paths/path", Path.class); digester.addSetProperties("*/logentry/paths/path"); digester.addBeanPropertySetter("*/logentry/paths/path","value"); digester.addSetNext("*/logentry/paths/path","addPath"); digester.parse(changelogFile); return new SubversionChangeLogSet(build,r); }
1,116,422
public void testGrantedAuthorities() { int i = 4, e = 3, d = 4, s = 3; List<UserRole> userRoleList = AuthorizationTestSupport.createUserRoleList(i, e, d, s); User user = userRoleList.get((int) Math.random()*userRoleList.size()).getUser(); Credential credential = AuthenticationDaoImplTests.createAndPersistCredential(null); user.setIdentity(credential.getIdentity()); UserDetailsAdapter userDetails = new UserDetailsAdapter(user, credential); GrantedAuthority[] authorities = userDetails.getAuthorities(); assertEquals(i*s, authorities.length); List<GrantedAuthority> list = Arrays.asList(authorities); for (UserRole ur: user.getRoles()) { String roleName = userDetails.convertUserRoleToString(ur); assertTrue(list.contains(new GrantedAuthorityImpl(roleName))); } }
public void testGrantedAuthorities() { int i = 4, e = 3, d = 4, s = 3; List<UserRole> userRoleList = AuthorizationTestSupport.createUserRoleList(i, e, d, s); User user = (User) userRoleList.get((int) Math.random()*userRoleList.size()).getUserGroup(); Credential credential = AuthenticationDaoImplTests.createAndPersistCredential(null); user.setIdentity(credential.getIdentity()); UserDetailsAdapter userDetails = new UserDetailsAdapter(user, credential); GrantedAuthority[] authorities = userDetails.getAuthorities(); assertEquals(i*s, authorities.length); List<GrantedAuthority> list = Arrays.asList(authorities); for (UserRole ur: user.getRoles()) { String roleName = userDetails.convertUserRoleToString(ur); assertTrue(list.contains(new GrantedAuthorityImpl(roleName))); } }
1,116,423
public boolean isPositive() { try { return ((Double) value).compareTo(pc.zero) > 0; } catch(Exception e) { return false; } }
public boolean isPositive() { try { return ((Double) value).compareTo((Double) pc.zero) > 0; } catch(Exception e) { return false; } }
1,116,425
public void testDoublePut() throws NotFound, SQLException { assertEquals(table.put(TimeUtils.future.getFissuresTime()), table.put(TimeUtils.future.getFissuresTime())); }
public void testDoublePut() throws SQLException { assertEquals(table.put(TimeUtils.future.getFissuresTime()), table.put(TimeUtils.future.getFissuresTime())); }
1,116,426
public void testUserRoleFactory() { Service service = new Service(); User user = new User(); UserRole userRole = AuthorizationCreator.userRoleFactory(user, service, "EXT"); assertSame(service, userRole.getService()); assertSame(user, userRole.getUser()); assertEquals("EXT", userRole.getServiceExtension()); assertTrue(user.getRoles().contains(userRole)); }
public void testUserRoleFactory() { Service service = new Service(); User user = new User(); UserRole userRole = AuthorizationCreator.userRoleFactory(user, service, "EXT"); assertSame(service, userRole.getService()); assertSame(user, userRole.getUserGroup()); assertEquals("EXT", userRole.getServiceExtension()); assertTrue(user.getRoles().contains(userRole)); }
1,116,427
public MashStep(String t, double st, double et, String tu, String m, int min, int rmin) { type = t; startTemp = st; endTemp = et; tempU = tu; method = m; minutes = min; rampMin = rmin; }
public MashStep(String t, double st, double et, String m, int min, int rmin) { type = t; startTemp = st; endTemp = et; tempU = tu; method = m; minutes = min; rampMin = rmin; }
1,116,428
public MashStep(String t, double st, double et, String tu, String m, int min, int rmin) { type = t; startTemp = st; endTemp = et; tempU = tu; method = m; minutes = min; rampMin = rmin; }
public MashStep(String t, double st, double et, String tu, String m, int min, int rmin) { type = t; startTemp = st; endTemp = et; tempU = tu; method = m; minutes = min; rampMin = rmin; }
1,116,429
public Mash(){ Options opts = new Options("mash"); mashRatio = opts.getDProperty("optMashRatio"); mashRatioU = opts.getProperty("optMashRatioU");; tempUnits = opts.getProperty("optMashTempU"); volUnits = opts.getProperty("optMashVolU"); grainTemp = opts.getDProperty("optGrainTemp"); boilTempF = opts.getDProperty("optBoilTempF"); }
public Mash(){ Options opts = new Options("mash"); mashRatio = opts.getDProperty("optMashRatio"); mashRatioU = opts.getProperty("optMashRatioU");; tempUnits = opts.getProperty("optMashTempU"); volUnits = opts.getProperty("optMashVolU"); grainTempF = opts.getDProperty("optGrainTemp"); boilTempF = opts.getDProperty("optBoilTempF"); }
1,116,430
public void addStep(String type, double st, double et, String tu, String m, int min, int rmin) { MashStep step = new MashStep(type, st, et, tu, m, min, rmin); steps.add(step); calcMashSchedule(); }
public void addStep(String type, double st, double et, String m, int min, int rmin) { MashStep step = new MashStep(type, st, et, tu, m, min, rmin); steps.add(step); calcMashSchedule(); }
1,116,431
public void addStep(String type, double st, double et, String tu, String m, int min, int rmin) { MashStep step = new MashStep(type, st, et, tu, m, min, rmin); steps.add(step); calcMashSchedule(); }
public void addStep(String type, double st, double et, String tu, String m, int min, int rmin) { MashStep step = new MashStep(type, st, et, m, min, rmin); steps.add(step); calcMashSchedule(); }
1,116,432
private double cToF(double tempC) { // routine to convert Celcius to Farenheit return ((tempC * 9) / 5) + 32; }
public static double cToF(double tempC) { // routine to convert Celcius to Farenheit return ((tempC * 9) / 5) + 32; }
1,116,433
public void calcMashSchedule() { // Method to run through the mash table and calculate values double strikeTemp = 0; double targetTemp = 0; double endTemp = 0; double waterAddedQTS = 0; double waterEquiv = 0; double mr = mashRatio; double currentTemp = grainTemp; double displTemp = 0; double tunLoss = tunLossF; // figure out a better way to do this, eg: themal mass double decoct = 0; int totalMashTime = 0; double totalSpargeTime = 0; double mashWaterQTS = 0; double mashVolQTS = 0; String stepType; int numSparge = 0; // convert mash ratio to qts/lb if in l/kg if (mashRatioU.equalsIgnoreCase("l/kg")) { mr *= 0.479325; } // convert CurrentTemp to F if (mashTempU == "C") { currentTemp = cToF(currentTemp); tunLoss = cToF(tunLossF); } // perform calcs on first record if (steps.isEmpty()) return; // sort the list Collections.sort(steps, new stepComparator()); MashStep stp = ((MashStep) steps.get(0)); targetTemp = stp.startTemp; endTemp = stp.endTemp; strikeTemp = calcStrikeTemp(targetTemp, currentTemp, mr, tunLoss); waterAddedQTS = mr * maltWeightLbs; waterEquiv = maltWeightLbs * (0.192 + mr); mashVolQTS = calcMashVol(maltWeightLbs, mr); totalMashTime += stp.minutes; mashWaterQTS += waterAddedQTS; stp.infuseVol.setUnits("qt"); stp.infuseVol.setAmount(waterAddedQTS); stp.method = "infusion"; // subtract the water added from the Water Equiv so that they are correct when added in the next part of the loop waterEquiv -= waterAddedQTS; // Updated the water added if (tempUnits == "C") strikeTemp = fToC(strikeTemp); stp.directions = "Mash in with " + df1.format(stp.infuseVol.getValueAs(volUnits)) + " " + volUnits + " of water at " + df1.format(strikeTemp) + " " + tempUnits; // set TargetTemp to the end temp targetTemp = stp.endTemp; for (int i = 1; i < steps.size(); i++) { stp = ((MashStep) steps.get(i)); currentTemp = targetTemp; // switch targetTemp = stp.startTemp; // do calcs if (stp.method.equals("infusion")) { // calculate an infusion step decoct = 0; waterEquiv += waterAddedQTS; // add previous addition to get WE strikeTemp = boilTempF; // boiling water // Updated the water added waterAddedQTS = calcWaterAddition(targetTemp, currentTemp, waterEquiv, boilTempF); stp.infuseVol.setUnits("qt"); stp.infuseVol.setAmount(waterAddedQTS); if (tempUnits == "C") strikeTemp = 100; stp.directions = "Add " + df1.format(stp.infuseVol.getValueAs(volUnits)) + " " + volUnits + " of water at " + df1.format(strikeTemp) + " " + tempUnits; mashWaterQTS += waterAddedQTS; mashVolQTS += waterAddedQTS; } else if (stp.method.indexOf("decoction") > 0) { // calculate a decoction step waterEquiv += waterAddedQTS; // add previous addition to get WE waterAddedQTS = 0; strikeTemp = boilTempF; // boiling water double ratio=0.75; if (stp.method.indexOf("thick") > 0) ratio = 0.6; else if (stp.method.indexOf("thin") > 0) ratio = 0.9; // Calculate volume (qts) of mash to remove decoct = calcDecoction2(targetTemp, currentTemp, mashWaterQTS, ratio); stp.decoctVol.setUnits("qt"); stp.decoctVol.setAmount(decoct); // Updated the decoction, convert to right units & make directions stp.directions = "Remove " + df1.format(stp.decoctVol.getValueAs(volUnits)) + " " + volUnits + " of mash, boil, and return to mash."; } else if (stp.method.equals("direct")) { // calculate a direct heat step decoct = 0; waterEquiv += waterAddedQTS; // add previous addition to get WE waterAddedQTS = 0; stp.directions = "Add direct heat until mash reaches " + displTemp + " " + tempUnits + "."; } if (stp.method.equals("sparge")) { // Count it numSparge++; } else totalMashTime += stp.minutes; stp.infuseVol.setUnits("qt"); stp.infuseVol.setAmount(waterAddedQTS); stp.decoctVol.setUnits("qt"); stp.decoctVol.setAmount(decoct); // set target temp to end temp for next step targetTemp = stp.endTemp; } // while not eof waterEquiv += waterAddedQTS; // add previous addition to get WE totalTime = totalMashTime; volQts = mashVolQTS; // water use stats: absorbedQTS = maltWeightLbs * 0.55; // figure from HBD // spargeTotalQTS = (myRecipe.getPreBoilVol("qt")) - (mashWaterQTS - absorbedQTS); totalWaterQTS = mashWaterQTS; // TODO: sparge stuff should get figured here: }
public void calcMashSchedule() { // Method to run through the mash table and calculate values double strikeTemp = 0; double targetTemp = 0; double endTemp = 0; double waterAddedQTS = 0; double waterEquiv = 0; double mr = mashRatio; double currentTemp = grainTempF; double displTemp = 0; double tunLoss = tunLossF; // figure out a better way to do this, eg: themal mass double decoct = 0; int totalMashTime = 0; double totalSpargeTime = 0; double mashWaterQTS = 0; double mashVolQTS = 0; String stepType; int numSparge = 0; // convert mash ratio to qts/lb if in l/kg if (mashRatioU.equalsIgnoreCase("l/kg")) { mr *= 0.479325; } // convert CurrentTemp to F if (mashTempU == "C") { currentTemp = cToF(currentTemp); tunLoss = cToF(tunLossF); } // perform calcs on first record if (steps.isEmpty()) return; // sort the list Collections.sort(steps, new stepComparator()); MashStep stp = ((MashStep) steps.get(0)); targetTemp = stp.startTemp; endTemp = stp.endTemp; strikeTemp = calcStrikeTemp(targetTemp, currentTemp, mr, tunLoss); waterAddedQTS = mr * maltWeightLbs; waterEquiv = maltWeightLbs * (0.192 + mr); mashVolQTS = calcMashVol(maltWeightLbs, mr); totalMashTime += stp.minutes; mashWaterQTS += waterAddedQTS; stp.infuseVol.setUnits("qt"); stp.infuseVol.setAmount(waterAddedQTS); stp.method = "infusion"; // subtract the water added from the Water Equiv so that they are correct when added in the next part of the loop waterEquiv -= waterAddedQTS; // Updated the water added if (tempUnits == "C") strikeTemp = fToC(strikeTemp); stp.directions = "Mash in with " + df1.format(stp.infuseVol.getValueAs(volUnits)) + " " + volUnits + " of water at " + df1.format(strikeTemp) + " " + tempUnits; // set TargetTemp to the end temp targetTemp = stp.endTemp; for (int i = 1; i < steps.size(); i++) { stp = ((MashStep) steps.get(i)); currentTemp = targetTemp; // switch targetTemp = stp.startTemp; // do calcs if (stp.method.equals("infusion")) { // calculate an infusion step decoct = 0; waterEquiv += waterAddedQTS; // add previous addition to get WE strikeTemp = boilTempF; // boiling water // Updated the water added waterAddedQTS = calcWaterAddition(targetTemp, currentTemp, waterEquiv, boilTempF); stp.infuseVol.setUnits("qt"); stp.infuseVol.setAmount(waterAddedQTS); if (tempUnits == "C") strikeTemp = 100; stp.directions = "Add " + df1.format(stp.infuseVol.getValueAs(volUnits)) + " " + volUnits + " of water at " + df1.format(strikeTemp) + " " + tempUnits; mashWaterQTS += waterAddedQTS; mashVolQTS += waterAddedQTS; } else if (stp.method.indexOf("decoction") > 0) { // calculate a decoction step waterEquiv += waterAddedQTS; // add previous addition to get WE waterAddedQTS = 0; strikeTemp = boilTempF; // boiling water double ratio=0.75; if (stp.method.indexOf("thick") > 0) ratio = 0.6; else if (stp.method.indexOf("thin") > 0) ratio = 0.9; // Calculate volume (qts) of mash to remove decoct = calcDecoction2(targetTemp, currentTemp, mashWaterQTS, ratio); stp.decoctVol.setUnits("qt"); stp.decoctVol.setAmount(decoct); // Updated the decoction, convert to right units & make directions stp.directions = "Remove " + df1.format(stp.decoctVol.getValueAs(volUnits)) + " " + volUnits + " of mash, boil, and return to mash."; } else if (stp.method.equals("direct")) { // calculate a direct heat step decoct = 0; waterEquiv += waterAddedQTS; // add previous addition to get WE waterAddedQTS = 0; stp.directions = "Add direct heat until mash reaches " + displTemp + " " + tempUnits + "."; } if (stp.method.equals("sparge")) { // Count it numSparge++; } else totalMashTime += stp.minutes; stp.infuseVol.setUnits("qt"); stp.infuseVol.setAmount(waterAddedQTS); stp.decoctVol.setUnits("qt"); stp.decoctVol.setAmount(decoct); // set target temp to end temp for next step targetTemp = stp.endTemp; } // while not eof waterEquiv += waterAddedQTS; // add previous addition to get WE totalTime = totalMashTime; volQts = mashVolQTS; // water use stats: absorbedQTS = maltWeightLbs * 0.55; // figure from HBD // spargeTotalQTS = (myRecipe.getPreBoilVol("qt")) - (mashWaterQTS - absorbedQTS); totalWaterQTS = mashWaterQTS; // TODO: sparge stuff should get figured here: }
1,116,434
private double fToC(double tempF) { // routine to convert basic F temps to C return (5 * (tempF - 32)) / 9; }
public static double fToC(double tempF) { // routine to convert basic F temps to C return (5 * (tempF - 32)) / 9; }
1,116,435
public double getGrainTemp() { return grainTemp; }
public double getGrainTemp() { if (tempUnits.equals("F")) return grainTempF; else return fToC(grainTempF); }
1,116,436
public void setGrainTemp(double t){ grainTemp = t; calcMashSchedule(); }
public void setGrainTemp(double t){ if (tempUnits.equals("F")) grainTempF = t; else grainTempF = cToF(t); calcMashSchedule(); }
1,116,437
private void initGUI() { try { this.setTitle("Malt Percent"); TableModel maltTableModel = new MaltPercentTableModel(); jPanel5 = new JPanel(); BoxLayout jPanel5Layout = new BoxLayout(jPanel5, javax.swing.BoxLayout.Y_AXIS); jPanel5.setLayout(jPanel5Layout); getContentPane().add(jPanel5, BorderLayout.CENTER); jPanel3 = new JPanel(); jPanel5.add(jPanel3); BoxLayout jPanel3Layout = new BoxLayout(jPanel3, javax.swing.BoxLayout.Y_AXIS); jPanel3.setLayout(jPanel3Layout); jPanel1 = new JScrollPane(); jPanel3.add(jPanel1); jPanel1.setPreferredSize(new java.awt.Dimension(392, 252)); jPanel1.setBorder(BorderFactory.createTitledBorder("Fermentables")); jPanel4 = new JPanel(); GridBagLayout jPanel4Layout = new GridBagLayout(); jPanel4Layout.rowWeights = new double[] {0.1, 0.1, 0.1, 0.1}; jPanel4Layout.rowHeights = new int[] {7, 7, 7, 7}; jPanel4Layout.columnWeights = new double[] {0.1, 0.2, 0.1, 0.1}; jPanel4Layout.columnWidths = new int[] {5, 9, 7, 7}; jPanel4.setLayout(jPanel4Layout); jPanel3.add(jPanel4); weightBtn = new JRadioButton("Target weight:"); jPanel4.add(weightBtn, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); bg.add(weightBtn); weightBtn.setSelected(true); weightSpn = new JSpinner(); jPanel4.add(weightSpn, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); // SpinnerListModel weightSpnModel = new SpinnerListModel(new String[] { "Sun", "Mon", "Tue", // "Wed", "Thu", "Fri", "Sat" }); // weightSpn.setModel(weightSpnModel); weightSpn.setValue(new Double(myRecipe.getTotalMaltLbs())); OGBtn = new JRadioButton("Target OG:"); jPanel4.add(OGBtn, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); bg.add(OGBtn); OGSpn = new JSpinner(); SpinnerNumberModel OGSpnModel = new SpinnerNumberModel(1.000, 0.900, 2.000, 0.001); jPanel4.add(OGSpn, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); OGSpn.setModel(OGSpnModel); jLabel1 = new JLabel(); jPanel4.add(jLabel1, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("lbs"); OGSpn.setValue(new Double(myRecipe.getEstOg())); maltTable = new JTable(); jPanel1.setViewportView(maltTable); maltTable.setModel(maltTableModel); maltTable.setPreferredSize(new java.awt.Dimension(203, 84)); jPanel2 = new JPanel(); jPanel5.add(jPanel2); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); cancelBtn = new JButton(); jPanel2.add(cancelBtn); cancelBtn.setText("Cancel"); okBtn = new JButton(); jPanel2.add(okBtn); okBtn.setText("OK"); okBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { calcWeights(); setVisible(false); app.displayRecipe(); app.maltTable.updateUI(); dispose(); } }); cancelBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { setVisible(false); dispose(); } }); // jPanel1.add(maltTable, BorderLayout.CENTER); setSize(400, 300); } catch (Exception e) { e.printStackTrace(); } }
private void initGUI() { try { this.setTitle("Malt Percent"); TableModel maltTableModel = new MaltPercentTableModel(); jPanel5 = new JPanel(); BoxLayout jPanel5Layout = new BoxLayout(jPanel5, javax.swing.BoxLayout.Y_AXIS); jPanel5.setLayout(jPanel5Layout); getContentPane().add(jPanel5, BorderLayout.CENTER); jPanel3 = new JPanel(); jPanel5.add(jPanel3); BoxLayout jPanel3Layout = new BoxLayout(jPanel3, javax.swing.BoxLayout.Y_AXIS); jPanel3.setLayout(jPanel3Layout); jPanel1 = new JScrollPane(); jPanel3.add(jPanel1); jPanel1.setPreferredSize(new java.awt.Dimension(392, 252)); jPanel1.setBorder(BorderFactory.createTitledBorder("Fermentables")); jPanel4 = new JPanel(); GridBagLayout jPanel4Layout = new GridBagLayout(); jPanel4Layout.rowWeights = new double[] {0.1, 0.1, 0.1, 0.1}; jPanel4Layout.rowHeights = new int[] {7, 7, 7, 7}; jPanel4Layout.columnWeights = new double[] {0.1, 0.2, 0.1, 0.1}; jPanel4Layout.columnWidths = new int[] {5, 9, 7, 7}; jPanel4.setLayout(jPanel4Layout); jPanel3.add(jPanel4); weightBtn = new JRadioButton("Target weight:"); jPanel4.add(weightBtn, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); bg.add(weightBtn); weightBtn.setSelected(true); weightSpn = new JSpinner(); jPanel4.add(weightSpn, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); // SpinnerListModel weightSpnModel = new SpinnerListModel(new String[] { "Sun", "Mon", "Tue", // "Wed", "Thu", "Fri", "Sat" }); // weightSpn.setModel(weightSpnModel); weightSpn.setValue(new Double(myRecipe.getTotalMalt())); OGBtn = new JRadioButton("Target OG:"); jPanel4.add(OGBtn, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); bg.add(OGBtn); OGSpn = new JSpinner(); SpinnerNumberModel OGSpnModel = new SpinnerNumberModel(1.000, 0.900, 2.000, 0.001); jPanel4.add(OGSpn, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); OGSpn.setModel(OGSpnModel); jLabel1 = new JLabel(); jPanel4.add(jLabel1, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("lbs"); OGSpn.setValue(new Double(myRecipe.getEstOg())); maltTable = new JTable(); jPanel1.setViewportView(maltTable); maltTable.setModel(maltTableModel); maltTable.setPreferredSize(new java.awt.Dimension(203, 84)); jPanel2 = new JPanel(); jPanel5.add(jPanel2); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); cancelBtn = new JButton(); jPanel2.add(cancelBtn); cancelBtn.setText("Cancel"); okBtn = new JButton(); jPanel2.add(okBtn); okBtn.setText("OK"); okBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { calcWeights(); setVisible(false); app.displayRecipe(); app.maltTable.updateUI(); dispose(); } }); cancelBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { setVisible(false); dispose(); } }); // jPanel1.add(maltTable, BorderLayout.CENTER); setSize(400, 300); } catch (Exception e) { e.printStackTrace(); } }
1,116,439
private void initGUI() { try { this.setTitle("Malt Percent"); TableModel maltTableModel = new MaltPercentTableModel(); jPanel5 = new JPanel(); BoxLayout jPanel5Layout = new BoxLayout(jPanel5, javax.swing.BoxLayout.Y_AXIS); jPanel5.setLayout(jPanel5Layout); getContentPane().add(jPanel5, BorderLayout.CENTER); jPanel3 = new JPanel(); jPanel5.add(jPanel3); BoxLayout jPanel3Layout = new BoxLayout(jPanel3, javax.swing.BoxLayout.Y_AXIS); jPanel3.setLayout(jPanel3Layout); jPanel1 = new JScrollPane(); jPanel3.add(jPanel1); jPanel1.setPreferredSize(new java.awt.Dimension(392, 252)); jPanel1.setBorder(BorderFactory.createTitledBorder("Fermentables")); jPanel4 = new JPanel(); GridBagLayout jPanel4Layout = new GridBagLayout(); jPanel4Layout.rowWeights = new double[] {0.1, 0.1, 0.1, 0.1}; jPanel4Layout.rowHeights = new int[] {7, 7, 7, 7}; jPanel4Layout.columnWeights = new double[] {0.1, 0.2, 0.1, 0.1}; jPanel4Layout.columnWidths = new int[] {5, 9, 7, 7}; jPanel4.setLayout(jPanel4Layout); jPanel3.add(jPanel4); weightBtn = new JRadioButton("Target weight:"); jPanel4.add(weightBtn, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); bg.add(weightBtn); weightBtn.setSelected(true); weightSpn = new JSpinner(); jPanel4.add(weightSpn, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); // SpinnerListModel weightSpnModel = new SpinnerListModel(new String[] { "Sun", "Mon", "Tue", // "Wed", "Thu", "Fri", "Sat" }); // weightSpn.setModel(weightSpnModel); weightSpn.setValue(new Double(myRecipe.getTotalMaltLbs())); OGBtn = new JRadioButton("Target OG:"); jPanel4.add(OGBtn, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); bg.add(OGBtn); OGSpn = new JSpinner(); SpinnerNumberModel OGSpnModel = new SpinnerNumberModel(1.000, 0.900, 2.000, 0.001); jPanel4.add(OGSpn, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); OGSpn.setModel(OGSpnModel); jLabel1 = new JLabel(); jPanel4.add(jLabel1, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("lbs"); OGSpn.setValue(new Double(myRecipe.getEstOg())); maltTable = new JTable(); jPanel1.setViewportView(maltTable); maltTable.setModel(maltTableModel); maltTable.setPreferredSize(new java.awt.Dimension(203, 84)); jPanel2 = new JPanel(); jPanel5.add(jPanel2); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); cancelBtn = new JButton(); jPanel2.add(cancelBtn); cancelBtn.setText("Cancel"); okBtn = new JButton(); jPanel2.add(okBtn); okBtn.setText("OK"); okBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { calcWeights(); setVisible(false); app.displayRecipe(); app.maltTable.updateUI(); dispose(); } }); cancelBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { setVisible(false); dispose(); } }); // jPanel1.add(maltTable, BorderLayout.CENTER); setSize(400, 300); } catch (Exception e) { e.printStackTrace(); } }
private void initGUI() { try { this.setTitle("Malt Percent"); TableModel maltTableModel = new MaltPercentTableModel(); jPanel5 = new JPanel(); BoxLayout jPanel5Layout = new BoxLayout(jPanel5, javax.swing.BoxLayout.Y_AXIS); jPanel5.setLayout(jPanel5Layout); getContentPane().add(jPanel5, BorderLayout.CENTER); jPanel3 = new JPanel(); jPanel5.add(jPanel3); BoxLayout jPanel3Layout = new BoxLayout(jPanel3, javax.swing.BoxLayout.Y_AXIS); jPanel3.setLayout(jPanel3Layout); jPanel1 = new JScrollPane(); jPanel3.add(jPanel1); jPanel1.setPreferredSize(new java.awt.Dimension(392, 252)); jPanel1.setBorder(BorderFactory.createTitledBorder("Fermentables")); jPanel4 = new JPanel(); GridBagLayout jPanel4Layout = new GridBagLayout(); jPanel4Layout.rowWeights = new double[] {0.1, 0.1, 0.1, 0.1}; jPanel4Layout.rowHeights = new int[] {7, 7, 7, 7}; jPanel4Layout.columnWeights = new double[] {0.1, 0.2, 0.1, 0.1}; jPanel4Layout.columnWidths = new int[] {5, 9, 7, 7}; jPanel4.setLayout(jPanel4Layout); jPanel3.add(jPanel4); weightBtn = new JRadioButton("Target weight:"); jPanel4.add(weightBtn, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); bg.add(weightBtn); weightBtn.setSelected(true); weightSpn = new JSpinner(); jPanel4.add(weightSpn, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); // SpinnerListModel weightSpnModel = new SpinnerListModel(new String[] { "Sun", "Mon", "Tue", // "Wed", "Thu", "Fri", "Sat" }); // weightSpn.setModel(weightSpnModel); weightSpn.setValue(new Double(myRecipe.getTotalMaltLbs())); OGBtn = new JRadioButton("Target OG:"); jPanel4.add(OGBtn, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); bg.add(OGBtn); OGSpn = new JSpinner(); SpinnerNumberModel OGSpnModel = new SpinnerNumberModel(1.000, 0.900, 2.000, 0.001); jPanel4.add(OGSpn, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); OGSpn.setModel(OGSpnModel); jLabel1 = new JLabel(); jPanel4.add(jLabel1, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel1.setText("lbs"); OGSpn.setValue(new Double(myRecipe.getEstOg())); maltTable = new JTable(); jPanel1.setViewportView(maltTable); maltTable.setModel(maltTableModel); maltTable.setPreferredSize(new java.awt.Dimension(203, 84)); jPanel2 = new JPanel(); jPanel5.add(jPanel2); FlowLayout jPanel2Layout = new FlowLayout(); jPanel2Layout.setAlignment(FlowLayout.RIGHT); jPanel2.setLayout(jPanel2Layout); cancelBtn = new JButton(); jPanel2.add(cancelBtn); cancelBtn.setText("Cancel"); okBtn = new JButton(); jPanel2.add(okBtn); okBtn.setText("OK"); okBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { calcWeights(); setVisible(false); app.displayRecipe(); app.maltTable.updateUI(); dispose(); } }); cancelBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { setVisible(false); dispose(); } }); // jPanel1.add(maltTable, BorderLayout.CENTER); setSize(400, 300); } catch (Exception e) { e.printStackTrace(); } }
1,116,440
public boolean checkout(Build build, Launcher launcher, FilePath dir, BuildListener listener, File changelogFile) throws IOException { List<String> changedFiles = null; // files that were affected by update. null this is a check out if(canUseUpdate && isUpdatable(dir.getLocal())) { changedFiles = update(false,launcher,dir,listener); if(changedFiles==null) return false; // failed } else { dir.deleteContents(); ArgumentListBuilder cmd = new ArgumentListBuilder(); cmd.add("cvs","-Q","-z9","-d",cvsroot,"co"); if(branch!=null) cmd.add("-r",branch); if(flatten) cmd.add("-d",dir.getName()); cmd.add(module); if(!run(launcher,cmd,listener, flatten ? dir.getParent() : dir)) return false; } // archive the workspace to support later tagging // TODO: doing this partially remotely would be faster File archiveFile = getArchiveFile(build); ZipOutputStream zos = new ZipOutputStream(archiveFile); if(flatten) { archive(build.getProject().getWorkspace().getLocal(), module, zos); } else { StringTokenizer tokens = new StringTokenizer(module); while(tokens.hasMoreTokens()) { String m = tokens.nextToken(); archive(new File(build.getProject().getWorkspace().getLocal(),m),m,zos); } } zos.close(); // contribute the tag action build.getActions().add(new TagAction(build)); return calcChangeLog(build, changedFiles, changelogFile, listener); }
public boolean checkout(Build build, Launcher launcher, FilePath dir, BuildListener listener, File changelogFile) throws IOException { List<String> changedFiles = null; // files that were affected by update. null this is a check out if(canUseUpdate && isUpdatable(dir.getLocal())) { changedFiles = update(false,launcher,dir,listener); if(changedFiles==null) return false; // failed } else { dir.deleteContents(); ArgumentListBuilder cmd = new ArgumentListBuilder(); cmd.add("cvs","-Q","-z9","-d",cvsroot,"co"); if(branch!=null) cmd.add("-r",branch); if(flatten) cmd.add("-d",dir.getName()); cmd.addTokenized(module); if(!run(launcher,cmd,listener, flatten ? dir.getParent() : dir)) return false; } // archive the workspace to support later tagging // TODO: doing this partially remotely would be faster File archiveFile = getArchiveFile(build); ZipOutputStream zos = new ZipOutputStream(archiveFile); if(flatten) { archive(build.getProject().getWorkspace().getLocal(), module, zos); } else { StringTokenizer tokens = new StringTokenizer(module); while(tokens.hasMoreTokens()) { String m = tokens.nextToken(); archive(new File(build.getProject().getWorkspace().getLocal(),m),m,zos); } } zos.close(); // contribute the tag action build.getActions().add(new TagAction(build)); return calcChangeLog(build, changedFiles, changelogFile, listener); }
1,116,441
public Node differentiate(ASTFunNode node,String var,Node [] children,Node [] dchildren,DJep djep) throws ParseException { OperatorSet opset = djep.getOperatorSet(); NodeFactory nf = djep.getNodeFactory(); Operator op = opset.getMultiply(); if(mulOp!=null) op = mulOp; int nchild = node.jjtGetNumChildren(); if(nchild==2) return nf.buildOperatorNode(opset.getAdd(), nf.buildOperatorNode(op, dchildren[0], djep.deepCopy(children[1])), nf.buildOperatorNode(op, djep.deepCopy(children[0]), dchildren[1])); else { Node sums[] = new Node[nchild]; for(int i=0;i<nchild;++i) { Node terms[] = new Node[nchild]; for(int j=0;j<nchild;++j) terms[j] = children[j]; terms[i] = dchildren[i]; sums[i] = nf.buildOperatorNode(op,terms); } Node res = nf.buildOperatorNode(opset.getAdd(),sums); return res; } //throw new ParseException("Too many children "+nchild+" for "+node+"\n"); }
public Node differentiate(ASTFunNode node,String var,Node [] children,Node [] dchildren,DJep djep) throws ParseException { OperatorSet opset = djep.getOperatorSet(); NodeFactory nf = djep.getNodeFactory(); Operator op = opset.getMultiply(); if(mulOp!=null) op = mulOp; int nchild = node.jjtGetNumChildren(); if(nchild==2) return nf.buildOperatorNode(opset.getAdd(), nf.buildOperatorNode(op, dchildren[0], djep.deepCopy(children[1])), nf.buildOperatorNode(op, djep.deepCopy(children[0]), dchildren[1])); else { Node sums[] = new Node[nchild]; for(int i=0;i<nchild;++i) { Node terms[] = new Node[nchild]; for(int j=0;j<nchild;++j) terms[j] = children[j]; terms[i] = dchildren[i]; sums[i] = nf.buildOperatorNode(op,terms); } Node res = nf.buildOperatorNode(opset.getAdd(),sums); return res; } //throw new ParseException("Too many children "+nchild+" for "+node+"\n"); }
1,116,442
public Node differentiate(ASTFunNode node,String var,Node [] children,Node [] dchildren,DJep djep) throws ParseException { OperatorSet opset = djep.getOperatorSet(); NodeFactory nf = djep.getNodeFactory(); Operator op = opset.getMultiply(); if(mulOp!=null) op = mulOp; int nchild = node.jjtGetNumChildren(); if(nchild==2) return nf.buildOperatorNode(opset.getAdd(), nf.buildOperatorNode(op, dchildren[0], djep.deepCopy(children[1])), nf.buildOperatorNode(op, djep.deepCopy(children[0]), dchildren[1])); else { Node sums[] = new Node[nchild]; for(int i=0;i<nchild;++i) { Node terms[] = new Node[nchild]; for(int j=0;j<nchild;++j) terms[j] = children[j]; terms[i] = dchildren[i]; sums[i] = nf.buildOperatorNode(op,terms); } Node res = nf.buildOperatorNode(opset.getAdd(),sums); return res; } //throw new ParseException("Too many children "+nchild+" for "+node+"\n"); }
public Node differentiate(ASTFunNode node,String var,Node [] children,Node [] dchildren,DJep djep) throws ParseException { OperatorSet opset = djep.getOperatorSet(); NodeFactory nf = djep.getNodeFactory(); Operator op = opset.getMultiply(); if(mulOp!=null) op = mulOp; int nchild = node.jjtGetNumChildren(); if(nchild==2) return nf.buildOperatorNode(opset.getAdd(), nf.buildOperatorNode(op, dchildren[0], djep.deepCopy(children[1])), nf.buildOperatorNode(op, djep.deepCopy(children[0]), dchildren[1])); else { Node sums[] = new Node[nchild]; for(int i=0;i<nchild;++i) { Node terms[] = new Node[nchild]; for(int j=0;j<nchild;++j) terms[j] = children[j]; terms[i] = dchildren[i]; sums[i] = nf.buildOperatorNode(op,terms); Node res = nf.buildOperatorNode(opset.getAdd(),sums); return res; //throw new ParseException("Too many children "+nchild+" for "+node+"\n");
1,116,443
protected void setUp() { j = new MatrixJep(); j.addStandardConstants(); j.addStandardFunctions(); j.addComplex(); //j.setTraverse(true); j.setAllowAssignment(true); j.setAllowUndeclared(true); j.setImplicitMul(true); j.dv.addStandardDiffRules(); }
protected void setUp() { j = new MatrixJep(); j.addStandardConstants(); j.addStandardFunctions(); j.addComplex(); //j.setTraverse(true); j.setAllowAssignment(true); j.setAllowUndeclared(true); j.setImplicitMul(true); j.addStandardDiffRules(); }
1,116,444
public void simplifyTest(String expr,String expected) throws ParseException { Node node = j.parse(expr); MatrixNodeI matEqn = j.dec.preprocess(node,j); Node simp = j.simplify(matEqn); String res = j.pv.toString(simp); Node node2 = j.parse(expected); MatrixNodeI matEqn2 = j.dec.preprocess(node2,j); Node simp2 = j.simplify(matEqn2); String res2 = j.pv.toString(simp2); if(!res2.equals(res)) System.out.println("Error: Value of \""+expr+"\" is \""+res+"\" should be \""+res2+"\""); assertEquals("<"+expr+">",res2,res); System.out.println("Sucess: Value of \""+expr+"\" is \""+res+"\""); // System.out.print("Full Brackets:\t");// j.pv.setFullBrackets(true);// j.pv.println(simp);// j.pv.setFullBrackets(false); }
public void simplifyTest(String expr,String expected) throws ParseException { Node node = j.parse(expr); MatrixNodeI matEqn = j.dec.preprocess(node,j); Node simp = j.simplify(matEqn); String res = j.toString(simp); Node node2 = j.parse(expected); MatrixNodeI matEqn2 = j.dec.preprocess(node2,j); Node simp2 = j.simplify(matEqn2); String res2 = j.pv.toString(simp2); if(!res2.equals(res)) System.out.println("Error: Value of \""+expr+"\" is \""+res+"\" should be \""+res2+"\""); assertEquals("<"+expr+">",res2,res); System.out.println("Sucess: Value of \""+expr+"\" is \""+res+"\""); // System.out.print("Full Brackets:\t");// j.pv.setFullBrackets(true);// j.pv.println(simp);// j.pv.setFullBrackets(false); }
1,116,445
public void simplifyTest(String expr,String expected) throws ParseException { Node node = j.parse(expr); MatrixNodeI matEqn = j.dec.preprocess(node,j); Node simp = j.simplify(matEqn); String res = j.pv.toString(simp); Node node2 = j.parse(expected); MatrixNodeI matEqn2 = j.dec.preprocess(node2,j); Node simp2 = j.simplify(matEqn2); String res2 = j.pv.toString(simp2); if(!res2.equals(res)) System.out.println("Error: Value of \""+expr+"\" is \""+res+"\" should be \""+res2+"\""); assertEquals("<"+expr+">",res2,res); System.out.println("Sucess: Value of \""+expr+"\" is \""+res+"\""); // System.out.print("Full Brackets:\t");// j.pv.setFullBrackets(true);// j.pv.println(simp);// j.pv.setFullBrackets(false); }
public void simplifyTest(String expr,String expected) throws ParseException { Node node = j.parse(expr); MatrixNodeI matEqn = j.dec.preprocess(node,j); Node simp = j.simplify(matEqn); String res = j.pv.toString(simp); Node node2 = j.parse(expected); MatrixNodeI matEqn2 = j.dec.preprocess(node2,j); Node simp2 = j.simplify(matEqn2); String res2 = j.toString(simp2); if(!res2.equals(res)) System.out.println("Error: Value of \""+expr+"\" is \""+res+"\" should be \""+res2+"\""); assertEquals("<"+expr+">",res2,res); System.out.println("Sucess: Value of \""+expr+"\" is \""+res+"\""); // System.out.print("Full Brackets:\t");// j.pv.setFullBrackets(true);// j.pv.println(simp);// j.pv.setFullBrackets(false); }
1,116,446
public void simplifyTestString(String expr,String expected) throws ParseException { Node node = j.parse(expr); MatrixNodeI matEqn = j.dec.preprocess(node,j); String res = j.pv.toString(matEqn); if(!expected.equals(res)) System.out.println("Error: Value of \""+expr+"\" is \""+res+"\" should be \""+expected+"\""); assertEquals("<"+expr+">",expected,res); System.out.println("Sucess: Value of \""+expr+"\" is \""+res+"\""); // System.out.print("Full Brackets:\t");// j.pv.setFullBrackets(true);// j.pv.println(simp);// j.pv.setFullBrackets(false); }
public void simplifyTestString(String expr,String expected) throws ParseException { Node node = j.parse(expr); MatrixNodeI matEqn = j.dec.preprocess(node,j); String res = j.toString(matEqn); if(!expected.equals(res)) System.out.println("Error: Value of \""+expr+"\" is \""+res+"\" should be \""+expected+"\""); assertEquals("<"+expr+">",expected,res); System.out.println("Sucess: Value of \""+expr+"\" is \""+res+"\""); // System.out.print("Full Brackets:\t");// j.pv.setFullBrackets(true);// j.pv.println(simp);// j.pv.setFullBrackets(false); }
1,116,447
@Test public void getObject() throws SQLException { stat.executeUpdate("create temp table testobj (" + "c1 integer, c2 float, c3, c4 varchar, c5 bit, c6, c7);"); PreparedStatement prep = conn.prepareStatement( "insert into testobj values (?,?,?,?,?,?,?);"); prep.setInt (1, Integer.MAX_VALUE); prep.setFloat (2, Float.MAX_VALUE); prep.setDouble (3, Double.MAX_VALUE); prep.setLong (4, Long.MAX_VALUE); prep.setBoolean(5, false); prep.setByte (6, (byte)7); prep.setBytes (7, b1); prep.executeUpdate(); ResultSet rs = stat.executeQuery( "select c1,c2,c3,c4,c5,c6,c7 from testobj;"); assertTrue(rs.next()); assertEquals(rs.getInt(1), Integer.MAX_VALUE); assertEquals(rs.getFloat(2), Float.MAX_VALUE); assertEquals(rs.getDouble(3), Double.MAX_VALUE); assertEquals(rs.getLong(4), Long.MAX_VALUE); assertFalse(rs.getBoolean(5)); assertEquals(rs.getByte(6), (byte)7); assertArrayEq(rs.getBytes(7), b1); assertNotNull(rs.getObject(1)); assertNotNull(rs.getObject(2)); assertNotNull(rs.getObject(3)); assertNotNull(rs.getObject(4)); assertNotNull(rs.getObject(5)); assertNotNull(rs.getObject(6)); assertNotNull(rs.getObject(7)); assertTrue(rs.getObject(1) instanceof Integer); assertTrue(rs.getObject(2) instanceof Double); assertTrue(rs.getObject(3) instanceof Double); assertTrue(rs.getObject(4) instanceof String); assertTrue(rs.getObject(5) instanceof Integer); assertTrue(rs.getObject(6) instanceof Integer); assertTrue(rs.getObject(7) instanceof byte[]); rs.close(); }
@Test public void getObject() throws SQLException { stat.executeUpdate("create table testobj (" + "c1 integer, c2 float, c3, c4 varchar, c5 bit, c6, c7);"); PreparedStatement prep = conn.prepareStatement( "insert into testobj values (?,?,?,?,?,?,?);"); prep.setInt (1, Integer.MAX_VALUE); prep.setFloat (2, Float.MAX_VALUE); prep.setDouble (3, Double.MAX_VALUE); prep.setLong (4, Long.MAX_VALUE); prep.setBoolean(5, false); prep.setByte (6, (byte)7); prep.setBytes (7, b1); prep.executeUpdate(); ResultSet rs = stat.executeQuery( "select c1,c2,c3,c4,c5,c6,c7 from testobj;"); assertTrue(rs.next()); assertEquals(rs.getInt(1), Integer.MAX_VALUE); assertEquals(rs.getFloat(2), Float.MAX_VALUE); assertEquals(rs.getDouble(3), Double.MAX_VALUE); assertEquals(rs.getLong(4), Long.MAX_VALUE); assertFalse(rs.getBoolean(5)); assertEquals(rs.getByte(6), (byte)7); assertArrayEq(rs.getBytes(7), b1); assertNotNull(rs.getObject(1)); assertNotNull(rs.getObject(2)); assertNotNull(rs.getObject(3)); assertNotNull(rs.getObject(4)); assertNotNull(rs.getObject(5)); assertNotNull(rs.getObject(6)); assertNotNull(rs.getObject(7)); assertTrue(rs.getObject(1) instanceof Integer); assertTrue(rs.getObject(2) instanceof Double); assertTrue(rs.getObject(3) instanceof Double); assertTrue(rs.getObject(4) instanceof String); assertTrue(rs.getObject(5) instanceof Integer); assertTrue(rs.getObject(6) instanceof Integer); assertTrue(rs.getObject(7) instanceof byte[]); rs.close(); }
1,116,448
@Test public void insert1000() throws SQLException { stat.executeUpdate("create temp table in1000 (a);"); PreparedStatement prep = conn.prepareStatement( "insert into in1000 values (?);"); conn.setAutoCommit(false); for (int i=0; i < 1000; i++) { prep.setInt(1, i); prep.executeUpdate(); } conn.commit(); ResultSet rs = stat.executeQuery("select count(a) from in1000;"); assertTrue(rs.next()); assertEquals(rs.getInt(1), 1000); rs.close(); }
@Test public void insert1000() throws SQLException { stat.executeUpdate("create table in1000 (a);"); PreparedStatement prep = conn.prepareStatement( "insert into in1000 values (?);"); conn.setAutoCommit(false); for (int i=0; i < 1000; i++) { prep.setInt(1, i); prep.executeUpdate(); } conn.commit(); ResultSet rs = stat.executeQuery("select count(a) from in1000;"); assertTrue(rs.next()); assertEquals(rs.getInt(1), 1000); rs.close(); }
1,116,449
public void setStyleData(){ Style s = (Style) cmbStyle2Model.getSelectedItem(); // descriptionTextArea.setText(s.getDescription()); // cmbStyle2.setToolTipText(multiLineToolTip(50,s.getDescription())); stlLowOG.setText(SBStringUtils.format(s.ogLow, 3)); stlRcpOG.setText(SBStringUtils.format(myRecipe.getEstOg(), 3)); stlHighOG.setText(SBStringUtils.format(s.ogHigh, 3)); stlLowABV.setText(SBStringUtils.format(s.alcLow, 1)); stlRcpABV.setText(SBStringUtils.format(myRecipe.getAlcohol(), 1)); stlHighABV.setText(SBStringUtils.format(s.alcHigh, 1)); stlLowColour.setText(SBStringUtils.format(s.srmLow, 1)); stlRcpColour.setText(SBStringUtils.format(myRecipe.getSrm(), 1)); stlHighColour.setText(SBStringUtils.format(s.srmHigh, 1)); stlLowIBU.setText(SBStringUtils.format(s.ibuLow, 1)); stlRcpIBU.setText(SBStringUtils.format(myRecipe.getIbu(), 1)); stlHighIBU.setText(SBStringUtils.format(s.ibuHigh, 1)); double bugu = myRecipe.getIbu() / (myRecipe.getEstOg() - 1) * 1000; ogbuLbl.setText("" + SBStringUtils.format(bugu, 1)); checkStyleConformance(); txaStyles.setText(getStyleMatches()); }
public void setStyleData(){ Style s = (Style) cmbStyle2Model.getSelectedItem(); // descriptionTextArea.setText(s.getDescription()); // cmbStyle2.setToolTipText(multiLineToolTip(50,s.getDescription())); stlLowOG.setText(SBStringUtils.format(s.ogLow, 3)); stlRcpOG.setText(SBStringUtils.format(myRecipe.getEstOg(), 3)); stlHighOG.setText(SBStringUtils.format(s.ogHigh, 3)); stlLowABV.setText(SBStringUtils.format(s.alcLow, 1)); stlRcpABV.setText(SBStringUtils.format(myRecipe.getAlcohol(), 1)); stlHighABV.setText(SBStringUtils.format(s.alcHigh, 1)); stlLowColour.setText(SBStringUtils.format(s.srmLow, 1)); stlRcpColour.setText(SBStringUtils.format(myRecipe.getSrm(), 1)); stlHighColour.setText(SBStringUtils.format(s.srmHigh, 1)); stlLowIBU.setText(SBStringUtils.format(s.ibuLow, 1)); stlRcpIBU.setText(SBStringUtils.format(myRecipe.getIbu(), 1)); stlHighIBU.setText(SBStringUtils.format(s.ibuHigh, 1)); double bugu = myRecipe.getIbu() / (myRecipe.getEstOg() - 1) * 1000; ogbuLbl.setText("" + SBStringUtils.format(bugu, 1)); checkStyleConformance(); txaStyles.setText(getStyleMatches()); }
1,116,450
public boolean perform(Build build, Launcher launcher, BuildListener listener) { FileSet fs = new FileSet(); Project p = new Project(); fs.setProject(p); fs.setDir(build.getProject().getWorkspace().getLocal()); fs.setIncludes(testResults); TestResultAction action = new TestResultAction(build, fs.getDirectoryScanner(p), listener); build.getActions().add(action); TestResult r = action.getResult(); if(r.getPassCount()==0 && r.getFailCount()==0) { listener.getLogger().println("No test report is found. Configuration error?"); // no test result. Most likely a configuration error or fatal problem build.setResult(Result.FAILURE); } if(r.getFailCount()>0) build.setResult(Result.UNSTABLE); return true; }
public boolean perform(Build build, Launcher launcher, BuildListener listener) { FileSet fs = new FileSet(); Project p = new Project(); fs.setProject(p); fs.setDir(build.getProject().getWorkspace().getLocal()); fs.setIncludes(testResults); if(ds.getIncludedFiles().length==0) { listener.getLogger().println("No test report files wer efound. Configuration error?"); build.setResult(Result.FAILURE); } TestResultAction action = new TestResultAction(build, ds, listener); build.getActions().add(action); TestResult r = action.getResult(); if(r.getPassCount()==0 && r.getFailCount()==0) { listener.getLogger().println("No test report is found. Configuration error?"); // no test result. Most likely a configuration error or fatal problem build.setResult(Result.FAILURE); } if(r.getFailCount()>0) build.setResult(Result.UNSTABLE); return true; }
1,116,451
public boolean perform(Build build, Launcher launcher, BuildListener listener) { FileSet fs = new FileSet(); Project p = new Project(); fs.setProject(p); fs.setDir(build.getProject().getWorkspace().getLocal()); fs.setIncludes(testResults); TestResultAction action = new TestResultAction(build, fs.getDirectoryScanner(p), listener); build.getActions().add(action); TestResult r = action.getResult(); if(r.getPassCount()==0 && r.getFailCount()==0) { listener.getLogger().println("No test report is found. Configuration error?"); // no test result. Most likely a configuration error or fatal problem build.setResult(Result.FAILURE); } if(r.getFailCount()>0) build.setResult(Result.UNSTABLE); return true; }
public boolean perform(Build build, Launcher launcher, BuildListener listener) { FileSet fs = new FileSet(); Project p = new Project(); fs.setProject(p); fs.setDir(build.getProject().getWorkspace().getLocal()); fs.setIncludes(testResults); TestResultAction action = new TestResultAction(build, fs.getDirectoryScanner(p), listener); build.getActions().add(action); TestResult r = action.getResult(); if(r.getPassCount()==0 && r.getFailCount()==0) { listener.getLogger().println("Test reports were found but none of them are new. Did tests run?"); // no test result. Most likely a configuration error or fatal problem build.setResult(Result.FAILURE); } if(r.getFailCount()>0) build.setResult(Result.UNSTABLE); return true; }
1,116,452
public String getIconName() { return isFolder?"folder.png":"text.png"; }
public String getIconName() { return isFolder?"folder.gif":"text.gif"; }
1,116,453
public final Result getResult() { if(state!=State.COMPLETED) return null; return result; }
public final Result getResult() { if(state!=State.COMPLETED) return null; return result; }
1,116,454
public boolean isReal(Node node) { return (node instanceof ASTConstant) && ( ((ASTConstant) node).getValue() instanceof Number ); }
public boolean isReal(Node node) { return (node instanceof ASTConstant) && ( ((ASTConstant) node).getValue() instanceof Double ); }
1,116,455
public void fireDownloadFileChanged( SWDownloadFile file ) { int position = downloadList.indexOf( file ); if ( position >= 0 ) { fireDownloadFileChanged( position ); } }
private void fireDownloadFileChanged( final int position ) { int position = downloadList.indexOf( file ); if ( position >= 0 ) { fireDownloadFileChanged( position ); } }
1,116,457
public void fireDownloadFileChanged( SWDownloadFile file ) { int position = downloadList.indexOf( file ); if ( position >= 0 ) { fireDownloadFileChanged( position ); } }
public void fireDownloadFileChanged( SWDownloadFile file ) { int position = downloadList.indexOf( file ); if ( position >= 0 ) { fireDownloadFileChanged( position ); } }
1,116,458
public void fireDownloadFileChanged( SWDownloadFile file ) { int position = downloadList.indexOf( file ); if ( position >= 0 ) { fireDownloadFileChanged( position ); } }
public void fireDownloadFileChanged( SWDownloadFile file ) { int position = downloadList.indexOf( file ); if ( position >= 0 ) { fireDownloadFileChanged( position ); } }
1,116,459
public void run(Stack inStack) throws ParseException { /* Check if stack is null */ if (null == inStack) { throw new ParseException("Stack argument null"); } Object param = null; double r = 0; while(!inStack.isEmpty()) { // get the parameter from the stack param = inStack.pop(); if (param instanceof Double) { // calculate the result r += ((Double) param).doubleValue(); } else throw new ParseException("Invalid parameter type"); } // push the result on the inStack inStack.push(new Double(r)); }
public void run(Stack inStack) throws ParseException { /* Check if stack is null */ if (null == inStack) { throw new ParseException("Stack argument null"); } Object param = null; double r = 0; while(!inStack.isEmpty()) { // get the parameter from the stack param = inStack.pop(); if (param instanceof Double) { // calculate the result r += ((Double) param).doubleValue(); } else throw new ParseException("Invalid parameter type"); } // push the result on the inStack inStack.push(new Double(r)); }
1,116,460
public void run(Stack inStack) throws ParseException { /* Check if stack is null */ if (null == inStack) { throw new ParseException("Stack argument null"); } Object param = null; double r = 0; while(!inStack.isEmpty()) { // get the parameter from the stack param = inStack.pop(); if (param instanceof Double) { // calculate the result r += ((Double) param).doubleValue(); } else throw new ParseException("Invalid parameter type"); } // push the result on the inStack inStack.push(new Double(r)); }
public void run(Stack inStack) throws ParseException { /* Check if stack is null */ if (null == inStack) { throw new ParseException("Stack argument null"); } Object param = null; double r = 0; while(!inStack.isEmpty()) { // get the parameter from the stack param = inStack.pop(); if (param instanceof Double) { // calculate the result r += ((Double) param).doubleValue(); } else throw new ParseException("Invalid parameter type"); } // push the result on the inStack inStack.push(new Double(r)); }
1,116,461
public void run(Stack inStack) throws ParseException { /* Check if stack is null */ if (null == inStack) { throw new ParseException("Stack argument null"); } Object param = null; double r = 0; while(!inStack.isEmpty()) { // get the parameter from the stack param = inStack.pop(); if (param instanceof Double) { // calculate the result r += ((Double) param).doubleValue(); } else throw new ParseException("Invalid parameter type"); } // push the result on the inStack inStack.push(new Double(r)); }
public void run(Stack inStack) throws ParseException { /* Check if stack is null */ if (null == inStack) { throw new ParseException("Stack argument null"); } Object param = null; double r = 0; while(!inStack.isEmpty()) { // get the parameter from the stack param = stack.pop(); if (param instanceof Double) { // calculate the result r += ((Double) param).doubleValue(); } else throw new ParseException("Invalid parameter type"); } // push the result on the inStack inStack.push(new Double(r)); }
1,116,462
public void run(Stack inStack) throws ParseException { /* Check if stack is null */ if (null == inStack) { throw new ParseException("Stack argument null"); } Object param = null; double r = 0; while(!inStack.isEmpty()) { // get the parameter from the stack param = inStack.pop(); if (param instanceof Double) { // calculate the result r += ((Double) param).doubleValue(); } else throw new ParseException("Invalid parameter type"); } // push the result on the inStack inStack.push(new Double(r)); }
public void run(Stack inStack) throws ParseException { /* Check if stack is null */ if (null == inStack) { throw new ParseException("Stack argument null"); } Object param = null; double r = 0; while(!inStack.isEmpty()) { // get the parameter from the stack param = inStack.pop(); if (param instanceof Double) { // calculate the result result += ((Double) param).doubleValue(); } else { throw new ParseException("Invalid parameter type"); } else throw new ParseException("Invalid parameter type"); } // push the result on the inStack inStack.push(new Double(r)); }
1,116,463
public void run(Stack inStack) throws ParseException { /* Check if stack is null */ if (null == inStack) { throw new ParseException("Stack argument null"); } Object param = null; double r = 0; while(!inStack.isEmpty()) { // get the parameter from the stack param = inStack.pop(); if (param instanceof Double) { // calculate the result r += ((Double) param).doubleValue(); } else throw new ParseException("Invalid parameter type"); } // push the result on the inStack inStack.push(new Double(r)); }
public void run(Stack inStack) throws ParseException { /* Check if stack is null */ if (null == inStack) { throw new ParseException("Stack argument null"); } Object param = null; double r = 0; while(!inStack.isEmpty()) { // get the parameter from the stack param = inStack.pop(); if (param instanceof Double) { // calculate the result r += ((Double) param).doubleValue(); } else throw new ParseException("Invalid parameter type"); } // push the result on the inStack inStack.push(new Double(r)); }
1,116,464
public void run(Stack inStack) throws ParseException { /* Check if stack is null */ if (null == inStack) { throw new ParseException("Stack argument null"); } Object param = null; double r = 0; while(!inStack.isEmpty()) { // get the parameter from the stack param = inStack.pop(); if (param instanceof Double) { // calculate the result r += ((Double) param).doubleValue(); } else throw new ParseException("Invalid parameter type"); } // push the result on the inStack inStack.push(new Double(r)); }
public void run(Stack inStack) throws ParseException { /* Check if stack is null */ if (null == inStack) { throw new ParseException("Stack argument null"); } Object param = null; double r = 0; while(!inStack.isEmpty()) { // get the parameter from the stack param = inStack.pop(); if (param instanceof Double) { // calculate the result r += ((Double) param).doubleValue(); } else throw new ParseException("Invalid parameter type"); } // push the result on the inStack stack.push(new Double(result)); }
1,116,465
private Dimensions() {};
private Dimensions() {}
1,116,467
private Complex parseNextLine(BufferedReader reader) { Complex value; String line, errorStr; // cycle till a valid line is found do { try { line = reader.readLine(); lineCount++; } catch (Exception e) { return null; } if (line==null) return null; } while (line.length()==0 || line.trim().charAt(0)=='#'); // parse the expression myParser.parseExpression(line); // did an error occur while parsing? errorStr = myParser.getErrorInfo(); if (errorStr != null) { println("Error while parsing line " + lineCount + ": " + errorStr); return null; } // evaluate the expression value = myParser.getComplexValue(); // did an error occur while evaluating? errorStr = myParser.getErrorInfo(); if ((value == null) || (errorStr != null)) { println("Error while evaluating line " + lineCount + ": " + errorStr); return null; } return value; }
private Complex parseNextLine(BufferedReader reader) { Complex value; String line, errorStr; // cycle till a valid line is found do { try { line = reader.readLine(); lineCount++; } catch (Exception e) { return null; } if (line==null) return null; } while (line.length()==0 || line.trim().charAt(0)=='#'); // parse the expression myParser.parseExpression(line); // did an error occur while parsing? errorStr = myParser.getErrorInfo(); if (errorStr != null) { println("Error while parsing line " + lineCount + ": " + errorStr); return null; } // evaluate the expression value = myParser.getComplexValue(); // did an error occur while evaluating? errorStr = myParser.getErrorInfo(); if ((value == null) || (errorStr != null)) { println("Error while evaluating line " + lineCount + ": " + errorStr); return null; } return value; }
1,116,468
private Complex parseNextLine(BufferedReader reader) { Complex value; String line, errorStr; // cycle till a valid line is found do { try { line = reader.readLine(); lineCount++; } catch (Exception e) { return null; } if (line==null) return null; } while (line.length()==0 || line.trim().charAt(0)=='#'); // parse the expression myParser.parseExpression(line); // did an error occur while parsing? errorStr = myParser.getErrorInfo(); if (errorStr != null) { println("Error while parsing line " + lineCount + ": " + errorStr); return null; } // evaluate the expression value = myParser.getComplexValue(); // did an error occur while evaluating? errorStr = myParser.getErrorInfo(); if ((value == null) || (errorStr != null)) { println("Error while evaluating line " + lineCount + ": " + errorStr); return null; } return value; }
private Complex parseNextLine(BufferedReader reader) { Complex value; String line, errorStr; // cycle till a valid line is found do { try { line = reader.readLine(); lineCount++; } catch (Exception e) { return null; } if (line==null) return null; } while (line.length()==0 || line.trim().charAt(0)=='#'); // parse the expression myParser.parseExpression(line); // did an error occur while parsing? errorStr = myParser.getErrorInfo(); if (errorStr != null) { println("Error while parsing line " + lineCount + ": " + errorStr); return null; } // evaluate the expression value = myParser.getComplexValue(); // did an error occur while evaluating? errorStr = myParser.getErrorInfo(); if ((value == null) || (errorStr != null)) { println("Error while evaluating line " + lineCount + ": " + errorStr); return null; } return value; }
1,116,469
private Complex parseNextLine(BufferedReader reader) { Complex value; String line, errorStr; // cycle till a valid line is found do { try { line = reader.readLine(); lineCount++; } catch (Exception e) { return null; } if (line==null) return null; } while (line.length()==0 || line.trim().charAt(0)=='#'); // parse the expression myParser.parseExpression(line); // did an error occur while parsing? errorStr = myParser.getErrorInfo(); if (errorStr != null) { println("Error while parsing line " + lineCount + ": " + errorStr); return null; } // evaluate the expression value = myParser.getComplexValue(); // did an error occur while evaluating? errorStr = myParser.getErrorInfo(); if ((value == null) || (errorStr != null)) { println("Error while evaluating line " + lineCount + ": " + errorStr); return null; } return value; }
private Complex parseNextLine(BufferedReader reader) { Complex value; String line, errorStr; // cycle till a valid line is found do { try { line = reader.readLine(); lineCount++; } catch (Exception e) { return null; } if (line==null) return null; } while (line.length()==0 || line.trim().charAt(0)=='#'); // parse the expression myParser.parseExpression(line); // did an error occur while parsing? errorStr = myParser.getErrorInfo(); if (errorStr != null) { println("Error while parsing line " + lineCount + ": " + errorStr); return null; } // evaluate the expression value = myParser.getComplexValue(); // did an error occur while evaluating? errorStr = myParser.getErrorInfo(); if ((value == null) || (errorStr != null)) { println("Error while evaluating line " + lineCount + ": " + errorStr); return null; } return value; }
1,116,470
private Complex parseNextLine(BufferedReader reader) { Complex value; String line, errorStr; // cycle till a valid line is found do { try { line = reader.readLine(); lineCount++; } catch (Exception e) { return null; } if (line==null) return null; } while (line.length()==0 || line.trim().charAt(0)=='#'); // parse the expression myParser.parseExpression(line); // did an error occur while parsing? errorStr = myParser.getErrorInfo(); if (errorStr != null) { println("Error while parsing line " + lineCount + ": " + errorStr); return null; } // evaluate the expression value = myParser.getComplexValue(); // did an error occur while evaluating? errorStr = myParser.getErrorInfo(); if ((value == null) || (errorStr != null)) { println("Error while evaluating line " + lineCount + ": " + errorStr); return null; } return value; }
private Complex parseNextLine(BufferedReader reader) { Complex value; String line, errorStr; // cycle till a valid line is found do { try { line = reader.readLine(); lineCount++; } catch (Exception e) { return null; } if (line==null) return null; } while (line.length()==0 || line.trim().charAt(0)=='#'); // parse the expression myParser.parseExpression(line); // did an error occur while parsing? errorStr = myParser.getErrorInfo(); if (errorStr != null) { println("Error while parsing line " + lineCount + ": " + errorStr); return null; } // evaluate the expression value = myParser.getComplexValue(); // did an error occur while evaluating? errorStr = myParser.getErrorInfo(); if ((value == null) || (errorStr != null)) { println("Error while evaluating line " + lineCount + ": " + errorStr); return null; } return value; }
1,116,471
private Complex parseNextLine(BufferedReader reader) { Complex value; String line, errorStr; // cycle till a valid line is found do { try { line = reader.readLine(); lineCount++; } catch (Exception e) { return null; } if (line==null) return null; } while (line.length()==0 || line.trim().charAt(0)=='#'); // parse the expression myParser.parseExpression(line); // did an error occur while parsing? errorStr = myParser.getErrorInfo(); if (errorStr != null) { println("Error while parsing line " + lineCount + ": " + errorStr); return null; } // evaluate the expression value = myParser.getComplexValue(); // did an error occur while evaluating? errorStr = myParser.getErrorInfo(); if ((value == null) || (errorStr != null)) { println("Error while evaluating line " + lineCount + ": " + errorStr); return null; } return value; }
private Complex parseNextLine(BufferedReader reader) { Complex value; String line, errorStr; // cycle till a valid line is found do { try { line = reader.readLine(); lineCount++; } catch (Exception e) { return null; } if (line==null) return null; } while (line.length()==0 || line.trim().charAt(0)=='#'); // parse the expression myParser.parseExpression(line); // did an error occur while parsing? errorStr = myParser.getErrorInfo(); if (errorStr != null) { println("Error while parsing line " + lineCount + ": " + errorStr); return null; } // evaluate the expression value = myParser.getValueAsObject(); // did an error occur while evaluating? errorStr = myParser.getErrorInfo(); if ((value == null) || (errorStr != null)) { println("Error while evaluating line " + lineCount + ": " + errorStr); return null; } return value; }
1,116,472
private Complex parseNextLine(BufferedReader reader) { Complex value; String line, errorStr; // cycle till a valid line is found do { try { line = reader.readLine(); lineCount++; } catch (Exception e) { return null; } if (line==null) return null; } while (line.length()==0 || line.trim().charAt(0)=='#'); // parse the expression myParser.parseExpression(line); // did an error occur while parsing? errorStr = myParser.getErrorInfo(); if (errorStr != null) { println("Error while parsing line " + lineCount + ": " + errorStr); return null; } // evaluate the expression value = myParser.getComplexValue(); // did an error occur while evaluating? errorStr = myParser.getErrorInfo(); if ((value == null) || (errorStr != null)) { println("Error while evaluating line " + lineCount + ": " + errorStr); return null; } return value; }
private Complex parseNextLine(BufferedReader reader) { Complex value; String line, errorStr; // cycle till a valid line is found do { try { line = reader.readLine(); lineCount++; } catch (Exception e) { return null; } if (line==null) return null; } while (line.length()==0 || line.trim().charAt(0)=='#'); // parse the expression myParser.parseExpression(line); // did an error occur while parsing? errorStr = myParser.getErrorInfo(); if (errorStr != null) { println("Error while parsing line " + lineCount + ": " + errorStr); return null; } // evaluate the expression value = myParser.getComplexValue(); // did an error occur while evaluating? errorStr = myParser.getErrorInfo(); if ((value == null) || (errorStr != null)) { println("Error while evaluating line " + lineCount + ": " + errorStr); return null; } return value; }
1,116,473
public void run(String fileName) { BufferedReader reader; Complex c1, c2; boolean hasError = false; // Load the input file try { reader = new BufferedReader(new FileReader(fileName)); } catch (Exception e) { println("File \""+fileName+"\" not found"); return; } // reset the line count lineCount = 0; // cycle through the expressions in pairs of two println("Evaluating and comparing expressions..."); while (true) { // get values of a pair of two lines c1 = parseNextLine(reader); c2 = parseNextLine(reader); if (c1==null || c2==null) break; // TODO: add comparison method that handles all types (Strings...) if (!c1.equals(c2,1e-15)) { hasError = true; print("Line: " + lineCount + ": "); if (c1.im() == 0) print("" + c1.re() + " != "); else print("" + c1 + " != "); if (c2.im() == 0) println("" + c2.re()); else println("" + c2); } } if (!hasError) { print("\n" + lineCount + " lines processed. No errors were found.\n\n"); } }
public void run(String fileName) { BufferedReader reader; Object v1, v2; boolean hasError = false; // Load the input file try { reader = new BufferedReader(new FileReader(fileName)); } catch (Exception e) { println("File \""+fileName+"\" not found"); return; } // reset the line count lineCount = 0; // cycle through the expressions in pairs of two println("Evaluating and comparing expressions..."); while (true) { // get values of a pair of two lines c1 = parseNextLine(reader); c2 = parseNextLine(reader); if (c1==null || c2==null) break; // TODO: add comparison method that handles all types (Strings...) if (!c1.equals(c2,1e-15)) { hasError = true; print("Line: " + lineCount + ": "); if (c1.im() == 0) print("" + c1.re() + " != "); else print("" + c1 + " != "); if (c2.im() == 0) println("" + c2.re()); else println("" + c2); } } if (!hasError) { print("\n" + lineCount + " lines processed. No errors were found.\n\n"); } }
1,116,474
public void run(String fileName) { BufferedReader reader; Complex c1, c2; boolean hasError = false; // Load the input file try { reader = new BufferedReader(new FileReader(fileName)); } catch (Exception e) { println("File \""+fileName+"\" not found"); return; } // reset the line count lineCount = 0; // cycle through the expressions in pairs of two println("Evaluating and comparing expressions..."); while (true) { // get values of a pair of two lines c1 = parseNextLine(reader); c2 = parseNextLine(reader); if (c1==null || c2==null) break; // TODO: add comparison method that handles all types (Strings...) if (!c1.equals(c2,1e-15)) { hasError = true; print("Line: " + lineCount + ": "); if (c1.im() == 0) print("" + c1.re() + " != "); else print("" + c1 + " != "); if (c2.im() == 0) println("" + c2.re()); else println("" + c2); } } if (!hasError) { print("\n" + lineCount + " lines processed. No errors were found.\n\n"); } }
public void run(String fileName) { BufferedReader reader; Complex c1, c2; boolean hasError = false; // Load the input file try { reader = new BufferedReader(new FileReader(fileName)); } catch (Exception e) { println("File \""+fileName+"\" not found"); return; } // reset the line count lineCount = 0; // cycle through the expressions in pairs of two println("Evaluating and comparing expressions..."); while (true) { // get values of a pair of two lines c1 = parseNextLine(reader); c2 = parseNextLine(reader); if (c1==null || c2==null) break; // TODO: add comparison method that handles all types (Strings...) if (!c1.equals(c2,1e-15)) { hasError = true; print("Line: " + lineCount + ": "); if (c1.im() == 0) print("" + c1.re() + " != "); else print("" + c1 + " != "); if (c2.im() == 0) println("" + c2.re()); else println("" + c2); } } if (!hasError) { print("\n" + lineCount + " lines processed. No errors were found.\n\n"); } }
1,116,475
public void run(String fileName) { BufferedReader reader; Complex c1, c2; boolean hasError = false; // Load the input file try { reader = new BufferedReader(new FileReader(fileName)); } catch (Exception e) { println("File \""+fileName+"\" not found"); return; } // reset the line count lineCount = 0; // cycle through the expressions in pairs of two println("Evaluating and comparing expressions..."); while (true) { // get values of a pair of two lines c1 = parseNextLine(reader); c2 = parseNextLine(reader); if (c1==null || c2==null) break; // TODO: add comparison method that handles all types (Strings...) if (!c1.equals(c2,1e-15)) { hasError = true; print("Line: " + lineCount + ": "); if (c1.im() == 0) print("" + c1.re() + " != "); else print("" + c1 + " != "); if (c2.im() == 0) println("" + c2.re()); else println("" + c2); } } if (!hasError) { print("\n" + lineCount + " lines processed. No errors were found.\n\n"); } }
public void run(String fileName) { BufferedReader reader; Complex c1, c2; boolean hasError = false; // Load the input file try { reader = new BufferedReader(new FileReader(fileName)); } catch (Exception e) { println("File \""+fileName+"\" not found"); return; } // reset the line count lineCount = 0; // cycle through the expressions in pairs of two println("Evaluating and comparing expressions..."); while (true) { // get values of a pair of two lines c1 = parseNextLine(reader); c2 = parseNextLine(reader); if (c1==null || c2==null) break; // TODO: add comparison method that handles all types (Strings...) if (!c1.equals(c2,1e-15)) { hasError = true; print("Line: " + lineCount + ": "); if (c1.im() == 0) print("" + c1.re() + " != "); else print("" + c1 + " != "); if (c2.im() == 0) println("" + c2.re()); else println("" + c2); } } if (!hasError) { print("\n" + lineCount + " lines processed. No errors were found.\n\n"); } }
1,116,476
public void run(String fileName) { BufferedReader reader; Complex c1, c2; boolean hasError = false; // Load the input file try { reader = new BufferedReader(new FileReader(fileName)); } catch (Exception e) { println("File \""+fileName+"\" not found"); return; } // reset the line count lineCount = 0; // cycle through the expressions in pairs of two println("Evaluating and comparing expressions..."); while (true) { // get values of a pair of two lines c1 = parseNextLine(reader); c2 = parseNextLine(reader); if (c1==null || c2==null) break; // TODO: add comparison method that handles all types (Strings...) if (!c1.equals(c2,1e-15)) { hasError = true; print("Line: " + lineCount + ": "); if (c1.im() == 0) print("" + c1.re() + " != "); else print("" + c1 + " != "); if (c2.im() == 0) println("" + c2.re()); else println("" + c2); } } if (!hasError) { print("\n" + lineCount + " lines processed. No errors were found.\n\n"); } }
public void run(String fileName) { BufferedReader reader; Complex c1, c2; boolean hasError = false; // Load the input file try { reader = new BufferedReader(new FileReader(fileName)); } catch (Exception e) { println("File \""+fileName+"\" not found"); return; } // reset the line count lineCount = 0; // cycle through the expressions in pairs of two println("Evaluating and comparing expressions..."); while (true) { // get values of a pair of two lines c1 = parseNextLine(reader); c2 = parseNextLine(reader); if (c1==null || c2==null) break; // TODO: add comparison method that handles all types (Strings...) if (!c1.equals(c2,1e-15)) { hasError = true; print("Line: " + lineCount + ": "); if (c1.im() == 0) print("" + c1.re() + " != "); else print("" + c1 + " != "); if (c2.im() == 0) println("" + c2.re()); else println("" + c2); } } if (!hasError) { print("\n" + lineCount + " lines processed. No errors were found.\n\n"); } }
1,116,477
public void run(String fileName) { BufferedReader reader; Complex c1, c2; boolean hasError = false; // Load the input file try { reader = new BufferedReader(new FileReader(fileName)); } catch (Exception e) { println("File \""+fileName+"\" not found"); return; } // reset the line count lineCount = 0; // cycle through the expressions in pairs of two println("Evaluating and comparing expressions..."); while (true) { // get values of a pair of two lines c1 = parseNextLine(reader); c2 = parseNextLine(reader); if (c1==null || c2==null) break; // TODO: add comparison method that handles all types (Strings...) if (!c1.equals(c2,1e-15)) { hasError = true; print("Line: " + lineCount + ": "); if (c1.im() == 0) print("" + c1.re() + " != "); else print("" + c1 + " != "); if (c2.im() == 0) println("" + c2.re()); else println("" + c2); } } if (!hasError) { print("\n" + lineCount + " lines processed. No errors were found.\n\n"); } }
public void run(String fileName) { BufferedReader reader; Complex c1, c2; boolean hasError = false; // Load the input file try { reader = new BufferedReader(new FileReader(fileName)); } catch (Exception e) { println("File \""+fileName+"\" not found"); return; } // reset the line count lineCount = 0; // cycle through the expressions in pairs of two println("Evaluating and comparing expressions..."); while (true) { // get values of a pair of two lines c1 = parseNextLine(reader); c2 = parseNextLine(reader); if (c1==null || c2==null) break; // TODO: add comparison method that handles all types (Strings...) if (!c1.equals(c2,1e-15)) { hasError = true; print("Line: " + lineCount + ": "); if (c1.im() == 0) print("" + c1.re() + " != "); else print("" + c1 + " != "); if (c2.im() == 0) println("" + c2.re()); else println("" + c2); } } if (!hasError) { print("\n" + lineCount + " lines processed. No errors were found.\n\n"); } }
1,116,478
public String getDisplayName() { return node.getNodeName(); }
public String getDisplayName() { return getNode().getNodeName(); }
1,116,481
public List<Project> getTiedJobs() { List<Project> r = new ArrayList<Project>(); for( Job j : Hudson.getInstance().getJobs() ) { if (j instanceof Project) { Project p = (Project) j; if(p.getAssignedNode()==node) r.add(p); } } return r; }
public List<Project> getTiedJobs() { List<Project> r = new ArrayList<Project>(); for( Job j : Hudson.getInstance().getJobs() ) { if (j instanceof Project) { Project p = (Project) j; if(p.getAssignedNode()==getNode()) r.add(p); } } return r; }
1,116,482
private Date parseDate(final String date) { try { return c_inputDate.parse(date); } catch (ParseException e) { StringWriter w = new StringWriter(); w.write("Failed to parse "); w.write(date); w.write('\n'); e.printStackTrace(new PrintWriter(w)); owner.log(w.toString(), Project.MSG_ERR); //final String message = REZ.getString( "changelog.bat-date.error", date ); //getContext().error( message ); return null; } }
private Date parseDate(final String date) { try { return c_inputDate.parse(date); } catch (ParseException e) { StringWriter w = new StringWriter(); w.write("Failed to parse "); w.write(date); w.write('\n'); e.printStackTrace(new PrintWriter(w)); owner.log(w.toString(), Project.MSG_ERR); //final String message = REZ.getString( "changelog.bat-date.error", date ); //getContext().error( message ); return null; } }
1,116,484
ShapeType(String typeID, String name, boolean isSelected) { this.typeID = typeID; this.name = name; this.isSelected = isSelected; }
ShapeType(String typeID, String name, String color, boolean isSelected) { this.typeID = typeID; this.name = name; this.isSelected = isSelected; }
1,116,486
private void writeDownloadData() { long totalBufferedSize = 0; boolean performCompleteWrite = false; if ( isShutingDown || lastCompleteWrite + DateUtils.MILLIS_PER_MINUTE < System.currentTimeMillis() ) { NLogger.debug(DownloadDataWriter.class, "Time for complete write cycle." ); performCompleteWrite = true; } List<SWDownloadFile> downloadList = SwarmingManager.getInstance().getDownloadFileListCopy(); ListIterator<SWDownloadFile> iterator = downloadList.listIterator(); while( iterator.hasNext() ) { SWDownloadFile downloadFile = iterator.next(); MemoryFile memoryFile = downloadFile.getMemoryFile(); long bufferedSize = memoryFile.getBufferedDataLength(); totalBufferedSize += bufferedSize; if ( performCompleteWrite || bufferedSize > ServiceManager.sCfg.maxWriteBufferPerDownload ) { NLogger.debug(DownloadDataWriter.class, "Trigger buffer write for " + downloadFile + ", amount: " + bufferedSize ); memoryFile.writeBuffersToDisk(); // remove from buffer since not needed anymore in possible // following complete write cycle iterator.remove(); } } NLogger.debug(DownloadDataWriter.class, "Total buffered data was: " + totalBufferedSize ); // if we have not already written everything but have a high total buffer // size we write down the complete download buffers to disk. if ( !performCompleteWrite && totalBufferedSize > ServiceManager.sCfg.maxTotalDownloadWriteBuffer ) { performCompleteWrite = true; iterator = downloadList.listIterator(); while( iterator.hasNext() ) { SWDownloadFile downloadFile = iterator.next(); MemoryFile memoryFile = downloadFile.getMemoryFile(); NLogger.debug(DownloadDataWriter.class, "Trigger buffer write for " + downloadFile + ", amount: " + memoryFile.getBufferedDataLength() ); memoryFile.writeBuffersToDisk(); } } if ( performCompleteWrite ) { lastCompleteWrite = System.currentTimeMillis(); } }
private void writeDownloadData() { long totalBufferedSize = 0; boolean performCompleteWrite = false; if ( isShutingDown || lastCompleteWrite + DateUtils.MILLIS_PER_MINUTE < System.currentTimeMillis() ) { NLogger.debug(DownloadDataWriter.class, "Time for complete write cycle." ); performCompleteWrite = true; } List<SWDownloadFile> downloadList = swarmingMgr.getDownloadFileListCopy(); ListIterator<SWDownloadFile> iterator = downloadList.listIterator(); while( iterator.hasNext() ) { SWDownloadFile downloadFile = iterator.next(); MemoryFile memoryFile = downloadFile.getMemoryFile(); long bufferedSize = memoryFile.getBufferedDataLength(); totalBufferedSize += bufferedSize; if ( performCompleteWrite || bufferedSize > ServiceManager.sCfg.maxWriteBufferPerDownload ) { NLogger.debug(DownloadDataWriter.class, "Trigger buffer write for " + downloadFile + ", amount: " + bufferedSize ); memoryFile.writeBuffersToDisk(); // remove from buffer since not needed anymore in possible // following complete write cycle iterator.remove(); } } NLogger.debug(DownloadDataWriter.class, "Total buffered data was: " + totalBufferedSize ); // if we have not already written everything but have a high total buffer // size we write down the complete download buffers to disk. if ( !performCompleteWrite && totalBufferedSize > ServiceManager.sCfg.maxTotalDownloadWriteBuffer ) { performCompleteWrite = true; iterator = downloadList.listIterator(); while( iterator.hasNext() ) { SWDownloadFile downloadFile = iterator.next(); MemoryFile memoryFile = downloadFile.getMemoryFile(); NLogger.debug(DownloadDataWriter.class, "Trigger buffer write for " + downloadFile + ", amount: " + memoryFile.getBufferedDataLength() ); memoryFile.writeBuffersToDisk(); } } if ( performCompleteWrite ) { lastCompleteWrite = System.currentTimeMillis(); } }
1,116,489
public void actionPerformed(ActionEvent e) { Object o = e.getSource(); String s = ""; // String t = ""; if (!o.getClass().getName().endsWith("JTextField")) return; s = ((JTextField) o).getText(); // t = s.replace(',','.'); // accept also european decimal komma if (o == txtName) myRecipe.setName(s); else if (o == brewerNameText) myRecipe.setBrewer(s); else if (o == txtPreBoil) { myRecipe.setPreBoil(Double.parseDouble(s)); displayRecipe(); } else if (o == postBoilText) { myRecipe.setPostBoil(Double.parseDouble(s)); displayRecipe(); } else if (o == evapText) { myRecipe.setEvap(Double.parseDouble(s)); displayRecipe(); } else if (o == boilMinText) { if( s.indexOf('.') > 0) { // parseInt doesn't like '.' or ',', so trim the string s = s.substring(0,s.indexOf('.')); } myRecipe.setBoilMinutes(Integer.parseInt(s)); displayRecipe(); } }
public void actionPerformed(ActionEvent e) { Object o = e.getSource(); String s = ""; // String t = ""; if (!o.getClass().getName().endsWith("TextField")) return; s = ((JTextField) o).getText(); // t = s.replace(',','.'); // accept also european decimal komma if (o == txtName) myRecipe.setName(s); else if (o == brewerNameText) myRecipe.setBrewer(s); else if (o == txtPreBoil) { myRecipe.setPreBoil(Double.parseDouble(s)); displayRecipe(); } else if (o == postBoilText) { myRecipe.setPostBoil(Double.parseDouble(s)); displayRecipe(); } else if (o == evapText) { myRecipe.setEvap(Double.parseDouble(s)); displayRecipe(); } else if (o == boilMinText) { if( s.indexOf('.') > 0) { // parseInt doesn't like '.' or ',', so trim the string s = s.substring(0,s.indexOf('.')); } myRecipe.setBoilMinutes(Integer.parseInt(s)); displayRecipe(); } }
1,116,491
public void actionPerformed(ActionEvent e) { Object o = e.getSource(); String s = ""; // String t = ""; if (!o.getClass().getName().endsWith("JTextField")) return; s = ((JTextField) o).getText(); // t = s.replace(',','.'); // accept also european decimal komma if (o == txtName) myRecipe.setName(s); else if (o == brewerNameText) myRecipe.setBrewer(s); else if (o == txtPreBoil) { myRecipe.setPreBoil(Double.parseDouble(s)); displayRecipe(); } else if (o == postBoilText) { myRecipe.setPostBoil(Double.parseDouble(s)); displayRecipe(); } else if (o == evapText) { myRecipe.setEvap(Double.parseDouble(s)); displayRecipe(); } else if (o == boilMinText) { if( s.indexOf('.') > 0) { // parseInt doesn't like '.' or ',', so trim the string s = s.substring(0,s.indexOf('.')); } myRecipe.setBoilMinutes(Integer.parseInt(s)); displayRecipe(); } }
public void actionPerformed(ActionEvent e) { Object o = e.getSource(); String s = ""; // String t = ""; if (!o.getClass().getName().endsWith("JTextField")) return; s = ((JTextField) o).getText(); // t = s.replace(',','.'); // accept also european decimal komma if (o == txtName) myRecipe.setName(s); else if (o == brewerNameText) myRecipe.setBrewer(s); else if (o == preBoilText) { myRecipe.setPreBoil(Double.parseDouble(s)); displayRecipe(); } else if (o == postBoilText) { myRecipe.setPostBoil(Double.parseDouble(s)); displayRecipe(); } else if (o == evapText) { myRecipe.setEvap(Double.parseDouble(s)); displayRecipe(); } else if (o == boilMinText) { if( s.indexOf('.') > 0) { // parseInt doesn't like '.' or ',', so trim the string s = s.substring(0,s.indexOf('.')); } myRecipe.setBoilMinutes(Integer.parseInt(s)); displayRecipe(); } }
1,116,492
private void addListeners(){ txtName.addActionListener(this); txtName.addFocusListener(this); brewerNameText.addFocusListener(this); brewerNameText.addActionListener(this); txtDate.addFocusListener(this); txtDate.addActionListener(this); txtPreBoil.addFocusListener(this); txtPreBoil.addActionListener(this); boilMinText.addFocusListener(this); boilMinText.addActionListener(this); evapText.addFocusListener(this); evapText.addActionListener(this); cmbStyle.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Style s = (Style) cmbStyleModel.getSelectedItem(); if (myRecipe != null && s != myRecipe.getStyleObj()) { myRecipe.setStyle(s); stylePanel.setStyle(s); } cmbStyle.setToolTipText(SBStringUtils.multiLineToolTip(50, s .getDescription())); } }); postBoilText.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }); postBoilText.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }); cmbYeast.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Yeast y = (Yeast) cmbYeastModel.getSelectedItem(); if (myRecipe != null && y != myRecipe.getYeastObj()) { myRecipe.setYeast(y); } String st = SBStringUtils.multiLineToolTip(40, y .getDescription()); cmbYeast.setToolTipText(st); } }); cmbSizeUnits.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String q = (String) cmbSizeUnits.getSelectedItem(); if (myRecipe != null && q != myRecipe.getVolUnits()) { // also sets postboil units: myRecipe.setVolUnits(q); displayRecipe(); } } }); alcMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); ibuMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); colourMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); evapMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); maltComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Fermentable f = (Fermentable) cmbMaltModel .getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1 ) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ f2.setLov(f.getLov()); f2.setPppg(f.getPppg()); f2.setDescription(f.getDescription()); f2.setMashed(f.getMashed()); f2.setSteep(f.getSteep()); f2.setCost(f.getCostPerU()); } } } }); maltUnitsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String u = (String) cmbMaltUnitsModel.getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ // this converts the cost and amount: f2.convertTo(u); myRecipe.calcMaltTotals(); displayRecipe(); } } } }); hopComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Hop h = (Hop) cmbHopsModel.getSelectedItem(); int i = hopsTable.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h2 = myRecipe.getHop(i); h2.setAlpha(h.getAlpha()); h2.setDescription(h.getDescription()); h2.setCost(h.getCostPerU()); } } }); hopsUnitsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String u = (String) cmbHopsUnitsModel.getSelectedItem(); int i = hopsTable.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h = myRecipe.getHop(i); h.convertTo(u); myRecipe.calcHopsTotals(); // tblHops.updateUI(); displayRecipe(); } } }); }
private void addListeners(){ txtName.addActionListener(this); txtName.addFocusListener(this); brewerNameText.addFocusListener(this); brewerNameText.addActionListener(this); txtDate.addFocusListener(this); txtDate.addActionListener(this); txtPreBoil.addFocusListener(this); txtPreBoil.addActionListener(this); boilMinText.addFocusListener(this); boilMinText.addActionListener(this); evapText.addFocusListener(this); evapText.addActionListener(this); cmbStyle.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Style s = (Style) cmbStyleModel.getSelectedItem(); if (myRecipe != null && s != myRecipe.getStyleObj()) { myRecipe.setStyle(s); stylePanel.setStyle(s); } cmbStyle.setToolTipText(SBStringUtils.multiLineToolTip(50, s .getDescription())); } }); postBoilText.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }); postBoilText.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }); cmbYeast.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Yeast y = (Yeast) cmbYeastModel.getSelectedItem(); if (myRecipe != null && y != myRecipe.getYeastObj()) { myRecipe.setYeast(y); } String st = SBStringUtils.multiLineToolTip(40, y .getDescription()); cmbYeast.setToolTipText(st); } }); cmbSizeUnits.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String q = (String) cmbSizeUnits.getSelectedItem(); if (myRecipe != null && q != myRecipe.getVolUnits()) { // also sets postboil units: myRecipe.setVolUnits(q); displayRecipe(); } } }); alcMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); ibuMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); colourMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); evapMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); maltComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Fermentable f = (Fermentable) cmbMaltModel .getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1 ) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ f2.setLov(f.getLov()); f2.setPppg(f.getPppg()); f2.setDescription(f.getDescription()); f2.setMashed(f.getMashed()); f2.setSteep(f.getSteep()); f2.setCost(f.getCostPerU()); } } } }); maltUnitsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String u = (String) cmbMaltUnitsModel.getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ // this converts the cost and amount: f2.convertTo(u); myRecipe.calcMaltTotals(); displayRecipe(); } } } }); hopComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Hop h = (Hop) cmbHopsModel.getSelectedItem(); int i = hopsTable.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h2 = myRecipe.getHop(i); h2.setAlpha(h.getAlpha()); h2.setDescription(h.getDescription()); h2.setCost(h.getCostPerU()); } } }); hopsUnitsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String u = (String) cmbHopsUnitsModel.getSelectedItem(); int i = hopsTable.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h = myRecipe.getHop(i); h.convertTo(u); myRecipe.calcHopsTotals(); // tblHops.updateUI(); displayRecipe(); } } }); }
1,116,493
private void addListeners(){ txtName.addActionListener(this); txtName.addFocusListener(this); brewerNameText.addFocusListener(this); brewerNameText.addActionListener(this); txtDate.addFocusListener(this); txtDate.addActionListener(this); txtPreBoil.addFocusListener(this); txtPreBoil.addActionListener(this); boilMinText.addFocusListener(this); boilMinText.addActionListener(this); evapText.addFocusListener(this); evapText.addActionListener(this); cmbStyle.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Style s = (Style) cmbStyleModel.getSelectedItem(); if (myRecipe != null && s != myRecipe.getStyleObj()) { myRecipe.setStyle(s); stylePanel.setStyle(s); } cmbStyle.setToolTipText(SBStringUtils.multiLineToolTip(50, s .getDescription())); } }); postBoilText.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }); postBoilText.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }); cmbYeast.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Yeast y = (Yeast) cmbYeastModel.getSelectedItem(); if (myRecipe != null && y != myRecipe.getYeastObj()) { myRecipe.setYeast(y); } String st = SBStringUtils.multiLineToolTip(40, y .getDescription()); cmbYeast.setToolTipText(st); } }); cmbSizeUnits.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String q = (String) cmbSizeUnits.getSelectedItem(); if (myRecipe != null && q != myRecipe.getVolUnits()) { // also sets postboil units: myRecipe.setVolUnits(q); displayRecipe(); } } }); alcMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); ibuMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); colourMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); evapMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); maltComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Fermentable f = (Fermentable) cmbMaltModel .getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1 ) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ f2.setLov(f.getLov()); f2.setPppg(f.getPppg()); f2.setDescription(f.getDescription()); f2.setMashed(f.getMashed()); f2.setSteep(f.getSteep()); f2.setCost(f.getCostPerU()); } } } }); maltUnitsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String u = (String) cmbMaltUnitsModel.getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ // this converts the cost and amount: f2.convertTo(u); myRecipe.calcMaltTotals(); displayRecipe(); } } } }); hopComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Hop h = (Hop) cmbHopsModel.getSelectedItem(); int i = hopsTable.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h2 = myRecipe.getHop(i); h2.setAlpha(h.getAlpha()); h2.setDescription(h.getDescription()); h2.setCost(h.getCostPerU()); } } }); hopsUnitsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String u = (String) cmbHopsUnitsModel.getSelectedItem(); int i = hopsTable.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h = myRecipe.getHop(i); h.convertTo(u); myRecipe.calcHopsTotals(); // tblHops.updateUI(); displayRecipe(); } } }); }
private void addListeners(){ txtName.addActionListener(this); txtName.addFocusListener(this); brewerNameText.addFocusListener(this); brewerNameText.addActionListener(this); txtDate.addFocusListener(this); txtDate.addActionListener(this); txtPreBoil.addFocusListener(this); txtPreBoil.addActionListener(this); boilMinText.addFocusListener(this); boilMinText.addActionListener(this); evapText.addFocusListener(this); evapText.addActionListener(this); cmbStyle.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Style s = (Style) cmbStyleModel.getSelectedItem(); if (myRecipe != null && s != myRecipe.getStyleObj()) { myRecipe.setStyle(s); stylePanel.setStyle(s); } cmbStyle.setToolTipText(SBStringUtils.multiLineToolTip(50, s .getDescription())); } }); /* postBoilText.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }); postBoilText.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }); cmbYeast.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Yeast y = (Yeast) cmbYeastModel.getSelectedItem(); if (myRecipe != null && y != myRecipe.getYeastObj()) { myRecipe.setYeast(y); } String st = SBStringUtils.multiLineToolTip(40, y .getDescription()); cmbYeast.setToolTipText(st); } }); cmbSizeUnits.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String q = (String) cmbSizeUnits.getSelectedItem(); if (myRecipe != null && q != myRecipe.getVolUnits()) { // also sets postboil units: myRecipe.setVolUnits(q); displayRecipe(); } } }); alcMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); ibuMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); colourMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); evapMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); maltComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Fermentable f = (Fermentable) cmbMaltModel .getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1 ) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ f2.setLov(f.getLov()); f2.setPppg(f.getPppg()); f2.setDescription(f.getDescription()); f2.setMashed(f.getMashed()); f2.setSteep(f.getSteep()); f2.setCost(f.getCostPerU()); } } } }); maltUnitsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String u = (String) cmbMaltUnitsModel.getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ // this converts the cost and amount: f2.convertTo(u); myRecipe.calcMaltTotals(); displayRecipe(); } } } }); hopComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Hop h = (Hop) cmbHopsModel.getSelectedItem(); int i = hopsTable.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h2 = myRecipe.getHop(i); h2.setAlpha(h.getAlpha()); h2.setDescription(h.getDescription()); h2.setCost(h.getCostPerU()); } } }); hopsUnitsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String u = (String) cmbHopsUnitsModel.getSelectedItem(); int i = hopsTable.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h = myRecipe.getHop(i); h.convertTo(u); myRecipe.calcHopsTotals(); // tblHops.updateUI(); displayRecipe(); } } }); }
1,116,494
private void addListeners(){ txtName.addActionListener(this); txtName.addFocusListener(this); brewerNameText.addFocusListener(this); brewerNameText.addActionListener(this); txtDate.addFocusListener(this); txtDate.addActionListener(this); txtPreBoil.addFocusListener(this); txtPreBoil.addActionListener(this); boilMinText.addFocusListener(this); boilMinText.addActionListener(this); evapText.addFocusListener(this); evapText.addActionListener(this); cmbStyle.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Style s = (Style) cmbStyleModel.getSelectedItem(); if (myRecipe != null && s != myRecipe.getStyleObj()) { myRecipe.setStyle(s); stylePanel.setStyle(s); } cmbStyle.setToolTipText(SBStringUtils.multiLineToolTip(50, s .getDescription())); } }); postBoilText.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }); postBoilText.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }); cmbYeast.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Yeast y = (Yeast) cmbYeastModel.getSelectedItem(); if (myRecipe != null && y != myRecipe.getYeastObj()) { myRecipe.setYeast(y); } String st = SBStringUtils.multiLineToolTip(40, y .getDescription()); cmbYeast.setToolTipText(st); } }); cmbSizeUnits.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String q = (String) cmbSizeUnits.getSelectedItem(); if (myRecipe != null && q != myRecipe.getVolUnits()) { // also sets postboil units: myRecipe.setVolUnits(q); displayRecipe(); } } }); alcMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); ibuMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); colourMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); evapMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); maltComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Fermentable f = (Fermentable) cmbMaltModel .getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1 ) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ f2.setLov(f.getLov()); f2.setPppg(f.getPppg()); f2.setDescription(f.getDescription()); f2.setMashed(f.getMashed()); f2.setSteep(f.getSteep()); f2.setCost(f.getCostPerU()); } } } }); maltUnitsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String u = (String) cmbMaltUnitsModel.getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ // this converts the cost and amount: f2.convertTo(u); myRecipe.calcMaltTotals(); displayRecipe(); } } } }); hopComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Hop h = (Hop) cmbHopsModel.getSelectedItem(); int i = hopsTable.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h2 = myRecipe.getHop(i); h2.setAlpha(h.getAlpha()); h2.setDescription(h.getDescription()); h2.setCost(h.getCostPerU()); } } }); hopsUnitsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String u = (String) cmbHopsUnitsModel.getSelectedItem(); int i = hopsTable.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h = myRecipe.getHop(i); h.convertTo(u); myRecipe.calcHopsTotals(); // tblHops.updateUI(); displayRecipe(); } } }); }
private void addListeners(){ txtName.addActionListener(this); txtName.addFocusListener(this); brewerNameText.addFocusListener(this); brewerNameText.addActionListener(this); txtDate.addFocusListener(this); txtDate.addActionListener(this); txtPreBoil.addFocusListener(this); txtPreBoil.addActionListener(this); boilMinText.addFocusListener(this); boilMinText.addActionListener(this); evapText.addFocusListener(this); evapText.addActionListener(this); cmbStyle.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Style s = (Style) cmbStyleModel.getSelectedItem(); if (myRecipe != null && s != myRecipe.getStyleObj()) { myRecipe.setStyle(s); stylePanel.setStyle(s); } cmbStyle.setToolTipText(SBStringUtils.multiLineToolTip(50, s .getDescription())); } }); postBoilText.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }); postBoilText.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }); cmbYeast.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Yeast y = (Yeast) cmbYeastModel.getSelectedItem(); if (myRecipe != null && y != myRecipe.getYeastObj()) { myRecipe.setYeast(y); } String st = SBStringUtils.multiLineToolTip(40, y .getDescription()); cmbYeast.setToolTipText(st); } }); cmbSizeUnits.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String q = (String) cmbSizeUnits.getSelectedItem(); if (myRecipe != null && q != myRecipe.getVolUnits()) { // also sets postboil units: myRecipe.setVolUnits(q); displayRecipe(); } } }); alcMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); ibuMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); colourMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); evapMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); maltComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Fermentable f = (Fermentable) cmbMaltModel .getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1 ) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ f2.setLov(f.getLov()); f2.setPppg(f.getPppg()); f2.setDescription(f.getDescription()); f2.setMashed(f.getMashed()); f2.setSteep(f.getSteep()); f2.setCost(f.getCostPerU()); } } } }); maltUnitsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String u = (String) cmbMaltUnitsModel.getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ // this converts the cost and amount: f2.convertTo(u); myRecipe.calcMaltTotals(); displayRecipe(); } } } }); hopComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Hop h = (Hop) cmbHopsModel.getSelectedItem(); int i = hopsTable.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h2 = myRecipe.getHop(i); h2.setAlpha(h.getAlpha()); h2.setDescription(h.getDescription()); h2.setCost(h.getCostPerU()); } } }); hopsUnitsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String u = (String) cmbHopsUnitsModel.getSelectedItem(); int i = hopsTable.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h = myRecipe.getHop(i); h.convertTo(u); myRecipe.calcHopsTotals(); // tblHops.updateUI(); displayRecipe(); } } }); }
1,116,495
private void addListeners(){ txtName.addActionListener(this); txtName.addFocusListener(this); brewerNameText.addFocusListener(this); brewerNameText.addActionListener(this); txtDate.addFocusListener(this); txtDate.addActionListener(this); txtPreBoil.addFocusListener(this); txtPreBoil.addActionListener(this); boilMinText.addFocusListener(this); boilMinText.addActionListener(this); evapText.addFocusListener(this); evapText.addActionListener(this); cmbStyle.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Style s = (Style) cmbStyleModel.getSelectedItem(); if (myRecipe != null && s != myRecipe.getStyleObj()) { myRecipe.setStyle(s); stylePanel.setStyle(s); } cmbStyle.setToolTipText(SBStringUtils.multiLineToolTip(50, s .getDescription())); } }); postBoilText.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }); postBoilText.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }); cmbYeast.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Yeast y = (Yeast) cmbYeastModel.getSelectedItem(); if (myRecipe != null && y != myRecipe.getYeastObj()) { myRecipe.setYeast(y); } String st = SBStringUtils.multiLineToolTip(40, y .getDescription()); cmbYeast.setToolTipText(st); } }); cmbSizeUnits.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String q = (String) cmbSizeUnits.getSelectedItem(); if (myRecipe != null && q != myRecipe.getVolUnits()) { // also sets postboil units: myRecipe.setVolUnits(q); displayRecipe(); } } }); alcMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); ibuMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); colourMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); evapMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); maltComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Fermentable f = (Fermentable) cmbMaltModel .getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1 ) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ f2.setLov(f.getLov()); f2.setPppg(f.getPppg()); f2.setDescription(f.getDescription()); f2.setMashed(f.getMashed()); f2.setSteep(f.getSteep()); f2.setCost(f.getCostPerU()); } } } }); maltUnitsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String u = (String) cmbMaltUnitsModel.getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ // this converts the cost and amount: f2.convertTo(u); myRecipe.calcMaltTotals(); displayRecipe(); } } } }); hopComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Hop h = (Hop) cmbHopsModel.getSelectedItem(); int i = hopsTable.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h2 = myRecipe.getHop(i); h2.setAlpha(h.getAlpha()); h2.setDescription(h.getDescription()); h2.setCost(h.getCostPerU()); } } }); hopsUnitsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String u = (String) cmbHopsUnitsModel.getSelectedItem(); int i = hopsTable.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h = myRecipe.getHop(i); h.convertTo(u); myRecipe.calcHopsTotals(); // tblHops.updateUI(); displayRecipe(); } } }); }
private void addListeners(){ txtName.addActionListener(this); txtName.addFocusListener(this); brewerNameText.addFocusListener(this); brewerNameText.addActionListener(this); txtDate.addFocusListener(this); txtDate.addActionListener(this); txtPreBoil.addFocusListener(this); txtPreBoil.addActionListener(this); boilMinText.addFocusListener(this); boilMinText.addActionListener(this); evapText.addFocusListener(this); evapText.addActionListener(this); cmbStyle.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Style s = (Style) cmbStyleModel.getSelectedItem(); if (myRecipe != null && s != myRecipe.getStyleObj()) { myRecipe.setStyle(s); stylePanel.setStyle(s); } cmbStyle.setToolTipText(SBStringUtils.multiLineToolTip(50, s .getDescription())); } }); postBoilText.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }); postBoilText.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }); cmbYeast.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Yeast y = (Yeast) cmbYeastModel.getSelectedItem(); if (myRecipe != null && y != myRecipe.getYeastObj()) { myRecipe.setYeast(y); } String st = SBStringUtils.multiLineToolTip(40, y .getDescription()); cmbYeast.setToolTipText(st); } }); cmbSizeUnits.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String q = (String) cmbSizeUnits.getSelectedItem(); if (myRecipe != null && q != myRecipe.getVolUnits()) { // also sets postboil units: myRecipe.setVolUnits(q); displayRecipe(); } } }); alcMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); ibuMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); colourMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); evapMethodCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); } }); maltComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Fermentable f = (Fermentable) cmbMaltModel .getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1 ) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ f2.setLov(f.getLov()); f2.setPppg(f.getPppg()); f2.setDescription(f.getDescription()); f2.setMashed(f.getMashed()); f2.setSteep(f.getSteep()); f2.setCost(f.getCostPerU()); } } } }); maltUnitsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String u = (String) cmbMaltUnitsModel.getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ // this converts the cost and amount: f2.convertTo(u); myRecipe.calcMaltTotals(); displayRecipe(); } } } }); hopComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Hop h = (Hop) cmbHopsModel.getSelectedItem(); int i = hopsTable.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h2 = myRecipe.getHop(i); h2.setAlpha(h.getAlpha()); h2.setDescription(h.getDescription()); h2.setCost(h.getCostPerU()); } } }); hopsUnitsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { String u = (String) cmbHopsUnitsModel.getSelectedItem(); int i = hopsTable.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h = myRecipe.getHop(i); h.convertTo(u); myRecipe.calcHopsTotals(); // tblHops.updateUI(); displayRecipe(); } } }); }
1,116,496
public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); }
public void actionPerformed(ActionEvent evt) { Fermentable f = (Fermentable) cmbMaltModel .getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1 ) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ f2.setLov(f.getLov()); f2.setPppg(f.getPppg()); f2.setDescription(f.getDescription()); f2.setMashed(f.getMashed()); f2.setSteep(f.getSteep()); f2.setCost(f.getCostPerU()); } } }
1,116,497
public void actionPerformed(ActionEvent evt) { recipeSettingsActionPerformed(evt); }
public void actionPerformed(ActionEvent evt) { String u = (String) cmbMaltUnitsModel.getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ f2.convertTo(u); myRecipe.calcMaltTotals(); displayRecipe(); } } }
1,116,498
public void actionPerformed(ActionEvent evt) { Fermentable f = (Fermentable) cmbMaltModel .getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1 ) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ f2.setLov(f.getLov()); f2.setPppg(f.getPppg()); f2.setDescription(f.getDescription()); f2.setMashed(f.getMashed()); f2.setSteep(f.getSteep()); f2.setCost(f.getCostPerU()); } } }
public void actionPerformed(ActionEvent evt) { Fermentable f = (Fermentable) cmbMaltModel .getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1 ) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ f2.setLov(f.getLov()); f2.setPppg(f.getPppg()); f2.setDescription(f.getDescription()); f2.setMashed(f.getMashed()); f2.setSteep(f.getSteep()); f2.setCost(f.getCostPerU()); } } }
1,116,499
public void actionPerformed(ActionEvent evt) { String u = (String) cmbMaltUnitsModel.getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ // this converts the cost and amount: f2.convertTo(u); myRecipe.calcMaltTotals(); displayRecipe(); } } }
public void actionPerformed(ActionEvent evt) { String u = (String) cmbMaltUnitsModel.getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ // this converts the cost and amount: f2.convertTo(u); myRecipe.calcMaltTotals(); displayRecipe(); } } }
1,116,500
public void actionPerformed(ActionEvent evt) { String u = (String) cmbMaltUnitsModel.getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ // this converts the cost and amount: f2.convertTo(u); myRecipe.calcMaltTotals(); displayRecipe(); } } }
public void actionPerformed(ActionEvent evt) { String u = (String) cmbMaltUnitsModel.getSelectedItem(); int i = maltTable.getSelectedRow(); if (myRecipe != null && i != -1) { Fermentable f2 = myRecipe.getFermentable(i); if (f2 != null){ // this converts the cost and amount: f2.convertTo(u); myRecipe.calcMaltTotals(); displayRecipe(); } } }
1,116,501
public void actionPerformed(ActionEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); }
public void actionPerformed(ActionEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); }
1,116,502
public void actionPerformed(ActionEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); }
public void actionPerformed(ActionEvent evt) { myRecipe.setPostBoil(Double.parseDouble(postBoilText.getText() .toString())); displayRecipe(); } }
1,116,503
public void actionPerformed(ActionEvent evt) { Yeast y = (Yeast) cmbYeastModel.getSelectedItem(); if (myRecipe != null && y != myRecipe.getYeastObj()) { myRecipe.setYeast(y); } String st = SBStringUtils.multiLineToolTip(40, y .getDescription()); cmbYeast.setToolTipText(st); }
public void actionPerformed(ActionEvent evt) { Yeast y = (Yeast) cmbYeastModel.getSelectedItem(); if (myRecipe != null && y != myRecipe.getYeastObj()) { myRecipe.setYeast(y); } String st = SBStringUtils.multiLineToolTip(40, y .getDescription()); cmbYeast.setToolTipText(st); }
1,116,504
public void actionPerformed(ActionEvent evt) { String q = (String) cmbSizeUnits.getSelectedItem(); if (myRecipe != null && q != myRecipe.getVolUnits()) { // also sets postboil units: myRecipe.setVolUnits(q); displayRecipe(); } }
public void actionPerformed(ActionEvent evt) { String q = (String) cmbSizeUnits.getSelectedItem(); if (myRecipe != null && q != myRecipe.getVolUnits()) { // also sets postboil units: myRecipe.setVolUnits(q); displayRecipe(); } }
1,116,505
public void displayRecipe() { if (myRecipe == null) return; txtName.setText(myRecipe.getName()); brewerNameText.setText(myRecipe.getBrewer()); txtPreBoil.setValue(new Double(myRecipe.getPreBoilVol(myRecipe.getVolUnits()))); lblSizeUnits.setText(myRecipe.getVolUnits()); postBoilText.setValue(new Double(myRecipe.getPostBoilVol(myRecipe.getVolUnits()))); boilMinText.setText(SBStringUtils.format(myRecipe.getBoilMinutes(), 0)); evapText.setText(SBStringUtils.format(myRecipe.getEvap(), 1)); spnEffic.setValue(new Double(myRecipe.getEfficiency())); spnAtten.setValue(new Double(myRecipe.getAttenuation())); spnOG.setValue(new Double(myRecipe.getEstOg())); spnFG.setValue(new Double(myRecipe.getEstFg())); txtComments.setText(myRecipe.getComments()); lblIBUvalue.setText(SBStringUtils.format(myRecipe.getIbu(), 1)); lblColourValue.setText(SBStringUtils.format(myRecipe.getSrm(), 1)); lblAlcValue.setText(SBStringUtils.format(myRecipe.getAlcohol(), 1)); try { txtDate.setDate(myRecipe.getCreated().getTime()); } catch (PropertyVetoException e) { // TODO Auto-generated catch block e.printStackTrace(); } // setText(SBStringUtils.dateFormat1.format(myRecipe.getCreated().getTime())); Costs = SBStringUtils.myNF.format(myRecipe.getTotalMaltCost()); tblMaltTotalsModel.setDataVector(new String[][]{{"", "", "Totals:", "" + SBStringUtils.format(myRecipe.getTotalMalt(), 1), myRecipe.getMaltUnits(), "" + SBStringUtils.format(myRecipe.getEstOg(), 3), "" + SBStringUtils.format(myRecipe.getSrm(), 1), Costs, "100"}}, new String[]{"", "", "", "", "", "", "", "", ""}); Costs = SBStringUtils.myNF.format(myRecipe.getTotalHopsCost()); tblHopsTotalsModel.setDataVector(new String[][]{{"Totals:", "", "", "" + SBStringUtils.format(myRecipe.getTotalHops(), 1), myRecipe.getHopUnits(), "", "", "" + SBStringUtils.format(myRecipe.getIbu(), 1), Costs}}, new String[]{"", "", "", "", "", "", "", "", ""}); String fileName = "not saved"; if (currentFile != null) { fileName = currentFile.getName(); } fileNameLabel.setText("File: " + fileName); ibuMethodLabel.setText("IBU method: " + myRecipe.getIBUMethod()); alcMethodLabel.setText("Alc method: " + myRecipe.getAlcMethod()); double colour = myRecipe.getSrm(); // convert from ebc if that's our mode: if (myRecipe.getColourMethod().equals("EBC")) { // From Greg Noonan's article at // http://brewingtechniques.com/bmg/noonan.html colour = (colour + 1.2) / 2.65; } if (preferences.getProperty("optRGBMethod").equals("1")) colourPanel.setBackground(Recipe.calcRGB(1, colour, preferences.getIProperty("optRed"), preferences.getIProperty("optGreen"), preferences.getIProperty("optBlue"), preferences.getIProperty("optAlpha"))); else colourPanel.setBackground(Recipe.calcRGB(2, colour, preferences.getIProperty("optRed"), preferences.getIProperty("optGreen"), preferences.getIProperty("optBlue"), preferences.getIProperty("optAlpha"))); // update the panels stylePanel.setStyleData(); costPanel.displayCost(); waterPanel.displayWater(); mashPanel.displayMash(); }
public void displayRecipe() { if (myRecipe == null) return; txtName.setText(myRecipe.getName()); brewerNameText.setText(myRecipe.getBrewer()); preBoilText.setValue(new Double(myRecipe.getPreBoilVol(myRecipe.getVolUnits()))); lblSizeUnits.setText(myRecipe.getVolUnits()); postBoilText.setValue(new Double(myRecipe.getPostBoilVol(myRecipe.getVolUnits()))); boilMinText.setText(SBStringUtils.format(myRecipe.getBoilMinutes(), 0)); evapText.setText(SBStringUtils.format(myRecipe.getEvap(), 1)); spnEffic.setValue(new Double(myRecipe.getEfficiency())); spnAtten.setValue(new Double(myRecipe.getAttenuation())); spnOG.setValue(new Double(myRecipe.getEstOg())); spnFG.setValue(new Double(myRecipe.getEstFg())); txtComments.setText(myRecipe.getComments()); lblIBUvalue.setText(SBStringUtils.format(myRecipe.getIbu(), 1)); lblColourValue.setText(SBStringUtils.format(myRecipe.getSrm(), 1)); lblAlcValue.setText(SBStringUtils.format(myRecipe.getAlcohol(), 1)); try { txtDate.setDate(myRecipe.getCreated().getTime()); } catch (PropertyVetoException e) { // TODO Auto-generated catch block e.printStackTrace(); } // setText(SBStringUtils.dateFormat1.format(myRecipe.getCreated().getTime())); Costs = SBStringUtils.myNF.format(myRecipe.getTotalMaltCost()); tblMaltTotalsModel.setDataVector(new String[][]{{"", "", "Totals:", "" + SBStringUtils.format(myRecipe.getTotalMalt(), 1), myRecipe.getMaltUnits(), "" + SBStringUtils.format(myRecipe.getEstOg(), 3), "" + SBStringUtils.format(myRecipe.getSrm(), 1), Costs, "100"}}, new String[]{"", "", "", "", "", "", "", "", ""}); Costs = SBStringUtils.myNF.format(myRecipe.getTotalHopsCost()); tblHopsTotalsModel.setDataVector(new String[][]{{"Totals:", "", "", "" + SBStringUtils.format(myRecipe.getTotalHops(), 1), myRecipe.getHopUnits(), "", "", "" + SBStringUtils.format(myRecipe.getIbu(), 1), Costs}}, new String[]{"", "", "", "", "", "", "", "", ""}); String fileName = "not saved"; if (currentFile != null) { fileName = currentFile.getName(); } fileNameLabel.setText("File: " + fileName); ibuMethodLabel.setText("IBU method: " + myRecipe.getIBUMethod()); alcMethodLabel.setText("Alc method: " + myRecipe.getAlcMethod()); double colour = myRecipe.getSrm(); // convert from ebc if that's our mode: if (myRecipe.getColourMethod().equals("EBC")) { // From Greg Noonan's article at // http://brewingtechniques.com/bmg/noonan.html colour = (colour + 1.2) / 2.65; } if (preferences.getProperty("optRGBMethod").equals("1")) colourPanel.setBackground(Recipe.calcRGB(1, colour, preferences.getIProperty("optRed"), preferences.getIProperty("optGreen"), preferences.getIProperty("optBlue"), preferences.getIProperty("optAlpha"))); else colourPanel.setBackground(Recipe.calcRGB(2, colour, preferences.getIProperty("optRed"), preferences.getIProperty("optGreen"), preferences.getIProperty("optBlue"), preferences.getIProperty("optAlpha"))); // update the panels stylePanel.setStyleData(); costPanel.displayCost(); waterPanel.displayWater(); mashPanel.displayMash(); }
1,116,506