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


Java Logger.debug方法代码示例

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


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

示例1: run

import org.jmol.util.Logger; //导入方法依赖的package包/类
public void run() {
  try {
    if (error == null) {
      if (Logger.debugging)
        Logger.debug("Running process " + process.processName + " "
            + process.context.pc + " - " + (process.context.pcEnd - 1));
      viewer.eval(process.context, shapeManager);
      if (Logger.debugging)
        Logger.debug("Process " + process.processName + " complete");
    }
  } catch (Exception e) {
    if (tok != Token.trycmd)
      e.printStackTrace();
  } catch (Error er) {
    clearShapeManager(er);
  } finally {
    synchronized (processLock) {
      --counter;
      processLock.notifyAll();
    }
  }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:23,代码来源:ParallelProcessor.java

示例2: dispatchTouchEvent

import org.jmol.util.Logger; //导入方法依赖的package包/类
/**
 * protocol modified by Bob Hanson for Jmol to demonstrate 
 * extended SparshUI protocol to include a return from the
 * server indicating whether or not to consume this event.
 * 
 * server return == (byte) 1 --> do consume this event
 * server return == (byte) 0 --> do not consume this event
 * 
 * @param data
 */
protected void dispatchTouchEvent(TouchData data) {
   Toolkit tk = Toolkit.getDefaultToolkit();
   Dimension dim = tk.getScreenSize();
   if (Logger.debugging)
     Logger.debug("[JmolTouchSimulator] dispatchTouchEvent("+data.id+", "+data.x+", "+data.y+", "+data.type+")");
   try {
     _out.writeInt(-1);
     _out.writeInt(21);
     _out.writeInt(data.id);
     _out.writeFloat(((float) data.x / (float) dim.width));
     _out.writeFloat(((float) data.y / (float) dim.height));
     _out.writeByte((byte) data.type);
     _out.writeLong(data.when);
     //boolean doConsume = (_in.readByte() == 1);
     //if (Logger.debugging)
      // System.out.println("[JmolTouchSimulator] doConsume=" + doConsume);
   } catch (IOException e1) {
     System.err.println("Failed to send event to server.");
   }
 }
 
开发者ID:mleoking,项目名称:PhET,代码行数:31,代码来源:JmolTouchSimulator.java

示例3: getString

import org.jmol.util.Logger; //导入方法依赖的package包/类
private String getString(String string, Object[] objects) {
  String trans = null;
  if (!doTranslate)
    return MessageFormat.format(string, objects);
  for (int bundle = 0; bundle < translationResourcesCount; bundle++) {
    try {
      trans = MessageFormat.format(translationResources[bundle]
          .getString(string), objects);
      return trans;
    } catch (MissingResourceException e) {
      // Normal
    }
  }
  trans = MessageFormat.format(string, objects);
  if (translationResourcesCount > 0) {
    if (Logger.debugging) {
      Logger.debug("No trans, using default: " + trans);
    }
  }
  return trans;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:22,代码来源:GT.java

示例4: getCachedLine

import org.jmol.util.Logger; //导入方法依赖的package包/类
private boolean getCachedLine() {
  slopeKey = new Float(slope);
  if (!lineCache.containsKey(slopeKey))
    return false;
  lineBits = lineCache.get(slopeKey);
  nFound++;
  if (nFound == 1000000)
    if (Logger.debugging) {
      Logger.debug("nCached/nFound lines: " + nCached + " " + nFound);
    }
  return true;
}
 
开发者ID:etomica,项目名称:etomica,代码行数:13,代码来源:LineRenderer.java

示例5: addBonds

import org.jmol.util.Logger; //导入方法依赖的package包/类
void addBonds(String data, int atomCount0) {
  /* from cached data:
   
   <one number per atom>
   1    2    1
   1    3    1
   1    4    1
   1    5    1
   1    6    1
   1    7    1

   */

  String tokens[] = getTokens(data);
  for (int i = modelAtomCount; i < tokens.length;) {
    int sourceIndex = parseInt(tokens[i++]) - 1 + atomCount0;
    int targetIndex = parseInt(tokens[i++]) - 1 + atomCount0;
    int bondOrder = parseInt(tokens[i++]);
    if (bondOrder > 0) {
      r.atomSetCollection.addBond(new Bond(sourceIndex, targetIndex,
          bondOrder < 4 ? bondOrder : bondOrder == 5 ? JmolAdapter.ORDER_AROMATIC : 1));
    }
  }
  int bondCount = r.atomSetCollection.getBondCount();
  if (Logger.debugging) {
    Logger.debug(bondCount + " bonds read");
  }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:29,代码来源:SpartanArchive.java

示例6: runAllProcesses

import org.jmol.util.Logger; //导入方法依赖的package包/类
public void runAllProcesses(Viewer viewer, boolean inParallel) {
  if (processes.size() == 0)
    return;
  this.viewer = viewer;
  inParallel &= !viewer.isParallel() && viewer.setParallel(true);
  List<ShapeManager> vShapeManagers = new ArrayList<ShapeManager>();
  error = null;
  counter = 0;
  if (Logger.debugging)
    Logger.debug("running " + processes.size() + " processes on "
        + Viewer.nProcessors + " processesors inParallel=" + inParallel);

  counter = processes.size();
  for (int i = processes.size(); --i >= 0;) {
    ShapeManager shapeManager = null;
    if (inParallel) {
      shapeManager = new ShapeManager(viewer, viewer.getModelSet());
      vShapeManagers.add(shapeManager);
    }
    runProcess(processes.remove(0), shapeManager);
  }

  synchronized (lock) {
    while (counter > 0) {
      try {
        lock.wait();
      } catch (InterruptedException e) {
      }
      if (error != null)
        throw error;
    }
  }
  mergeResults(vShapeManagers);
  viewer.setParallel(false);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:36,代码来源:ParallelProcessor.java

示例7: getColix

import org.jmol.util.Logger; //导入方法依赖的package包/类
public static short getColix(Object obj) {
  if (obj == null)
    return INHERIT_ALL;
  if (obj instanceof Byte)
    return (((Byte) obj).byteValue() == 0 ? INHERIT_ALL
        : USE_PALETTE);
  if (obj instanceof Integer)
    return Colix3D.getColix(((Integer) obj).intValue());
  if (obj instanceof String)
    return getColix((String) obj);
  if (Logger.debugging) {
    Logger.debug("?? getColix(" + obj + ")");
  }
  return HOTPINK;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:16,代码来源:Graphics3D.java

示例8: readInputAtoms

import org.jmol.util.Logger; //导入方法依赖的package包/类
private void readInputAtoms() throws Exception {
  modelAtomCount = 0;
  while (readLine() != null
      && !line.startsWith("ENDCART")) {
    String[] tokens = getTokens();
    Atom atom = atomSetCollection.addNewAtom();
    atom.elementSymbol = getElementSymbol(parseInt(tokens[0]));
    setAtomCoord(atom, parseFloat(tokens[1]), parseFloat(tokens[2]), parseFloat(tokens[3]));
    modelAtomCount++;
  }
  atomCount = atomSetCollection.getAtomCount();
  if (Logger.debugging)
    Logger.debug(atomCount + " atoms read");
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:15,代码来源:SpartanInputReader.java

示例9: loadInline

import org.jmol.util.Logger; //导入方法依赖的package包/类
public String loadInline(String strModel, char newLine, boolean isAppend, Map<String, Object> htParams) {
  // ScriptEvaluator DATA command uses this, but anyone could.
  if (strModel == null || strModel.length() == 0)
    return null;
  if (strModel.startsWith("LOAD files")) {
    script(strModel);
    return null;
  }
  strModel = fixInlineString(strModel, newLine);
  if (newLine != 0)
    Logger.info("loading model inline, " + strModel.length()
        + " bytes, with newLine character " + (int) newLine + " isAppend="
        + isAppend);
  Logger.debug(strModel);
  String datasep = getDataSeparator();
  int i;
  if (datasep != null && datasep != ""
      && (i = strModel.indexOf(datasep)) >= 0
      && strModel.indexOf("# Jmol state") < 0) {
    int n = 2;
    while ((i = strModel.indexOf(datasep, i + 1)) >= 0)
      n++;
    String[] strModels = new String[n];
    int pt = 0, pt0 = 0;
    for (i = 0; i < n; i++) {
      pt = strModel.indexOf(datasep, pt0);
      if (pt < 0)
        pt = strModel.length();
      strModels[i] = strModel.substring(pt0, pt);
      pt0 = pt + datasep.length();
    }
    return openStringsInline(strModels, htParams, isAppend);
  }
  return openStringInline(strModel, htParams, isAppend);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:36,代码来源:Viewer.java

示例10: dispose

import org.jmol.util.Logger; //导入方法依赖的package包/类
@Override
public void dispose() {
  Logger.debug("ActionManagerMT -- dispose");
  // per applet/application instance
  doneHere = true;
  adapter.dispose();
  if (simulator != null)
    simulator.dispose();
  super.dispose();
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:11,代码来源:ActionManagerMT.java

示例11: addTriangleCheck

import org.jmol.util.Logger; //导入方法依赖的package包/类
@Override
public int addTriangleCheck(int iA, int iB, int iC, int check,
                             int check2, boolean isAbsolute, int color) {
  if (Logger.debugging)
    Logger.debug("tri: " + iA + " " + iB + " " + iC);
  return super.addTriangleCheck(iA, iB, iC, check, check2, isAbsolute, color); 
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:8,代码来源:PmeshReader.java

示例12: setVibrationsFromProperties

import org.jmol.util.Logger; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void setVibrationsFromProperties() throws Exception {
  List<List<Float>> freq_modes = (List<List<Float>>) r.atomSetCollection.getAtomSetCollectionAuxiliaryInfo("FREQ_MODES");
  if (freq_modes == null) {
    return;
  }
  List<String> freq_lab = (List<String>) r.atomSetCollection.getAtomSetCollectionAuxiliaryInfo("FREQ_LAB");
  List<Float> freq_val = (List<Float>) r.atomSetCollection.getAtomSetCollectionAuxiliaryInfo("FREQ_VAL");
  int frequencyCount = freq_val.size();
  List<List<List<Float>>> vibrations = new ArrayList<List<List<Float>>>();
  List<Map<String, Object>> freqs = new ArrayList<Map<String,Object>>();
  if (Logger.debugging) {
    Logger.debug(
        "reading PROP VALUE:VIB FREQ_MODE vibration records: frequencyCount = " + frequencyCount);
  }
  Float v;
  for (int i = 0; i < frequencyCount; ++i) {
    int atomCount0 = r.atomSetCollection.getAtomCount();
    r.atomSetCollection.cloneLastAtomSet();
    addBonds(bondData, atomCount0);
    Map<String, Object> info = new Hashtable<String, Object>();
    info.put("freq", (v = freq_val.get(i)));
    float freq = v.floatValue();
    String label = freq_lab.get(i);
    if (!label.equals("???")) {
      info.put("label", label);
    }
    freqs.add(info);
    r.atomSetCollection.setAtomSetName(label + " " + freq + " cm^-1");
    r.atomSetCollection.setAtomSetProperty("Frequency", freq + " cm^-1");
    r.atomSetCollection.setAtomSetProperty(SmarterJmolAdapter.PATH_KEY, "Frequencies");
  }
  r.atomSetCollection.setAtomSetCollectionAuxiliaryInfo("VibFreqs", freqs);
  int atomCount = r.atomSetCollection.getFirstAtomSetAtomCount();
  int iatom = atomCount; // add vibrations starting at second atomset
  for (int i = 0; i < frequencyCount; i++) {
    if (!r.doGetVibration(i + 1))
      continue;
    int ipt = 0;
    List<List<Float>> vib = new ArrayList<List<Float>>();
    List<Float> mode = freq_modes.get(i);
    for (int ia = 0; ia < atomCount; ia++, iatom++) {
      List<Float> vibatom = new ArrayList<Float>();
      float vx = (v = mode.get(ipt++)).floatValue();
      vibatom.add(v);
      float vy = (v = mode.get(ipt++)).floatValue();
      vibatom.add(v);
      float vz = (v = mode.get(ipt++)).floatValue();
      vibatom.add(v);
      r.atomSetCollection.addVibrationVector(iatom, vx, vy, vz);
      vib.add(vibatom);
    }
    vibrations.add(vib);
  }
  r.atomSetCollection.setAtomSetCollectionAuxiliaryInfo("vibration", vibrations);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:57,代码来源:SpartanArchive.java

示例13: dragEnter

import org.jmol.util.Logger; //导入方法依赖的package包/类
public void dragEnter(DropTargetDragEvent dtde) {
  Logger.debug("DropEnter detected...");
  dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:5,代码来源:JmolFileDropper.java

示例14: setMatrixFromXYZ

import org.jmol.util.Logger; //导入方法依赖的package包/类
boolean setMatrixFromXYZ(String xyz) {
  /*
   * sets symmetry based on an operator string "x,-y,z+1/2", for example
   * 
   */
  if (xyz == null)
    return false;
  xyzOriginal = xyz;
  xyz = xyz.toLowerCase();
  float[] temp = new float[16];
  boolean isReverse = (xyz.startsWith("!"));
  if (isReverse)
    xyz = xyz.substring(1);
  if (xyz.indexOf("xyz matrix:") == 0) {
    /* note: these terms must in unit cell fractional coordinates!
     * CASTEP CML matrix is in fractional coordinates, but do not take into accout
     * hexagonal systems. Thus, in wurtzite.cml, for P 6c 2'c:
     *
     * "transform3": 
     * 
     * -5.000000000000e-1  8.660254037844e-1  0.000000000000e0   0.000000000000e0 
     * -8.660254037844e-1 -5.000000000000e-1  0.000000000000e0   0.000000000000e0 
     *  0.000000000000e0   0.000000000000e0   1.000000000000e0   0.000000000000e0 
     *  0.000000000000e0   0.000000000000e0   0.000000000000e0   1.000000000000e0
     *
     * These are transformations of the STANDARD xyz axes, not the unit cell. 
     * But, then, what coordinate would you feed this? Fractional coordinates of what?
     * The real transform is something like x-y,x,z here.
     * 
     * The coordinates we are using here 
     */
    this.xyz = xyz;
    Parser.parseStringInfestedFloatArray(xyz, null, temp);
    for (int i = 0; i < 16; i++) {
      if (Float.isNaN(temp[i]))
        return false;
      float v = temp[i];
      if (Math.abs(v) < 0.00001f)
        v = 0;
      if (i % 4 == 3)
        v = normalizeTwelfths((v < 0 ? -1 : 1) * Math.round(Math.abs(v * 12)), doNormalize);
      temp[i] = v;
    }
    temp[15] = 1;
    set(temp);
    isFinalized = true;
    if (isReverse)
      invert(this);
    this.xyz = getXYZFromMatrix(this, true, false, false);
    return true;
  }
  if (xyz.indexOf("[[") == 0) {
    xyz = xyz.replace('[',' ').replace(']',' ').replace(',',' ');
    Parser.parseStringInfestedFloatArray(xyz, null, temp);
    for (int i = 0; i < 16; i++) {
      if (Float.isNaN(temp[i]))
        return false;
    }
    set(temp);
    isFinalized = true;
    if (isReverse)
      invert(this);
    this.xyz = getXYZFromMatrix(this, false, false, false);
    //System.out.println("SymmetryOperation: " + xyz + "\n" + (Matrix4f)this + "\n" + this.xyz);
    return true;
  }
  String strOut = getMatrixFromString(xyz, temp, doNormalize, false);
  if (strOut == null)
    return false;
  set(temp);
  if (isReverse) {
    invert(this);
    this.xyz = getXYZFromMatrix(this, true, false, false);
  } else {
    this.xyz = strOut;
  }
  if (Logger.debugging)
    Logger.debug("" + this);
  return true;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:81,代码来源:SymmetryOperation.java

示例15: readGaussianBasis

import org.jmol.util.Logger; //导入方法依赖的package包/类
private boolean readGaussianBasis() throws Exception {
  /* 
   [GTO]
     1 0
    s   10 1.00
     0.8236000000D+04  0.5309998617D-03
     0.1235000000D+04  0.4107998930D-02
     0.2808000000D+03  0.2108699451D-01
     0.7927000000D+02  0.8185297868D-01
     0.2559000000D+02  0.2348169388D+00
     0.8997000000D+01  0.4344008869D+00
     0.3319000000D+01  0.3461289099D+00
     0.9059000000D+00  0.3937798974D-01
     0.3643000000D+00 -0.8982997660D-02
     0.1285000000D+00  0.2384999379D-02
    s   10 1.00
   */
  shells = new ArrayList<int[]>();
  List<float[]> gdata = new ArrayList<float[]>();
  int atomIndex = 0;
  int gaussianPtr = 0;
  
  while (readLine() != null 
      && ! ((line = line.trim()).length() == 0 || line.charAt(0) == '[') ) {
    // First, expect the number of the atomic center
    // The 0 following the atom index is now optional
    String[] tokens = getTokens();
    
    atomIndex = parseInt(tokens[0]) - 1;
    
    // Next is a sequence of shells and their primitives
    while (readLine() != null && line.trim().length() > 0) {
      // Next line has the shell label and a count of the number of primitives
      tokens = getTokens();
      String shellLabel = tokens[0].toUpperCase();
      int nPrimitives = parseInt(tokens[1]);
      int[] slater = new int[4];
      
      slater[0] = atomIndex;
      slater[1] = JmolAdapter.getQuantumShellTagID(shellLabel);
      slater[2] = gaussianPtr;
      slater[3] = nPrimitives;
      
      for (int ip = nPrimitives; --ip >= 0;) {
        // Read ip primitives, each containing an exponent and one (s,p,d,f)
        // or two (sp) contraction coefficient(s)
        String [] primTokens = getTokens(readLine());
        int nTokens = primTokens.length;
        float orbData[] = new float[nTokens];
        
        for (int d = 0; d < nTokens; d++)
          orbData[d] = parseFloat(primTokens[d]);
        gdata.add(orbData);
        gaussianPtr++;
      }
      shells.add(slater);
    }      
    // Next atom
  }

  float [][] garray = new float[gaussianPtr][];
  for (int i = 0; i < gaussianPtr; i++) {
    garray[i] = gdata.get(i);
  }
  moData.put("shells", shells);
  moData.put("gaussians", garray);
  if (Logger.debugging) {
    Logger.debug(shells.size() + " slater shells read");
    Logger.debug(garray.length + " gaussian primitives read");
  }
  atomSetCollection.setAtomSetAuxiliaryInfo("moData", moData);
  return false;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:74,代码来源:MoldenReader.java


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