Search in sources :

Example 1 with IsRenderableHolder

use of artisynth.core.renderables.IsRenderableHolder in project artisynth_core by artisynth.

the class IsRenderableEditor method applyAction.

public void applyAction(String actionCommand, LinkedList<ModelComponent> selection, Rectangle popupBounds) {
    if (glEditCmd.equals(actionCommand)) {
        ArrayList<HasProperties> contained = new ArrayList<HasProperties>(selection.size());
        for (ModelComponent mc : selection) {
            if (mc instanceof IsRenderableHolder) {
                IsRenderableHolder holder = (IsRenderableHolder) mc;
                IsRenderable glr = holder.getRenderable();
                if (glr instanceof HasProperties) {
                    contained.add((HasProperties) glr);
                }
            }
        }
        if (contained.size() > 0) {
            createPropertyDialog(contained, true, popupBounds);
        } else {
            JOptionPane.showMessageDialog(null, "No properties for selected components", "No properties", JOptionPane.INFORMATION_MESSAGE);
        }
    }
}
Also used : IsRenderable(maspack.render.IsRenderable) ModelComponent(artisynth.core.modelbase.ModelComponent) IsRenderableHolder(artisynth.core.renderables.IsRenderableHolder) HasProperties(maspack.properties.HasProperties) ArrayList(java.util.ArrayList)

Example 2 with IsRenderableHolder

use of artisynth.core.renderables.IsRenderableHolder in project artisynth_core by artisynth.

the class RootModel method addRenderable.

public IsRenderableHolder addRenderable(Renderable renderable) {
    IsRenderableHolder holder = new IsRenderableHolder(renderable);
    addRenderable(holder);
    return holder;
}
Also used : IsRenderableHolder(artisynth.core.renderables.IsRenderableHolder)

Aggregations

IsRenderableHolder (artisynth.core.renderables.IsRenderableHolder)2 ModelComponent (artisynth.core.modelbase.ModelComponent)1 ArrayList (java.util.ArrayList)1 HasProperties (maspack.properties.HasProperties)1 IsRenderable (maspack.render.IsRenderable)1