Search in sources :

Example 11 with PreviewModel

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

the class RendererManager method restoreRenderersList.

/**
     * Restores the original order of the renderers list, preserving their enabled state.
     */
private void restoreRenderersList() {
    PreviewModel model = previewController.getModel();
    Set<Renderer> enabledRenderers = null;
    if (model != null && model.getManagedRenderers() != null) {
        enabledRenderers = new HashSet<>();
        enabledRenderers.addAll(Arrays.asList(model.getManagedEnabledRenderers()));
    }
    renderersList.clear();
    for (Renderer r : previewController.getRegisteredRenderers()) {
        renderersList.add(new RendererCheckBox(r, enabledRenderers == null || enabledRenderers.contains(r)));
    }
    updateModelManagedRenderers();
}
Also used : PreviewModel(org.gephi.preview.api.PreviewModel) ManagedRenderer(org.gephi.preview.api.ManagedRenderer) Renderer(org.gephi.preview.spi.Renderer)

Aggregations

PreviewModel (org.gephi.preview.api.PreviewModel)11 PreviewController (org.gephi.preview.api.PreviewController)5 ManagedRenderer (org.gephi.preview.api.ManagedRenderer)3 PreviewPreset (org.gephi.preview.api.PreviewPreset)2 PreviewProperty (org.gephi.preview.api.PreviewProperty)2 Color (java.awt.Color)1 Dimension (java.awt.Dimension)1 Image (java.awt.Image)1 BufferedImage (java.awt.image.BufferedImage)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)1 JPanel (javax.swing.JPanel)1 PreviewUIController (org.gephi.desktop.preview.api.PreviewUIController)1 Column (org.gephi.graph.api.Column)1 Node (org.gephi.graph.api.Node)1 Item (org.gephi.preview.api.Item)1 PreviewProperties (org.gephi.preview.api.PreviewProperties)1 PreviewUI (org.gephi.preview.spi.PreviewUI)1 Renderer (org.gephi.preview.spi.Renderer)1