当前位置: 首页>>代码示例>>Java>>正文


Java Logger.warn方法代码示例

本文整理汇总了Java中org.jmol.util.Logger.warn方法的典型用法代码示例。如果您正苦于以下问题:Java Logger.warn方法的具体用法?Java Logger.warn怎么用?Java Logger.warn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jmol.util.Logger的用法示例。


在下文中一共展示了Logger.warn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkValencesAndBond

import org.jmol.util.Logger; //导入方法依赖的package包/类
protected boolean checkValencesAndBond(Atom atomA, Atom atomB, int order, short mad,
                          BitSet bsBonds) {
  if (atomA.getCurrentBondCount() > JmolConstants.MAXIMUM_AUTO_BOND_COUNT
      || atomB.getCurrentBondCount() > JmolConstants.MAXIMUM_AUTO_BOND_COUNT) {
    if (!haveWarned)
      Logger.warn("maximum auto bond count reached");
    haveWarned = true;
    return false;
  }
  int formalChargeA = atomA.getFormalCharge();
  if (formalChargeA != 0) {
    int formalChargeB = atomB.getFormalCharge();
    if ((formalChargeA < 0 && formalChargeB < 0)
        || (formalChargeA > 0 && formalChargeB > 0))
      return false;
  }
  if (atomA.alternateLocationID != atomB.alternateLocationID
      && atomA.alternateLocationID != '\0' && atomB.alternateLocationID != '\0')
    return false;
  getOrAddBond(atomA, atomB, order, mad, bsBonds, 0, false);
  return true;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:23,代码来源:BondCollection.java

示例2: checkCalculationType

import org.jmol.util.Logger; //导入方法依赖的package包/类
private boolean checkCalculationType() {
  if (calculationType == null) {
    Logger.warn("calculation type not identified -- continuing");
    return true;
  }
  nwChemMode = (calculationType.indexOf("NWCHEM") >= 0);
  /*if (calculationType.indexOf("5D") >= 0) {
   Logger
   .error("QuantumCalculation.checkCalculationType: can't read 5D basis sets yet: "
   + calculationType + " -- exit");
   return false;
   }*/
  if (calculationType.indexOf("+") >= 0 || calculationType.indexOf("*") >= 0) {
    Logger
        .warn("polarization/diffuse wavefunctions have not been tested fully: "
            + calculationType + " -- continuing");
  }
  if (calculationType.indexOf("?") >= 0) {
    Logger
        .warn("unknown calculation type may not render correctly -- continuing");
  } else {
    Logger.info("calculation type: " + calculationType + " OK.");
  }
  return true;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:26,代码来源:MOCalculation.java

示例3: nextVoxel

import org.jmol.util.Logger; //导入方法依赖的package包/类
protected float nextVoxel() throws Exception {
  float voxelValue = parseFloat();
  if (Float.isNaN(voxelValue)) {
    while (readLine() != null
        && Float.isNaN(voxelValue = parseFloat(line))) {
    }
    if (line == null) {
      if (!endOfData)
        Logger.warn("end of file reading cube voxel data? nBytes=" + nBytes
            + " nDataPoints=" + nDataPoints + " (line):" + line);
      endOfData = true;
      line = "0 0 0 0 0 0 0 0 0 0";
    }
  }
  return voxelValue;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:17,代码来源:VolumeFileReader.java

示例4: checkLine

import org.jmol.util.Logger; //导入方法依赖的package包/类
@Override
protected boolean checkLine() throws Exception {
  // reader-dependent
  boolean isMDL = (line.startsWith("$MDL"));
  if (isMDL) {
    discardLinesUntilStartsWith("$HDR");
    readLine();
    if (line == null) {
      Logger.warn("$HDR not found in MDL RG file");
      continuing = false;
      return false;
    }
  }
  if (doGetModel(++modelNumber)) {
    processMolSdHeader();
    processCtab(isMDL);
    if (isLastModel(modelNumber)) {
      continuing = false;
      return false;
    }
    return true;
  }
  discardLinesUntilStartsWith("$$$$");
  return true;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:26,代码来源:MolReader.java

示例5: readAtomData

import org.jmol.util.Logger; //导入方法依赖的package包/类
private void readAtomData(float factor) throws Exception {
  float x, y, z;
  do {
    if (tokens[0].equalsIgnoreCase("%ENDBLOCK"))
      break;
    if (tokens.length >= 4) {
      Atom atom = atomSetCollection.addNewAtom();
      x = parseFloat(tokens[1]) * factor;
      y = parseFloat(tokens[2]) * factor;
      z = parseFloat(tokens[3]) * factor;
      atom.set(x, y, z);
      atom.elementSymbol = tokens[0];
    } else {
      Logger.warn("cannot read line with CASTEP atom data: " + line);
    }
  } while (tokenizeCastepCell() > 0);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:18,代码来源:CastepReader.java

示例6: processSymmetryOperationsLoopBlock

import org.jmol.util.Logger; //导入方法依赖的package包/类
/**
 * retrieves symmetry operations
 * 
 * @throws Exception
 */
private void processSymmetryOperationsLoopBlock() throws Exception {
  parseLoopParameters(symmetryOperationsFields);
  int nRefs = 0;
  for (int i = propertyCount; --i >= 0;)
    if (fieldOf[i] != NONE)
      nRefs++;
  if (nRefs != 1) {
    Logger.warn("?que? _symmetry_equiv or _space_group_symop property not found");
    skipLoop();
    return;
  }
  while (tokenizer.getData()) {
    for (int i = 0; i < tokenizer.fieldCount; ++i) {
      switch (fieldProperty(i)) {
      case SYMOP_XYZ:
      case SYM_EQUIV_XYZ:
        setSymmetryOperator(field);
        break;
      }
    }
  }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:28,代码来源:CifReader.java

示例7: setProperty

import org.jmol.util.Logger; //导入方法依赖的package包/类
/**
   * may come from any source -- executed AFTER a shape's own setProperty method
   * 
   * @param propertyName
   * @param value
   * @param bsSelected
   */
  @SuppressWarnings("unchecked")
  public void setProperty(String propertyName, Object value, BitSet bsSelected) {
/*    if (propertyName == "setXml") {
      // some states mignt also check this in order to preseve their state
      xmlProperties = new Vector();
      return;
    }
*/
    if (propertyName == "setProperties") {
      List<Object[]> propertyList = (List<Object[]>) value;
      while (propertyList.size() > 0) {
        Object[] data = propertyList.remove(0);
        setShapeProperty(((String) data[0]).intern(), data[1], null);
      }
      return;
    }
    if (propertyName == "translucentLevel") {
      translucentLevel = ((Float) value).floatValue();
      return;
    }

    if (propertyName == "refreshTrajectories") {
      return;
    }

    Logger.warn("unassigned " + JmolConstants.shapeClassBases[shapeID] + " + shape setProperty:" + propertyName + ":" + value);
  }
 
开发者ID:mleoking,项目名称:PhET,代码行数:35,代码来源:Shape.java

示例8: readLatticeAbc

import org.jmol.util.Logger; //导入方法依赖的package包/类
private void readLatticeAbc() throws Exception {
  if (tokenizeCastepCell() == 0)
    return;
  float factor = readLengthUnit();
  if (tokens.length >= 3) {
    a = parseFloat(tokens[0]) * factor;
    b = parseFloat(tokens[1]) * factor;
    c = parseFloat(tokens[2]) * factor;
  } else {
    Logger
        .warn("error reading a,b,c in %BLOCK LATTICE_ABC in CASTEP .cell file");
    return;
  }

  if (tokenizeCastepCell() == 0)
    return;
  if (tokens.length >= 3) {
    alpha = parseFloat(tokens[0]);
    beta = parseFloat(tokens[1]);
    gamma = parseFloat(tokens[2]);
  } else {
    Logger
        .warn("error reading alpha,beta,gamma in %BLOCK LATTICE_ABC in CASTEP .cell file");
  }

  // initialize lattice vectors to NaN - since not present in .cell file
  for (int n = 0; n < 3; n++) {
    abc[n] = new Vector3f(Float.NaN, Float.NaN, Float.NaN);
  }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:31,代码来源:CastepReader.java

示例9: readVolumeParameters

import org.jmol.util.Logger; //导入方法依赖的package包/类
@Override
protected boolean readVolumeParameters() {
  endOfData = false;
  nSurfaces = readVolumetricHeader();
  if (nSurfaces == 0)
    return false;
  if (nSurfaces < params.fileIndex) {
    Logger.warn("not enough surfaces in file -- resetting params.fileIndex to "
        + nSurfaces);
    params.fileIndex = nSurfaces;
  }
  return true;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:14,代码来源:VolumeFileReader.java

示例10: setSymmetryOperator

import org.jmol.util.Logger; //导入方法依赖的package包/类
public void setSymmetryOperator(String xyz) {
  if (ignoreFileSymmetryOperators)
    return;
  atomSetCollection.setLatticeCells(latticeCells, applySymmetryToBonds,
      doPackUnitCell, supercell);
  if (!atomSetCollection.addSpaceGroupOperation(xyz))
    Logger.warn("Skipping symmetry operation " + xyz);
  iHaveSymmetryOperators = true;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:AtomSetCollectionReader.java

示例11: processBondObject

import org.jmol.util.Logger; //导入方法依赖的package包/类
private void processBondObject() throws Exception {
  readLine();
  parseLineParameters(bondFields, bondFieldMap);
  for (; readLine() != null;) {
    if (line.startsWith("property_flags:"))
      break;
    String thisBondID = null;
    String tokens[] = getTokens();
    for (int i = 0; i < fieldCount; ++i) {
      String field = tokens[i];
      switch (fieldTypes[i]) {
      case ID:
        thisBondID = "bond" + field;
        break;
      case bondType:
        int order = 1;
        if (field.equals("single"))
          order = 1;
        else if (field.equals("double"))
          order = 2;
        else if (field.equals("triple"))
          order = 3;
        else
          Logger.warn("unknown CSF bond order: " + field);
        Bond bond = new Bond();
        bond.order = order;
        if (connectors == null) {
          if (htBonds == null)
            htBonds = new Hashtable<String, Bond>();
          htBonds.put(thisBondID, bond);
        } else {
          int[] connect = connectors.get(thisBondID);
          setBond(bond, connect);
        }
        break;
      }
    }
  }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:40,代码来源:CsfReader.java

示例12: calculateMolecularDipole

import org.jmol.util.Logger; //导入方法依赖的package包/类
public Vector3f calculateMolecularDipole(int modelIndex) {
  if (partialCharges == null || modelIndex < 0)
    return null;
  int nPos = 0;
  int nNeg = 0;
  float cPos = 0;
  float cNeg = 0;
  Vector3f pos = new Vector3f();
  Vector3f neg = new Vector3f();
  for (int i = 0; i < atomCount; i++) {
    if (atoms[i].modelIndex != modelIndex)
      continue;
    float c = partialCharges[i];
    if (c < 0) {
      nNeg++;
      cNeg += c;
      neg.scaleAdd(c, atoms[i], neg);
    } else if (c > 0) {
      nPos++;
      cPos += c;
      pos.scaleAdd(c, atoms[i], pos);
    }
  }
  if (nNeg == 0 || nPos == 0)
    return null;
  pos.scale(1f/cPos);
  neg.scale(1f/cNeg);
  pos.sub(neg);
  Logger.warn("CalculateMolecularDipole: this is an approximate result -- needs checking");
  pos.scale(cPos * 4.8f); //1e-10f * 1.6e-19f/ 3.336e-30f;
  
  // SUM_Q[(SUM_pos Q_iRi) / SUM_Q   -  (SUM_neg Q_iRi) / (-SUM_Q) ]    
  // this is really just SUM_i (Q_iR_i). Don't know why that would not work. 
  
  
  //http://www.chemistry.mcmaster.ca/esam/Chapter_7/section_3.html
  // 1 Debye = 3.336e-30 Coulomb-meter; C_e = 1.6022e-19 C
  return pos;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:40,代码来源:ModelCollection.java

示例13: getData

import org.jmol.util.Logger; //导入方法依赖的package包/类
/**
 * 
 * @return TRUE if data, even if ''; FALSE if '.' or  '?' or eof.
 * 
 * @throws Exception
 */
private boolean getData() throws Exception {
  key = tokenizer.getTokenPeeked();
  data = tokenizer.getNextToken();
  if (Logger.debugging)
    Logger.debug(key  + " " + data);
  if (data == null) {
    Logger.warn("CIF ERROR ? end of file; data missing: " + key);
    return false;
  }
  return (data.length() == 0 || data.charAt(0) != '\0');
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:18,代码来源:CifReader.java

示例14: addToMenu

import org.jmol.util.Logger; //导入方法依赖的package包/类
void addToMenu(Object menu, JComponent item) {
  if (menu instanceof JPopupMenu) {
    ((JPopupMenu) menu).add(item);
  } else if (menu instanceof JMenu) {
    ((JMenu) menu).add(item);
  } else {
    Logger.warn("cannot add object to menu: " + menu);
  }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:SimplePopup.java

示例15: scanForOffsets

import org.jmol.util.Logger; //导入方法依赖的package包/类
protected static byte[] scanForOffsets(int firstAtomIndex,
                             int[] specialAtomIndexes,
                             byte[] interestingAtomIDs) {
  /*
   * from validateAndAllocate in AminoMonomer or NucleicMonomer extensions
   * 
   * sets offsets for the FIRST conformation ONLY
   * (provided that the conformation is listed first in each atom case)
   *  
   *  specialAtomIndexes[] corrolates with JmolConstants.specialAtomNames[]
   *  and is set up back in the calling frame.distinguishAndPropagateGroups
   */
  int interestingCount = interestingAtomIDs.length;
  byte[] offsets = new byte[interestingCount];
  for (int i = interestingCount; --i >= 0; ) {
    int atomIndex;
    int atomID = interestingAtomIDs[i];
    // mth 2004 06 09
    // use ~ instead of - as the optional indicator
    // because I got hosed by a missing comma
    // in an interestingAtomIDs table
    if (atomID < 0) {
      atomIndex = specialAtomIndexes[~atomID]; // optional
    } else {
      atomIndex = specialAtomIndexes[atomID];  // required
      if (atomIndex < 0)
        return null;
    }
    int offset;
    if (atomIndex < 0)
      offset = 255;
    else {
      offset = atomIndex - firstAtomIndex;
      if (offset < 0 || offset > 254) {
        Logger.warn("Monomer.scanForOffsets i="+i+" atomID="+atomID+" atomIndex:"+atomIndex+" firstAtomIndex:"+firstAtomIndex+" offset out of 0-254 range. Groups aren't organized correctly. Is this really a protein?: "+offset);
        if (atomID < 0) {
          offset = 255; //it was optional anyway RMH
        } else {
          //throw new NullPointerException();
        }
      }
    }
    offsets[i] = (byte)offset;
  }
  return offsets;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:47,代码来源:Monomer.java


注:本文中的org.jmol.util.Logger.warn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。