Examples of XObject


Examples of com.sun.org.apache.xpath.internal.objects.XObject

   public NodeList selectNodeList(
           Node contextNode, Node xpathnode, String str, Node namespaceNode)
              throws TransformerException {

      // Execute the XPath, and have it return the result
      XObject list = eval(contextNode, xpathnode, str, namespaceNode);

      // Return a NodeList.
      return list.nodelist();
   }
View Full Code Here

Examples of com.sun.org.apache.xpath.internal.objects.XObject

   * @throws javax.xml.transform.TransformerException
   */
  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
  {

    XObject expr1 = m_left.execute(xctxt);

    if (!expr1.bool())
    {
      XObject expr2 = m_right.execute(xctxt);

      return expr2.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE;
    }
    else
      return XBoolean.S_TRUE;
  }
View Full Code Here

Examples of com.tensegrity.palo.gwt.core.client.models.XObject

      public void componentSelected(ComponentEvent ce) {
        final TreeItem ti = ReportStructureEditor.view.getTree().getSelectedItem();
        if (ti == null) {
          return;
        }
        XObject remObj = ((TreeNode) ti.getModel()).getXObject();
        if (!(remObj instanceof XReportFolder)) {
          return;
        }
               
        List <TreeItem> items = reportsTree.getSelectedItems();
        if (items == null || items.size() == 0) {
          return;
        }
       
        List <XObject> objs = new ArrayList <XObject> ();
        for (TreeItem it: items) {
          XObject obj = ((TreeNode) it.getModel()).getXObject();
          if (obj == null) {
            continue;
          }
          if (!(obj instanceof XTemplate) &&
            !(obj instanceof XWorkbook) &&
View Full Code Here

Examples of org.apache.xalan.xpath.XObject

          if(score == kd.m_match.MATCH_SCORE_NONE)
            continue;

          // Query from the node, according the the select pattern in the
          // use attribute in xsl:key.
          XObject xuse = kd.m_use.execute(xmlLiaison, testNode, nscontext);

          NodeList nl = xuse.nodeset();
          if(0 == nl.getLength())
            continue;
         
          // Use each node in the node list as a key value that we'll be
          // able to use to look up the given node.
          int nUseValues = nl.getLength();
          for(int k = 0; k < nUseValues; k++)
          {
            Node useNode = nl.item(k);
           
            // Use getExpr to get the string value of the given node. I hope
            // the string assumption is the right thing... I can't see how
            // it could work any other way.
            String exprResult = xmlLiaison.getNodeData(useNode);
           
            if(null == exprResult)
              continue;
           
            // Look to see if there's already a table indexed by the
            // name attribute on xsl:key.  If there's not, create one.
            Hashtable namedKeyTable;
            {
              Object keyTableObj = m_keys.get(kd.m_name);
              if(null == keyTableObj)
              {
                namedKeyTable = new Hashtable();
                m_keys.put(kd.m_name, namedKeyTable);
              }
              else
              {
                namedKeyTable = (Hashtable)keyTableObj;
              }
            }
           
            // Look to see if we already have row indexed by
            // the node value, which is one of the nodes found via
            // the use attribute of xsl:key.  If there's not a row,
            // create one.
            NodeListImpl keyNodes;
            {
              Object nodeListObj = namedKeyTable.get(exprResult);
              if(null == nodeListObj)
              {
                keyNodes = new NodeListImpl();
                namedKeyTable.put(exprResult, keyNodes);
              }
              else
              {
                keyNodes = (NodeListImpl)nodeListObj;
              }
            }
           
            // See if the matched node is already in the
            // table set.  If it is there, we're done, otherwise
            // add it.
            boolean foundit = false;
            int nKeyNodes = keyNodes.size();
            for(int j = 0; j < nKeyNodes; j++)
            {
              if(testNode == keyNodes.item(j))
              {
                foundit = true;
                break;
              }
            } // end for j
            if(!foundit)
            {
              keyNodes.addElement(testNode);
            }
          } // end for(int k = 0; k < nUseValues; k++)
        } // end for(int i = 0; i < nDeclarations; i++)
      }

    }
    catch(ClassCastException cce)
    {
      Node pos = startNode;

      // Do a non-recursive pre-walk over the tree.
      while(null != pos)
      {    
        int nDeclarations = keyDeclarations.size();
       
        // We're going to have to walk the attribute list
        // if it's an element, so get the attributes.
        NamedNodeMap attrs = null;
        int nNodes;
        if(Node.ELEMENT_NODE == pos.getNodeType())
        {
          attrs = ((Element)pos).getAttributes();
          nNodes = attrs.getLength();
          if(0 == nNodes)
            attrs = null;
        }
        else
        {
          nNodes = 0;
        }
       
        // Walk the primary node, and each of the attributes.
        // This loop is a little strange... it is meant to always
        // execute once, then execute for each of the attributes.
        Node testNode = pos;
        for(int nodeIndex = -1; nodeIndex < nNodes;)
        {
          // Walk through each of the declarations made with xsl:key
          for(int i = 0; i < nDeclarations; i++)
          {
            KeyDeclaration kd = (KeyDeclaration)keyDeclarations.elementAt(i);
           
            // See if our node matches the given key declaration according to
            // the match attribute on xsl:key.
            double score = kd.m_match.getMatchScore(execContext, testNode);
            if(score == kd.m_match.MATCH_SCORE_NONE)
              continue;

            // Query from the node, according the the select pattern in the
            // use attribute in xsl:key.
            XObject xuse = kd.m_use.execute(execContext, testNode, nscontext);

            NodeList nl = xuse.nodeset();
            if(0 == nl.getLength())
              continue;
           
            // Use each node in the node list as a key value that we'll be
            // able to use to look up the given node.
View Full Code Here

Examples of org.apache.xpath.objects.XObject

  public Object selectObject(Node contextNode, String expression)
      throws JRException {
    try {
      createNamespaceElement(contextNode, expression);
      Object value;
      XObject object = null;
      if (namespaceElement != null) { 
        object = xpathAPI.eval(contextNode, expression, namespaceElement);
      } else {
        object = xpathAPI.eval(contextNode, expression);
      }
      switch (object.getType()) {
      case XObject.CLASS_NODESET:
        value = object.nodeset().nextNode();
        break;
      case XObject.CLASS_BOOLEAN:
        value = object.bool() ? Boolean.TRUE : Boolean.FALSE;
        break;
      case XObject.CLASS_NUMBER:
        value = new Double(object.num());
        break;
      default:
        value = object.str();
        break;
      }
      return value;
    } catch (TransformerException e) {
      throw new JRException("XPath selection failed. Expression: "
View Full Code Here

Examples of org.apache.xpath.objects.XObject

  }

  public Object selectObject(Node contextNode, String expression) throws JRException {
    try {
      Object value;
      XObject object = xpathAPI.eval(contextNode, expression);
      switch (object.getType()) {
        case XObject.CLASS_NODESET:
          value = object.nodeset().nextNode();
          break;
        case XObject.CLASS_BOOLEAN:
          value = object.bool() ? Boolean.TRUE : Boolean.FALSE;
          break;
        case XObject.CLASS_NUMBER:
          value = new Double(object.num());
          break;
        default:
          value = object.str();
          break;
      }
      return value;
    } catch (TransformerException e) {
      throw new JRException("XPath selection failed. Expression: "
View Full Code Here

Examples of org.apache.xpath.objects.XObject

    if(null != fileNameExpr)
    {
      org.apache.xpath.XPathContext xctxt
        = context.getTransformer().getXPathContext();
      XPath myxpath = new XPath(fileNameExpr, elem, xctxt.getNamespaceContext(), XPath.SELECT);
      XObject xobj = myxpath.execute(xctxt, context.getContextNode(), elem);
      fileName = xobj.str();
      if((null == fileName) || (fileName.length() == 0))
      {
        fileName = elem.getAttribute ("file",
                                      context.getContextNode(),
                                      context.getTransformer());
View Full Code Here

Examples of org.jpedal.objects.raw.XObject

            }
           
        }
       
        //create a fake XObject to make use of the code we already have to generate image
    fakeObj=new XObject(form.getObjectRefAsString()); //value does not matter
   
    //do not think we need but here for completeness
//    XObject.setFloatArray(PdfDictionary.Matrix,new float[]{1,0,0,1,0,0});

    //forms can have resources (Fonts, XOBjects, etc) which are in the DR value -
View Full Code Here

Examples of org.pdfclown.documents.contents.objects.XObject

  public ContentObject parseContentObject(
    ) throws FileFormatException
  {
    final Operation operation = parseOperation();
    if(operation instanceof PaintXObject) // External object.
      return new XObject((PaintXObject)operation);
    else if(operation instanceof PaintShading) // Shading.
      return new Shading((PaintShading)operation);
    else if(operation instanceof BeginSubpath
      || operation instanceof DrawRectangle) // Path.
      return parsePath(operation);
View Full Code Here

Examples of org.pdfclown.documents.contents.xObjects.XObject

    AlignmentXEnum alignmentX,
    AlignmentYEnum alignmentY,
    float rotation
    )
  {
    XObject xObject = scanner.getContentContext().getResources().getXObjects().get(name);

    // Adjusting default dimensions...
    /*
      NOTE: Zero-valued dimensions represent default proportional dimensions.
    */
    Dimension2D xObjectSize = xObject.getSize();
    if(size.getWidth() == 0)
    {
      if(size.getHeight() == 0)
      {size.setSize(xObjectSize);}
      else
      {size.setSize(size.getHeight() * xObjectSize.getWidth() / xObjectSize.getHeight(),size.getHeight());}
    }
    else if(size.getHeight() == 0)
    {size.setSize(size.getWidth(),size.getWidth() * xObjectSize.getHeight() / xObjectSize.getWidth());}

    // Scaling.
    double[] matrix = xObject.getMatrix();
    double scaleX, scaleY;
    scaleX = size.getWidth() / (xObjectSize.getWidth() * matrix[0]);
    scaleY = size.getHeight() / (xObjectSize.getHeight() * matrix[3]);

    // Alignment.
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.