Package org.kite9.diagram.adl

Examples of org.kite9.diagram.adl.Link


    Glyph g3 = new Glyph("ref1", "", "Some Item B", null, null);

    Context inside = new Context(createList((Contained) g1, g2, g3), true,
        null, null);

    new Link(a1, g1, null, null, LinkEndStyle.ARROW, new TextLine(
        "Some Label"), Direction.RIGHT);
    new Link(a1, g2);
    new Link(a1, g3);

    Diagram d1 = new Diagram("My Diagram", createList((Contained) inside,
        (Contained) a1), new Key("Here is my amazing diagram", null,
        kh.getUsedSymbols()));
    return d1;
View Full Code Here


public class Examples {

  private void addLink(Glyph collection, Glyph list, String string, Collection<Contained> top) {
    Arrow a = new Arrow(string);
    new Link(a, collection, null, null, LinkEndStyle.ARROW, null, Direction.UP);
    new Link(list, a, null, null, null, null, Direction.UP);
    top.add(a);
  }
View Full Code Here

    if (diag instanceof CompositionalDiagramElement) {
      ((CompositionalDiagramElement) diag).setParent(parent);
    }

    if (diag instanceof Link) {
      Link il = (Link) diag;
      if (il.getFrom() == null) {
        il.setFrom((Connected) parent);
      } else {
        ensureLink(il.getFrom(), il);
      }

      if (il.getTo() == null) {
        il.setTo((Connected) parent);
      } else {
        ensureLink(il.getTo(), il);
      }

      postProcess(il.getFromLabel(), il);
      postProcess(il.getToLabel(), il);
    }

    if (diag instanceof Glyph) {
      for (CompositionalDiagramElement c : ((Glyph) diag).getText()) {
        postProcess(c, diag);
View Full Code Here

  protected void createLink(Step s, DiagramElement from, DiagramElement to, Direction d) {
    DiagramElement out = ii.returnConnection(from, to, s, null, null, true, d);
    System.out.println("Link from " + from + " to " + to + " in " + d);

    if (out instanceof Link) {
      Link l = (Link) out;
      Label fromLabel = buildFromLabel(s, l.getFromLabel());
      Label toLabel = buildToLabel(s, l.getToLabel());
      l.setFromLabel(fromLabel);
      l.setToLabel(toLabel);
     
    }
   
  }
View Full Code Here

    for (Contained c2 : c.getContents()) {
      if (c2 instanceof Container) {
        for (Contained c3 : ((Container) c2).getContents()) {
          if ((c3 instanceof Connected) && (headerGlyphs.contains(c3))) {
            if (last != null) {
              Link l = new Link(last, (Connected) c3, null, null, null, null, getDirectionFor(getArrowDirection()));
              l.setShapeName(LinkLineStyle.INVISIBLE);
            }
            last = (Connected) c3;
          }
        }
      }
View Full Code Here

  protected void createLink(Step s, DiagramElement from, DiagramElement to, Direction d) {
    DiagramElement out = ii.returnConnection(from, to, s, null, null, true, d);
    System.out.println("Link from " + from + " to " + to + " in " + d);
   
    if (out instanceof Link) {
      Link l = (Link) out;
      Label fromLabel = buildFromLabel(s, l.getFromLabel());
      Label toLabel = buildToLabel(s, l.getToLabel());
      l.setFromLabel(fromLabel);
      l.setToLabel(toLabel);
    }

  }
View Full Code Here

 
  Arrow a = (Arrow) db.getRelationshipElement(SomeClass.class, JavaRelationships.IMPLEMENTS);
  Glyph sc = (Glyph) db.getNounElement(SomeClass.class);
  Glyph si = (Glyph) db.getNounElement(SomeInterface.class);
 
  Link top = (Link) a.getConnectionTo(si);
  Link bottom = (Link) a.getConnectionTo(sc);
 
  top.setDrawDirection(Direction.RIGHT);
  bottom.setDrawDirection(Direction.DOWN);
 
  top.setToLabel(new TextLine("some text here"));
  bottom.setFromLabel(new TextLine("some text there"));
 
  renderDiagram(db.getDiagram());
    }
View Full Code Here

        if (out == null) {
          if ((from instanceof Connected)
              && (to instanceof Connected)) {
            Connected cfrom = (Connected) from;
            Connected cto = (Connected) to;
            out = new Link(cfrom, cto, null, fromLabel,
                arrowHead ? LinkEndStyle.ARROW : null, toLabel,
                d);
          } else {
            throw new Kite9ProcessingException(
                "Could not link between: " + from + " and "
View Full Code Here

      final Layout d, final Label l) {
    return new NounFormat() {
      public Connected returnElement(Container c, SimpleNoun to,
          InsertionInterface ii) {
        Label toUse = (l == null) ? (to.getLabel() == null ? null
            : new TextLine(to.getLabel())) : l;
        DiagramElement de = ii.returnContext(c, to, border ? toUse
            : null, border, d);
        if (de instanceof Connected) {
          return (Connected) de;
        } else {
View Full Code Here

          boolean arrowPreExists = ii.returnExisting(sr) instanceof Arrow;
         
          DiagramElement arrowEl = ii.returnConnectionBody(cont, sr,
              (String) activeVerb.getObjectForAlias());
          String fromLabel = getLabel(subject, from, ii);
          TextLine fromLabelTL = fromLabel.length() == 0 ? null
              : new TextLine(fromLabel);
          String toLabel = getLabel(object, to, ii);
          TextLine toLabelTL = toLabel.length() == 0 ? null
              : new TextLine(toLabel);

          Direction direction = d == null ? activeVerb.getDirection()
              : d;
          if (verb.getType() == RelationshipType.PASSIVE) {
            ii.returnConnection(toEl, arrowEl, or, toLabelTL, null, false, direction);
View Full Code Here

TOP

Related Classes of org.kite9.diagram.adl.Link

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.