Package org.vectomatic.dom.svg

Examples of org.vectomatic.dom.svg.OMElement


   *
   * @param line Line with a write block indicator
   */
  public static void removeWriteBlock(OMElement line) {
   
    OMElement par = (OMElement) line.getParentNode();
    OMNodeList<OMElement> circles = par.getElementsByTagName("circle");
   
    for(int i=0; i < circles.getLength(); i++) {
      if (!circles.getItem(i).getAttribute(WRITE_BLOCK_ATTR).isEmpty()) {
        par.removeChild(circles.getItem(i));
        break;
      }
    }
  }
View Full Code Here


   *
   * @param line Line with a read block indicator
   */
  public static void removeReadBlock(OMElement line) {
   
    OMElement par = (OMElement) line.getParentNode();
    OMNodeList<OMElement> circles = par.getElementsByTagName("circle");
   
    for(int i=0; i < circles.getLength(); i++) {
      if (!circles.getItem(i).getAttribute(READ_BLOCK_ATTR).isEmpty()) {
        par.removeChild(circles.getItem(i));
        break;
      }
    }
  }
View Full Code Here

   *
   * @param pipeId
   */
  protected void blankPipe(String pipeId) {

    OMElement e = null;
    try {
      e = mSVG.getOwnerDocument().getElementById(pipeId);
    } catch (Exception ex) {
      //Don't want to do anything, just don't have a hissy fit :)
      logger.log(Level.WARNING,
          "No pipe with id " + pipeId + " in workflow "
          + mWorkflowId);
    }
    

    if (e != null) { 

      OMNodeList<OMElement> paths = e.getElementsByTagName("path");
      OMElement line = paths.getItem(0);

      GraphUtilities.removeReadBlock(line);
      GraphUtilities.removeWriteBlock(line);
     
      OMElement par = (OMElement) line.getParentNode();
      OMNodeList<OMElement> oldText = par.getElementsByTagName("text");
      if (oldText.getLength() > 0) {
        par.removeChild(oldText.getItem(0));
      }
    }
  }
View Full Code Here

   
    if (pipeId == null || pipeId.isEmpty()) {
      logger.log(Level.SEVERE, "Empty or null pipe id");
    }
    OMDocument doc = mSVG.getOwnerDocument();
    OMElement e = null;
   
    // Workaround for apparent bug in svg-gwt's getElementById when there
    // is no element with the id. Apparently due to a mozilla bug.
    try {
      e = doc.getElementById(pipeId);
    } catch (Exception ex) {
      //Don't want to do anything, just don't have a hissy fit :)
      logger.log(Level.WARNING,
          "No pipe with id " + pipeId + " in workflow "
          + mWorkflowId);
    }

    if (e != null) { 
      PipelineInfo prevInfo = getPrevInfo(pipelineInfo.getId());

      OMNodeList<OMElement> paths = e.getElementsByTagName("path");
      OMElement line = paths.getItem(0);

      updateText(pipelineInfo, line);
      if (mPlaying && hasDataTransfers(pipelineInfo, prevInfo)) {
        mAnimator.addLine(pipelineInfo.getId(), line);
      } else {
View Full Code Here

    text.getStyle().setSVGProperty(
        SVGConstants.CSS_TEXT_ANCHOR_PROPERTY, "middle");
    text.getStyle().setSVGProperty(
        SVGConstants.CSS_FONT_SIZE_PROPERTY, "8pt");
   
    OMElement par = (OMElement) line.getParentNode();
    OMNodeList<OMElement> oldText = par.getElementsByTagName("text");
    if (oldText.getLength() > 0) {
      par.removeChild(oldText.getItem(0));
    }
    par.appendChild(text);
  }
View Full Code Here

   * Stop animating given line.
   * @param id Pipeline id of line to remove.
   */
  public void removeLine(String id) {
   
    OMElement line;
    synchronized (mLineMap) {
      line = mLineMap.remove(id);
    }
    if (line != null) {
      line.removeAttribute("stroke-dasharray");
    }
  }
View Full Code Here

   */
  public void removeAllLines() {
   
    synchronized (mLineMap) {
      for (String id : mLineMap.keySet()) {
        OMElement line = mLineMap.get(id);
       
        if (line != null) {
          line.removeAttribute("stroke-dasharray");
        }
      }
      mLineMap.clear();
    }
   
View Full Code Here

TOP

Related Classes of org.vectomatic.dom.svg.OMElement

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.