Package org.kite9.diagram.builders.java

Examples of org.kite9.diagram.builders.java.DiagramBuilder


  }

  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);
View Full Code Here


          }

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

              : 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

            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

TOP

Related Classes of org.kite9.diagram.builders.java.DiagramBuilder

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.