本文整理汇总了Java中org.jmol.util.Logger.error方法的典型用法代码示例。如果您正苦于以下问题:Java Logger.error方法的具体用法?Java Logger.error怎么用?Java Logger.error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jmol.util.Logger
的用法示例。
在下文中一共展示了Logger.error方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.jmol.util.Logger; //导入方法依赖的package包/类
@Override
public void run() {
try {
while (console.checking) {
try {
Thread.sleep(100); //wait for command checker
} catch (Exception e) {
break; //-- interrupt?
}
}
executeCommand(strCommand);
} catch (Exception ie) {
Logger.error("execution command interrupted!", ie);
}
}
示例2: evaluateExpression
import org.jmol.util.Logger; //导入方法依赖的package包/类
/**
* a general-use method to evaluate a "SET" type expression.
*
* @param viewer
* @param expr
* @return an object of one of the following types: Boolean, Integer, Float,
* String, Point3f, BitSet
*/
public static Object evaluateExpression(Viewer viewer, Object expr) {
// Text.formatText for MESSAGE and ECHO
ScriptEvaluator e = new ScriptEvaluator(viewer);
try {
if (expr instanceof String) {
if (e.compileScript(null, EXPRESSION_KEY + " = " + expr, false)) {
e.contextVariables = viewer.getContextVariables();
e.setStatement(0);
return e.parameterExpressionString(2, 0);
}
} else if (expr instanceof Token[]) {
e.contextVariables = viewer.getContextVariables();
return e.atomExpression((Token[]) expr, 0, 0, true, false, true, false);
}
} catch (Exception ex) {
Logger.error("Error evaluating: " + expr + "\n" + ex);
}
return "ERROR";
}
示例3: run
import org.jmol.util.Logger; //导入方法依赖的package包/类
@Override
public void run() {
long startTime = System.currentTimeMillis();
long lastRepaintTime = startTime;
//should save the atom coordinates
if (!startMinimization())
return;
try {
do {
long currentTime = System.currentTimeMillis();
int elapsed = (int) (currentTime - lastRepaintTime);
int sleepTime = 33 - elapsed;
if (sleepTime > 0)
Thread.sleep(sleepTime);
lastRepaintTime = currentTime = System.currentTimeMillis();
if (!stepMinimization())
endMinimization();
elapsed = (int) (currentTime - startTime);
} while (minimizationOn && !isInterrupted());
} catch (Exception e) {
if (minimizationOn)
Logger.error(e.getMessage());
}
}
示例4: DOMResolve
import org.jmol.util.Logger; //导入方法依赖的package包/类
/**
* a largely untested reader of the DOM - where in a browser there
* is model actually in XML format already present on the page.
* -- Egon Willighagen
*
* @param DOMNode
* @param htParams
* @return an AtomSetCollection or a String error
* @throws Exception
*/
static Object DOMResolve(Object DOMNode, Map<String, Object> htParams) throws Exception {
String className = null;
Class<?> atomSetCollectionReaderClass;
AtomSetCollectionReader atomSetCollectionReader;
String atomSetCollectionReaderName = getXmlType((JSObject) DOMNode);
if (Logger.debugging) {
Logger.debug("The Resolver thinks " + atomSetCollectionReaderName);
}
htParams.put("readerName", atomSetCollectionReaderName);
try {
className = classBase + "xml.XmlReader";
atomSetCollectionReaderClass = Class.forName(className);
atomSetCollectionReader = (AtomSetCollectionReader) atomSetCollectionReaderClass.newInstance();
return atomSetCollectionReader;
} catch (Exception e) {
String err = "File reader was not found:" + className;
Logger.error(err, e);
return err;
}
}
示例5: addBundles
import org.jmol.util.Logger; //导入方法依赖的package包/类
private void addBundles(String type, String la_co_va, String la_co, String la) {
try {
String className = "org.jmol.translation." + type + ".";
if (la_co_va != null)
addBundle(className, la_co_va);
if (la_co != null)
addBundle(className, la_co);
if (la != null)
addBundle(className, la);
} catch (Exception exception) {
Logger.error("Some exception occurred!", exception);
translationResources = null;
translationResourcesCount = 0;
}
}
示例6: readAtomicOrbitalOrder
import org.jmol.util.Logger; //导入方法依赖的package包/类
void readAtomicOrbitalOrder() throws Exception {
/*
[AO_ORDER]
DOrbitals XX YY ZZ XY XZ YZ
FOrbitals XXX YYY ZZZ XXY XXZ YYX YYZ ZZX ZZY XYZ
*/
while (getLine()) {
String[] tokens = getTokens();
if (tokens.length == 0)
continue;
String data = line.substring(9).trim().toLowerCase();
boolean isOK = false;
switch(tokens.length - 1) {
case 3:
case 4:
isOK = true;
break;
case 5:
isOK = (tokens[0].equals("DOrbitals") && getDFMap(data, JmolAdapter.SHELL_D_SPHERICAL, DS_LIST, 99));
break;
case 6:
isOK = (tokens[0].equals("DOrbitals") && getDFMap(data, JmolAdapter.SHELL_D_CARTESIAN, DC_LIST, 2));
break;
case 7:
isOK = (tokens[0].equals("FOrbitals") && getDFMap(data, JmolAdapter.SHELL_F_SPHERICAL, FS_LIST, 99));
break;
case 10:
isOK = (tokens[0].equals("FOrbitals") && getDFMap(data, JmolAdapter.SHELL_F_CARTESIAN, FC_LIST, 3));
break;
}
if (!isOK) {
Logger.error("atomic orbital order is unrecognized -- skipping reading of MOs due to line: " + line);
orbitals = null;
}
}
}
示例7: readPsiMolecularOrbitals
import org.jmol.util.Logger; //导入方法依赖的package包/类
void readPsiMolecularOrbitals() throws Exception {
//TODO: This reader will fail for G orbitals
//TODO: No way to check order
Map<String, Object>[] mos = ArrayUtil.createArrayOfHashtable(5);
List<String>[] data = ArrayUtil.createArrayOfArrayList(5);
int nThisLine = 0;
while (readLine() != null && line.toUpperCase().indexOf("DENS") < 0) {
String[] tokens = getTokens();
int ptData = (line.charAt(5) == ' ' ? 2 : 4);
if (line.indexOf(" ") == 0) {
addMOData(nThisLine, data, mos);
nThisLine = tokens.length;
tokens = getTokens(readLine());
for (int i = 0; i < nThisLine; i++) {
mos[i] = new Hashtable<String, Object>();
data[i] = new ArrayList<String>();
mos[i].put("symmetry", tokens[i]);
}
tokens = getStrings(readLine().substring(21), nThisLine, 10);
for (int i = 0; i < nThisLine; i++) {
mos[i].put("energy", new Float(tokens[i]));
}
continue;
}
try {
for (int i = 0; i < nThisLine; i++) {
data[i].add(tokens[i + ptData]);
}
} catch (Exception e) {
Logger.error("Error reading Psi3 file molecular orbitals at line: "
+ line);
break;
}
}
addMOData(nThisLine, data, mos);
moData.put("mos", orbitals);
setMOData(moData);
}
示例8: setProperty
import org.jmol.util.Logger; //导入方法依赖的package包/类
private void setProperty(int tok, Dipole dipole, int iValue, float fValue) {
switch (tok) {
case Token.on:
dipole.visible = true;
return;
case Token.off:
dipole.visible = false;
return;
case Token.delete:
deleteDipole(dipole);
return;
case Token.wireframe:
dipole.mad = tempDipole.mad = (short) iValue;
return;
case Token.axes:
dipole.offsetAngstroms = fValue;
return;
case Token.percent:
dipole.offsetAngstroms = fValue * dipole.dipoleValue;
return;
case Token.sidechain:
dipole.offsetSide = fValue;
return;
case Token.cross:
dipole.noCross = (iValue == 0);
return;
case Token.color:
dipole.colix = colix;
return;
case Token.translucent:
dipole.setTranslucent(iValue == 1, translucentLevel);
return;
}
Logger.error("Unkown dipole property! " + Token.nameOf(tok));
}
示例9: getVoxelBitSet
import org.jmol.util.Logger; //导入方法依赖的package包/类
@Override
protected BitSet getVoxelBitSet(int nPoints) throws Exception {
if (bsVoxelBitSet != null)
return bsVoxelBitSet;
BitSet bs = new BitSet();
int bsVoxelPtr = 0;
if (surfaceDataCount <= 0)
return bs; //unnecessary -- probably a plane or color density
int nThisValue = 0;
while (bsVoxelPtr < nPoints) {
nThisValue = parseInt();
if (nThisValue == Integer.MIN_VALUE) {
readLine();
// note -- does not allow for empty lines;
// must be a continuous block of numbers.
if (line == null || (nThisValue = parseInt(line)) == Integer.MIN_VALUE) {
if (!endOfData)
Logger.error("end of file in JvxlReader?" + " line=" + line);
endOfData = true;
nThisValue = 10000;
//throw new NullPointerException();
}
}
thisInside = !thisInside;
++jvxlNSurfaceInts;
if (thisInside)
bs.set(bsVoxelPtr, bsVoxelPtr + nThisValue);
bsVoxelPtr += nThisValue;
}
return bs;
}
示例10: dialogAsk
import org.jmol.util.Logger; //导入方法依赖的package包/类
String dialogAsk(String type, String fileName) {
inputFileName = fileName;
dialogType = type;
//System.out.println("Jvm12 thread: " + Thread.currentThread().getName());
try {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
if (dialogType.equals("load")) {
outputFileName = newDialog(false).getOpenFileNameFromDialog(
viewer.getAppletContext(), viewer, inputFileName, null, null, false);
return;
}
JmolDialogInterface sd = newDialog(false);
if (dialogType.equals("save")) {
outputFileName = sd.getSaveFileNameFromDialog(viewer,
inputFileName, null);
return;
}
if (dialogType.startsWith("saveImage")) {
outputFileName = sd.getImageFileNameFromDialog(viewer,
inputFileName, imageType, imageChoices, imageExtensions,
qualityJPG, qualityPNG);
qualityJPG = sd.getQuality("JPG");
qualityPNG = sd.getQuality("PNG");
String sType = sd.getType();
if (sType != null)
imageType = sType;
int iQuality = sd.getQuality(sType);
if (iQuality >= 0)
imageQuality = iQuality;
return;
}
outputFileName = null;
}
});
} catch (Exception e) {
Logger.error(e.getMessage());
}
return outputFileName;
}
示例11: render1
import org.jmol.util.Logger; //导入方法依赖的package包/类
private void render1(Graphics g, Image img, int x, int y) {
if (g != null && img != null) {
try {
g.drawImage(img, x, y, null);
} catch (NullPointerException npe) {
Logger.error("Sun!! ... fix graphics your bugs!");
}
}
g3d.releaseScreenImage();
}
示例12: getOutputStream
import org.jmol.util.Logger; //导入方法依赖的package包/类
public OutputStream getOutputStream(String localName, String[] fullPath) {
Object ret = createImage(localName, "OutputStream", null,
Integer.MIN_VALUE, 0, 0, fullPath);
if (ret instanceof String) {
Logger.error((String) ret);
return null;
}
return (OutputStream) ret;
}
示例13: getForceField
import org.jmol.util.Logger; //导入方法依赖的package包/类
public ForceField getForceField() {
if (pFF == null) {
try {
String className = getClass().getName();
className = className.substring(0, className.lastIndexOf("."))
+ ".forcefield.ForceField" + ff;
Logger.info( "minimize: using " + className);
pFF = (ForceField) Class.forName(className).newInstance();
} catch (Exception e) {
Logger.error(e.getMessage());
}
}
//Logger.info("minimize: forcefield = " + pFF);
return pFF;
}
示例14: importData
import org.jmol.util.Logger; //导入方法依赖的package包/类
@Override
public boolean importData(JComponent c, Transferable t) {
if (sourceIndices == null || !canImport(c, t.getTransferDataFlavors())) {
return false;
}
JList target = null;
List<?> alist = null;
try {
target = (JList) c;
if (hasLocalArrayListFlavor(t.getTransferDataFlavors())) {
alist = (List<?>) t.getTransferData(localArrayListFlavor);
} else if (hasSerialArrayListFlavor(t.getTransferDataFlavors())) {
alist = (List<?>) t.getTransferData(serialArrayListFlavor);
} else {
return false;
}
} catch (UnsupportedFlavorException ufe) {
Logger.error("importData: unsupported data flavor");
return false;
} catch (IOException ioe) {
Logger.error("importData: I/O exception");
return false;
}
// At this point we use the same code to retrieve the data
// locally or serially.
// We'll drop at the current selected index.
int targetIndex = target.getSelectedIndex();
// Prevent the user from dropping data back on itself.
// For example, if the user is moving items #4,#5,#6 and #7 and
// attempts to insert the items after item #5, this would
// be problematic when removing the original items.
// This is interpreted as dropping the same data on itself
// and has no effect.
if (source.equals(target)) {
// System.out.print("checking indices index TO: " + targetIndex + "
// FROM:");
// for (int i = 0; i < sourceIndices.length;i++)
// System.out.print(" "+sourceIndices[i]);
// System.out.println("");
if (targetIndex >= sourceIndices[0]
&& targetIndex <= sourceIndices[sourceIndices.length - 1]) {
// System.out.println("setting indices null : " + targetIndex + " " +
// sourceIndices[0] + " " + sourceIndices[sourceIndices.length - 1]);
sourceIndices = null;
return true;
}
}
DefaultListModel listModel = (DefaultListModel) target.getModel();
int max = listModel.getSize();
if (targetIndex < 0) {
targetIndex = max;
} else {
if (sourceIndices[0] < targetIndex)
targetIndex++;
if (targetIndex > max) {
targetIndex = max;
}
}
addIndex = targetIndex;
addCount = alist.size();
for (int i = 0; i < alist.size(); i++) {
listModel.add(targetIndex++, objectOf(listModel, alist.get(i)));
}
return true;
}
示例15: readMolecularOrbitals
import org.jmol.util.Logger; //导入方法依赖的package包/类
private void readMolecularOrbitals() throws Exception {
if (shells == null)
return;
Map<String, Object>[] mos = ArrayUtil.createArrayOfHashtable(5);
List<String>[] data = ArrayUtil.createArrayOfArrayList(5);
int nThisLine = 0;
while (readLine() != null
&& line.toUpperCase().indexOf("DENS") < 0) {
String[] tokens;
if (line.indexOf(" ") == 0) {
addMOData(nThisLine, data, mos);
tokens = getTokens(readLine());
nThisLine = tokens.length;
for (int i = 0; i < nThisLine; i++) {
mos[i] = new Hashtable<String, Object>();
data[i] = new ArrayList<String>();
String sym = tokens[i];
mos[i].put("symmetry", sym);
if (sym.indexOf("--O") >= 0)
mos[i].put("occupancy", new Float(2));
else if (sym.indexOf("--V") >= 0)
mos[i].put("occupancy", new Float(0));
}
line = readLine().substring(21);
tokens = getTokens();
if (tokens.length != nThisLine)
tokens = getStrings(line, nThisLine, 10);
for (int i = 0; i < nThisLine; i++)
mos[i].put("energy", new Float(tokens[i]));
continue;
} else if (line.length() < 21 || (line.charAt(11) != ' '
&& ! Character.isDigit(line.charAt(11))
) ) {
continue;
}
try {
String type = line.substring(13, 18).trim();
if (!isQuantumBasisSupported(type.charAt(0)) && "XYZ".indexOf(type.charAt(0)) >= 0)
type = (type.length() == 2 ? "D" : "F") + type;
if (!isQuantumBasisSupported(type.charAt(0)))
continue;
tokens = getStrings(line.substring(21), nThisLine, 10);
for (int i = 0; i < nThisLine; i++)
data[i].add(tokens[i]);
} catch (Exception e) {
Logger.error("Error reading Gaussian file Molecular Orbitals at line: "
+ line);
break;
}
}
addMOData(nThisLine, data, mos);
setMOData(false); // perhaps in the future we might change this to TRUE
}