Search in sources :

Example 1 with StyleService

use of eu.esdihumboldt.hale.ui.common.service.style.StyleService in project hale by halestudio.

the class DefinitionLabelProvider method dispose.

/**
 * @see BaseLabelProvider#dispose()
 */
@Override
public void dispose() {
    if (styleListener != null) {
        StyleService styles = PlatformUI.getWorkbench().getService(StyleService.class);
        styles.removeListener(styleListener);
    }
    images.dispose();
    super.dispose();
}
Also used : StyleService(eu.esdihumboldt.hale.ui.common.service.style.StyleService)

Example 2 with StyleService

use of eu.esdihumboldt.hale.ui.common.service.style.StyleService in project hale by halestudio.

the class SpectrumColorSchemeHandler method execute.

/**
 * @see IHandler#execute(ExecutionEvent)
 */
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    // collect all types
    SetMultimap<DataSet, TypeDefinition> types = HashMultimap.create();
    SchemaService schemas = PlatformUI.getWorkbench().getService(SchemaService.class);
    for (TypeDefinition type : schemas.getSchemas(SchemaSpaceID.SOURCE).getMappingRelevantTypes()) {
        types.put(DataSet.SOURCE, type);
    }
    for (TypeDefinition type : schemas.getSchemas(SchemaSpaceID.TARGET).getMappingRelevantTypes()) {
        types.put(DataSet.TRANSFORMED, type);
    }
    Style style = StyleHelper.getSpectrumStyles(types);
    StyleService styleService = PlatformUI.getWorkbench().getService(StyleService.class);
    styleService.addStyles(style);
    return null;
}
Also used : DataSet(eu.esdihumboldt.hale.common.instance.model.DataSet) SchemaService(eu.esdihumboldt.hale.ui.service.schema.SchemaService) StyleService(eu.esdihumboldt.hale.ui.common.service.style.StyleService) Style(org.geotools.styling.Style) TypeDefinition(eu.esdihumboldt.hale.common.schema.model.TypeDefinition)

Example 3 with StyleService

use of eu.esdihumboldt.hale.ui.common.service.style.StyleService in project hale by halestudio.

the class TypeRandomColorHandler method execute.

/**
 * @see IHandler#execute(ExecutionEvent)
 */
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    // collect types and associated data sets
    SetMultimap<DataSet, TypeDefinition> types = TypeStyleHandler.collectTypesFromSelection(event);
    Style style = StyleHelper.getRandomStyles(types);
    StyleService styleService = PlatformUI.getWorkbench().getService(StyleService.class);
    styleService.addStyles(style);
    return null;
}
Also used : DataSet(eu.esdihumboldt.hale.common.instance.model.DataSet) StyleService(eu.esdihumboldt.hale.ui.common.service.style.StyleService) Style(org.geotools.styling.Style) TypeDefinition(eu.esdihumboldt.hale.common.schema.model.TypeDefinition)

Example 4 with StyleService

use of eu.esdihumboldt.hale.ui.common.service.style.StyleService in project hale by halestudio.

the class LoadStyle method handleResults.

/**
 * @see AbstractIOAdvisor#handleResults(IOProvider)
 */
@Override
public void handleResults(StyleReader provider) {
    StyleService ss = getService(StyleService.class);
    ss.addStyles(provider.getStyles());
    super.handleResults(provider);
}
Also used : StyleService(eu.esdihumboldt.hale.ui.common.service.style.StyleService)

Example 5 with StyleService

use of eu.esdihumboldt.hale.ui.common.service.style.StyleService in project hale by halestudio.

the class StyledInstanceMarker method getStyle.

/**
 * Get the style for a given way-point.
 *
 * @param context the way-point
 * @return the style
 */
private Style getStyle(InstanceWaypoint context) {
    StyleService ss = PlatformUI.getWorkbench().getService(StyleService.class);
    InstanceReference ref = context.getValue();
    return ss.getStyle(context.getInstanceType(), ref.getDataSet());
}
Also used : StyleService(eu.esdihumboldt.hale.ui.common.service.style.StyleService) InstanceReference(eu.esdihumboldt.hale.common.instance.model.InstanceReference)

Aggregations

StyleService (eu.esdihumboldt.hale.ui.common.service.style.StyleService)10 GeometrySchemaService (eu.esdihumboldt.hale.ui.geometry.service.GeometrySchemaService)3 InstanceService (eu.esdihumboldt.hale.ui.service.instance.InstanceService)3 ISelectionService (org.eclipse.ui.ISelectionService)3 Style (org.geotools.styling.Style)3 DataSet (eu.esdihumboldt.hale.common.instance.model.DataSet)2 TypeDefinition (eu.esdihumboldt.hale.common.schema.model.TypeDefinition)2 ITileOverlayService (de.fhg.igd.mapviewer.view.overlay.ITileOverlayService)1 TileOverlayFactory (de.fhg.igd.mapviewer.view.overlay.TileOverlayFactory)1 InstanceReference (eu.esdihumboldt.hale.common.instance.model.InstanceReference)1 SchemaService (eu.esdihumboldt.hale.ui.service.schema.SchemaService)1 PainterLayoutController (eu.esdihumboldt.hale.ui.views.styledmap.clip.layout.extension.PainterLayoutController)1 AbstractInstancePainter (eu.esdihumboldt.hale.ui.views.styledmap.painter.AbstractInstancePainter)1 Color (java.awt.Color)1 Graphics2D (java.awt.Graphics2D)1 BufferedImage (java.awt.image.BufferedImage)1 IPartService (org.eclipse.ui.IPartService)1 Drawer (org.geotools.legend.Drawer)1 LineSymbolizer (org.geotools.styling.LineSymbolizer)1 PointSymbolizer (org.geotools.styling.PointSymbolizer)1