use of ffx.potential.bonded.RendererCache.ColorModel in project ffx by mjschnie.
the class GraphicsCanvas method setColorModel.
/**
* **********************************************************************
*/
// Color Commands
/**
* Operates on the Active nodes.
*
* @param model String
*/
public void setColorModel(String model) {
if (!RendererCache.colorModelHash.containsKey(model.toUpperCase())) {
return;
}
RendererCache.ColorModel colorModel = RendererCache.colorModelHash.get(model.toUpperCase());
ArrayList<MSNode> active = mainPanel.getHierarchy().getActiveNodes();
if (active == null) {
return;
}
renderer.arm(active, false, false, null, true, colorModel);
}
use of ffx.potential.bonded.RendererCache.ColorModel in project ffx by mjschnie.
the class ModelingShell method initContext.
/**
* Initialize access to Force Field X variables and methods from with the
* Shell.
*/
private void initContext() {
setVariable("dat", mainPanel.getHierarchy());
setVariable("cmd", mainPanel);
setVariable("vis", mainPanel.getGraphics3D());
setVariable("sh", this);
setVariable("active", mainPanel.getHierarchy().getActive());
setVariable("logger", logger);
// Timer
setVariable("time", new MethodClosure(this, "time"));
// File
setVariable("open", new MethodClosure(mainPanel, "openWait"));
setVariable("convertWait", new MethodClosure(mainPanel, "convertWait"));
setVariable("save", new MethodClosure(mainPanel, "saveAsXYZ"));
setVariable("saveAsXYZ", new MethodClosure(mainPanel, "saveAsXYZ"));
setVariable("saveAsP1", new MethodClosure(mainPanel, "saveAsP1"));
setVariable("saveAsPDB", new MethodClosure(mainPanel, "saveAsPDB"));
setVariable("close", new MethodClosure(mainPanel, "closeWait"));
setVariable("closeAll", new MethodClosure(mainPanel, "closeAll"));
// Select
setVariable("select", new MethodClosure(this, "select"));
// Display and View menus.
if (!headless) {
GraphicsCanvas graphics = mainPanel.getGraphics3D();
// Display
int index = 0;
for (ViewModel view : ViewModel.values()) {
setVariable(view.name(), view);
index++;
if (index > 8) {
break;
}
}
setVariable("view", new MethodClosure(graphics, "viewWait"));
// Color
index = 0;
for (ColorModel color : ColorModel.values()) {
setVariable(color.name(), color);
index++;
if (index > 6) {
break;
}
}
setVariable("color", new MethodClosure(graphics, "colorWait"));
}
// Algorithms
setVariable("returnEnergy", new MethodClosure(this, "returnEnergy"));
setVariable("energy", new MethodClosure(this, "energy"));
setVariable("analyze", new MethodClosure(this, "analyze"));
setVariable("minimize", new MethodClosure(this, "minimize"));
setVariable("minimize_2", new MethodClosure(this, "minimize_2"));
setVariable("md", new MethodClosure(this, "md"));
setVariable("potential", new MethodClosure(this, "potential"));
setVariable("poledit", new MethodClosure(this, "poledit"));
setVariable("superpose", new MethodClosure(this, "superpose"));
// Obtain UIUtils object
setVariable("getAlgorithmUtils", new MethodClosure(this, "getUIAlgorithmUtils"));
setVariable("getPotentialsUtils", new MethodClosure(this, "getUIPotentialsUtils"));
}
use of ffx.potential.bonded.RendererCache.ColorModel in project ffx by mjschnie.
the class GraphicsCanvas method colorWait.
/**
* <p>
* colorWait</p>
*
* @param colorMode a {@link java.lang.String} object.
*/
public void colorWait(String colorMode) {
if (colorMode == null) {
logger.info("Null color.");
return;
}
try {
ColorModel colorModel = ColorModel.valueOf(colorMode.toUpperCase());
colorWait(colorModel);
} catch (Exception e) {
logger.info("Unknown color command.");
}
}
use of ffx.potential.bonded.RendererCache.ColorModel in project ffx by mjschnie.
the class GraphicsCanvas method setColorModel.
/**
* Operates on the passed node.
*
* @param model String
* @param node a {@link ffx.potential.bonded.MSNode} object.
*/
public void setColorModel(String model, MSNode node) {
if (node == null) {
return;
}
if (!RendererCache.colorModelHash.containsKey(model.toUpperCase())) {
return;
}
RendererCache.ColorModel colorModel = RendererCache.colorModelHash.get(model.toUpperCase());
renderer.arm(node, false, false, null, true, colorModel);
}
Aggregations