@Override
    public void setTail(Node n) {
      if (_tail != null) {
        ((BasicNode) _tail).removeOutEdge(this);
      }

      _tail = n;

      if (_tail != null) {
        ((BasicNode) _tail).addOutEdge(this);
      }
    }
    @Override
    public void setHead(Node n) {
      if (_head != null) {
        ((BasicNode) _head).removeInEdge(this);
      }

      _head = n;

      if (_head != null) {
        ((BasicNode) _head).addInEdge(this);
      }
    }
Example #3
0
  /*
   * (non-Javadoc)
   *
   * @see de.unisb.loot.gui.BasicNode#adjustSize(java.awt.Graphics)
   */
  @Override
  public void adjustSize(Graphics g) {
    assert (this.style.getFont() != null);
    Rectangle charBounds =
        this.style
            .getFont()
            .getStringBounds(this.text, ((Graphics2D) g).getFontRenderContext())
            .getBounds();

    // adjust offsets
    this.xOffset = charBounds.x;
    this.yOffset = -charBounds.y;

    // add offset to Node's size
    this.area.width = charBounds.width;
    this.area.height = charBounds.height;
    // treat padding parameters like in all other basic nodes
    super.adjustSize(g);
  }
 @Override
 protected void nodeCopyPaste(BasicNode child) throws IOException {
   CoreEntity e = child.getEntity();
   addNewChild(e);
 }