use of org.knime.core.node.workflow.EditorUIInformation in project knime-core by knime.
the class EditorUIInformationTest method testCopyFrom.
@Test
public void testCopyFrom() {
EditorUIInformation eui = EditorUIInformation.builder().setConnectionLineWidth(1).setGridX(10).setGridY(11).setHasCurvedConnections(true).setShowGrid(false).setSnapToGrid(true).setZoomLevel(.1).build();
EditorUIInformation eui2 = EditorUIInformation.builder().copyFrom(eui).build();
assertTrue(eui.equals(eui2));
assertEquals(eui.hashCode(), eui2.hashCode());
}
use of org.knime.core.node.workflow.EditorUIInformation in project knime-core by knime.
the class WorkflowEditor method applyEditorSettingsFromWorkflowManager.
private void applyEditorSettingsFromWorkflowManager() {
final WorkflowManagerUI wfm = getWorkflowManagerUI();
EditorUIInformation settings = wfm.getEditorUIInformation();
if (settings == null || settings.getGridX() == -1) {
// if this is a metanode - derive settings from parent
if (m_fileResource == null && m_parentEditor != null) {
settings = m_parentEditor.getCurrentEditorSettings();
} else {
// this is an old workflow: don't show or enable grid
settings = getEditorSettingsDefaultBuilder().setShowGrid(false).setSnapToGrid(false).build();
}
}
applyEditorSettings(settings);
}
Aggregations