Package org.kite9.diagram.adl

Examples of org.kite9.diagram.adl.Key


    return new PropositionFormat() {
      public void write(NounPart subject, Relationship verb,
          NounPart object) {

        // these are the knowledge items that will be represented in the format.
        SimpleNoun from = getExistingNounOnDiagram(subject, ii);
        NounRelationshipBinding sr = new NounRelationshipBinding(
            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)) {
View Full Code Here


    } else if (subject instanceof SimpleNoun) {
      return null;
    } else if (subject instanceof AnnotatedNounPart) {
      return getExistingNounOnDiagram(((AnnotatedNounPart)subject).getNounPart(), ii);
    } else if (subject instanceof OwnedNoun) {
      SimpleNoun out = getExistingNounOnDiagram(((OwnedNoun)subject).getOwned(), ii);
      if (out != null) {
        return out;
      } else {
        return getExistingNounOnDiagram(((OwnedNoun)subject).getOwner(), ii);
      }
View Full Code Here

  public static PropositionFormat asSymbols(final InsertionInterface ii) {
    return new PropositionFormat() {

      public void write(NounPart context, Relationship key, NounPart value) {
        SimpleNoun from = NounFactory.getRawSimpleNoun(context);
        DiagramElement de = ii.returnExisting(from);

        String fromLabel = getLabel(context, from, ii);
        String toLabel = getLabel(value, null, ii);
        String text = (fromLabel.length() == 0 ? "" : (fromLabel + " "))
View Full Code Here

  public static PropositionFormat asTextLines(final InsertionInterface ii) {
    return new PropositionFormat() {
      public void write(NounPart context, Relationship key, NounPart value) {
        PropositionBinding pb = new PropositionBinding(context, key, value);
        SimpleNoun from = getExistingNounOnDiagram(context, ii);
        DiagramElement de = ii.returnExisting(from);

        String fromLabel = getLabel(context, from, ii);
        String toLabel = getLabel(value, null, ii);
        String text = (fromLabel.length() == 0 ? "" : (fromLabel + " "))
View Full Code Here

    ClassBuilder cb = db.withClasses(Book.class);
    cb.show(db.asConnectedContexts());
    Context c = (Context) db.getNounElement(Book.class);
    FiniteStateMachineWizard fsmFormat = new FiniteStateMachineWizard(db, c);
    Field f = Book.class.getDeclaredField("state");
    FSMDataProvider provider = new EnumWithAnnotationFSMDataProvider(db, f, BookState.class, BeforeState.class,
        AfterState.class);
    fsmFormat.write(provider);

    return db.getDiagram();
  }
View Full Code Here

    ClassBuilder cb = db.withClasses(Book.class);
    cb.show(db.asConnectedContexts());
    Context c = (Context) db.getNounElement(Book.class);
    FiniteStateMachineWizard fsmFormat = new FiniteStateMachineWizard(db, c);
    Field f = Book.class.getDeclaredField("state");
    FSMDataProvider provider = new EnumWithAnnotationFSMDataProvider(db, f, BookState.class, BeforeState.class,
        AfterState.class);
    fsmFormat.write(provider);

    return db.getDiagram();
  }
View Full Code Here

  @Kite9Item
  public Diagram example_1_8_StateTransition(DiagramBuilder db) throws Exception {
    ClassBuilder cb = db.withClasses(Book.class);
    cb.show(db.asConnectedContexts());
    Context c = (Context) db.getNounElement(Book.class);
    FiniteStateMachineWizard fsmFormat = new FiniteStateMachineWizard(db, c);
    Field f = Book.class.getDeclaredField("state");
    FSMDataProvider provider = new EnumWithAnnotationFSMDataProvider(db, f, BookState.class, BeforeState.class,
        AfterState.class);
    fsmFormat.write(provider);

    return db.getDiagram();
  }
View Full Code Here

 
  @Kite9Item
  public Diagram example_1_10_SequenceDiagramClasses(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);
    ColumnSequenceDiagramWizard format = new ColumnSequenceDiagramWizard(db);
    format.write(mbsddp, db.getDiagram());
    db.withKeyText("BorrowBook", "Exception routes are ommitted for clarity");
    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

    return db.getDiagram();
  }

  private ClassBasedSequenceDiagramDataProvider createClassProvider(DiagramBuilder db, Method m,
      final String packageLimit) {
    ClassBasedSequenceDiagramDataProvider out =  new ClassBasedSequenceDiagramDataProvider(db, m);
    out.setLimitFilter(
        new Filter<AccessibleObject>() {

          public boolean accept(AccessibleObject o) {
            if ((o instanceof Constructor<?>) || (o instanceof Method)) {
              java.lang.reflect.Member m = (java.lang.reflect.Member) o;
View Full Code Here

TOP

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

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.