如何获得箭头上文本字段的值(见下图)?

时间:2017-01-21 09:39:43

标签: javafx

谢谢,我有一个问题。通过我的程序,我得到类似的东西:在此处输入图像描述

此图表生成以下xmi文件。enter image description here

  <?xml version="1.0" encoding="ASCII"?>
  <graph:GModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:graph="http://de.tesis.dynaware.grapheditor.model/1.0">
  <nodes type="tree-node" x="1154.0" y="551.0">
  <connectors type="tree-output" connections="//@connections.0 //@connections.1" connectionDetachedOnDrag="false"/>
  </nodes>
  <nodes type="tree-node" x="1275.0" y="768.0">
  <connectors type="tree-input" connections="//@connections.0"/>
  <connectors type="tree-output" connectionDetachedOnDrag="false"/>
  </nodes>
  <nodes type="tree-node" x="1056.0" y="761.0">
  <connectors type="tree-input" connections="//@connections.1"/>
  <connectors type="tree-output" connectionDetachedOnDrag="false"/>
  </nodes>
  <connections type="tree-connection" source="//@nodes.0/@connectors.0" target="//@nodes.1/@connectors.0"/>
  <connections type="tree-connection" source="//@nodes.0/@connectors.0" target="//@nodes.2/@connectors.0"/>
  </graph:GModel>

我想知道的是添加有关连接的xmi文件信息(此处:value1和value 2)。

要添加值1和值2,请使用此类

public class Arrow extends Group {

  private final Line line = new Line();
  private final ArrowHead head = new ArrowHead();
  public TextField txt;
  public Arrow() {
  line.getStyleClass().add(STYLE_CLASS_LINE);
  head.getStyleClass().add(STYLE_CLASS_HEAD);
  txt=new TextField();
  }}

您可以在此处找到代码:https://github.com/tesis-dynaware/graph-editor/blob/master/api/src/main/java/de/tesis/dynaware/grapheditor/utils/Arrow.java

如何处理将此值添加到xmi文件?

感谢您的帮助。

0 个答案:

没有答案