Search in sources :

Example 6 with ExtensionInterface

use of com.sldeditor.extension.ExtensionInterface in project sldeditor by robward-scisys.

the class SLDEditorDockableLayout method createUI.

/*
     * (non-Javadoc)
     * 
     * @see com.sldeditor.UILayoutInterface#createUI(com.sldeditor.SLDEditorInterface, com.sldeditor.SLDEditorUIPanels, java.util.List)
     */
@Override
public void createUI(SLDEditorInterface application, SLDEditorUIPanels uiMgr, List<ExtensionInterface> extensionList) {
    JFrame frame = application.getApplicationFrame();
    control = new CControl(frame);
    frame.setLayout(new GridLayout(1, 1));
    frame.add(control.getContentArea());
    CGrid grid = new CGrid(control);
    SingleCDockable legend = create(Localisation.getString(SLDEditorDockableLayout.class, "panels.legend"), (JPanel) uiMgr.getLegendData());
    SingleCDockable symbol = create(Localisation.getString(SLDEditorDockableLayout.class, "panels.symbol"), uiMgr.getSLDSymbolData());
    SingleCDockable sld = create(Localisation.getString(SLDEditorDockableLayout.class, "panels.sld"), SLDTextArea.getPanel());
    SingleCDockable map = create(Localisation.getString(SLDEditorDockableLayout.class, "panels.map"), RenderPanelFactory.getMapRenderer());
    SingleCDockable dataSource = create(Localisation.getString(SLDEditorDockableLayout.class, "panels.dataSource"), uiMgr.getDataSourceConfig());
    SingleCDockable vendorOption = create(Localisation.getString(SLDEditorDockableLayout.class, "panels.vendorOption"), uiMgr.getVendorOption());
    SingleCDockable console = create(Localisation.getString(SLDEditorDockableLayout.class, "panels.console"), ConsoleManager.getInstance().getPanel());
    control.addDockable(sld);
    control.addDockable(legend);
    control.addDockable(symbol);
    control.addDockable(map);
    control.addDockable(dataSource);
    control.addDockable(vendorOption);
    control.addDockable(console);
    ToolManager toolManagerInstance = ToolManager.getInstance();
    toolManagerInstance.setApplication(application);
    for (ExtensionInterface extension : extensionList) {
        extension.initialise(application.getLoadSLDInterface(), toolManagerInstance);
        SingleCDockable dockablePlugin = create(extension.getName(), extension.getPanel());
        control.addDockable(dockablePlugin);
        grid.add(0, 0, 1, 4, dockablePlugin);
    }
    grid.add(1, 0, 2, 4, sld);
    grid.add(1, 0, 2, 4, legend);
    grid.add(1, 0, 2, 4, map);
    grid.add(1, 0, 2, 4, dataSource);
    grid.add(1, 0, 2, 4, vendorOption);
    grid.add(1, 0, 2, 4, symbol);
    grid.add(0, 4, 3, 1, console);
    CContentArea content = control.getContentArea();
    content.deploy(grid);
}
Also used : GridLayout(java.awt.GridLayout) CControl(bibliothek.gui.dock.common.CControl) JFrame(javax.swing.JFrame) ToolManager(com.sldeditor.tool.ToolManager) ExtensionInterface(com.sldeditor.extension.ExtensionInterface) CGrid(bibliothek.gui.dock.common.CGrid) DefaultSingleCDockable(bibliothek.gui.dock.common.DefaultSingleCDockable) SingleCDockable(bibliothek.gui.dock.common.SingleCDockable) CContentArea(bibliothek.gui.dock.common.CContentArea)

Example 7 with ExtensionInterface

use of com.sldeditor.extension.ExtensionInterface in project sldeditor by robward-scisys.

the class SLDEditorMenusTest method testSLDEditorMenus.

/**
 * Test method for {@link com.sldeditor.ui.menu.SLDEditorMenus#SLDEditorMenus(com.sldeditor.common.SLDEditorInterface)}.
 */
@Test
public void testSLDEditorMenus() {
    SLDEditorMenus.createMenus(null, null);
    SLDEditorMenus.destroyInstance();
    SLDEditorInterface application = new SLDEditorInterface() {

        @Override
        public JPanel getAppPanel() {
            return null;
        }

        @Override
        public void updateWindowTitle(boolean dataEditedFlag) {
        }

        @Override
        public void chooseNewSLD() {
        }

        @Override
        public void exitApplication() {
        }

        @Override
        public void saveFile(URL url) {
        }

        @Override
        public void saveSLDData(SLDDataInterface sldData) {
        }

        @Override
        public LoadSLDInterface getLoadSLDInterface() {
            return null;
        }

        @Override
        public JFrame getApplicationFrame() {
            return null;
        }

        @Override
        public void openFile(URL selectedURL) {
        }

        @Override
        public String getAppName() {
            return null;
        }

        @Override
        public void refreshPanel(Class<?> parent, Class<?> panelClass) {
        }
    };
    SLDEditorMenus.createMenus(application, null);
    SLDEditorMenus.destroyInstance();
    SLDEditorMenus.createMenus(application, new ArrayList<ExtensionInterface>());
    SLDEditorMenus.destroyInstance();
    EnvironmentVariableManager.destroyInstance();
    SLDEditorFile.destroyInstance();
    VendorOptionManager.destroyInstance();
    UndoManager.destroyInstance();
}
Also used : SLDEditorInterface(com.sldeditor.common.SLDEditorInterface) SLDDataInterface(com.sldeditor.common.SLDDataInterface) ExtensionInterface(com.sldeditor.extension.ExtensionInterface) URL(java.net.URL) Test(org.junit.Test)

Aggregations

ExtensionInterface (com.sldeditor.extension.ExtensionInterface)7 SLDDataInterface (com.sldeditor.common.SLDDataInterface)3 ToolManager (com.sldeditor.tool.ToolManager)2 URL (java.net.URL)2 JFrame (javax.swing.JFrame)2 Test (org.junit.Test)2 CContentArea (bibliothek.gui.dock.common.CContentArea)1 CControl (bibliothek.gui.dock.common.CControl)1 CGrid (bibliothek.gui.dock.common.CGrid)1 DefaultSingleCDockable (bibliothek.gui.dock.common.DefaultSingleCDockable)1 SingleCDockable (bibliothek.gui.dock.common.SingleCDockable)1 SLDEditorInterface (com.sldeditor.common.SLDEditorInterface)1 SelectedFiles (com.sldeditor.common.filesystem.SelectedFiles)1 MapRender (com.sldeditor.map.MapRender)1 CheckUpdatePanel (com.sldeditor.update.CheckUpdatePanel)1 BorderLayout (java.awt.BorderLayout)1 GridLayout (java.awt.GridLayout)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 JComponent (javax.swing.JComponent)1