rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
ObjComparator sc = new ObjComparator(); Collections.sort(yeastDB, sc);
public void readYeast(String path) { // read the yeast from the csv file try { File yeastFile = new File(path, "yeast.csv"); CSVReader reader = new CSVReader(new FileReader( yeastFile), ',', '\"', true, false); try { // get the first line and set up the index: String[] fields = reader.getAllFieldsInL...
public Collection find(String query, Object values) {
public Collection find(String query, Object... values) throws DataAccessException {
public Collection find(String query, Object values) { if (logger.isDebugEnabled()) { logger.debug("\n Finding object with query "+query); } if (values instanceof Object[]) { return queryAssembler(query, values).list(); } return this.getHibernateTempla...
logger.debug("\n Finding object with query "+query);
logger.debug("** DAO finding ["+query+"] with "+values);
public Collection find(String query, Object values) { if (logger.isDebugEnabled()) { logger.debug("\n Finding object with query "+query); } if (values instanceof Object[]) { return queryAssembler(query, values).list(); } return this.getHibernateTempla...
if (values instanceof Object[]) { return queryAssembler(query, values).list(); } return this.getHibernateTemplate().find(query, values);
return queryAssembler(query, values).list();
public Collection find(String query, Object values) { if (logger.isDebugEnabled()) { logger.debug("\n Finding object with query "+query); } if (values instanceof Object[]) { return queryAssembler(query, values).list(); } return this.getHibernateTempla...
public Object findUnique(String query, Object values) throws DataAccessException { Collection list = find(query, values); if (logger.isDebugEnabled()) { logger.debug("\n Query result size is "+list.size()); } if (list.size()==1) { Object object = list.toArray()[0]; if (logger.isDebugEnabled()) { logger.debug("\...
public Object findUnique(String query, Object... values) throws DataAccessException { Collection list = find(query, values); if (isUnique(list)) { return ((List) list).get(0);
public Object findUnique(String query, Object values) throws DataAccessException { Collection list = find(query, values); if (logger.isDebugEnabled()) { logger.debug("\n Query result size is "+list.size()); } if (list.size()==1) { Object object = list.toArray()...
logger.debug("\n Loading "+clazz.toString()
logger.debug("** DAO Loading "+clazz.toString()
public Object load(Class clazz, Serializable key) throws DataAccessException { if (logger.isDebugEnabled()) { logger.debug("\n Loading "+clazz.toString() +" with id "+key.toString()); } return this.getHibernateTemplate().load(clazz, key); }
logger.debug("\n Merging "+object.toString());
logger.debug("** DAO Merging "+object.toString());
public void merge(Object object) { if (logger.isDebugEnabled()) { logger.debug("\n Merging "+object.toString()); } this.getHibernateTemplate().merge(object); }
if (logger.isDebugEnabled()) { logger.debug("** DAO Persisting "+object); }
public void persist(Object object) throws DataAccessException { this.getHibernateTemplate().persist(object); }
protected Query queryAssembler(String query, Object values) {
protected Query queryAssembler(String query, Object... values) {
protected Query queryAssembler(String query, Object values) { try { Session session = getSession(true); Query result = session.createQuery(query); if (values != null) { if (values instanceof Object[]) { Object[] valueList = (Object[]) values;...
Session session = getSession(true);
Session session = this.getHibernateTemplate().getSessionFactory().getCurrentSession();
protected Query queryAssembler(String query, Object values) { try { Session session = getSession(true); Query result = session.createQuery(query); if (values != null) { if (values instanceof Object[]) { Object[] valueList = (Object[]) values;...
if (values != null) { if (values instanceof Object[]) { Object[] valueList = (Object[]) values; for (int i = 0; i<valueList.length; i++) { result.setParameter(i, valueList[i]); if (logger.isDebugEnabled()) { logger.debug("\n Parameter "+i+"="+valueList[i]); } } } else { result.setParameter(0, values); if (logger...
int i = 0; for (Object value: values) { result.setParameter(i++, value);
protected Query queryAssembler(String query, Object values) { try { Session session = getSession(true); Query result = session.createQuery(query); if (values != null) { if (values instanceof Object[]) { Object[] valueList = (Object[]) values;...
logger.debug("\n No parameters");
logger.debug("Parameter "+i+"="+value);
protected Query queryAssembler(String query, Object values) { try { Session session = getSession(true); Query result = session.createQuery(query); if (values != null) { if (values instanceof Object[]) { Object[] valueList = (Object[]) values;...
logger.debug("\n Refreshing "+object);
logger.debug("** DAO Refreshing "+object);
public void refresh(Object object) throws DataAccessException { if (logger.isDebugEnabled()) { logger.debug("\n Refreshing "+object); } this.getHibernateTemplate().refresh(object); }
remove(find(object.toString(), null));
remove(find(object.toString()));
public void remove(Object object) { if (object instanceof String) { remove(find(object.toString(), null)); } else if (object instanceof Collection) { Collection collection = (Collection) object; if (logger.isDebugEnabled()) { logger.debug("\n Dele...
logger.debug("\n Deleting collection of size "+collection.size());
logger.debug("** DAO Deleting collection of size "+collection.size());
public void remove(Object object) { if (object instanceof String) { remove(find(object.toString(), null)); } else if (object instanceof Collection) { Collection collection = (Collection) object; if (logger.isDebugEnabled()) { logger.debug("\n Dele...
logger.debug("\n Deleting "+object.toString());
logger.debug("** DAO Deleting "+object.toString());
public void remove(Object object) { if (object instanceof String) { remove(find(object.toString(), null)); } else if (object instanceof Collection) { Collection collection = (Collection) object; if (logger.isDebugEnabled()) { logger.debug("\n Dele...
UserLog userLog = new UserLog(); userLog.setUser(user); userLog.setLastLogin(lastLogin); userLogList.add(userLog); return userLog;
lastUserLog = new UserLog(); lastUserLog.setUser(user); lastUserLog.setLastLogin(lastLogin); userLogList.add(lastUserLog); return lastUserLog;
public UserLog createAndPersistUserLog(User user) { if (userLogList==null) { userLogList = new ArrayList<UserLog>(); } UserLog userLog = new UserLog(); userLog.setUser(user); userLog.setLastLogin(lastLogin); userLogList.add(userLog...
public UserLog findLastUserLog(String principal) { return null; }
public UserLog findLastUserLog(String principal) { return lastUserLog; }
public UserLog findLastUserLog(String principal) { return null; }
userDao = new UserDaoStub();
public void setUp() { testCredential = new Credential(); testCredential.setPrincipal("CRED1"); testCredential.setPassword("PASSWORD1"); userDetailsService = new UserDetailsServiceImpl(); userDetailsService.setUserDao(new UserDaoStub()); }
else if ( exp.getType() == FileHandlingException.RENAME_FAILED )
else { NLogger.error( DownloadConfigDialog.class, exp ); } } catch ( ManagedFileException exp ) { if ( exp.getCause() instanceof FileHandlingException && ((FileHandlingException)exp.getCause()).getType() == FileHandlingException.RENAME_FAILED )
private boolean isInputValidAndUpdated() { final String localFilename = filenameTF.getText().trim(); if ( localFilename.length() == 0 ) { GUIUtils.showErrorMessage( this, Localizer.getString( "NoFileName" ) ); filenameTF.requestFocus(); return ...
exp.printStackTrace();
NLogger.error( DownloadConfigDialog.class, exp );
private boolean isInputValidAndUpdated() { final String localFilename = filenameTF.getText().trim(); if ( localFilename.length() == 0 ) { GUIUtils.showErrorMessage( this, Localizer.getString( "NoFileName" ) ); filenameTF.requestFocus(); return ...
OperatorSet op = djep.getOperatorSet();
OperatorSet opset = djep.getOperatorSet();
public Node differentiate(ASTFunNode node,String var,Node [] children,Node [] dchildren,DJep djep) throws ParseException { OperatorSet op = djep.getOperatorSet(); NodeFactory nf = djep.getNodeFactory(); int nchild = node.jjtGetNumChildren(); if(nchild==2) return nf.buildOperatorNode(op.getAdd(), nf.buildOp...
Operator op = opset.getMultiply(); if(mulOp!=null) op = mulOp;
public Node differentiate(ASTFunNode node,String var,Node [] children,Node [] dchildren,DJep djep) throws ParseException { OperatorSet op = djep.getOperatorSet(); NodeFactory nf = djep.getNodeFactory(); int nchild = node.jjtGetNumChildren(); if(nchild==2) return nf.buildOperatorNode(op.getAdd(), nf.buildOp...
return nf.buildOperatorNode(op.getAdd(), nf.buildOperatorNode(op.getMultiply(),
return nf.buildOperatorNode(opset.getAdd(), nf.buildOperatorNode(op,
public Node differentiate(ASTFunNode node,String var,Node [] children,Node [] dchildren,DJep djep) throws ParseException { OperatorSet op = djep.getOperatorSet(); NodeFactory nf = djep.getNodeFactory(); int nchild = node.jjtGetNumChildren(); if(nchild==2) return nf.buildOperatorNode(op.getAdd(), nf.buildOp...
nf.buildOperatorNode(op.getMultiply(),
nf.buildOperatorNode(op,
public Node differentiate(ASTFunNode node,String var,Node [] children,Node [] dchildren,DJep djep) throws ParseException { OperatorSet op = djep.getOperatorSet(); NodeFactory nf = djep.getNodeFactory(); int nchild = node.jjtGetNumChildren(); if(nchild==2) return nf.buildOperatorNode(op.getAdd(), nf.buildOp...
cmbStyle2Model.setList(db.styleDB);
public StrangeSwing() { super(); initGUI(); // There has *got* to be a better way to do this: Database db = new Database(); String path=""; String slash = System.getProperty("file.separator"); try { path = new File(".").getCanonicalPath() + slash + "src" + slash + "strangebrew" + slash + "data"; } ca...
TableColumnModel tcm = tblHops.getColumnModel(); TableColumnModel tcmt = tblHopsTotals.getColumnModel();
TableColumnModel tcm = tblMalt.getColumnModel(); TableColumnModel tcmt = tblMaltTotals.getColumnModel();
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals("preferredWidth")) { TableColumnModel tcm = tblHops.getColumnModel(); TableColumnModel tcmt = tblHopsTotals.getColumnModel(); int columnCount =...
cmbStyle2Model.addOrInsert(myRecipe.getStyleObj());
public void attachRecipeData(){ // this method attaches data from the recipe to the tables // and comboboxes // use whenever the Recipe changes cmbStyleModel.addOrInsert(myRecipe.getStyleObj()); cmbYeastModel.addOrInsert(myRecipe.getYeastObj()); cmbSizeUnitsModel.addOrInsert(myRecipe.getVolUnits()); tblMaltMod...
ComboBoxModel cmbStyle2Model = new DefaultComboBoxModel(new String[]{ "Item One", "Item Two"});
cmbStyle2Model = new ComboModel();
private void initGUI() { try { this.setSize(520, 532); this.addWindowListener(new WindowAdapter() { public void windowClosed(WindowEvent evt) { System.exit(1); } }); { pnlMain = new JPanel(); GridBagLayout jPanel2Layout = new GridBagLayout(); jPanel2Layout.columnWeights = new double[] {0...
pnlStyle.add(cmbStyle2);
pnlStyle.add(cmbStyle2, new GridBagConstraints( 1, 2, 5, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
private void initGUI() { try { this.setSize(520, 532); this.addWindowListener(new WindowAdapter() { public void windowClosed(WindowEvent evt) { System.exit(1); } }); { pnlMain = new JPanel(); GridBagLayout jPanel2Layout = new GridBagLayout(); jPanel2Layout.columnWeights = new double[] {0...
cmbStyle2.setMaximumSize(new java.awt.Dimension(100, 32767)); cmbStyle2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Style s = (Style) cmbStyle2Model.getSelectedItem(); descriptionTextArea.setText(s.getDescription()); cmbStyle2.setToolTipText(multiLineToolTip(50,s.getDescrip...
private void initGUI() { try { this.setSize(520, 532); this.addWindowListener(new WindowAdapter() { public void windowClosed(WindowEvent evt) { System.exit(1); } }); { pnlMain = new JPanel(); GridBagLayout jPanel2Layout = new GridBagLayout(); jPanel2Layout.columnWeights = new double[] {0...
String u = (String) cmbMaltUnitsModel.getSelectedItem();
Fermentable f = (Fermentable) cmbMaltModel .getSelectedItem();
public void actionPerformed(ActionEvent evt) { String u = (String) cmbMaltUnitsModel.getSelectedItem(); int i = tblMalt.getSelectedRow(); if (myRecipe != null && i != -1) { Fermentable f2 = myRecipe.getFermentable(i); f2.setUnitsFull(u); myRecipe.calcMal...
f2.setUnitsFull(u); myRecipe.calcMaltTotals(); displayRecipe();
f2.setLov(f.getLov()); f2.setPppg(f.getPppg()); f2.setDescription(f.getDescription()); f2.setMashed(f.getMashed()); f2.setSteep(f.getSteep());
public void actionPerformed(ActionEvent evt) { String u = (String) cmbMaltUnitsModel.getSelectedItem(); int i = tblMalt.getSelectedRow(); if (myRecipe != null && i != -1) { Fermentable f2 = myRecipe.getFermentable(i); f2.setUnitsFull(u); myRecipe.calcMal...
if (myRecipe != null) { Fermentable f = new Fermentable(myRecipe.getMaltUnits()); myRecipe.addMalt(f); tblMalt.updateUI();
String u = (String) cmbMaltUnitsModel.getSelectedItem(); int i = tblMalt.getSelectedRow(); if (myRecipe != null && i != -1) { Fermentable f2 = myRecipe.getFermentable(i); f2.setUnitsFull(u); myRecipe.calcMaltTotals();
public void actionPerformed(ActionEvent evt) { if (myRecipe != null) { Fermentable f = new Fermentable(myRecipe.getMaltUnits()); myRecipe.addMalt(f); tblMalt.updateUI(); displayRecipe(); } }
int i = tblMalt.getSelectedRow(); myRecipe.delMalt(i);
Fermentable f = new Fermentable(myRecipe.getMaltUnits()); myRecipe.addMalt(f);
public void actionPerformed(ActionEvent evt) { if (myRecipe != null) { int i = tblMalt.getSelectedRow(); myRecipe.delMalt(i); tblMalt.updateUI(); displayRecipe(); } }
String u = (String) cmbHopsUnitsModel.getSelectedItem();
Hop h = (Hop) cmbHopsModel.getSelectedItem();
public void actionPerformed(ActionEvent evt) { String u = (String) cmbHopsUnitsModel.getSelectedItem(); int i = tblHops.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h = (Hop) myRecipe.getHop(i); h.setUnitsFull(u); myRecipe.calcHopsTotals(); ...
Hop h = (Hop) myRecipe.getHop(i); h.setUnitsFull(u); myRecipe.calcHopsTotals(); displayRecipe();
Hop h2 = (Hop) myRecipe.getHop(i); h2.setAlpha(h.getAlpha()); h2.setDescription(h.getDescription());
public void actionPerformed(ActionEvent evt) { String u = (String) cmbHopsUnitsModel.getSelectedItem(); int i = tblHops.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h = (Hop) myRecipe.getHop(i); h.setUnitsFull(u); myRecipe.calcHopsTotals(); ...
if (myRecipe != null) { Hop h = new Hop(myRecipe.getHopUnits()); myRecipe.addHop(h); tblHops.updateUI();
String u = (String) cmbHopsUnitsModel.getSelectedItem(); int i = tblHops.getSelectedRow(); if (myRecipe != null && i != -1) { Hop h = (Hop) myRecipe.getHop(i); h.setUnitsFull(u); myRecipe.calcHopsTotals();
public void actionPerformed(ActionEvent evt) { if (myRecipe != null) { Hop h = new Hop(myRecipe.getHopUnits()); myRecipe.addHop(h); tblHops.updateUI(); displayRecipe(); } }
}
public void actionPerformed(ActionEvent evt) { if (myRecipe != null) { Hop h = new Hop(myRecipe.getHopUnits()); myRecipe.addHop(h); tblHops.updateUI(); displayRecipe(); } }
int i = tblHops.getSelectedRow(); myRecipe.delHop(i);
Hop h = new Hop(myRecipe.getHopUnits()); myRecipe.addHop(h);
public void actionPerformed(ActionEvent evt) { if (myRecipe != null) { int i = tblHops.getSelectedRow(); myRecipe.delHop(i); tblHops.updateUI(); displayRecipe(); } }
myRecipe = new Recipe(); attachRecipeData(); displayRecipe(); }
if (myRecipe != null) { int i = tblHops.getSelectedRow(); myRecipe.delHop(i); tblHops.updateUI(); displayRecipe(); } }
public void actionPerformed(ActionEvent evt) { // This is just a test right now to see that // stuff is changed. myRecipe = new Recipe(); attachRecipeData(); displayRecipe(); }
public void actionPerformed(ActionEvent evt) { int returnVal = fileChooser.showOpenDialog(jMenuBar1); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); System.out.print("Opening: " + file.getName() + ".\n"); ImportXml imp = new ImportXml(file.toString()); myRecipe = imp.handl...
public void actionPerformed(ActionEvent evt) { myRecipe = new Recipe(); attachRecipeData(); displayRecipe();
public void actionPerformed(ActionEvent evt) { // Show open dialog; this method does // not return until the dialog is closed int returnVal = fileChooser.showOpenDialog(jMenuBar1); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(...
public void actionPerformed(ActionEvent evt) { if (DEBUG){ System.out.print(myRecipe.toXML());
public void actionPerformed(ActionEvent evt) { int returnVal = fileChooser.showOpenDialog(jMenuBar1); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); System.out.print("Opening: " + file.getName() + ".\n"); ImportXml imp = new ImportXml(file.toString()); myRecipe = imp.handl...
public void actionPerformed(ActionEvent evt) { if (DEBUG){ // This is just a test right now to see that // stuff is changed. System.out.print(myRecipe.toXML()); } // Show save dialog; this method does // not return until the dialog is closed int...
int returnVal = fileChooser.showSaveDialog(jMenuBar1); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); try { FileWriter out = new FileWriter(file); out.write(myRecipe.toXML()); out.close(); } catch (Exception e){ } } else { System.out.print("Save command cancelled by user.\n...
public void actionPerformed(ActionEvent evt) { if (DEBUG){ // This is just a test right now to see that // stuff is changed. System.out.print(myRecipe.toXML()); } // Show save dialog; this method does // not return until the dialog is closed int...
public void actionPerformed(ActionEvent evt) { fileChooser.setSelectedFile(new File(myRecipe.getName()+".html")); int returnVal = fileChooser.showSaveDialog(jMenuBar1); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); try { saveAsHTML(file); } catch (Exception e){ } } else...
public void actionPerformed(ActionEvent evt) { if (DEBUG){ System.out.print(myRecipe.toXML()); } int returnVal = fileChooser.showSaveDialog(jMenuBar1); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); try { FileWriter out = new FileWriter(file); out.write(myRecipe.toXML(...
public void actionPerformed(ActionEvent evt) { // Show save dialog; this method does // not return until the dialog is closed fileChooser.setSelectedFile(new File(myRecipe.getName()+".html")); int returnVal = fileChooser.showSaveDialog(jMenuBar1); if (returnVal ...
fileChooser.setSelectedFile(new File(myRecipe.getName()+".txt"));
fileChooser.setSelectedFile(new File(myRecipe.getName()+".html"));
public void actionPerformed(ActionEvent evt) { // Show save dialog; this method does // not return until the dialog is closed fileChooser.setSelectedFile(new File(myRecipe.getName()+".txt")); int returnVal = fileChooser.showSaveDialog(jMenuBar1); if (returnVal == JFileCho...
FileWriter out = new FileWriter(file); out.write(myRecipe.toText()); out.close();
saveAsHTML(file);
public void actionPerformed(ActionEvent evt) { // Show save dialog; this method does // not return until the dialog is closed fileChooser.setSelectedFile(new File(myRecipe.getName()+".txt")); int returnVal = fileChooser.showSaveDialog(jMenuBar1); if (returnVal == JFileCho...
System.out.print("Export text command cancelled by user.\n");
System.out.print("Save command cancelled by user.\n");
public void actionPerformed(ActionEvent evt) { // Show save dialog; this method does // not return until the dialog is closed fileChooser.setSelectedFile(new File(myRecipe.getName()+".txt")); int returnVal = fileChooser.showSaveDialog(jMenuBar1); if (returnVal == JFileCho...
System.exit(0); }
fileChooser.setSelectedFile(new File(myRecipe.getName()+".txt")); int returnVal = fileChooser.showSaveDialog(jMenuBar1); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); try { FileWriter out = new FileWriter(file); out.write(myRecipe.toText()); out.close(); } catch (Exception ...
public void actionPerformed(ActionEvent evt) { // exit program System.exit(0); }
PreferencesDialog d = new PreferencesDialog(owner, preferences); d.setVisible(true);
System.exit(0);
public void actionPerformed(ActionEvent evt) { PreferencesDialog d = new PreferencesDialog(owner, preferences); d.setVisible(true); }
public void actionPerformed(ActionEvent evt) { mashMgr = new MashManager(myRecipe); mashMgr.setVisible(true);
public void actionPerformed(ActionEvent evt) { PreferencesDialog d = new PreferencesDialog(owner, preferences); d.setVisible(true);
public void actionPerformed(ActionEvent evt) { mashMgr = new MashManager(myRecipe); mashMgr.setVisible(true); }
public void actionPerformed(ActionEvent evt) { aboutDlg = new AboutDialog(owner); aboutDlg.setVisible(true);
public void actionPerformed(ActionEvent evt) { mashMgr = new MashManager(myRecipe); mashMgr.setVisible(true);
public void actionPerformed(ActionEvent evt) { aboutDlg = new AboutDialog(owner); aboutDlg.setVisible(true); }
suite.addTest(new LogarithmTest("testLogarithm")); suite.addTest(new NaturalLogarithmTest("testNaturalLogarithm"));
public static Test suite() { TestSuite suite = new TestSuite("All JUnit Tests"); suite.addTest(new JEPTest("testParseExpression")); return suite; }
public FissuresToWAV(SeismogramIterator iterator, int speedUp) { this.iterator = iterator; chunkSize = 36 + 2*iterator.getNumPoints();
public FissuresToWAV(SeismogramContainer container, int speedUp) { this.container = container; this.speedUp = speedUp;
public FissuresToWAV(SeismogramIterator iterator, int speedUp) { this.iterator = iterator; chunkSize = 36 + 2*iterator.getNumPoints(); numChannels = 1; bitsPerSample = 16; blockAlign = numChannels * (bitsPerSample/8); subchunk2Size = iterator.getNumPoints() * blockAlign; setSpeedUp(speedUp); }
subchunk2Size = iterator.getNumPoints() * blockAlign; setSpeedUp(speedUp);
public FissuresToWAV(SeismogramIterator iterator, int speedUp) { this.iterator = iterator; chunkSize = 36 + 2*iterator.getNumPoints(); numChannels = 1; bitsPerSample = 16; blockAlign = numChannels * (bitsPerSample/8); subchunk2Size = iterator.getNumPoints() * blockAlign; setSpeedUp(speedUp); }
setInfo();
public void play(){ ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); try{ writeWAVData(dos); } catch(IOException e){ e.printStackTrace(); } if (clip != null) clip.close(); Clip clip = null; AudioFormat audioFormat = new AudioFormat(sampleRate, 16...
sampleRate = calculateSampleRate(iterator.getSampling(), newSpeed); byteRate = sampleRate * blockAlign;
setInfo();
public void setSpeedUp(int newSpeed){ speedUp = newSpeed; sampleRate = calculateSampleRate(iterator.getSampling(), newSpeed); byteRate = sampleRate * blockAlign; }
setInfo();
public void writeWAV(DataOutput out) throws IOException { writeChunkData(out); writeWAVData(out); }
SeismogramIterator iterator = container.getIterator();
private void writeWAVData(DataOutput out) throws IOException{ //calculate maximum amplification factor to avoid either //clipping or dead quiet int amplification = (int)(24000.0/iterator.minMaxMean()[1]); while (iterator.hasNext()){ try{ QuantityImpl next = (QuantityImpl)iterator.next(); writeLittleEndian(...
else if (currentList.equalsIgnoreCase("yeast")){
else if (currentList.equalsIgnoreCase("yeasts")){
public void characters(char buf[], int offset, int len) throws SAXException { String s = new String(buf, offset, len); // we're inside a style: if (!s.trim().equals("")) { if (currentElement.equalsIgnoreCase("notes")) descrBuf += s; if (currentList.equalsIgnoreCase("hops")){ if (currentElement.equalsI...
if (currentList.equalsIgnoreCase("yeast"))
if (currentList.equalsIgnoreCase("yeasts"))
public void endElement(String namespaceURI, String sName, // simple name String qName // qualified name ) throws SAXException { if (qName.equalsIgnoreCase("recipe")){ newRecipe = false; numRecipes ++; recipes.add(myRecipe); } if (qName.equalsIgnoreCase("hops") || qName.equalsIgnoreCase("fermentables")...
myContainer.setLayout(myLayout); attach(myBrewerLabel.getWidget(), null, 0, 0, 0); attach(myBrewer.getWidget(), myBrewerLabel.getWidget(), 200, 14, 5); attach(myEfficiencyLabel.getWidget(), myBrewer.getWidget(), 0, 0, 10); attach(myEfficiency.getWidget(), myEfficiencyLabel.getWidget(), 25, 14, 5); attach(myAlcoholLabe...
myContainer.setLayout(myLayout);
public void init() { myBrewerLabel = new SWTTextOutput(); myBrewerLabel.init(myContainer); myBrewer = new SWTTextInput(myController); myBrewer.init(myContainer); myEfficiencyLabel = new SWTTextOutput(); myEfficiencyLabel.init(myContainer); myEfficiency = new SWTNumberInput(myController); myEfficiency.init(myCo...
attach(myBrewerLabel.getWidget(), null, 0, 0, 0); attach(myBrewer.getWidget(), myBrewerLabel.getWidget(), 200, 14, 5); attach(myEfficiencyLabel.getWidget(), myBrewer.getWidget(), 0, 0, 10); attach(myEfficiency.getWidget(), myEfficiencyLabel.getWidget(), 25, 14, 5); attach(myAlcoholLabel.getWidget(), myEfficiency.getWid...
public void layout() { myContainer.layout(); myContainer.pack(); }
Node simp = mjep.simplify(diff); return simp;
return diff;
public Object visitDiff(ASTFunNode node, Object data) throws ParseException { MatrixNodeI children[] = visitChildrenAsArray(node,data); if(children.length != 2) throw new ParseException("Diff opperator should have two children, it has "+children.length); // TODO need to handle diff(x,[x,y]) if(!(children[1] ins...
var.setEquation(mjep.deepCopy(children[1]));
Node copy =mjep.deepCopy(children[1]); Node simp = mjep.simplify(copy); var.setEquation(simp);
public Object visitOp(ASTFunNode node, Object data) throws ParseException { PostfixMathCommandI pfmc=node.getPFMC();// if(pfmc instanceof SpecialPreProcessI)// {// SpecialPreProcessI spp = (SpecialPreProcessI) node.getPFMC();// return spp.preprocess(node,this,mjep);// } MatrixNodeI children[] = visitChildrenA...
if(((ASTMFunNode) children[i]).getOperator() != opSet.getMTensorFun())
if(((ASTMFunNode) children[i]).getOperator() != opSet.getMList())
public Object visitOp(ASTFunNode node, Object data) throws ParseException { PostfixMathCommandI pfmc=node.getPFMC();// if(pfmc instanceof SpecialPreProcessI)// {// SpecialPreProcessI spp = (SpecialPreProcessI) node.getPFMC();// return spp.preprocess(node,this,mjep);// } MatrixNodeI children[] = visitChildrenA...
ASTMFunNode res = (ASTMFunNode) nf.buildUnfinishedOperatorNode(opSet.getMTensorFun());
ASTMFunNode res = (ASTMFunNode) nf.buildUnfinishedOperatorNode(opSet.getMList());
public Object visitOp(ASTFunNode node, Object data) throws ParseException { PostfixMathCommandI pfmc=node.getPFMC();// if(pfmc instanceof SpecialPreProcessI)// {// SpecialPreProcessI spp = (SpecialPreProcessI) node.getPFMC();// return spp.preprocess(node,this,mjep);// } MatrixNodeI children[] = visitChildrenA...
ASTMFunNode res = (ASTMFunNode) nf.buildOperatorNode(opSet.getMTensorFun(),children,dim);
ASTMFunNode res = (ASTMFunNode) nf.buildOperatorNode(opSet.getMList(),children,dim);
public Object visitOp(ASTFunNode node, Object data) throws ParseException { PostfixMathCommandI pfmc=node.getPFMC();// if(pfmc instanceof SpecialPreProcessI)// {// SpecialPreProcessI spp = (SpecialPreProcessI) node.getPFMC();// return spp.preprocess(node,this,mjep);// } MatrixNodeI children[] = visitChildrenA...
openIpAddressSet = new HashSet();
private ChatManager() { }
if ( alternateLocations != null && alternateLocations.length > DROP_PACKAGE_ALT_LOCATION_LIMIT ) { throw new InvalidMessageException( "Number of query response record alt-locs exceed the acceptable maximum: " + alternateLocations.length + "/" + DROP_PACKAGE_ALT_LOCATION_LIMIT ); }
private void parseExtensionArea(byte[] extensionArea) { try { PushbackInputStream inStream = new PushbackInputStream( new ByteArrayInputStream( extensionArea ) ); byte b; StringBuffer buffer = new StringBuffer(); GGEPBlock[] ggepBlocks = n...
if(File.separatorChar=='\\')
if(onWindows)
public boolean perform(Build build, Launcher launcher, BuildListener listener) { Project proj = build.getProject(); String cmd; String execName; if(File.separatorChar=='\\') execName = "ant.bat"; else execName = "ant"; AntInstallation ai = getAnt(); ...
if(onWindows) { cmd = "cmd.exe /C "+cmd+" && exit %%ERRORLEVEL%%"; }
public boolean perform(Build build, Launcher launcher, BuildListener listener) { Project proj = build.getProject(); String cmd; String execName; if(File.separatorChar=='\\') execName = "ant.bat"; else execName = "ant"; AntInstallation ai = getAnt(); ...
else if(param1 instanceof Matrix && param2 instanceof Matrix) return mul((Matrix) param1,(Matrix) param2);
public Object mul(Object param1, Object param2) throws ParseException { // TODO tensor mult? if(param1 instanceof Matrix && param2 instanceof MVector) return mul((Matrix) param1,(MVector) param2); else if(param1 instanceof MVector && param2 instanceof Matrix) return mul((MVector) param1,(Matrix) param2); e...
if (param instanceof Number)
if (param instanceof Complex) { return ((Complex)param).atan(); } else if (param instanceof Number)
public Object atan(Object param) throws ParseException { if (param instanceof Number) { return new Double(Math.atan(((Number)param).doubleValue())); } else if (param instanceof Complex) { return ((Complex)param).atan(); } throw new ParseException("Invalid parameter type"); }
} else if (param instanceof Complex) { return ((Complex)param).atan();
public Object atan(Object param) throws ParseException { if (param instanceof Number) { return new Double(Math.atan(((Number)param).doubleValue())); } else if (param instanceof Complex) { return ((Complex)param).atan(); } throw new ParseException("Invalid parameter type"); }
Map<BuildStepDescriptor,BuildStep> m = new HashMap<BuildStepDescriptor,BuildStep>();
Map<BuildStepDescriptor,BuildStep> m = new LinkedHashMap<BuildStepDescriptor,BuildStep>();
public synchronized Map<BuildStepDescriptor,BuildStep> getBuilders() { Map<BuildStepDescriptor,BuildStep> m = new HashMap<BuildStepDescriptor,BuildStep>(); for( int i=builders.size()-1; i>=0; i-- ) { BuildStep b = builders.get(i); m.put(b.getDescriptor(),b); } retur...
Map<BuildStepDescriptor,BuildStep> m = new HashMap<BuildStepDescriptor,BuildStep>();
Map<BuildStepDescriptor,BuildStep> m = new LinkedHashMap<BuildStepDescriptor,BuildStep>();
public synchronized Map<BuildStepDescriptor,BuildStep> getPublishers() { Map<BuildStepDescriptor,BuildStep> m = new HashMap<BuildStepDescriptor,BuildStep>(); for( int i=publishers.size()-1; i>=0; i-- ) { BuildStep b = publishers.get(i); m.put(b.getDescriptor(),b); } ...
GWebCacheManager.getInstance().invokeQueryMoreHostsRequest( false );
GWebCacheManager.getInstance().invokeQueryMoreHostsRequest( true );
private void ensureMinCaughHosts() { int minCount = (int)Math.ceil( NetworkPrefs.MaxHostInHostCache.get().doubleValue()/100.0 ); if ( caughtHosts.getSize() < minCount ) { // Query udpHostCache for new hosts UdpHostCacheManager.getInstance().invokeQueryCachesRequest...
j = new GroupJep(new Quartonians());
j = new GroupJep(new Quaternions());
public void testQuartonians() throws Exception { j = new GroupJep(new Quartonians()); j.addStandardConstants(); System.out.println(j.getGroup().toString()); valueToStringTest("i*j","-k"); }
drawEnd = drawnPixels[1] - 1;
drawEnd = drawnPixels[1];
private void drag(int dragAmount, int dragFrom, SeismogramShapeIterator iterator){ double pointsPerPixel = iterator.getPointsPerPixel(); int[] seisPoints = currentIterator.getSeisPoints(); seisPoints[0] =(int)-(iterator.getTotalShift() * pointsPerPixel) + iterator.getBaseSeisPoint(); seisPoints[1] = se...
double pixelShift = currentIterator.getSize().width * shiftPercentage;
double pixels = currentIterator.getSize().width * shiftPercentage + currentIterator.getLeftoverPixels();
public void dragPlot(SeismogramShapeIterator iterator){ iterator.copyBasicInfo(currentIterator); double shiftPercentage = getShiftPercentage(currentIterator.getTime(), iterator.getTime()); double pixelShift = currentIterator.getSize().width * shiftPercentage; //checks if the pixel shift is within ...
pixelShift = Math.round(pixelShift*1000)/1000; if(pixelShift%1 == 0){ int shift = (int)pixelShift; if(shift >= 1){ iterator.setTotalShift(currentIterator.getTotalShift() + shift); drag(shift, 0, iterator); }else if(shift <= -1){ iterator.setTotalShift(currentIterator.getTotalShift() + shift); drag(shift, -shift, iterat...
pixels *= 1000; pixels = Math.round(pixels); pixels /= 1000; int shift = 0; if(pixels >= 1){ shift = (int)Math.floor(pixels); drag(shift, 0, iterator); }else if(pixels <= -1){ shift = (int)Math.ceil(pixels); drag(shift, -shift, iterator); }else{ iterator.setSeisPoints(currentIterator.getSeisPoints()); iterator.setDrawn...
public void dragPlot(SeismogramShapeIterator iterator){ iterator.copyBasicInfo(currentIterator); double shiftPercentage = getShiftPercentage(currentIterator.getTime(), iterator.getTime()); double pixelShift = currentIterator.getSize().width * shiftPercentage; //checks if the pixel shift is within ...
}
iterator.setLeftoverPixels(pixels - shift); currentIterator = iterator; }
public void dragPlot(SeismogramShapeIterator iterator){ iterator.copyBasicInfo(currentIterator); double shiftPercentage = getShiftPercentage(currentIterator.getTime(), iterator.getTime()); double pixelShift = currentIterator.getSize().width * shiftPercentage; //checks if the pixel shift is within ...
run.getNextBuild().previousBuild = null;
public synchronized void removeRun(Run run) { builds.remove(run.getNumber()); }
instance.show();
instance.setVisible(true);
public static void splash(Image image) { if (instance == null && image != null) { Frame f = new Frame(); // Create the splash image instance = new SplashWindow(f, image); // Show the window. instance.show(); ...
Complex temp = new Complex(((Number)param).doubleValue(),0.0); return temp.atanh();
double val = ((Number)param).doubleValue(); if(val > -1.0 && val < 1) { double res = Math.log((1+val)/(1-val))/2; return new Double(res); } else { Complex temp = new Complex(val,0.0); return temp.atanh(); }
public Object atanh(Object param) throws ParseException { if (param instanceof Complex) { return ((Complex)param).atanh(); } else if (param instanceof Number) { Complex temp = new Complex(((Number)param).doubleValue(),0.0); return temp.atanh(); } throw new ParseException("Invalid parameter type"); }
volUnitsCombo.addActionListener(new ActionListener() { public void actionPerformed (ActionEvent e){ setEvapLable(); } });
private void layoutUi() { JPanel buttons = new JPanel(); okButton = new JButton("OK"); okButton.addActionListener(this); cancelButton = new JButton("Cancel"); cancelButton.addActionListener(this); buttons.setLayout(new FlowLayout(FlowLayout.RIGHT)); buttons.add(cancelButton); buttons.add(okButton); getContent...
if (opts.getProperty("optEvapCalcMethod").equalsIgnoreCase("Percent")) evapAmountLbl.setText("%"); else evapAmountLbl.setText(opts.getProperty("optSizeU") + "/hr");
setEvapLable();
private void setOptions() { // cost tab: txtOtherCost.setText(opts.getProperty("optMiscCost")); txtBottleSize.setText(opts.getProperty("optBottleSize")); cmbBottleSizeModel.addOrInsert(opts.getProperty("optBottleU")); // brewer tab: txtBrewerName.setText(opts.getProperty("optBrewer")); txtPhone.setText(opts.get...
txtLostInTrub.setText(opts.getProperty("optTrubLoss")); boilTempTxt.setText(opts.getProperty("optBoilTempF")); batchSizeTxt.setText(opts.getProperty("optPostBoilVol")); maltUnitsComboModel.addOrInsert(opts.getProperty("optMaltU")); hopsUnitsComboModel.addOrInsert(opts.getProperty("optHopsU")); volUnitsComboModel.addO...
txtLostInTrub.setText(opts.getProperty("optTrubLoss"));
private void setOptions() { // cost tab: txtOtherCost.setText(opts.getProperty("optMiscCost")); txtBottleSize.setText(opts.getProperty("optBottleSize")); cmbBottleSizeModel.addOrInsert(opts.getProperty("optBottleU")); // brewer tab: txtBrewerName.setText(opts.getProperty("optBrewer")); txtPhone.setText(opts.get...
else return error.getMessage();
return error.getMessage();
public String getErrorsMessage() { if(error==null) return null; else return error.getMessage(); }
float hVal = getVal(hIt, hMin, hMax, size.height); float vVal = getVal(vIt, vMin, vMax, size.height);
double hVal = getVal(hIt, hMin, hMax, size.height); double vVal = getVal(vIt, vMin, vMax, size.height);
public void draw(Graphics g, Dimension size) { if(visible){ Graphics2D g2D = (Graphics2D) g; if(horiz.getIterator(tr).numPointsLeft() <= 0 || vert.getIterator(tr).numPointsLeft() <= 0){ return; } g2D.setC...
hVal *= -1; hVal += size.height;
vVal *= -1; vVal += size.height;
public void draw(Graphics g, Dimension size) { if(visible){ Graphics2D g2D = (Graphics2D) g; if(horiz.getIterator(tr).numPointsLeft() <= 0 || vert.getIterator(tr).numPointsLeft() <= 0){ return; } g2D.setC...
generalPath.moveTo(hVal, vVal);
generalPath.moveTo((int)hVal, (int)vVal);
public void draw(Graphics g, Dimension size) { if(visible){ Graphics2D g2D = (Graphics2D) g; if(horiz.getIterator(tr).numPointsLeft() <= 0 || vert.getIterator(tr).numPointsLeft() <= 0){ return; } g2D.setC...
generalPath.lineTo(hVal, vVal);
generalPath.lineTo((int)hVal, (int)vVal);
public void draw(Graphics g, Dimension size) { if(visible){ Graphics2D g2D = (Graphics2D) g; if(horiz.getIterator(tr).numPointsLeft() <= 0 || vert.getIterator(tr).numPointsLeft() <= 0){ return; } g2D.setC...
private int getVal(SeismogramIterator it, double minAmp, double maxAmp, int size){
private double getVal(SeismogramIterator it, double minAmp, double maxAmp, int size){
private int getVal(SeismogramIterator it, double minAmp, double maxAmp, int size){ double itVal = ((QuantityImpl)it.next()).getValue(); if(Double.isNaN(itVal)){//Gap in trace itVal = Integer.MAX_VALUE; }else{ itVal= Math.ro...
return (int)itVal;
return itVal;
private int getVal(SeismogramIterator it, double minAmp, double maxAmp, int size){ double itVal = ((QuantityImpl)it.next()).getValue(); if(Double.isNaN(itVal)){//Gap in trace itVal = Integer.MAX_VALUE; }else{ itVal= Math.ro...
tc.addListener(ParticleMotionView.this);
private void setUpConfigs(){ DataSetSeismogram[] seis = { horiz.getDataSetSeismogram(), vert.getDataSetSeismogram()}; AmpConfig ac = (AmpConfig)keysToAmpConfigs.get(key); if(ac == null){ ac = new RMeanAmpConfig(); keysToAmpConfigs...
repaint();
public void updateTime(TimeEvent timeEvent) { this.tr = timeEvent.getTime(); }
pmd.setActiveAmpConfig((AmpConfig)keysToAmpConfigs.get(displayKey));
public void setDisplayKey(String key) { displayKey = key; }
for(int i=numberOfParameters-1;i>0;) vars[i] = mySymTab.addVariable("x"+String.valueOf(i),null);
for(int i=numberOfParameters;i>0;--i) vars[i-1] = mySymTab.addVariable("x"+String.valueOf(i),null);
public MacroFunction(String inName,int nargs,String expression,XJep jep) throws IllegalArgumentException,ParseException { super(); name = inName; XSymbolTable jepSymTab = (XSymbolTable) jep.getSymbolTable(); mySymTab = (XSymbolTable) jepSymTab.newInstance(); mySymTab.copyConstants(jepSymTab); XJep localJep = je...