Search in sources :

Example 1 with PopulateDetailsInterface

use of com.sldeditor.ui.iface.PopulateDetailsInterface in project sldeditor by robward-scisys.

the class SymbolizerDetailsPanel method internal_getMinimumVersion.

/**
 * Internal get minimum version.
 *
 * @param sldObj the sld obj
 * @param vendorOptionsPresentList the vendor options present list
 * @param parentClass the parent class
 * @param classSelected the class selected
 */
private void internal_getMinimumVersion(Object parentObj, Object sldObj, List<VendorOptionPresent> vendorOptionsPresentList, Class<?> parentClass, Class<?> classSelected) {
    String key = null;
    if (classSelected != null) {
        key = classSelected.toString();
    } else {
        key = EMPTY_PANEL_KEY;
    }
    PopulateDetailsInterface panel = getPanel(parentClass, key);
    if (panel != null) {
        panel.getMinimumVersion(parentObj, sldObj, vendorOptionsPresentList);
    }
}
Also used : PopulateDetailsInterface(com.sldeditor.ui.iface.PopulateDetailsInterface)

Example 2 with PopulateDetailsInterface

use of com.sldeditor.ui.iface.PopulateDetailsInterface in project sldeditor by robward-scisys.

the class SLDTree method getSelectedSymbolPanel.

/**
 * Gets the panel.
 *
 * @return the selected symbol panel
 */
public PopulateDetailsInterface getSelectedSymbolPanel() {
    PopulateDetailsInterface panel = null;
    TreePath path = symbolTree.getSelectionPath();
    if (path != null) {
        DefaultMutableTreeNode lastNode = (DefaultMutableTreeNode) path.getLastPathComponent();
        if (lastNode != null) {
            Object nodeInfo = lastNode.getUserObject();
            if (nodeInfo != null) {
                Class<?> classSelected = nodeInfo.getClass();
                String key = classSelected.toString();
                Class<?> parentClass = null;
                if (lastNode.getParent() != null) {
                    DefaultMutableTreeNode parent = (DefaultMutableTreeNode) lastNode.getParent();
                    parentClass = parent.getUserObject().getClass();
                }
                if (displayPanel != null) {
                    panel = displayPanel.getPanel(parentClass, key);
                }
            }
        }
    }
    return panel;
}
Also used : TreePath(javax.swing.tree.TreePath) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) PopulateDetailsInterface(com.sldeditor.ui.iface.PopulateDetailsInterface)

Example 3 with PopulateDetailsInterface

use of com.sldeditor.ui.iface.PopulateDetailsInterface in project sldeditor by robward-scisys.

the class SymbolizerDetailsPanel method populateMap.

/**
 * Populate map.
 *
 * @param classMap the class map
 */
private void populateMap(Map<String, List<Class<?>>> classMap) {
    Set<String> keySet = classMap.keySet();
    for (String key : keySet) {
        List<PopulateDetailsInterface> panelList = panelMap.get(key);
        if (panelList == null) {
            panelList = new ArrayList<>();
            panelMap.put(key, panelList);
        }
    }
    keySet.parallelStream().forEach(key -> {
        List<PopulateDetailsInterface> panelList = panelMap.get(key);
        if (panelList != null) {
            List<Class<?>> clazzList = classMap.get(key);
            for (Class<?> clazz : clazzList) {
                PopulateDetailsInterface panelDetails = null;
                try {
                    panelDetails = (PopulateDetailsInterface) clazz.newInstance();
                } catch (IllegalAccessException | InstantiationException e) {
                    ConsoleManager.getInstance().exception(this, e);
                }
                panelList.add(panelDetails);
            }
        }
    });
}
Also used : PopulateDetailsInterface(com.sldeditor.ui.iface.PopulateDetailsInterface)

Example 4 with PopulateDetailsInterface

use of com.sldeditor.ui.iface.PopulateDetailsInterface in project sldeditor by robward-scisys.

the class SymbolizerDetailsPanel method refresh.

/*
     * (non-Javadoc)
     *
     * @see com.sldeditor.ui.iface.SymbolizerSelectedInterface#refresh(java.lang.Class,
     * java.lang.Class)
     */
@Override
public void refresh(Class<?> parentClass, Class<?> classSelected) {
    String key = null;
    if (classSelected != null) {
        key = classSelected.toString();
    } else {
        key = EMPTY_PANEL_KEY;
    }
    PopulateDetailsInterface panel = getPanel(parentClass, key);
    if ((panel != null) && (currentDisplayedPanel != null)) {
        if (currentDisplayedPanel.equals(encodePanelKey(key, panel))) {
            SelectedSymbol selectedSymbol = SelectedSymbol.getInstance();
            panel.populate(selectedSymbol);
        }
    }
    repaint();
}
Also used : SelectedSymbol(com.sldeditor.common.data.SelectedSymbol) PopulateDetailsInterface(com.sldeditor.ui.iface.PopulateDetailsInterface)

Example 5 with PopulateDetailsInterface

use of com.sldeditor.ui.iface.PopulateDetailsInterface in project sldeditor by robward-scisys.

the class SymbolizerDetailsPanel method show.

/**
 * Show panel for selected tree item.
 *
 * @param parentClass the parent class
 * @param classSelected the class selected
 */
@Override
public void show(Class<?> parentClass, Class<?> classSelected) {
    String key = null;
    if (classSelected != null) {
        key = classSelected.toString();
    } else {
        key = EMPTY_PANEL_KEY;
    }
    PopulateDetailsInterface panel = getPanel(parentClass, key);
    if (panel != null) {
        CardLayout cl = (CardLayout) (detailsPanel.getLayout());
        currentDisplayedPanel = encodePanelKey(key, panel);
        cl.show(detailsPanel, currentDisplayedPanel);
        SelectedSymbol selectedSymbol = SelectedSymbol.getInstance();
        panel.populate(selectedSymbol);
    }
    repaint();
}
Also used : SelectedSymbol(com.sldeditor.common.data.SelectedSymbol) CardLayout(java.awt.CardLayout) PopulateDetailsInterface(com.sldeditor.ui.iface.PopulateDetailsInterface)

Aggregations

PopulateDetailsInterface (com.sldeditor.ui.iface.PopulateDetailsInterface)15 VendorOptionInterface (com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface)4 SLDTree (com.sldeditor.ui.tree.SLDTree)3 File (java.io.File)3 IOException (java.io.IOException)3 InputStream (java.io.InputStream)3 TreeSelectionData (com.sldeditor.TreeSelectionData)2 SLDData (com.sldeditor.common.data.SLDData)2 SelectedSymbol (com.sldeditor.common.data.SelectedSymbol)2 RenderSymbolInterface (com.sldeditor.datasource.RenderSymbolInterface)2 StyledLayerDescriptor (org.geotools.styling.StyledLayerDescriptor)2 Test (org.junit.jupiter.api.Test)2 VersionData (com.sldeditor.common.vendoroption.VersionData)1 FieldIdEnum (com.sldeditor.common.xml.ui.FieldIdEnum)1 GroupIdEnum (com.sldeditor.common.xml.ui.GroupIdEnum)1 SldEditorTest (com.sldeditor.common.xml.ui.SldEditorTest)1 XMLColourMapEntries (com.sldeditor.common.xml.ui.XMLColourMapEntries)1 XMLFieldAttribute (com.sldeditor.common.xml.ui.XMLFieldAttribute)1 XMLFieldBase (com.sldeditor.common.xml.ui.XMLFieldBase)1 XMLFieldDisabled (com.sldeditor.common.xml.ui.XMLFieldDisabled)1