Search in sources :

Example 1 with J3DGraphics2D

use of javax.media.j3d.J3DGraphics2D in project ffx by mjschnie.

the class GraphicsCanvas method postRender.

/**
 * {@inheritDoc}
 *
 * Labels are drawn in postRender.
 */
@Override
public void postRender() {
    if (RendererCache.labelAtoms || RendererCache.labelResidues) {
        J3DGraphics2D g2D = getGraphics2D();
        synchronized (mainPanel.getHierarchy()) {
            ArrayList<MSNode> nodes = mainPanel.getHierarchy().getActiveNodes();
            if (nodes != null && nodes.size() > 0) {
                for (MSNode node : nodes) {
                    MolecularAssembly sys = (MolecularAssembly) node.getMSNode(MolecularAssembly.class);
                    if (sys != null) {
                        node.drawLabel(this, g2D, sys.getWireFrame());
                    }
                }
            } else {
                return;
            }
        }
        g2D.flush(true);
    }
}
Also used : MSNode(ffx.potential.bonded.MSNode) MolecularAssembly(ffx.potential.MolecularAssembly) J3DGraphics2D(javax.media.j3d.J3DGraphics2D)

Aggregations

MolecularAssembly (ffx.potential.MolecularAssembly)1 MSNode (ffx.potential.bonded.MSNode)1 J3DGraphics2D (javax.media.j3d.J3DGraphics2D)1