Search in sources :

Example 1 with SelectedSymbol

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();
}
Also used : SelectedSymbol(com.sldeditor.common.data.SelectedSymbol) CardLayout(java.awt.CardLayout) PopulateDetailsInterface(com.sldeditor.ui.iface.PopulateDetailsInterface)

Example 2 with SelectedSymbol

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();
}
Also used : SelectedSymbol(com.sldeditor.common.data.SelectedSymbol) PopulateDetailsInterface(com.sldeditor.ui.iface.PopulateDetailsInterface)

Example 3 with SelectedSymbol

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);
            }
        }
    }
}
Also used : SelectedSymbol(com.sldeditor.common.data.SelectedSymbol) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) Symbolizer(org.geotools.styling.Symbolizer)

Example 4 with SelectedSymbol

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);
            }
        }
    }
}
Also used : SelectedSymbol(com.sldeditor.common.data.SelectedSymbol) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) Symbolizer(org.geotools.styling.Symbolizer)

Example 5 with SelectedSymbol

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);
        }
    }
}
Also used : SelectedSymbol(com.sldeditor.common.data.SelectedSymbol) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) Symbolizer(org.geotools.styling.Symbolizer) PointSymbolizer(org.geotools.styling.PointSymbolizer) RasterSymbolizer(org.geotools.styling.RasterSymbolizer) LineSymbolizer(org.geotools.styling.LineSymbolizer) PolygonSymbolizer(org.geotools.styling.PolygonSymbolizer) TextSymbolizer(org.geotools.styling.TextSymbolizer)

Aggregations

SelectedSymbol (com.sldeditor.common.data.SelectedSymbol)13 StyledLayerDescriptor (org.geotools.styling.StyledLayerDescriptor)7 FeatureTypeStyle (org.geotools.styling.FeatureTypeStyle)6 PolygonSymbolizer (org.geotools.styling.PolygonSymbolizer)6 Style (org.geotools.styling.Style)6 Test (org.junit.Test)6 LineSymbolizer (org.geotools.styling.LineSymbolizer)5 NamedLayer (org.geotools.styling.NamedLayer)5 Rule (org.geotools.styling.Rule)5 Symbolizer (org.geotools.styling.Symbolizer)5 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)4 PointSymbolizer (org.geotools.styling.PointSymbolizer)4 RasterSymbolizer (org.geotools.styling.RasterSymbolizer)4 PopulateDetailsInterface (com.sldeditor.ui.iface.PopulateDetailsInterface)2 StyledLayer (org.geotools.styling.StyledLayer)2 DataSourcePropertiesInterface (com.sldeditor.common.DataSourcePropertiesInterface)1 SLDEditorFile (com.sldeditor.datasource.SLDEditorFile)1 CardLayout (java.awt.CardLayout)1 File (java.io.File)1 Fill (org.geotools.styling.Fill)1