Package org.kite9.diagram.primitives

Examples of org.kite9.diagram.primitives.Connection


  @Kite9Item
  public Diagram example_1_11_MethodCallDiagramMethods(DiagramBuilder db) throws Exception {
    Method m = LibraryFacade.class.getDeclaredMethod("borrow", int.class, int.class);
    final String packageLimit = Book.class.getPackage().getName();
    MethodBasedSequenceDiagramDataProvider mbsddp = createMethodProvider(db, m, packageLimit);
    NoLayoutSequenceDiagramWizard format = new NoLayoutSequenceDiagramWizard(db);
    format.write(mbsddp, db.getDiagram());
    return db.getDiagram();
  }
View Full Code Here


  @Kite9Item
  public Diagram example_1_12_MethodCallDiagramClasses(DiagramBuilder db) throws Exception {
    Method m = LibraryFacade.class.getDeclaredMethod("borrow", int.class, int.class);
    final String packageLimit = Book.class.getPackage().getName();
    ClassBasedSequenceDiagramDataProvider mbsddp = createClassProvider(db, m, packageLimit);
    NoLayoutSequenceDiagramWizard format = new NoLayoutSequenceDiagramWizard(db);
    format.write(mbsddp, db.getDiagram());
    db.withKeyText("BorrowBook", "Exception routes are ommitted for clarity");
    return db.getDiagram();
  }
View Full Code Here

              : 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);
            if (!arrowPreExists) {
              ii.returnConnection(arrowEl, fromEl, null, null, fromLabelTL, true, direction);
View Full Code Here

    return "[A:"+getID()+"]";
  }
 
  public RenderingInformation getRenderingInformation() {
    if (renderingInformation==null)
      renderingInformation = new RectangleRenderingInformation();
   
    return renderingInformation;
  }
View Full Code Here

   */
  private void postProcess(DiagramElement diag, DiagramElement parent) {
    if (diag instanceof Diagram) {
      int rank = 0;
      for (Iterator<Connection> iterator = ((Diagram) diag).getAllLinks().iterator(); iterator.hasNext();) {
        Connection l = (Connection) iterator.next();
        if ((l.getFrom() != NO_REF) && (l.getTo() != NO_REF)) {
          l.getFrom().getLinks().add(l);
          l.getTo().getLinks().add(l);
          if (l instanceof Link) {
            ((Link) l).setRank(rank++);
          }
        } else {
          iterator.remove();
        }
      }
    }

    if (diag instanceof Contained) {
      ((Contained) diag).setContainer((Container) parent);
    }

    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);
      }
    }

    if (diag instanceof Container) {
      Collection<Contained> content = ((Container) diag).getContents();
      if (content != null) {
        for (Contained c : content) {
          postProcess(c, diag);
        }
      }
      postProcess(((Container) diag).getLabel(), diag);
    }
    if (diag instanceof Connected) {
      for (Iterator<Connection> lc = ((Connected) diag).getLinks().iterator(); lc.hasNext();) {
        Connection c = (Connection) lc.next();
        if ((c.getFrom() == NO_REF) || (c.getTo() == NO_REF)) {
          lc.remove();
        } else {
          postProcess(c, diag);
        }
      }
View Full Code Here

            subject, verb);
        PropositionBinding or = new PropositionBinding(subject, verb, object);
       

        SimpleNoun to = NounFactory.getRawSimpleNoun(object);
        Container cont = c == null ? getContainerFor(from, verb, ii) : c;
        DiagramElement toEl = toElementFormat.returnElement(cont, to,
            ii);

        if ((from != null) && (verb != null)) {
          DiagramElement fromEl = ii.returnExisting(from);
View Full Code Here

  public static NounFormat asGlyph(final String stereotypeOverride) {
    return new NounFormat() {
      public Connected returnElement(Container c, SimpleNoun to,
          InsertionInterface ii) {
        DiagramElement de = ii.returnGlyph(c, to, to.getLabel(),
            stereotypeOverride == null ? to.getStereotype()
                : stereotypeOverride);

        if (to.getDisambiguation() != null) {
          for (NounPart item : to.getDisambiguation()) {
View Full Code Here

 
  public static NounFormat asConnectionBody( ) {
    return new NounFormat() {
      public Connected returnElement(Container c, SimpleNoun to,
          InsertionInterface ii) {
        DiagramElement de = ii.returnConnectionBody(c, to, to.getLabel());

        if (de instanceof Connected) {
          return (Connected) de;
        } else {
          throw new Kite9ProcessingException(
View Full Code Here

    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 {
          throw new Kite9ProcessingException(
View Full Code Here

        PropositionBinding or = new PropositionBinding(subject, verb, object);
       

        SimpleNoun to = NounFactory.getRawSimpleNoun(object);
        Container cont = c == null ? getContainerFor(from, verb, ii) : c;
        DiagramElement toEl = toElementFormat.returnElement(cont, to,
            ii);

        if ((from != null) && (verb != null)) {
          DiagramElement fromEl = ii.returnExisting(from);

          if ((fromEl instanceof Container)
              && (contains(toEl, fromEl))) {
            return;
          }

          if (fromEl == null)
            return;

          Relationship activeVerb = verb.getActiveRelationship();
          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);
View Full Code Here

TOP

Related Classes of org.kite9.diagram.primitives.Connection

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.