private static String text_y="{text_y}";
public String createComponent(SvgBaseTo svgTo) {
String result = null;
try {
SvgLaneTo lane = (SvgLaneTo)svgTo;
if(lane.isHorizontal()){
comPath = "/svgcomponent/lane.xml";
}
else {
comPath = "/svgcomponent/lane_h.xml";
}
InputStream in = SvgBench.class.getResourceAsStream(comPath);
Document doc = XmlUtil.read(in);
String str = doc.getRootElement().asXML();
str = FlowSvgUtil.replaceAll(str, local_x, StringUtil.getString(lane.getX()));
str = FlowSvgUtil.replaceAll(str, local_y, StringUtil.getString(lane.getY()));
str = FlowSvgUtil.replaceAll(str, id, lane.getId());
str = FlowSvgUtil.replaceAll(str, text, lane.getLabel());
str = FlowSvgUtil.replaceAll(str, width, StringUtil.getString(lane.getWidth()));
str = FlowSvgUtil.replaceAll(str, hight, StringUtil.getString(lane.getHeight()));
if(lane.isHorizontal()){
str = FlowSvgUtil.replaceAll(str, text_y, StringUtil.getString(lane.getHeight()/2));
}
else {
str = FlowSvgUtil.replaceAll(str, text_x, StringUtil.getString(lane.getWidth()/2));
}
result = str;
} catch (DocumentException e) {
throw new FixFlowException("",e);