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


Java Logger类代码示例

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


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

示例1: ViewerPanel

import org.jmol.util.Logger; //导入依赖的package包/类
public ViewerPanel( final Molecule3D molecule, Color background, Dimension size ) {
    setPreferredSize( size );

    // configure Jmol's logging so we don't spew to the console
    Logger.setLogLevel( PhetApplication.getInstance().isDeveloperControlsEnabled() ? Logger.LEVEL_WARN : Logger.LEVEL_FATAL );

    // create the 3D viewer
    viewer = JmolViewer.allocateViewer( ViewerPanel.this, new SmarterJmolAdapter(), null, null, null, "-applet", null );

    // default settings of the viewer, independent of the molecule displayed
    viewer.setColorBackground( toJmolColor( background ) );
    viewer.setFrankOn( false ); // hide the "Jmol" watermark in the lower-right corner
    viewer.setBooleanProperty( "antialiasDisplay", true );
    viewer.setBooleanProperty( "autoBond", false );
    viewer.setFloatProperty( "dipoleScale", 0.8f ); // so that molecular dipole isn't clipped by viewer

    JmolUtil.unbindMouse( viewer ); // unbind all mouse operations
    JmolUtil.bindRotateLeft( viewer ); // bind rotate to left mouse button

    setMolecule( molecule );
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:22,代码来源:JmolViewerNode.java

示例2: getEncodedVertexData

import org.jmol.util.Logger; //导入依赖的package包/类
/**
 * retrieve Jvxl 2.0 format vertex/triangle/color data found
 * within <jvxlSurfaceData> element 
 * 
 * @throws Exception
 */
protected void getEncodedVertexData() throws Exception {
  String data = xr.getXmlData("jvxlSurfaceData", null, true, false);
  String tData = xr.getXmlData("jvxlTriangleData", data, true, false);
  jvxlDecodeVertexData(xr.getXmlData("jvxlVertexData", data, true, false), false);
  String polygonColorData = xr.getXmlData("jvxlPolygonColorData", data, false, false);
  jvxlDecodeTriangleData(tData, polygonColorData);
  Logger.info("Checking for vertex values");
  data = xr.getXmlData("jvxlColorData", data, true, false);
  jvxlData.isJvxlPrecisionColor = XmlReader.getXmlAttrib(data, "encoding").endsWith("2");
  jvxlColorDataRead = JvxlCoder.jvxlUncompressString(XmlReader.getXmlAttrib(data, "data"));
  if (jvxlColorDataRead.length() == 0)
    jvxlColorDataRead = xr.getXmlData("jvxlColorData", data, false, false);
  jvxlDataIsColorMapped = (jvxlColorDataRead.length() > 0);
  if (haveContourData)
    jvxlDecodeContourData(jvxlData, xr.getXmlData("jvxlContourData", null, false, false));
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:23,代码来源:JvxlXmlReader.java

示例3: initializeReader

import org.jmol.util.Logger; //导入依赖的package包/类
@Override
protected void initializeReader() throws Exception {
  while (mopacVersion == 0) {
    discardLinesUntilContains("MOPAC");
    if (line.indexOf("2009") >= 0)
      mopacVersion = 2009;
    else if (line.indexOf("6.") >= 0)
      mopacVersion = 6;
    else if (line.indexOf("7.") >= 0)
      mopacVersion = 7;
    else if (line.indexOf("93") >= 0)
      mopacVersion = 93;
    else if (line.indexOf("2002") >= 0)
      mopacVersion = 2002;
  }
  Logger.info("MOPAC version " + mopacVersion);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:18,代码来源:MopacReader.java

示例4: HallInfo

import org.jmol.util.Logger; //导入依赖的package包/类
HallInfo(String hallSymbol) {
  try {
    String str = this.hallSymbol = hallSymbol.trim();
    str = extractLatticeInfo(str);
    if (Translation.getLatticeIndex(latticeCode) == 0)
      return;
    latticeExtension = Translation.getLatticeExtension(latticeCode,
        isCentrosymmetric);
    str = extractVectorInfo(str) + latticeExtension;
    Logger.info("Hallinfo: " + hallSymbol + " " + str);
    int prevOrder = 0;
    char prevAxisType = '\0';
    primitiveHallSymbol = "P";
    while (str.length() > 0 && nRotations < 16) {
      str = extractRotationInfo(str, prevOrder, prevAxisType);
      RotationTerm r = rotationTerms[nRotations - 1];
      prevOrder = r.order;
      prevAxisType = r.axisType;
      primitiveHallSymbol += " " + r.primitiveCode;
    }
    primitiveHallSymbol += vectorCode;
  } catch (Exception e) {
    Logger.error("Invalid Hall symbol");
    nRotations = 0;
  }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:27,代码来源:HallInfo.java

示例5: pushContext

import org.jmol.util.Logger; //导入依赖的package包/类
private void pushContext(ContextToken token) throws ScriptException {
  if (scriptLevel == scriptLevelMax)
    error(ERROR_tooManyScriptLevels);
  thisContext = getScriptContext();
  thisContext.token = token;
  if (token == null) {
    scriptLevel = ++thisContext.scriptLevel;
  } else {
    thisContext.scriptLevel = -1;
    contextVariables = new Hashtable<String, ScriptVariable>();
    if (token.contextVariables != null)
      for (String key : token.contextVariables.keySet())
        ScriptCompiler.addContextVariable(contextVariables, key);
  }
  if (Logger.debugging || isCmdLine_c_or_C_Option)
    Logger.info("-->>-------------".substring(0, Math
        .max(17, scriptLevel + 5))
        + scriptLevel + " " + filename + " " + token + " " + thisContext);
  //System.out.println("scriptEval " + token + " " + scriptLevel + ": " + contextVariables);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:21,代码来源:ScriptEvaluator.java

示例6: popContext

import org.jmol.util.Logger; //导入依赖的package包/类
void popContext(boolean isFlowCommand, boolean statementOnly) {
  if (thisContext == null)
    return;
  if (thisContext.scriptLevel > 0)
    scriptLevel = thisContext.scriptLevel - 1;
  // we must save (and thus NOT restore) the current statement
  // business when doing push/pop for commands like FOR and WHILE
  ScriptContext scTemp = (isFlowCommand ? getScriptContext() : null);
  restoreScriptContext(thisContext, true, isFlowCommand, statementOnly);
  restoreScriptContext(scTemp, true, false, true);
  if (Logger.debugging || isCmdLine_c_or_C_Option)
    Logger.info("--<<-------------".substring(0, Math.max(17, scriptLevel + 5))
        + scriptLevel + " " + filename + " "
        + (thisContext == null ? "" : "" + thisContext.token) + " "
        + thisContext);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:17,代码来源:ScriptEvaluator.java

示例7: setLogFile

import org.jmol.util.Logger; //导入依赖的package包/类
private String setLogFile(String value) {
  String path = null;
  if (logFilePath == null || value.indexOf("\\") >= 0
      || value.indexOf("/") >= 0) {
    value = null;
  } else if (value.length() > 0) {
    if (!value.startsWith("JmolLog_"))
      value = "JmolLog_" + value;
    try {
      path = (isApplet ? logFilePath + value : (new File(logFilePath + value)
          .getAbsolutePath()));
    } catch (Exception e) {
      value = null;
    }
  }
  if (value == null) {
    Logger.info(GT._("Cannot set log file path."));
  } else {
    if (path != null) 
      Logger.info(GT._("Setting log file to {0}", path));
    logFile = path;
  }
  return value;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:25,代码来源:Viewer.java

示例8: sendJsTextStatus

import org.jmol.util.Logger; //导入依赖的package包/类
void sendJsTextStatus(String message) {
  if (!haveDocumentAccess || statusForm == null || statusText == null)
    return;
  try {
    JSObject jsoWindow = JSObject.getWindow(appletWrapper);
    JSObject jsoDocument = (JSObject) jsoWindow.getMember("document");
    JSObject jsoForm = (JSObject) jsoDocument.getMember(statusForm);
    if (statusText != null) {
      JSObject jsoText = (JSObject) jsoForm.getMember(statusText);
      jsoText.setMember("value", message);
    }
  } catch (Exception e) {
    Logger.error("error indicating status at document." + statusForm + "."
        + statusText + ":" + e.toString());
  }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:17,代码来源:Jmol.java

示例9: AppletWrapper

import org.jmol.util.Logger; //导入依赖的package包/类
public AppletWrapper(String wrappedAppletClassName,
                     String preloadImageName,
                     int preloadThreadCount,
                     String[] preloadClassNames) {
  GT.ignoreApplicationBundle();
  this.wrappedAppletClassName = wrappedAppletClassName;
  this.preloadImageName = preloadImageName;
  this.preloadTextMessage = GT._("Loading Jmol applet ...");
  this.preloadThreadCount = preloadThreadCount;
  this.preloadClassNames = preloadClassNames;
  needToCompleteInitialization = true;
  isSigned = false;
  try {
    String imagePath = "" + (getClass().getClassLoader().getResource(preloadImageName));
    isSigned = (imagePath.indexOf("Signed") >= 0);
    int i = imagePath.indexOf("0.jar");
    GT.setLanguagePath(i >= 0 ? imagePath.substring(4, i + 1) : null); 
  } catch (Exception e) {
    Logger.error("isSigned false: " + e);
  }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:22,代码来源:AppletWrapper.java

示例10: loadCoordinates

import org.jmol.util.Logger; //导入依赖的package包/类
private void loadCoordinates(String data, boolean isVibrationVectors, boolean doTaint) {
  if (!isVibrationVectors)
    bspf = null;
  int[] lines = Parser.markLines(data, ';');
  try {
    int nData = Parser.parseInt(data.substring(0, lines[0] - 1));
    for (int i = 1; i <= nData; i++) {
      String[] tokens = Parser.getTokens(Parser.parseTrimmed(data.substring(
          lines[i], lines[i + 1])));
      int atomIndex = Parser.parseInt(tokens[0]) - 1;
      float x = Parser.parseFloat(tokens[3]);
      float y = Parser.parseFloat(tokens[4]);
      float z = Parser.parseFloat(tokens[5]);
      if (isVibrationVectors) {
        setAtomVibrationVector(atomIndex, x, y, z);
      } else {
        setAtomCoord(atomIndex, x, y, z);
        if (!doTaint)
          untaint(atomIndex, TAINT_COORD);
      }
    }
  } catch (Exception e) {
    Logger.error("Frame.loadCoordinate error: " + e);
  }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:26,代码来源:AtomCollection.java

示例11: setInfo

import org.jmol.util.Logger; //导入依赖的package包/类
private int setInfo(String info) throws Exception {
  //    5  17  11  18   0   1  17   0 RHF      3-21G(d)           NOOPT FREQ
  //    0   1  2   3    4   5   6   7  8        9

  String[] tokens = getTokens(info);
  if (Logger.debugging) {
    Logger.debug("reading Spartan archive info :" + info);
  }
  modelAtomCount = parseInt(tokens[0]);
  coefCount = parseInt(tokens[1]);
  shellCount = parseInt(tokens[2]);
  gaussianCount = parseInt(tokens[3]);
  //overallCharge = parseInt(tokens[4]);
  moCount = parseInt(tokens[6]);
  r.calculationType = tokens[9];
  String s = (String) r.moData.get("calculationType");
  if (s == null)
    s = r.calculationType;
  else if (s.indexOf(r.calculationType) < 0)
    s = r.calculationType + s;
  r.moData.put("calculationType", r.calculationType = s);
  return modelAtomCount;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:24,代码来源:SpartanArchive.java

示例12: ProteinStructure

import org.jmol.util.Logger; //导入依赖的package包/类
/**
 * 
 * @param apolymer
 * @param type
 * @param monomerIndex
 * @param monomerCount
 * @param id              UNUSED
 */
ProteinStructure(AlphaPolymer apolymer, byte type,
                 int monomerIndex, int monomerCount, int id) {
  uniqueID = ++globalSerialID;
  this.apolymer = apolymer;
  this.type = type;    
  monomerIndexFirst = monomerIndex;
  addMonomer(monomerIndex + monomerCount - 1);
  
  if(Logger.debugging)
    Logger.debug(
        "Creating ProteinStructure " + uniqueID 
        + " " + JmolConstants.getProteinStructureName(type, false) 
        + " from " + monomerIndexFirst + " through "+ monomerIndexLast
        + " in polymer " + apolymer);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:24,代码来源:ProteinStructure.java

示例13: setUnitCellItem

import org.jmol.util.Logger; //导入依赖的package包/类
public void setUnitCellItem(int i, float x) {
  if (ignoreFileUnitCell)
    return;
  if (i == 0 && x == 1 || i == 3 && x == 0)
    return;
  if (!Float.isNaN(x) && i >= 6 && Float.isNaN(notionalUnitCell[6]))
    initializeCartesianToFractional();
  notionalUnitCell[i] = x;
  if (Logger.debugging) {
    Logger.debug("setunitcellitem " + i + " " + x);
  }
  //System.out.println("atomSetCollection unitcell item " + i + " = " + x);
  if (i < 6 || Float.isNaN(x))
    iHaveUnitCell = checkUnitCell(6);
  else if (++nMatrixElements == 12)
    checkUnitCell(22);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:18,代码来源:AtomSetCollectionReader.java

示例14: readParameters

import org.jmol.util.Logger; //导入依赖的package包/类
@Override
protected void readParameters() throws Exception {
  String s = xr.getXmlData("jvxlFileTitle", null, false, false);
  jvxlFileHeaderBuffer = new StringBuffer(s);
  xr.toTag("jvxlVolumeData");
  String data = tempDataXml = xr.getXmlData("jvxlVolumeData", null, true, false);
  volumetricOrigin.set(xr.getXmlPoint(data, "origin"));
 isAngstroms = true;
 readVector(0);
 readVector(1);
 readVector(2);
 line = xr.toTag("jvxlSurfaceSet");
 nSurfaces = parseInt(XmlReader.getXmlAttrib(line, "count"));
 Logger.info("jvxl file surfaces: " + nSurfaces);
 Logger.info("using default edge fraction base and range");
 Logger.info("using default color fraction base and range");
 cJvxlEdgeNaN = (char) (edgeFractionBase + edgeFractionRange);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:19,代码来源:JvxlXmlReader.java

示例15: assignPotentials

import org.jmol.util.Logger; //导入依赖的package包/类
public void assignPotentials(Atom[] atoms, float[] potentials,
                             BitSet bsAromatic, BitSet bsCarbonyl,
                             BitSet bsIgnore, String data) {
  getAtomicPotentials(data, null);
  for (int i = 0; i < atoms.length; i++) {
    float f;
    if (bsIgnore != null && bsIgnore.get(i)) {
      f = Float.NaN;
    } else {
      f = getTabulatedPotential(atoms[i]);
      if (Float.isNaN(f))
        f = 0;
    }
    if (Logger.debugging)
      Logger.info(atoms[i].getInfo() + " " + f);
    potentials[i] = f;
  }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:19,代码来源:MepCalculation.java


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