Examples of SimpleNode


Examples of org.apache.velocity.runtime.parser.node.SimpleNode

        if (logTag == null)
        {
            throw new NullPointerException("logTag (i.e. template name) cannot be null, you must provide an identifier for the content being evaluated");
        }

        SimpleNode nodeTree = null;
        try
        {
            nodeTree = parse(reader, logTag);
        }
        catch (ParseException pex)
View Full Code Here

Examples of org.apache.velocity.runtime.parser.node.SimpleNode

        if (logTag == null)
        {
            throw new NullPointerException("logTag (i.e. template name) cannot be null, you must provide an identifier for the content being evaluated");
        }

        SimpleNode nodeTree = null;
        try
        {
            nodeTree = parse(reader, logTag);
        }
        catch (ParseException pex)
View Full Code Here

Examples of org.apache.velocity.runtime.parser.node.SimpleNode

     */
    public SimpleNode parse( Reader reader, String templateName, boolean dumpNamespace )
        throws ParseException
    {

        SimpleNode ast = null;
        Parser parser = (Parser) parserPool.get();
        boolean madeNew = false;

        if (parser == null)
        {
View Full Code Here

Examples of org.codehaus.aspectwerkz.definition.expression.ast.SimpleNode

            root = parser.ExpressionScript();

            // inflate anonymous expressions and register anonymous leaf (3x faster)
            StringBuffer inflated = (StringBuffer)root.jjtAccept(ANONYMOUSINFLATE_VISITOR, m_namespace);
            ExpressionParser parserInflate = new ExpressionParser(new StringReader(inflated.toString()));
            SimpleNode newRoot = parserInflate.ExpressionScript();

            // swap
            root = newRoot;
        }
        catch (Throwable t) {
View Full Code Here

Examples of org.codehaus.aspectwerkz.expression.ast.SimpleNode

        if(reflectInfo instanceof StaticInitializationInfo) {

          // Ignore the ASTStaticInitialization node in this context

          SimpleNode staticClinitNode = (SimpleNode) node.jjtGetChild(0);

               ClassInfo declaringClassInfo = ((StaticInitializationInfo) reflectInfo).getDeclaringType();

           

              boolean matchedAnnotations = visitAttributes(staticClinitNode, declaringClassInfo);

              if(!matchedAnnotations) {

                return Boolean.FALSE;

              }

           

              // In an annotated subtree, the last child node represents the pattern

              Node lastNode = staticClinitNode.jjtGetChild(staticClinitNode.jjtGetNumChildren() - 1);

              if(lastNode instanceof ASTAttribute) {

                return Boolean.TRUE;
View Full Code Here

Examples of org.eclipse.zest.layouts.exampleStructures.SimpleNode

      public void mouseMove(MouseEvent e) {

        if (selectedEntity == null) {
          // Nothing selected, lets use a mouse hover
          SimpleNode oldEntity = hoverEntity;
          hoverEntity = null;

          for (Iterator iter = entities.iterator(); iter.hasNext() && selectedEntity == null;) {
            SimpleNode entity = (SimpleNode) iter.next();
            double x = entity.getX();
            double y = entity.getY();
            double w = entity.getWidth();
            double h = entity.getHeight();
            Rectangle rect = new Rectangle((int) x, (int) y, (int) w, (int) h);
            if (rect.contains(e.x, e.y)) {
              hoverEntity = entity;
              hoverEntity.ignoreInLayout(true);
              hoverEntity.setSelected();
              break;
            }
          }
          if (oldEntity != null && oldEntity != hoverEntity) {
            oldEntity.ignoreInLayout(false);
            oldEntity.setUnSelected();
          }
        }

      }

    });
    mainComposite.addMouseListener(new MouseListener() {

      public void mouseDoubleClick(MouseEvent e) {
      }

      public void mouseDown(MouseEvent e) {
        selectedEntity = null;
        hoverEntity = null;
        for (Iterator iter = entities.iterator(); iter.hasNext() && selectedEntity == null;) {
          SimpleNode entity = (SimpleNode) iter.next();
          double x = entity.getX();
          double y = entity.getY();
          double w = entity.getWidth();
          double h = entity.getHeight();
          Rectangle rect = new Rectangle((int) x, (int) y, (int) w, (int) h);
          if (rect.contains(e.x, e.y)) {
            selectedEntity = entity;
          }
        }
        if (selectedEntity != null) {
          mouseDownPoint = new Point(e.x, e.y);
          selectedEntityPositionAtMouseDown = new Point((int) selectedEntity.getX(), (int) selectedEntity.getY());
          selectedEntity.ignoreInLayout(true);
          selectedEntity.setSelected();
        } else {
          mouseDownPoint = null;
          selectedEntityPositionAtMouseDown = null;
        }
      }

      public void mouseUp(MouseEvent e) {
        if (selectedEntity != null) {
          selectedEntity.ignoreInLayout(false);
          selectedEntity.setUnSelected();
          List relatedNodes = selectedEntity.getRelatedEntities();
          for (Iterator iter = relatedNodes.iterator(); iter.hasNext();) {
            SimpleNode element = (SimpleNode) iter.next();
            element.setUnSelected();
          }
          SimpleRelationship[] rels = selectedEntity.getRelationships();
          for (int i = 0; i < rels.length; i++) {
            rels[i].resetLineWidth();
          }
View Full Code Here

Examples of org.eclipse.zest.layouts.exampleStructures.SimpleNode

  private void createTreeGraph(int maxLevels, int maxChildren, boolean random) {
    entities = new ArrayList();
    relationships = new ArrayList();

    // ccallendar - testing out having 2 roots
    SimpleNode root = createSimpleNode(getNextID());
    entities.add(root);
    SimpleNode root2 = createSimpleNode(getNextID());
    entities.add(root2);
    // end

    SimpleNode currentParent = createSimpleNode(getNextID());
    entities.add(currentParent);

    // ccallendar - adding relationships from the parent to the 2 roots
    SimpleRelationship rel = new SimpleRelationship(root, currentParent, false);
    root.addRelationship(rel);
    currentParent.addRelationship(rel);
    relationships.add(rel);
    rel = new SimpleRelationship(root2, currentParent, false);
    root2.addRelationship(rel);
    currentParent.addRelationship(rel);
    relationships.add(rel);
    // end

    int levels = random ? (int) (Math.random() * maxLevels + 1) : maxLevels;
    createTreeGraphRecursive(currentParent, maxChildren, levels, 1, random);
View Full Code Here

Examples of org.eclipse.zest.layouts.exampleStructures.SimpleNode

      return;
    }

    int numChildren = random ? (int) (Math.random() * maxChildren + 1) : maxChildren;
    for (int child = 0; child < numChildren; child++) {
      SimpleNode childNode = createSimpleNode(getNextID());
      entities.add(childNode);
      SimpleRelationship rel = new SimpleRelationship(currentParentNode, childNode, false);
      childNode.addRelationship(rel);
      currentParentNode.addRelationship(rel);
      relationships.add(rel);
      SimpleRelationship.setDefaultSize(2);
      createTreeGraphRecursive(childNode, maxChildren, maxLevel, level + 1, random);
    }
View Full Code Here

Examples of org.eclipse.zest.layouts.exampleStructures.SimpleNode

  }

  /** Places nodes randomly on the screen **/
  private void placeRandomly() {
    for (Iterator iter = entities.iterator(); iter.hasNext();) {
      SimpleNode simpleNode = (SimpleNode) iter.next();
      double x = Math.random() * INITIAL_PANEL_WIDTH - INITIAL_NODE_WIDTH;
      double y = Math.random() * INITIAL_PANEL_HEIGHT - INITIAL_NODE_HEIGHT;
      simpleNode.setLocationInLayout(x, y);
    }
  }
View Full Code Here

Examples of org.eclipse.zest.layouts.exampleStructures.SimpleNode

   * Creates a SimpleNode
   * @param name
   * @return SimpleNode
   */
  private SimpleNode createSimpleNode(String name) {
    SimpleNode simpleNode = new SimpleNode(name);
    int w = name.length() * 8; // an initial approximation of the width
    simpleNode.setSizeInLayout(Math.max(w, INITIAL_NODE_WIDTH), INITIAL_NODE_HEIGHT);
    return simpleNode;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.