Package org.w3c.dom

Examples of org.w3c.dom.Element


      mesgElem = createMessage();
     
      // Transfer value into this message element
      node = (Node)node.cloneNode(true);
     
      Element partElem=mesgElem.getOwnerDocument().createElement(requestPartName);
      mesgElem.appendChild(partElem);
     
      node = (Node)mesgElem.getOwnerDocument().adoptNode(node);
     
      partElem.appendChild(node);
    }
       
    return(mesgElem);
  }
View Full Code Here


    if (__log.isDebugEnabled())  __log.debug("ODE routed to operation " + odeMex.getOperation() + " from service " + adapter.getServiceName());
    return odeMex;
  }

  private void onResponse(MyRoleMessageExchange mex, InvocationAdapter invocationAdapter) throws Exception {
    Element ret=null;

    switch (mex.getStatus()) {
      case FAULT:
        if (__log.isDebugEnabled())
          __log.debug("Fault response message: " + mex.getFault());
View Full Code Here

    protected Element getImageText(SVGDocument doc, int imgXLeft, int imgYTop, int imgWidth, int imgHeight,
                                   String imgName, String imgDisplayName) {
        int txtXLeft = imgXLeft;
        int txtYTop = imgYTop; // + imgHeight + BPEL2SVGFactory.TEXT_ADJUST;

        Element a = doc.createElementNS("http://www.w3.org/2000/svg", "a");
        if (imgDisplayName != null) {
            a.setAttributeNS(null, "id", imgName);

            Element text1 = doc.createElementNS("http://www.w3.org/2000/svg", "text");
            text1.setAttributeNS(null, "x", String.valueOf(txtXLeft));
            text1.setAttributeNS(null, "y", String.valueOf(txtYTop));
            text1.setAttributeNS(null, "id", imgName + ".Text");
            text1.setAttributeNS(null, "xml:space", "preserve");
            text1.setAttributeNS(null, "style", "font-size:12px;font-style:normal;font-variant:normal;font-weight:" +
                    "normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:" +
                    "start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;" +
                    "stroke-linejoin:miter;stroke-opacity:1;font-family:Arial Narrow;" +
                    "-inkscape-font-specification:Arial Narrow");

            Element tspan = doc.createElementNS("http://www.w3.org/2000/svg", "tspan");
            tspan.setAttributeNS(null, "x", String.valueOf(txtXLeft));
            tspan.setAttributeNS(null, "y", String.valueOf(txtYTop));
            tspan.setAttributeNS(null, "id", "tspan-" + imgName);

            Text text2 = doc.createTextNode(imgDisplayName);
            tspan.appendChild(text2);

            text1.appendChild(tspan);
            a.appendChild(text1);
        }
        return a;
View Full Code Here

        }
    }

    protected Element getArrowDefinition(SVGDocument doc, int startX, int startY, int endX, int endY,
            String id, ActivityInterface start, ActivityInterface end) {         //here we have to find whether
        Element path = doc.createElementNS("http://www.w3.org/2000/svg", "path");

        if (startX == endX || startY == endY) {
                path.setAttributeNS(null, "d", "M " + startX + "," + startY + " L " + endX + "," + endY);
        }
        else {
            if(layoutManager.isVerticalLayout()){
                path.setAttributeNS(null, "d", "M " + startX + "," + startY + " L " + startX + "," +
                        ((startY + 2 * endY) / 3) + " L " + endX + "," + ((startY + 2 * endY) / 3) + " L " + endX +
                        "," + endY);                            //use constants for these propotions
            }else{
                path.setAttributeNS(null, "d", "M " + startX + "," + startY + " L " + ((startX + 1* endX) / 2) +
                        "," + startY + " L " + ((startX + 1* endX) / 2) + "," + endY + " L " + endX + "," + endY);                              //use constants for these propotions
            }
        }
        path.setAttributeNS(null, "id", id);
        path.setAttributeNS(null, "style", getArrowStyle(start, end));

        return path;
    }
View Full Code Here

        return path;
    }

    protected Element getArrowDefinition(SVGDocument doc, int startX, int startY, int midX, int midY, int endX,
                                         int endY, String id, ActivityInterface start, ActivityInterface end) {
        Element path = doc.createElementNS("http://www.w3.org/2000/svg", "path");
        path.setAttributeNS(null, "d", "M " + startX + "," + startY + " L " + midX + "," + midY + "L " + endX +
                "," + endY);
        path.setAttributeNS(null, "id", id);
        path.setAttributeNS(null, "style", getArrowStyle(start, end));

        return path;
    }
View Full Code Here

        return getBoxDefinition(doc, getDimensions().getXLeft() + BOX_MARGIN, getDimensions().getYTop() + BOX_MARGIN,
                getDimensions().getWidth() - (BOX_MARGIN * 2), getDimensions().getHeight() - (BOX_MARGIN * 2), getBoxId());
    }

    protected Element getBoxDefinition(SVGDocument doc, int boxXLeft, int boxYTop, int boxWidth, int boxHeight, String id) {
        Element group = null;
        group = doc.createElementNS("http://www.w3.org/2000/svg", "g");
        group.setAttributeNS(null, "id", "Layer-" + id);

        if (layoutManager.isShowSequenceBoxes()) {

            Element rect = doc.createElementNS("http://www.w3.org/2000/svg", "rect");
            rect.setAttributeNS(null, "width", String.valueOf(boxWidth));
            rect.setAttributeNS(null, "height", String.valueOf(boxHeight));
            rect.setAttributeNS(null, "x", String.valueOf(boxXLeft));
            rect.setAttributeNS(null, "y", String.valueOf(boxYTop));
            rect.setAttributeNS(null, "id", "Rect" + id);
            rect.setAttributeNS(null, "rx", "10");
            rect.setAttributeNS(null, "ry", "10");
            rect.setAttributeNS(null, "style", getBoxStyle());

            group.appendChild(rect);
        }
        return group;
    }
View Full Code Here

    /**
     * get first "real" element (ie not the document-rootelement, but the next one
     */
    public static Element getFirstElement(Document document) {
        Element workelement = null;

        if (document.getDocumentElement() != null) {
            org.w3c.dom.Node tmp = document.getDocumentElement().getFirstChild();

            while (tmp != null) {
View Full Code Here

   */
  private void localizeAttrib(Node node,
            String attribute,
            URL context)
  {
    Element el = (Element)node;
    String oldValue = el.getAttribute(attribute);

    // only localize if the attribute exists
    // only localize if the file is in another directory
    if (!oldValue.equals("") && oldValue.indexOf("/")!=-1) {
      String newValue = localizeURL(oldValue,context);
      el.setAttribute(attribute, newValue);
    } // end of if ()
   
  }
View Full Code Here

        return coords;
    }

    @Override
    public Element getSVGString(SVGDocument doc) {
        Element group = null;

        group = doc.createElementNS("http://www.w3.org/2000/svg", "g");
        group.setAttributeNS(null, "id", getLayerId());

        if (isAddOpacity()) {
            group.setAttributeNS(null, "style", "opacity:" + getOpacity());
        }
        //Add Arrow
        group.appendChild(getArrows(doc));

        group.appendChild(getBoxDefinition(doc));
        group.appendChild(getStartImageText(doc));
        // Process Sub Activities
        group.appendChild(getSubActivitiesSVGString(doc));
        //Add Arrow
       // group.appendChild(getArrows(doc));

        return group;
    }
View Full Code Here

    }

  public Element getSubActivitiesSVGString(SVGDocument doc) {
        Iterator<org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface> itr = subActivities.iterator();
        org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface activity = null;
        Element subElement = doc.createElementNS("http://www.w3.org/2000/svg", "g");
        while (itr.hasNext()) {
            activity = itr.next();
            subElement.appendChild(activity.getSVGString(doc));   //attention check this probably should be changed
            name = activity.getId();
        }
        return subElement;
    }
View Full Code Here

TOP

Related Classes of org.w3c.dom.Element

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.