Search in sources :

Example 6 with EditorUIInformation

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());
}
Also used : EditorUIInformation(org.knime.core.node.workflow.EditorUIInformation) Test(org.junit.Test)

Example 7 with EditorUIInformation

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);
}
Also used : EditorUIInformation(org.knime.core.node.workflow.EditorUIInformation) WorkflowManagerUI(org.knime.core.ui.node.workflow.WorkflowManagerUI)

Aggregations

EditorUIInformation (org.knime.core.node.workflow.EditorUIInformation)7 Test (org.junit.Test)3 ArrayList (java.util.ArrayList)1 AbsoluteBendpoint (org.eclipse.draw2d.AbsoluteBendpoint)1 Point (org.eclipse.draw2d.geometry.Point)1 ConnectionUIInformation (org.knime.core.node.workflow.ConnectionUIInformation)1 WorkflowManagerUI (org.knime.core.ui.node.workflow.WorkflowManagerUI)1 WorkflowEditor (org.knime.workbench.editor2.WorkflowEditor)1 CurvedPolylineConnection (org.knime.workbench.editor2.figures.CurvedPolylineConnection)1