当前位置: 首页>>代码示例>>Java>>正文


Java TextSymbolizer类代码示例

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


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

示例1: convertTextSymbols

import org.geotools.styling.TextSymbolizer; //导入依赖的package包/类
public void convertTextSymbols(TextSymbolizer textSymbolizer,
    int transparency, JsonElement jsonElement)
{
    if (jsonElement == null) return;

    JsonObject jsonSymbol = jsonElement.getAsJsonObject();
    boolean found = false;
    for(String symbolType : textSymbolMap.keySet())
    {
        JsonElement obj = jsonSymbol.get(symbolType);

        if(obj != null)
        {
            EsriTextSymbolInterface esriTextSymbol = textSymbolMap.get(symbolType);
            esriTextSymbol.convert(textSymbolizer, obj, transparency);
            found = true;
            break;
        }
    }

    if(!found)
    {
        ConsoleManager.getInstance().error(this, "Unsupported text symbol : " + SymbolUtils.extractName(jsonElement));
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:26,代码来源:SymbolManager.java

示例2: defaultString

import org.geotools.styling.TextSymbolizer; //导入依赖的package包/类
/**
 * Default string.
 *
 * @param symbol the symbol
 * @return the string
 */
private String defaultString(Symbolizer symbol) {
    String name = "";

    if (symbol instanceof PointSymbolizer) {
        name = DEFAULT_MARKER_NAME;
    } else if (symbol instanceof TextSymbolizer) {
        name = DEFAULT_TEXT_NAME;
    } else if (symbol instanceof LineSymbolizer) {
        name = DEFAULT_LINE_NAME;
    } else if (symbol instanceof PolygonSymbolizer) {
        name = DEFAULT_POLYGON_NAME;
    } else if (symbol instanceof RasterSymbolizer) {
        name = DEFAULT_RASTER_NAME;
    }
    return name;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:23,代码来源:SymbolizerTreeItem.java

示例3: internal_updateSymbolEnumField

import org.geotools.styling.TextSymbolizer; //导入依赖的package包/类
/**
 * Internal_update symbol enum field.
 *
 * @param options the options
 * @param field the field
 * @param key the key
 */
private void internal_updateSymbolEnumField(Map<String, String> options, FieldIdEnum field,
        String key) {
    ValueComboBoxData value = fieldConfigVisitor.getComboBox(field);

    Object object = getDefaultFieldValue(field);
    String defaultValue = null;

    if (object instanceof TextSymbolizer.PolygonAlignOptions) {
        TextSymbolizer.PolygonAlignOptions option = (PolygonAlignOptions) object;
        defaultValue = option.toString();
    } else {
        defaultValue = (String) object;
    }

    if (defaultValue == null) {
        ConsoleManager.getInstance().error(this, "Failed to find default for field : " + field);
    } else if ((value.getKey().compareToIgnoreCase(defaultValue) != 0) || includeValue(field)) {
        options.put(key, value.getKey());
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:28,代码来源:VOGeoServerLabelling.java

示例4: getMinimumVersion

import org.geotools.styling.TextSymbolizer; //导入依赖的package包/类
@Override
public void getMinimumVersion(Object parentObj, Object sldObj,
        List<VendorOptionPresent> vendorOptionsPresentList) {
    if (sldObj instanceof TextSymbolizer) {
        TextSymbolizer textSymbolizer = (TextSymbolizer) sldObj;
        Map<String, String> options = textSymbolizer.getOptions();

        for (FieldIdEnum key : fieldMap.keySet()) {
            String vendorOptionAttributeKey = fieldMap.get(key);

            if (options.containsKey(vendorOptionAttributeKey)) {
                VendorOptionPresent voPresent = new VendorOptionPresent(sldObj,
                        getVendorOptionInfo());

                if (!vendorOptionsPresentList.contains(voPresent)) {
                    vendorOptionsPresentList.add(voPresent);
                }
            }
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:22,代码来源:VOGeoServerLabelling.java

示例5: internal_updateSymbolEnumField

import org.geotools.styling.TextSymbolizer; //导入依赖的package包/类
/**
 * Internal_update symbol enum field.
 *
 * @param options the options
 * @param field the field
 * @param key the key
 */
private void internal_updateSymbolEnumField(Map<String, String> options, FieldIdEnum field,
        String key) {
    ValueComboBoxData value = fieldConfigVisitor.getComboBox(field);

    Object object = getDefaultFieldValue(field);
    String defaultValue = null;

    if (object instanceof TextSymbolizer.PolygonAlignOptions) {
        TextSymbolizer.PolygonAlignOptions option = (PolygonAlignOptions) object;
        defaultValue = option.toString();
    } else {
        defaultValue = (String) object;
    }

    if (defaultValue == null) {
        ConsoleManager.getInstance().error(this, "Failed to find default for field : " + field);
    } else if (value.getKey().compareToIgnoreCase(defaultValue) != 0) {
        options.put(key, value.getKey());
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:28,代码来源:VOGeoServerLabellingUnderline.java

示例6: getMinimumVersion

import org.geotools.styling.TextSymbolizer; //导入依赖的package包/类
@Override
public void getMinimumVersion(Object parentObj, Object sldObj,
        List<VendorOptionPresent> vendorOptionsPresentList) {
    if (sldObj instanceof TextSymbolizer) {
        TextSymbolizer textSymbolizer = (TextSymbolizer) sldObj;
        Map<String, String> options = textSymbolizer.getOptions();

        for (FieldIdEnum key : fieldMap.keySet()) {
            String vendorOptionAttributeKey = fieldMap.get(key);

            if (options.containsKey(vendorOptionAttributeKey)) {
                VendorOptionPresent voPresent = new VendorOptionPresent(sldObj,
                        getVendorOptionInfo());

                vendorOptionsPresentList.add(voPresent);
            }
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:20,代码来源:VOGeoServerLabellingUnderline.java

示例7: populate

import org.geotools.styling.TextSymbolizer; //导入依赖的package包/类
/**
 * Populate.
 *
 * @param textSymbolizer the text symbolizer
 */
/*
 * (non-Javadoc)
 * 
 * @see com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface#populate(org.geotools.styling.TextSymbolizer)
 */
@Override
public void populate(TextSymbolizer textSymbolizer) {
    if (textSymbolizer != null) {
        Map<String, String> options = textSymbolizer.getOptions();

        for (FieldIdEnum key : fieldMap.keySet()) {
            internalPopulate(options, key, fieldMap.get(key));
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:21,代码来源:VOGeoServerTextSpacing.java

示例8: updateSymbol

import org.geotools.styling.TextSymbolizer; //导入依赖的package包/类
/**
 * Update symbol.
 *
 * @param textSymbolizer the text symbolizer
 */
/*
 * (non-Javadoc)
 * 
 * @see com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface#updateSymbol(org.geotools.styling.TextSymbolizer)
 */
@Override
public void updateSymbol(TextSymbolizer textSymbolizer) {
    if (textSymbolizer != null) {
        Map<String, String> options = textSymbolizer.getOptions();

        for (FieldIdEnum key : fieldMap.keySet()) {
            internalUpdateSymbol(options, key, fieldMap.get(key));
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:21,代码来源:VOGeoServerTextSpacing.java

示例9: testHasFill

import org.geotools.styling.TextSymbolizer; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.common.tree.leaf.SLDTreeLeafFactory#hasFill(org.opengis.style.Symbolizer)}.
 */
@Test
public void testHasFill() {
    PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    //CHECKSTYLE:OFF
    LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
    TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
    //CHECKSTYLE:ON

    assertFalse(SLDTreeLeafFactory.getInstance().hasFill(null));
    assertTrue(SLDTreeLeafFactory.getInstance().hasFill(polygonSymbolizer));
    assertTrue(SLDTreeLeafFactory.getInstance().hasFill(pointSymbolizer));
    assertFalse(SLDTreeLeafFactory.getInstance().hasFill(lineSymbolizer));
    assertFalse(SLDTreeLeafFactory.getInstance().hasFill(textSymbolizer));
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:20,代码来源:SLDTreeLeafFactoryTest.java

示例10: testHasStroke

import org.geotools.styling.TextSymbolizer; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.common.tree.leaf.SLDTreeLeafFactory#hasStroke(org.opengis.style.Symbolizer)}.
 */
@Test
public void testHasStroke() {
    PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    //CHECKSTYLE:OFF
    LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
    TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
    //CHECKSTYLE:ON

    assertFalse(SLDTreeLeafFactory.getInstance().hasStroke(null));
    assertTrue(SLDTreeLeafFactory.getInstance().hasStroke(polygonSymbolizer));
    assertFalse(SLDTreeLeafFactory.getInstance().hasStroke(pointSymbolizer));
    assertTrue(SLDTreeLeafFactory.getInstance().hasStroke(lineSymbolizer));
    assertFalse(SLDTreeLeafFactory.getInstance().hasStroke(textSymbolizer));
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:20,代码来源:SLDTreeLeafFactoryTest.java

示例11: testGetFill

import org.geotools.styling.TextSymbolizer; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.common.tree.leaf.SLDTreeLeafFactory#getFill(org.opengis.style.Symbolizer)}.
 */
@Test
public void testGetFill() {
    PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    //CHECKSTYLE:OFF
    LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
    TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
    //CHECKSTYLE:ON

    assertNull(SLDTreeLeafFactory.getInstance().getFill(null));
    assertTrue(SLDTreeLeafFactory.getInstance().getFill(polygonSymbolizer) != null);
    assertTrue(SLDTreeLeafFactory.getInstance().getFill(pointSymbolizer) != null);

    // Returns default fill
    assertTrue(SLDTreeLeafFactory.getInstance().getFill(lineSymbolizer) != null);
    assertTrue(SLDTreeLeafFactory.getInstance().getFill(textSymbolizer) != null);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:22,代码来源:SLDTreeLeafFactoryTest.java

示例12: testGetStroke

import org.geotools.styling.TextSymbolizer; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.common.tree.leaf.SLDTreeLeafFactory#getStroke(org.opengis.style.Symbolizer)}.
 */
@Test
public void testGetStroke() {
    PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
    //CHECKSTYLE:OFF
    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
    TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
    //CHECKSTYLE:ON

    assertNull(SLDTreeLeafFactory.getInstance().getStroke(null));
    assertTrue(SLDTreeLeafFactory.getInstance().getStroke(polygonSymbolizer) != null);
    assertTrue(SLDTreeLeafFactory.getInstance().getStroke(lineSymbolizer) != null);

    // Returns default stroke
    assertTrue(SLDTreeLeafFactory.getInstance().getStroke(pointSymbolizer) != null);
    assertTrue(SLDTreeLeafFactory.getInstance().getStroke(textSymbolizer) != null);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:22,代码来源:SLDTreeLeafFactoryTest.java

示例13: textFont

import org.geotools.styling.TextSymbolizer; //导入依赖的package包/类
/**
 * Grabs the font from the first TextSymbolizer.
 * <p>
 * If you are using something fun like symbols you will need to do your own
 * thing.
 * </p>
 * 
 * @param symbolizer
 *            Text symbolizer information.
 * @return FontData[] of the font's fill, or null if unavailable.
 */
public static FontData[] textFont(final TextSymbolizer symbolizer) {

	final Font font = font(symbolizer);
	if (font == null)
		return null;

	final FontData[] tempFD = new FontData[1];
	final Expression fontFamilyExpression = font.getFamily().get(0);
	final Expression sizeExpression = font.getSize();
	if (sizeExpression == null || fontFamilyExpression == null)
		return null;

	final Double size = sizeExpression.evaluate(null, Double.class);

	try {
		final String fontFamily = fontFamilyExpression.evaluate(null, String.class);
		tempFD[0] = new FontData(fontFamily, size.intValue(), 1);
	} catch (final NullPointerException ignore) {
		return null;
	}
	if (tempFD[0] != null)
		return tempFD;
	return null;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:36,代码来源:SLDs.java

示例14: getWrapper

import org.geotools.styling.TextSymbolizer; //导入依赖的package包/类
private SymbolizerWrapper getWrapper(Symbolizer symbolizer) {
    SymbolizerWrapper symbolizerWrapper = null;
    if (symbolizer instanceof PointSymbolizer) {
        symbolizerWrapper = new PointSymbolizerWrapper(symbolizer, this);
    } else if (symbolizer instanceof LineSymbolizer) {
        symbolizerWrapper = new LineSymbolizerWrapper(symbolizer, this);
    } else if (symbolizer instanceof PolygonSymbolizer) {
        symbolizerWrapper = new PolygonSymbolizerWrapper(symbolizer, this);
    } else if (symbolizer instanceof TextSymbolizer) {
        symbolizerWrapper = new TextSymbolizerWrapper(symbolizer, this, getType());
    } else if (symbolizer instanceof RasterSymbolizer) {
        return null;
    }

    return symbolizerWrapper;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:17,代码来源:RuleWrapper.java

示例15: skipSymbolizer

import org.geotools.styling.TextSymbolizer; //导入依赖的package包/类
protected boolean skipSymbolizer(Symbolizer symbolizer) {
	if (symbolizer instanceof TextSymbolizer) {
		if (!isIncludeText()) {
			return true;
		}
	} else if (symbolizer instanceof LineSymbolizer) {
		if (!isIncludeGeometry()) {
			return true;
		}
	} else if (symbolizer instanceof PointSymbolizer) {
		if (!isIncludeGeometry()) {
			return true;
		}
	} else if (symbolizer instanceof PolygonSymbolizer) {
		if (!isIncludeGeometry()) {
			return true;
		}
	} else if (symbolizer instanceof RasterSymbolizer) {
		if (!isIncludeGeometry()) {
			return true;
		}
	}
	return false;
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:25,代码来源:SymbolizerFilterVisitor.java


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