Package org.kite9.diagram.annotation

Examples of org.kite9.diagram.annotation.K9OnDiagram


  @Kite9Item
  public Diagram someDesignItem() {
    Glyph g1 = new Glyph("stereo", "project:" + this.getClass().getName(), null, null);
    Glyph g2 = new Glyph("stereo", "project:" + Another.class.getName(), null, null);

    return new Diagram("somename", createList((Contained) g1, g2), null);
  }
View Full Code Here


  }
 
  @Kite9Item
  public Diagram simpleDiagram(DiagramBuilder db) {
    Glyph test = new Glyph("project_class:bob", "this is a", "test", null, null);
    Diagram out = new Diagram("some diagram", createList((Contained) test), null);
    return out;
  }
View Full Code Here

   *
   * @return
   */
  @Kite9Item
  public Diagram someDesignItem() {
    Glyph g1 = new Glyph("stereo", "project:" + this.getClass().getName(), null, null);
    Glyph g2 = new Glyph("stereo", "project:" + Another.class.getName(), null, null);

    return new Diagram("somename", createList((Contained) g1, g2), null);
  }
View Full Code Here

    FileDiff.filesContainSameLines(f2, f2comp);
  }
 
  @Kite9Item
  public Diagram simpleDiagram(DiagramBuilder db) {
    Glyph test = new Glyph("project_class:bob", "this is a", "test", null, null);
    Diagram out = new Diagram("some diagram", createList((Contained) test), null);
    return out;
  }
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

   
    // ok, need to sort into groups
    Map<Object, Set<Class<?>>> diagramToClassMap = new HashMap<Object, Set<Class<?>>>();
    for (String string : classes) {
      Class<?> cl = ClassHandle.hydrateClass(string, getContext().getUserClassLoader());
      K9OnDiagram onDiagram = cl.getAnnotation(K9OnDiagram.class);
      Class<?>[] on = onDiagram.on();
      if ((on==null) || (on.length==0)) {
        addTo("default", cl, diagramToClassMap);
      } else {
        for (int i = 0; i < on.length; i++) {
          addTo(on[i], cl, diagramToClassMap);
View Full Code Here

    return p.getName();
  }

  protected String getAliasFromAnnotation(AnnotatedElement p) {
    K9OnDiagram ann = p.getAnnotation(K9OnDiagram.class);
    if (ann != null) {
      String aa = ann.alias();
      if (aa.length() > 0)
        return aa;
    }

    return null;
View Full Code Here

  protected String getStereotype(String s) {
    return "";
  }

  protected String getStereotypeFromAnnotation(AnnotatedElement p) {
    K9OnDiagram ann = p.getAnnotation(K9OnDiagram.class);
    if (ann != null) {
      String aa = ann.stereotype();
      if (aa.length() > 0)
        return aa;
    }

    return null;
View Full Code Here

  /**
   * Returns true for fields, methods, inner classes that have an in-scope
   * {@link K9OnDiagram} annotation.
   */
  public boolean isAnnotated(AnnotatedElement o) {
    K9OnDiagram on = null;
    if (o instanceof AnnotatedElement) {
      AnnotatedElement ae = (AnnotatedElement) o;
      on = ae.getAnnotation(K9OnDiagram.class);
    }

    if (on != null) {
      if ((on.on().length == 0))
        return true;

      for (Class<?> on1 : on.on()) {
        if (on1.equals((creator instanceof Method) ? ((Method) creator)
            .getDeclaringClass() : null)) {
          return true;
        }
      }
View Full Code Here

TOP

Related Classes of org.kite9.diagram.annotation.K9OnDiagram

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.