示例#1
0
文件: In.java 项目: tomkren/kutil
  @Override
  public void resolveRenaming(String oldId, String newId) {
    super.resolveRenaming(oldId, newId);

    targetString.set(Function.repairTarget(oldId, newId, targetString.get()));
    if (targetString.get() != null) {
      resetTargets();
    }
  }
示例#2
0
文件: In.java 项目: tomkren/kutil
  @Override
  public void resolveCopying() {
    super.resolveCopying();

    if (isCopied()) {

      String newTargetString = Global.idChangeDB().repairTargetString(targetString.get());

      targetString.set(newTargetString);
      if (targetString.get() != null) {
        resetTargets();
      }
    }
  }
示例#3
0
文件: In.java 项目: tomkren/kutil
  private void resetTargets() {

    if (targetString.get().equals("null")) {
      target = null;
      targetPort = -1;
      return;
    }

    String[] parts = targetString.get().split(":");

    KObject o = idDB().get(parts[0]);
    if (o instanceof Inputable) {
      target = (Inputable) o;
      targetPort = Integer.parseInt(parts[1]);
    }
  }
示例#4
0
文件: In.java 项目: tomkren/kutil
  public void setTargetAndPort(int fromPort, Inputable t, int p) {

    String[] ts;
    if (targetString.get() != null) {
      ts = targetString.get().split(" ");
    } else {
      ts = new String[0];
    }

    if (ts.length <= fromPort) {
      String[] ts2 = new String[fromPort + 1];
      System.arraycopy(ts, 0, ts2, 0, ts.length);
      for (int i = ts.length; i < ts2.length; i++) {
        ts2[i] = "null";
      }
      ts = ts2;
    }

    if (t != null) {
      ts[fromPort] = t.id() + ":" + p;
    } else {
      ts[fromPort] = "null";
    }

    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < ts.length; i++) {
      sb.append(ts[i]);
      if (i != ts.length - 1) {
        sb.append(" ");
      }
    }

    // Log.it("NOVý targetString : >"+ sb +"<" );
    targetString.set(sb.toString());
    resetTargets();
  }