use of com.sldeditor.common.data.SelectedSymbol 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();
}
use of com.sldeditor.common.data.SelectedSymbol 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.common.data.SelectedSymbol in project sldeditor by robward-scisys.
the class FillTreeItem method itemSelected.
/*
* (non-Javadoc)
*
* @see com.sldeditor.ui.tree.item.SLDTreeItemInterface#itemSelected(javax.swing.tree.DefaultMutableTreeNode, java.lang.Object)
*/
@Override
public void itemSelected(DefaultMutableTreeNode node, Object userObject) {
SelectedSymbol selectedSymbol = SelectedSymbol.getInstance();
// Individual symbol selected
if (node != null) {
DefaultMutableTreeNode parent = (DefaultMutableTreeNode) node.getParent();
if (parent != null) {
if (parent.getUserObject() instanceof Symbolizer) {
Symbolizer symbolizer = (Symbolizer) parent.getUserObject();
selectedSymbol.setSymbolizer(symbolizer);
}
}
}
}
use of com.sldeditor.common.data.SelectedSymbol in project sldeditor by robward-scisys.
the class StrokeTreeItem method itemSelected.
/*
* (non-Javadoc)
*
* @see com.sldeditor.ui.tree.SLDTreeItemInterface#itemSelected(javax.swing.tree.DefaultMutableTreeNode, java.lang.Object)
*/
@Override
public void itemSelected(DefaultMutableTreeNode node, Object userObject) {
if (node != null) {
SelectedSymbol selectedSymbol = SelectedSymbol.getInstance();
// Individual symbol selected
DefaultMutableTreeNode parent = (DefaultMutableTreeNode) node.getParent();
if (parent != null) {
if (parent.getUserObject() instanceof Symbolizer) {
Symbolizer symbolizer = (Symbolizer) parent.getUserObject();
selectedSymbol.setSymbolizer(symbolizer);
}
}
}
}
use of com.sldeditor.common.data.SelectedSymbol in project sldeditor by robward-scisys.
the class SymbolizerTreeItem method itemSelected.
/**
* Item selected.
*
* @param node the node
* @param userObject the user object
*/
@Override
public void itemSelected(DefaultMutableTreeNode node, Object userObject) {
SelectedSymbol selectedSymbol = SelectedSymbol.getInstance();
// Individual symbol selected
Symbolizer symbolizer = (Symbolizer) userObject;
if (node != null) {
DefaultMutableTreeNode parent = (DefaultMutableTreeNode) node.getParent();
if (parent != null) {
selectedSymbol.setSymbolizer(symbolizer);
}
}
}
Aggregations