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);
}
}
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;
}
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);
}
}
});
}
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();
}
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();
}
Aggregations