• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Mark类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.geotools.styling.Mark的典型用法代码示例。如果您正苦于以下问题:Java Mark类的具体用法?Java Mark怎么用?Java Mark使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Mark类属于org.geotools.styling包,在下文中一共展示了Mark类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setValue

import org.geotools.styling.Mark; //导入依赖的package包/类
/**
 * Sets the value.
 *
 * @param symbolizerType the symbolizer type
 * @param fieldConfigManager the field config manager
 * @param multiOptionPanel the multi option panel
 * @param graphic the graphic
 * @param symbol the symbol
 */
@Override
public void setValue(Class<?> symbolizerType, GraphicPanelFieldManager fieldConfigManager,
        FieldConfigSymbolType multiOptionPanel, Graphic graphic, GraphicalSymbol symbol) {
    if (symbol != null) {
        if (symbol instanceof Mark) {
            MarkImpl markerSymbol = (MarkImpl) symbol;

            if (getConfigField() != null) {
                getConfigField().populate(markerSymbol.getWellKnownName());
            }

            if (multiOptionPanel != null) {
                multiOptionPanel.setSelectedItem(WINDBARB_SYMBOL_KEY);
            }
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:27,代码来源:FieldConfigWindBarbs.java


示例2: createFill

import org.geotools.styling.Mark; //导入依赖的package包/类
@Override
public void createFill(Symbolizer symbolizer) {
    if (symbolizer instanceof PointSymbolizer) {
        PointSymbolizer point = (PointSymbolizer) symbolizer;

        if (point != null) {
            Graphic graphic = point.getGraphic();
            if (graphic == null) {
                graphic = styleFactory.createDefaultGraphic();
                point.setGraphic(graphic);
            }

            if (graphic != null) {
                if (graphic.graphicalSymbols().isEmpty()) {
                    Mark mark = styleFactory.getDefaultMark();

                    graphic.graphicalSymbols().add(mark);
                }
            }
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:23,代码来源:SLDTreeLeafPoint.java


示例3: testAccept

import org.geotools.styling.Mark; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename#accept(org.opengis.style.GraphicalSymbol)}.
 */
@Test
public void testAccept() {
    boolean valueOnly = true;
    FieldConfigFilename field = new FieldConfigFilename(
            new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly),
            null, null, null);

    assertFalse(field.accept(null));

    StyleBuilder styleBuilder = new StyleBuilder();
    ExternalGraphicImpl externalGraphic = (ExternalGraphicImpl) styleBuilder
            .createExternalGraphic("test.tmp", "png");
    assertTrue(field.accept(externalGraphic));

    Mark marker = styleBuilder.createMark("triangle");
    assertFalse(field.accept(marker));
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:22,代码来源:FieldConfigFilenameTest.java


示例4: testAccept

import org.geotools.styling.Mark; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#accept(org.opengis.style.GraphicalSymbol)}.
 */
@Test
public void testAccept() {
    boolean valueOnly = true;
    FieldConfigTTF field = new FieldConfigTTF(
            new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly),
            null, null, null);

    assertFalse(field.accept(null));

    StyleBuilder styleBuilder = new StyleBuilder();
    ExternalGraphicImpl externalGraphic = (ExternalGraphicImpl) styleBuilder
            .createExternalGraphic("test.tmp", "png");
    assertFalse(field.accept(externalGraphic));

    Mark marker1 = styleBuilder.createMark("triangle");
    assertFalse(field.accept(marker1));

    Mark marker2 = styleBuilder.createMark("ttf://Arial");
    assertTrue(field.accept(marker2));
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:25,代码来源:FieldConfigTTFTest.java


示例5: testAccept

import org.geotools.styling.Mark; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT#accept(org.opengis.style.GraphicalSymbol)}.
 */
@Test
public void testAccept() {
    boolean valueOnly = true;
    FieldConfigWKT field = new FieldConfigWKT(
            new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly),
            null, null, null);

    assertFalse(field.accept(null));

    StyleBuilder styleBuilder = new StyleBuilder();
    ExternalGraphicImpl externalGraphic = (ExternalGraphicImpl) styleBuilder
            .createExternalGraphic("test.tmp", "png");
    assertFalse(field.accept(externalGraphic));

    Mark marker1 = styleBuilder.createMark("star");
    assertFalse(field.accept(marker1));

    //CHECKSTYLE:OFF
    Mark marker2 = styleBuilder.createMark(
            "wkt://MULTILINESTRING((-0.25 -0.25, -0.125 -0.25), (0.125 -0.25, 0.25 -0.25), (-0.25 0.25, -0.125 0.25), (0.125 0.25, 0.25 0.25))");
    //CHECKSTYLE:ON
    assertTrue(field.accept(marker2));
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:28,代码来源:FieldConfigWKTTest.java


示例6: testAccept

import org.geotools.styling.Mark; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.ui.detail.vendor.geoserver.marker.arrow.FieldConfigArrow#accept(org.opengis.style.GraphicalSymbol)}.
 */
@Test
public void testAccept() {
    boolean valueOnly = true;
    FieldConfigArrow field = new FieldConfigArrow(
            new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly),
            null, null, null);

    assertFalse(field.accept(null));

    StyleBuilder styleBuilder = new StyleBuilder();

    Mark marker1 = styleBuilder.createMark("star");
    assertFalse(field.accept(marker1));

    Mark marker2 = styleBuilder.createMark("extshape://arrow?hr=1.2&t=0.34&ab=0.56");
    assertTrue(field.accept(marker2));
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:22,代码来源:FieldConfigArrowTest.java


示例7: testAccept

import org.geotools.styling.Mark; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs#accept(org.opengis.style.GraphicalSymbol)}.
 */
@Test
public void testAccept() {
    boolean valueOnly = true;
    FieldConfigWindBarbs field = new FieldConfigWindBarbs(
            new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly),
            null, null, null);

    assertFalse(field.accept(null));

    StyleBuilder styleBuilder = new StyleBuilder();
    ExternalGraphicImpl externalGraphic = (ExternalGraphicImpl) styleBuilder
            .createExternalGraphic("test.tmp", "png");
    assertFalse(field.accept(externalGraphic));

    Mark marker1 = styleBuilder.createMark("triangle");
    assertFalse(field.accept(marker1));

    Mark marker2 = styleBuilder.createMark("windbarbs://default(15)[kts]");
    assertTrue(field.accept(marker2));
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:25,代码来源:FieldConfigWindBarbsTest.java


示例8: setMark

import org.geotools.styling.Mark; //导入依赖的package包/类
private void setMark(final Mark mark, final Mode mode) {
	listen(false);
	try {
		this.enabled = mode == Mode.POINT && mark != null;
		this.type = SLD.wellKnownName(mark);

		// Stroke is used in line, point and polygon
		this.on.setEnabled(mode == Mode.POINT || mode == Mode.ALL);

		if ( this.type != null ) {
			this.name.setText(this.type);
			this.name.select(this.name.indexOf(this.type));
		}

		this.on.setSelection(this.enabled);
		this.size.setEnabled(this.enabled);
		this.name.setEnabled(this.enabled);
	} finally {
		listen(true); // listen to user now
	}
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:22,代码来源:GraphicViewer.java


示例9: initEndPointSymbolizers

import org.geotools.styling.Mark; //导入依赖的package包/类
private void initEndPointSymbolizers() {
    for (Symbolizer x : super.getParent().getRule().getSymbolizers()) {
        if (x instanceof PointSymbolizer) {
            PointSymbolizer pnt = (PointSymbolizer) x;
            Expression ex = pnt.getGeometry();
            boolean endpnt = ex instanceof FilterFunction_endPoint;
            boolean startpnt = ex instanceof FilterFunction_startPoint;
            if (endpnt || startpnt) {
                GraphicalSymbol gs = pnt.getGraphic().graphicalSymbols().get(0);
                if (gs instanceof Mark) {
                    String name = ((Mark) gs).getWellKnownName().evaluate(null, String.class);
                    if (Utilities.lineEndStyles.values().contains(name)) {
                        if (endpnt) {
                            endPointStyle = new PointSymbolizerWrapper(pnt, super.getParent());
                        } else if (startpnt) {
                            startPointStyle = new PointSymbolizerWrapper(pnt, super.getParent());
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:24,代码来源:LineSymbolizerWrapper.java


示例10: createDefaultPointRule

import org.geotools.styling.Mark; //导入依赖的package包/类
/**
 * Creates a default {@link Rule} for a point.
 * 
 * @return the default rule.
 */
public static Rule createDefaultPointRule() {
    Graphic graphic = sf.createDefaultGraphic();
    Mark circleMark = sf.getCircleMark();
    circleMark.setFill(sf.createFill(ff.literal("#" + Integer.toHexString(Color.RED.getRGB() & 0xffffff))));
    circleMark.setStroke(sf.createStroke(ff.literal("#" + Integer.toHexString(Color.BLACK.getRGB() & 0xffffff)),
            ff.literal(DEFAULT_WIDTH)));
    graphic.graphicalSymbols().clear();
    graphic.graphicalSymbols().add(circleMark);
    graphic.setSize(ff.literal(DEFAULT_SIZE));

    PointSymbolizer pointSymbolizer = sf.createPointSymbolizer();
    Rule rule = sf.createRule();
    rule.setName("New rule");
    rule.symbolizers().add(pointSymbolizer);

    pointSymbolizer.setGraphic(graphic);
    return rule;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:24,代码来源:Utilities.java


示例11: createDefaultPointFeatureTypeStyle

import org.geotools.styling.Mark; //导入依赖的package包/类
private FeatureTypeStyle createDefaultPointFeatureTypeStyle(String radius, String color, String opacity){	
	Fill pointFill = sf.getDefaultFill();        
	pointFill.setColor(filterFactory.literal(color));        
	pointFill.setOpacity(filterFactory.literal(opacity));
       
	Stroke pointStroke = sf.getDefaultStroke();
	pointStroke.setWidth(filterFactory.literal(new Integer(DEFAULT_STROKE_WIDTH)));
	pointStroke.setColor(filterFactory.literal(DEFAULT_COLOR));
	pointStroke.setOpacity(filterFactory.literal(opacity));

	StyleBuilder sb = new StyleBuilder();
	Mark circle = sb.createMark(StyleBuilder.MARK_CIRCLE, pointFill,pointStroke);
	Graphic graph = sb.createGraphic(null, circle, null, Double.parseDouble(opacity), Double.parseDouble(radius) , DEFAULT_POINT_ROTATION);
       PointSymbolizer pointSymbolizer = sb.createPointSymbolizer(graph);		
       
       Rule pointRule = sf.createRule();
       pointRule.symbolizers().add(pointSymbolizer);
       FeatureTypeStyle pointFeatureTypeStyle = sf.createFeatureTypeStyle(new Rule[]{pointRule});
	
       return pointFeatureTypeStyle;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:22,代码来源:LayerFactory.java


示例12: quickPointSymbolizer

import org.geotools.styling.Mark; //导入依赖的package包/类
private void quickPointSymbolizer() {
    // quickPointSymbolizer start
    // "testPoint" feature type style
    StyleBuilder sb = new StyleBuilder();
    FilterFactory2 ff = sb.getFilterFactory();
    
    Mark testMark = sb.createMark(sb.attributeExpression("name"), sb.createFill(Color.RED, 0.5),
            null);
    Graphic graph = sb.createGraphic(null, // An external graphics if needed
            new Mark[] { testMark }, // a Mark if not an external graphics
            null, // aSymbol
            ff.literal(1), // opacity
            ff.property("size"), // read from feature "size" attribute
            ff.property("rotation")); // rotation, here read into the feature
    PointSymbolizer aPointSymbolizer = sb.createPointSymbolizer(graph);
    
    // creation of the style
    Style style = sb.createStyle(aPointSymbolizer);
    // quickPointSymbolizer end
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:21,代码来源:StyleExamples.java


示例13: createSymbol

import org.geotools.styling.Mark; //导入依赖的package包/类
private GraphicalSymbol createSymbol(FeatureStyleInfo featureStyle) throws LayerException {
	SymbolInfo info = featureStyle.getSymbol();
	if (info.getImage() != null) {

		return styleBuilder.createExternalGraphic(getUrl(info.getImage().getHref()), getFormat(info.getImage()
				.getHref()));
	} else {
		Mark mark;
		if (info.getRect() != null) {
			// TODO: do rectangles by adding custom factory ?
			mark = styleBuilder.createMark(MARK_SQUARE);
		} else if (info.getCircle() != null) {
			mark = styleBuilder.createMark(MARK_CIRCLE);
		} else {
			throw new IllegalArgumentException(
					"Feature style should have either an image, a circle or a rectangle defined. Style name: " +
							featureStyle.getName() + ", index: " + featureStyle.getIndex());
		}
		mark.setFill(createFill(featureStyle));
		mark.setStroke(createStroke(featureStyle));
		return mark;
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:24,代码来源:StyleConverterServiceImpl.java


示例14: getFill

import org.geotools.styling.Mark; //导入依赖的package包/类
/**
 * Gets the fill.
 *
 * @param graphicFill the graphic fill
 * @param fieldConfigManager the field config manager
 * @return the fill
 */
@Override
public Fill getFill(GraphicFill graphicFill, GraphicPanelFieldManager fieldConfigManager) {
    if (fieldConfigManager == null) {
        return null;
    }
    Expression fillColour = null;
    FieldConfigBase field = fieldConfigManager.get(fillFieldConfig.getColour());
    if (field != null) {
        if ((field instanceof FieldConfigColour) && field.isEnabled()) {
            fillColour = ((FieldConfigColour) field).getColourExpression();
        }
    }

    Expression fillColourOpacity = null;
    field = fieldConfigManager.get(fillFieldConfig.getOpacity());
    if (field != null) {
        fillColourOpacity = field.getExpression();
    }

    GraphicFill _graphicFill = null;
    Expression _fillColour = fillColour;
    Expression _fillColourOpacity = fillColourOpacity;
    if (graphicFill != null) {
        List<GraphicalSymbol> symbolList = graphicFill.graphicalSymbols();

        if ((symbolList != null) && (!symbolList.isEmpty())) {
            GraphicalSymbol symbol = symbolList.get(0);
            Mark mark = (Mark) symbol;
            if (mark.getWellKnownName() != null) {
                _graphicFill = graphicFill;
                _fillColour = null;
                _fillColourOpacity = null;
            }
        }
    }
    Fill fill = getStyleFactory().fill(_graphicFill, _fillColour, _fillColourOpacity);

    return fill;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:47,代码来源:FieldConfigMarker.java


示例15: setValue

import org.geotools.styling.Mark; //导入依赖的package包/类
/**
 * Sets the value.
 *
 * @param symbolizerType the symbolizer type
 * @param fieldConfigManager the field config manager
 * @param multiOptionPanel the multi option panel
 * @param graphic the graphic
 * @param symbol the symbol
 */
@Override
public void setValue(Class<?> symbolizerType, GraphicPanelFieldManager fieldConfigManager,
        FieldConfigSymbolType multiOptionPanel, Graphic graphic, GraphicalSymbol symbol) {
    if ((symbol != null) && (fieldConfigManager != null)) {
        if (symbol instanceof Mark) {
            MarkImpl markerSymbol = (MarkImpl) symbol;

            FillImpl fill = markerSymbol.getFill();

            if (fill != null) {
                Expression expFillColour = fill.getColor();
                Expression expFillColourOpacity = fill.getOpacity();

                FieldConfigBase field = fieldConfigManager.get(FieldIdEnum.FILL_COLOUR);
                if (field != null) {
                    field.populate(expFillColour);
                }
                field = fieldConfigManager.get(FieldIdEnum.OVERALL_OPACITY);
                if (field != null) {
                    field.populate(expFillColourOpacity);
                }
            }

            if (arrowPanel != null) {
                arrowPanel.populateExpression(markerSymbol.getWellKnownName().toString());
            }

            if (multiOptionPanel != null) {
                multiOptionPanel.setSelectedItem(ARROW_SYMBOL_KEY);
            }
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:43,代码来源:FieldConfigArrow.java


示例16: getValue

import org.geotools.styling.Mark; //导入依赖的package包/类
/**
 * Gets the value.
 *
 * @param fieldConfigManager the field config manager
 * @param symbolType the symbol type
 * @param fillEnabled the fill enabled
 * @param strokeEnabled the stroke enabled
 * @return the value
 */
@Override
public List<GraphicalSymbol> getValue(GraphicPanelFieldManager fieldConfigManager,
        Expression symbolType, boolean fillEnabled, boolean strokeEnabled) {
    List<GraphicalSymbol> symbolList = new ArrayList<GraphicalSymbol>();

    Expression wellKnownName = null;
    if ((getConfigField() != null) && (fieldConfigManager != null)) {
        wellKnownName = getConfigField().getExpression();
        if (wellKnownName != null) {
            Expression expFillColour = null;
            Expression expFillColourOpacity = null;

            FieldConfigBase field = fieldConfigManager.get(FieldIdEnum.FILL_COLOUR);
            if (field != null) {
                FieldConfigColour colourField = (FieldConfigColour) field;

                expFillColour = colourField.getColourExpression();
            }

            Stroke stroke = null;
            Fill fill = getStyleFactory().createFill(expFillColour, expFillColourOpacity);
            Expression size = null;
            Expression rotation = null;
            Mark mark = getStyleFactory().createMark(wellKnownName, stroke, fill, size,
                    rotation);

            symbolList.add(mark);
        }
    }
    return symbolList;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:41,代码来源:FieldConfigWindBarbs.java


示例17: testAccept

import org.geotools.styling.Mark; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker#accept(org.opengis.style.GraphicalSymbol)}.
 */
@Test
public void testAccept() {
    boolean valueOnly = true;
    FieldConfigMarker field = new FieldConfigMarker(
            new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly),
            null, null, null);

    assertFalse(field.accept(null));

    StyleBuilder styleBuilder = new StyleBuilder();
    ExternalGraphicImpl externalGraphic = (ExternalGraphicImpl) styleBuilder
            .createExternalGraphic("test.tmp", "png");
    assertFalse(field.accept(externalGraphic));

    Mark marker = styleBuilder.createMark("triangle");
    assertFalse(field.accept(marker));

    List<ValueComboBoxData> dataList = new ArrayList<ValueComboBoxData>();

    dataList.add(new ValueComboBoxData("star", "Star", this.getClass()));
    dataList.add(new ValueComboBoxData("square", "Square", this.getClass()));
    dataList.add(new ValueComboBoxData("triangle", "Triangle", this.getClass()));

    List<ValueComboBoxDataGroup> groupList = new ArrayList<ValueComboBoxDataGroup>();
    groupList.add(new ValueComboBoxDataGroup(dataList));

    field.populateSymbolList(String.class, groupList);
    field.populateSymbolList(PointFillDetails.class, groupList);
    assertTrue(field.accept(marker));
    field.populateSymbolList(PointFillDetails.class, groupList);
    assertTrue(field.accept(marker));
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:37,代码来源:FieldConfigMarkerTest.java


示例18: testSetValue

import org.geotools.styling.Mark; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#setValue(com.sldeditor.ui.detail.GraphicPanelFieldManager, com.sldeditor.ui.detail.config.FieldConfigSymbolType, org.opengis.style.GraphicalSymbol)}.
 */
@Test
public void testSetValue() {

    GraphicPanelFieldManager fieldConfigManager = null;

    Class<?> panelId = PointFillDetails.class;
    fieldConfigManager = new GraphicPanelFieldManager(panelId);
    FieldIdEnum colourFieldId = FieldIdEnum.FILL_COLOUR;
    FieldConfigColour colourField = new FieldConfigColour(
            new FieldConfigCommonData(panelId, colourFieldId, "", false));
    colourField.createUI();
    String expectedColourValue = "#012345";
    colourField.setTestValue(null, expectedColourValue);
    fieldConfigManager.add(colourFieldId, colourField);

    ColourFieldConfig fillConfig = new ColourFieldConfig(GroupIdEnum.FILL,
            FieldIdEnum.FILL_COLOUR, FieldIdEnum.OVERALL_OPACITY, FieldIdEnum.STROKE_WIDTH);
    ColourFieldConfig strokeConfig = new ColourFieldConfig(GroupIdEnum.STROKE,
            FieldIdEnum.STROKE_STROKE_COLOUR, FieldIdEnum.OVERALL_OPACITY,
            FieldIdEnum.STROKE_FILL_WIDTH);
    boolean valueOnly = true;
    FieldConfigTTF field = new FieldConfigTTF(
            new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly),
            fillConfig, strokeConfig, null);

    field.setValue(null, null, null, null, null);
    field.setValue(null, fieldConfigManager, null, null, null);

    field.createUI();
    StyleBuilder styleBuilder = new StyleBuilder();
    Mark marker = styleBuilder.createMark("star", Color.green, Color.black, 2.0);

    field.setValue(null, null, null, null, marker);
    field.setValue(null, fieldConfigManager, null, null, marker);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:40,代码来源:FieldConfigTTFTest.java


示例19: createPointStyle

import org.geotools.styling.Mark; //导入依赖的package包/类
/**
 * Create a default point style.
 * 
 * @return the created style.
 */
public static Style createPointStyle() {
	final Graphic gr = styleFactory.createDefaultGraphic();

	final Mark mark = styleFactory.getCircleMark();

	mark.setStroke(styleFactory.createStroke(filterFactory.literal(Color.BLUE), filterFactory.literal(1)));

	mark.setFill(styleFactory.createFill(filterFactory.literal(Color.CYAN)));

	gr.graphicalSymbols().clear();
	gr.graphicalSymbols().add(mark);
	gr.setSize(filterFactory.literal(5));

	/*
	 * Setting the geometryPropertyName arg to null signals that we want to draw the default geomettry of features
	 */
	final PointSymbolizer sym = styleFactory.createPointSymbolizer(gr, null);

	final Rule rule = styleFactory.createRule();
	rule.symbolizers().add(sym);
	final FeatureTypeStyle fts = styleFactory.createFeatureTypeStyle(new Rule[] { rule });
	final Style style = styleFactory.createStyle();
	style.featureTypeStyles().add(fts);

	return style;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:32,代码来源:Utils.java


示例20: setGraphic

import org.geotools.styling.Mark; //导入依赖的package包/类
/**
 * TODO summary sentence for setGraphic ...
 * 
 * @param graphic
 * @param mode
 * @param enabled
 */
public void setGraphic(Graphic graphic, final Mode mode, final Color defaultColor) {
	boolean enabled = true;
	if ( graphic == null ) {
		final StyleBuilder builder = new StyleBuilder();
		graphic = builder.createGraphic(null, builder.createMark(StyleBuilder.MARK_SQUARE, defaultColor), null);
		enabled = true;
	}
	this.width = SLDs.size(graphic);
	final String text = MessageFormat.format("{0,number,#0}", this.width); //$NON-NLS-1$
	if ( text != null ) {
		this.size.setText(text);
		this.size.select(this.size.indexOf(text));
	}

	boolean marked = false;
	if ( graphic != null && graphic.graphicalSymbols() != null && !graphic.graphicalSymbols().isEmpty() ) {

		for ( final GraphicalSymbol symbol : graphic.graphicalSymbols() ) {
			if ( symbol instanceof Mark ) {
				final Mark mark = (Mark) symbol;
				setMark(mark, mode);
				marked = true;
				break;
			}
		}
	}
	if ( !marked ) {
		setMark(null, mode);
	}
	this.enabled = this.enabled && enabled;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:39,代码来源:GraphicViewer.java



注:本文中的org.geotools.styling.Mark类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java QueryResultIO类代码示例发布时间:2022-05-22
下一篇:
Java SaslPropertiesResolver类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap