Search in sources :

Example 1 with LineSymbolizerEditor

use of eu.esdihumboldt.hale.ui.style.editors.LineSymbolizerEditor in project hale by halestudio.

the class SimpleLineStylePage method createControl.

/**
 * @see IDialogPage#createControl(Composite)
 */
@Override
public void createControl(Composite parent) {
    // create new controls
    Composite page = new Composite(parent, SWT.NONE);
    RowLayout layout = new RowLayout(SWT.HORIZONTAL);
    page.setLayout(layout);
    Style style = getParent().getStyle();
    LineSymbolizer line = null;
    try {
        Symbolizer[] symbolizers = SLD.symbolizers(style);
        for (Symbolizer symbol : symbolizers) {
            if (symbol instanceof LineSymbolizer) {
                line = (LineSymbolizer) symbol;
                break;
            }
        }
    } catch (Exception e) {
    // ignore
    }
    if (line == null) {
        line = styleBuilder.createLineSymbolizer();
    }
    lineEditor = new LineSymbolizerEditor(page, line);
    setControl(page);
}
Also used : LineSymbolizerEditor(eu.esdihumboldt.hale.ui.style.editors.LineSymbolizerEditor) Composite(org.eclipse.swt.widgets.Composite) RowLayout(org.eclipse.swt.layout.RowLayout) LineSymbolizer(org.geotools.styling.LineSymbolizer) Style(org.geotools.styling.Style) Symbolizer(org.geotools.styling.Symbolizer) LineSymbolizer(org.geotools.styling.LineSymbolizer)

Aggregations

LineSymbolizerEditor (eu.esdihumboldt.hale.ui.style.editors.LineSymbolizerEditor)1 RowLayout (org.eclipse.swt.layout.RowLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 LineSymbolizer (org.geotools.styling.LineSymbolizer)1 Style (org.geotools.styling.Style)1 Symbolizer (org.geotools.styling.Symbolizer)1