@Override protected final boolean isChecked(GraphContainer container) { if(container.getLayoutAlgorithm().getClass().getName().equals(m_factory.getLayoutAlgorithm().getClass().getName())) { return true; } return false; }
@Override protected final boolean isChecked(GraphContainer container) { if(container.getLayoutAlgorithm().getClass().getName().equals(m_factory.getLayoutAlgorithm().getClass().getName())) { return true; } return false; }
private void handleSaveButton(GraphContainer graphContainer) { // Toggle save button for coordinates if (graphContainer.getLayoutAlgorithm() instanceof ManualLayoutAlgorithm) { // We only show the save button if we don't have a layout persisted, or the layout is not equal boolean showSave = layoutManager.loadLayout(graphContainer.getGraph()) == null || !layoutManager.isPersistedLayoutEqualToCurrentLayout(graphContainer.getGraph()); layerSaveButton.setEnabled(showSave); if (showSave) { layerSaveButton.setDescription("Save the current layout"); } else { layerSaveButton.setDescription("Nothing to save"); } } else { layerSaveButton.setEnabled(false); layerSaveButton.setDescription("Change to Manual Layout to enable saving"); } } }
@Override public void graphChanged(GraphContainer graphContainer) { if (!(graphContainer.getLayoutAlgorithm() instanceof ManualLayoutAlgorithm)) { LayoutEntity layoutEntity = layoutManager.loadLayout(graphContainer.getGraph()); if (layoutEntity != null) { boolean isEqualLayout = layoutManager.isPersistedLayoutEqualToCurrentLayout(graphContainer.getGraph()); getCompositionRoot().setVisible(!isEqualLayout); } else { getCompositionRoot().setVisible(false); } } else { getCompositionRoot().setVisible(false); } } }
@Override public void graphChanged(GraphContainer graphContainer) { if (!(graphContainer.getLayoutAlgorithm() instanceof ManualLayoutAlgorithm)) { LayoutEntity layoutEntity = layoutManager.loadLayout(graphContainer.getGraph()); if (layoutEntity != null) { boolean isEqualLayout = layoutManager.isPersistedLayoutEqualToCurrentLayout(graphContainer.getGraph()); getCompositionRoot().setVisible(!isEqualLayout); } else { getCompositionRoot().setVisible(false); } } else { getCompositionRoot().setVisible(false); } } }
private void handleSaveButton(GraphContainer graphContainer) { // Toggle save button for coordinates if (graphContainer.getLayoutAlgorithm() instanceof ManualLayoutAlgorithm) { // We only show the save button if we don't have a layout persisted, or the layout is not equal boolean showSave = layoutManager.loadLayout(graphContainer.getGraph()) == null || !layoutManager.isPersistedLayoutEqualToCurrentLayout(graphContainer.getGraph()); layerSaveButton.setEnabled(showSave); if (showSave) { layerSaveButton.setDescription("Save the current layout"); } else { layerSaveButton.setDescription("Nothing to save"); } } else { layerSaveButton.setEnabled(false); layerSaveButton.setDescription("Change to Manual Layout to enable saving"); } } }