Examples of StyleBlackboard


Examples of org.locationtech.udig.project.internal.StyleBlackboard

  public void preApply() {

        int width = Integer.parseInt(widthText.getText());
        int height = Integer.parseInt(heightText.getText());
       
        StyleBlackboard styleBlackboard = getLayer().getStyleBlackboard();
        Rectangle rec = (Rectangle)styleBlackboard.get(LocationStyleContent.ID);
        styleBlackboard.setSelected(new String[]{LocationStyleContent.ID});
        rec.setSize(width, height);
        styleBlackboard.put(LocationStyleContent.ID, rec);
  }
View Full Code Here

Examples of org.locationtech.udig.project.internal.StyleBlackboard

     */
    private void prepareDraw( IProgressMonitor monitor ) throws IOException, SchemaException {

        // check for style information on the blackboard
        ILayer layer = getContext().getLayer();
        StyleBlackboard styleBlackboard = (StyleBlackboard) layer.getStyleBlackboard();
        SimpleFeatureSource featureSource;
        featureSource = layer.getResource(SimpleFeatureStore.class, new SubProgressMonitor(monitor, 0));
        if (featureSource == null) {
            featureSource = layer.getResource(SimpleFeatureSource.class, new SubProgressMonitor(monitor,
                    0));
        }
        Style style = getStyle(styleBlackboard, featureSource);
        layers = new Layer[1];
        CoordinateReferenceSystem layerCRS = layer.getCRS();
        SimpleFeatureType schema = featureSource.getSchema();
       
        // Original Query provided by Layer.getFilter() as adjusted by selection and edit filter
        Query query = getContext().getFeatureQuery();
        if( styleBlackboard.contains(ProjectBlackboardConstants.LAYER__STYLE_FILTER)){
            if( query == null ){
                query = new Query( schema.getTypeName() );
            }
            // Additional Filter provided as Style used to reduce onscreen clutter
            FilterStyle filterStyle = (FilterStyle) styleBlackboard.get(ProjectBlackboardConstants.LAYER__STYLE_FILTER);
            Filter styleFilter = filterStyle.toFilter(schema);
            if( styleFilter != Filter.INCLUDE ){
                Filter queryFilter = query.getFilter();
                if( queryFilter == Filter.INCLUDE ){
                    query.setFilter( styleFilter );
View Full Code Here

Examples of org.locationtech.udig.project.internal.StyleBlackboard

    }

  }

  private FeatureTypeStyle[] locateStyle(ILayer layer) {
    StyleBlackboard blackboard = (StyleBlackboard) layer
        .getStyleBlackboard();
    if (blackboard == null) {
      return null;
    }

    Style sld = (Style) blackboard.lookup(Style.class);
    if (sld == null) {
      return null;
    }

    List<FeatureTypeStyle> styles = new ArrayList<FeatureTypeStyle>();
View Full Code Here

Examples of org.locationtech.udig.project.internal.StyleBlackboard

        }
        return null;
    }

    public void setStyle( Style newStyle ) {
        StyleBlackboard styleBlackboard = selectedLayer.getStyleBlackboard();
        // put the style on the blackboard
        styleBlackboard.put(SLDContent.ID, newStyle);       
        styleBlackboard.setSelected(new String[]{SLDContent.ID});
    }
View Full Code Here

Examples of org.locationtech.udig.project.internal.StyleBlackboard

     * </p>
     *
     * @return gernated layer
     */
    public static ImageDescriptor generateIcon( Layer layer ) {
        StyleBlackboard style = layer.getStyleBlackboard();

        if (style != null && !style.getContent().isEmpty()) {
            ImageDescriptor icon = generateStyledIcon(layer);
            if (icon != null)
                return icon;
        }
        ImageDescriptor icon = generateDefaultIcon(layer);
View Full Code Here

Examples of org.locationtech.udig.project.internal.StyleBlackboard

     *
     * @param layer
     * @return ImageDecriptor for layer, or null in style could not be indicated
     */
    public static ImageDescriptor generateStyledIcon( Layer layer ) {
        StyleBlackboard blackboard = layer.getStyleBlackboard();
        if (blackboard == null)
            return null;

        Style sld = (Style) blackboard.lookup(Style.class); // or
        // blackboard.get(
        // "org.locationtech.udig.style.sld"
        // );
        if (sld != null) {
            Rule rule = getRule(sld);
View Full Code Here

Examples of org.locationtech.udig.project.internal.StyleBlackboard

               
                StructuredSelection structuredSelection = (StructuredSelection) paletteTable.getSelection();
                BrewerPalette pal = (BrewerPalette) structuredSelection.getFirstElement();
                if (pal == null) {
                    // get it from the last memento used
                    StyleBlackboard bb = getSelectedLayer().getStyleBlackboard();
                    IMemento memento = (IMemento) bb.get(DialogSettingsStyleContent.EXTENSION_ID);
                    String paletteName = memento.getString(PALETTE_KEY);
                    pal = getBrewer().getPalette(paletteName);
                }
                String paletteName = pal.getName();
                Combo combo = getCombo(COMBO_CLASSES);
View Full Code Here

Examples of org.locationtech.udig.project.internal.StyleBlackboard

        DecoratorOverlayIcon ovrIcon = new DecoratorOverlayIcon(base, new ImageDescriptor[] {null,null,overlay,null,null});
        return ovrIcon.createImage();
    }

    public void gotFocus() {
        StyleBlackboard bb = getSelectedLayer().getStyleBlackboard();
        IMemento memento = (IMemento) bb
                .get(DialogSettingsStyleContent.EXTENSION_ID);
        if (memento != null) {
            setComboSelectionInt(memento, COMBO_OPACITY, OPACITY_KEY);
            setComboSelectionString(memento, COMBO_ATTRIBUTES, ATTRIBUTE_KEY);
            setComboSelectionInt(memento, COMBO_CLASSES, CLASSES_KEY);
View Full Code Here

Examples of org.locationtech.udig.project.internal.StyleBlackboard

      control.select(integer);
      }
  };
   
    public boolean performApply() {
      StyleBlackboard bb = getSelectedLayer().getStyleBlackboard();
      IMemento memento = (IMemento) bb.get(DialogSettingsStyleContent.EXTENSION_ID);
      if(memento == null ){
        memento = XMLMemento.createWriteRoot("ThemeingData");
      }

      putIntFromCombo(memento, OPACITY_KEY, COMBO_OPACITY);
      putStringFromCombo(memento, ATTRIBUTE_KEY, COMBO_ATTRIBUTES);
      putIntFromCombo(memento, CLASSES_KEY, COMBO_CLASSES);
      putStringFromCombo(memento, BREAK_KEY, COMBO_BREAKTYPE);
      putStringFromCombo(memento, NORMALIZE_KEY, COMBO_NORMALIZE);
      memento.putInteger(ELSE_KEY, getCombo(COMBO_ELSE).getSelectionIndex());
        putStringFromCombo(memento, PALETTE_CATEGORY_KEY, COMBO_PALETTES);

        putButton(memento, BUTTON_COLORBLIND, COLOR_BLIND_KEY);
        putButton(memento, BUTTON_CRT, CRT_KEY);
        putButton(memento, BUTTON_PROJECTOR, PROJECTOR_KEY);
        putButton(memento, BUTTON_LCD, LCD_KEY);
        putButton(memento, BUTTON_PRINT, PRINT_KEY);
        putButton(memento, BUTTON_PHOTOCOPY, PHOTO_COPY_KEY);

        storeOutline(memento);
        storePalette(memento);
        storeCustomPalette(memento);
        storeCustomBreak(memento);
        bb.put(DialogSettingsStyleContent.EXTENSION_ID, memento);
        return true;
    }
View Full Code Here

Examples of org.locationtech.udig.project.internal.StyleBlackboard

    /**
     *  grab the style from the blackboard, otherwise return null
     */
    private Style grabStyle() {
        // check for style information on the blackboard
        StyleBlackboard styleBlackboard = (StyleBlackboard) getContext()
                .getLayer().getStyleBlackboard();
       
        Style style = (Style) styleBlackboard.lookup(Style.class);
       
        return style;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.