Search in sources :

Example 1 with ManagedRenderer

use of org.gephi.preview.api.ManagedRenderer in project gephi by gephi.

the class RendererManager method loadModelManagedRenderers.

/**
     * Obtain renderers enabled state and order from the preview model.
     */
private void loadModelManagedRenderers() {
    renderersList.clear();
    PreviewModel model = previewController.getModel();
    if (model != null) {
        if (model.getManagedRenderers() != null) {
            for (ManagedRenderer mr : model.getManagedRenderers()) {
                renderersList.add(new RendererCheckBox(mr.getRenderer(), mr.isEnabled()));
            }
        } else {
            restoreRenderersList();
        }
    }
}
Also used : PreviewModel(org.gephi.preview.api.PreviewModel) ManagedRenderer(org.gephi.preview.api.ManagedRenderer)

Example 2 with ManagedRenderer

use of org.gephi.preview.api.ManagedRenderer in project gephi by gephi.

the class RendererManager method updateModelManagedRenderers.

/**
     * Sets current renderers enabled state and order to the preview model.
     */
private void updateModelManagedRenderers() {
    PreviewModel model = previewController.getModel();
    if (model != null) {
        ArrayList<ManagedRenderer> managedRenderers = new ArrayList<>();
        for (RendererCheckBox rendererCheckBox : renderersList) {
            managedRenderers.add(new ManagedRenderer(rendererCheckBox.renderer, rendererCheckBox.isSelected()));
        }
        model.setManagedRenderers(managedRenderers.toArray(new ManagedRenderer[0]));
    }
}
Also used : PreviewModel(org.gephi.preview.api.PreviewModel) ArrayList(java.util.ArrayList) ManagedRenderer(org.gephi.preview.api.ManagedRenderer)

Aggregations

ManagedRenderer (org.gephi.preview.api.ManagedRenderer)2 PreviewModel (org.gephi.preview.api.PreviewModel)2 ArrayList (java.util.ArrayList)1