Search in sources :

Example 1 with SLDEditorUIPanels

use of com.sldeditor.ui.panels.SLDEditorUIPanels in project sldeditor by robward-scisys.

the class SLDEditorDockableLayoutTest method testCreateUI.

/**
 * Test method for {@link
 * com.sldeditor.ui.layout.SLDEditorDockableLayout#createUI(com.sldeditor.common.SLDEditorInterface,
 * com.sldeditor.ui.panels.SLDEditorUIPanels, java.util.List)}.
 */
@Test
void testCreateUI() {
    TestSLDEditor testSLDEditor = null;
    PrefData prefData = new PrefData();
    prefData.setUiLayoutClass(SLDEditorDockableLayout.class.getName());
    PrefManager.getInstance().setPrefData(prefData);
    try {
        testSLDEditor = TestSLDEditor.createAndShowGUI2(null, null, true, null);
    } catch (Exception e) {
        e.printStackTrace();
    }
    File tmpFolder = new File(System.getProperty("java.io.tmpdir"));
    String uiLayout = SLDEditorDockableLayout.class.getName();
    UILayoutInterface ui = UILayoutFactory.getUILayout(uiLayout);
    SLDEditorUIPanels uiMgr = SLDEditorUIPanels.getInstance();
    ui.createUI(new SLDEditorMain(testSLDEditor), uiMgr, new ArrayList<ExtensionInterface>());
    ui.writeLayout(tmpFolder.getAbsolutePath());
    ui.readLayout(tmpFolder.getAbsolutePath());
    File f = new File(tmpFolder, "layout.data");
    f.delete();
    assertEquals(uiLayout, SLDEditorDockableLayout.class.getName());
}
Also used : SLDEditorMain(com.sldeditor.SLDEditorMain) PrefData(com.sldeditor.common.preferences.PrefData) SLDEditorDockableLayout(com.sldeditor.ui.layout.SLDEditorDockableLayout) ExtensionInterface(com.sldeditor.extension.ExtensionInterface) SLDEditorUIPanels(com.sldeditor.ui.panels.SLDEditorUIPanels) SLDEditorFile(com.sldeditor.datasource.SLDEditorFile) File(java.io.File) UILayoutInterface(com.sldeditor.ui.layout.UILayoutInterface) Test(org.junit.jupiter.api.Test)

Example 2 with SLDEditorUIPanels

use of com.sldeditor.ui.panels.SLDEditorUIPanels in project sldeditor by robward-scisys.

the class SLDEditorDefaultLayoutTest method testCreateUI.

/**
 * Test method for {@link
 * com.sldeditor.ui.layout.SLDEditorDockableLayout#createUI(com.sldeditor.common.SLDEditorInterface,
 * com.sldeditor.ui.panels.SLDEditorUIPanels, java.util.List)}.
 */
@Test
void testCreateUI() {
    @SuppressWarnings("unused") TestSLDEditor testSLDEditor = null;
    PrefData prefData = new PrefData();
    prefData.setUiLayoutClass(SLDEditorDefaultLayout.class.getName());
    PrefManager.getInstance().setPrefData(prefData);
    try {
        testSLDEditor = TestSLDEditor.createAndShowGUI2(null, null, true, null);
    } catch (Exception e) {
        e.printStackTrace();
    }
    File tmpFolder = new File(System.getProperty("java.io.tmpdir"));
    String uiLayout = SLDEditorDefaultLayout.class.getName();
    UILayoutInterface ui = UILayoutFactory.getUILayout(uiLayout);
    SLDEditorUIPanels uiMgr = SLDEditorUIPanels.getInstance();
    ui.createUI(new SLDEditorMain(testSLDEditor), uiMgr, new ArrayList<ExtensionInterface>());
    ui.writeLayout(tmpFolder.getAbsolutePath());
    ui.readLayout(tmpFolder.getAbsolutePath());
    File f = new File(tmpFolder, "layout.data");
    f.delete();
    assertEquals(uiLayout, SLDEditorDefaultLayout.class.getName());
}
Also used : SLDEditorMain(com.sldeditor.SLDEditorMain) PrefData(com.sldeditor.common.preferences.PrefData) SLDEditorDefaultLayout(com.sldeditor.ui.layout.SLDEditorDefaultLayout) ExtensionInterface(com.sldeditor.extension.ExtensionInterface) SLDEditorUIPanels(com.sldeditor.ui.panels.SLDEditorUIPanels) SLDEditorFile(com.sldeditor.datasource.SLDEditorFile) File(java.io.File) UILayoutInterface(com.sldeditor.ui.layout.UILayoutInterface) Test(org.junit.jupiter.api.Test)

Aggregations

SLDEditorMain (com.sldeditor.SLDEditorMain)2 PrefData (com.sldeditor.common.preferences.PrefData)2 SLDEditorFile (com.sldeditor.datasource.SLDEditorFile)2 ExtensionInterface (com.sldeditor.extension.ExtensionInterface)2 UILayoutInterface (com.sldeditor.ui.layout.UILayoutInterface)2 SLDEditorUIPanels (com.sldeditor.ui.panels.SLDEditorUIPanels)2 File (java.io.File)2 Test (org.junit.jupiter.api.Test)2 SLDEditorDefaultLayout (com.sldeditor.ui.layout.SLDEditorDefaultLayout)1 SLDEditorDockableLayout (com.sldeditor.ui.layout.SLDEditorDockableLayout)1