Java 类org.w3c.dom.css.ViewCSS 实例源码

项目:Push2Display    文件:DOMViewer.java   
/**
 * Sets the document to display and its ViewCSS.
 */
public void setDocument(Document doc, ViewCSS view) {
    if (document != null) {
        if (document != doc) {
            removeDomMutationListeners(document);
            addDomMutationListeners(doc);
            removeCapturingListener(document);
            addCapturingListener(doc);
        }
    }
    else {
        addDomMutationListeners(doc);
        addCapturingListener(doc);
    }
    resetHistory();
    document = doc;
    viewCSS = view;
    TreeNode root = createTree(doc, showWhitespace);
    ((DefaultTreeModel) tree.getModel()).setRoot(root);
    if (rightPanel.getComponentCount() != 0) {
        rightPanel.remove(0);
        splitPane.revalidate();
        splitPane.repaint();
    }
}
项目:Push2Display    文件:DOMViewer.java   
/**
 * Sets the document to display and its ViewCSS.
 */
public void setDocument(Document doc, ViewCSS view) {
    if (document != null) {
        if (document != doc) {
            removeDomMutationListeners(document);
            addDomMutationListeners(doc);
            removeCapturingListener(document);
            addCapturingListener(doc);
        }
    }
    else {
        addDomMutationListeners(doc);
        addCapturingListener(doc);
    }
    resetHistory();
    document = doc;
    viewCSS = view;
    TreeNode root = createTree(doc, showWhitespace);
    ((DefaultTreeModel) tree.getModel()).setRoot(root);
    if (rightPanel.getComponentCount() != 0) {
        rightPanel.remove(0);
        splitPane.revalidate();
        splitPane.repaint();
    }
}
项目:PDFReporter-Studio    文件:SVGUtils.java   
public static Color toSWTColor(Element element, String attributeName) {
    Document document = element.getOwnerDocument();
    ViewCSS viewCSS = (ViewCSS) document.getDocumentElement();
    CSSStyleDeclaration computedStyle = viewCSS.getComputedStyle(element, null);
    SVGPaint svgPaint = (SVGPaint) computedStyle.getPropertyCSSValue(attributeName);
    if (svgPaint.getPaintType() == SVGPaint.SVG_PAINTTYPE_RGBCOLOR) {
        RGBColor rgb = svgPaint.getRGBColor();
        float red = rgb.getRed().getFloatValue(CSSValue.CSS_PRIMITIVE_VALUE);
        float green = rgb.getGreen().getFloatValue(CSSValue.CSS_PRIMITIVE_VALUE);
        float blue = rgb.getBlue().getFloatValue(CSSValue.CSS_PRIMITIVE_VALUE);
        return SWTResourceManager.getColor((int) red, (int) green, (int) blue);
    }
    return null;
}
项目:Push2Display    文件:DOMViewer.java   
/**
 * Sets the document to display and its ViewCSS.
 */
public void setDocument(Document doc, ViewCSS view) {
    panel.setDocument(doc, view);
}
项目:Push2Display    文件:JSVGViewerFrame.java   
/**
 * Forces the viewer frame to show the input SVGDocument
 */
public void setSVGDocument(SVGDocument svgDocument,
                           String svgDocumentURL,
                           String svgDocumentTitle) {
    this.svgDocument = svgDocument;

    if (domViewer != null) {
        if(domViewer.isVisible() && svgDocument != null) {
            domViewer.setDocument(svgDocument,
                                  (ViewCSS)svgDocument.getDocumentElement());
        } else {
            domViewer.dispose();
            domViewer = null;
        }
    }
    stopAction.update(false);
    svgCanvas.setCursor(DEFAULT_CURSOR);
    String s = svgDocumentURL;
    locationBar.setText(s);
    if (debugger != null) {
        debugger.detach();
        debugger.setDocumentURL(s);
    }
    if (title == null) {
        title = getTitle();
    }

    String dt = svgDocumentTitle;
    if (dt.length() != 0) {
        setTitle(title + ": " + dt);
    } else {
        int i = s.lastIndexOf("/");
        if (i == -1)
            i = s.lastIndexOf("\\");
        if (i == -1) {
            setTitle(title + ": " + s);
        } else {
            setTitle(title + ": " + s.substring(i + 1));
        }
    }

    localHistory.update(s);
    application.addVisitedURI(s);
    backAction.update();
    forwardAction.update();

    transformHistory = new TransformHistory();
    previousTransformAction.update();
    nextTransformAction.update();

    useStylesheetAction.update();
}
项目:Push2Display    文件:SVGOMSVGElement.java   
/**
 * <b>DOM</b>: Implements {@link
 * org.w3c.dom.css.ViewCSS#getComputedStyle(Element,String)}.
 */
public CSSStyleDeclaration getComputedStyle(Element elt,
                                            String pseudoElt) {
    AbstractView av = ((DocumentView)getOwnerDocument()).getDefaultView();
    return ((ViewCSS)av).getComputedStyle(elt, pseudoElt);
}
项目:Push2Display    文件:SVGDOMImplementation.java   
/**
 * Creates a ViewCSS.
 */
public ViewCSS createViewCSS(AbstractStylableDocument doc) {
    return new CSSOMSVGViewCSS(doc.getCSSEngine());
}
项目:gwt-chronoscope    文件:BatikGssProperties.java   
protected CSSStyleDeclaration getCssProperties(Element styleElem,
    String pseudoElt) {
  return ((ViewCSS) (((DocumentView) doc).getDefaultView()))
      .getComputedStyle(styleElem, pseudoElt);
}
项目:Push2Display    文件:DOMViewer.java   
/**
 * Sets the document to display and its ViewCSS.
 */
public void setDocument(Document doc, ViewCSS view) {
    panel.setDocument(doc, view);
}
项目:Push2Display    文件:JSVGViewerFrame.java   
/**
 * Forces the viewer frame to show the input SVGDocument
 */
public void setSVGDocument(SVGDocument svgDocument,
                           String svgDocumentURL,
                           String svgDocumentTitle) {
    this.svgDocument = svgDocument;

    if (domViewer != null) {
        if(domViewer.isVisible() && svgDocument != null) {
            domViewer.setDocument(svgDocument,
                                  (ViewCSS)svgDocument.getDocumentElement());
        } else {
            domViewer.dispose();
            domViewer = null;
        }
    }
    stopAction.update(false);
    svgCanvas.setCursor(DEFAULT_CURSOR);
    String s = svgDocumentURL;
    locationBar.setText(s);
    if (debugger != null) {
        debugger.detach();
        debugger.setDocumentURL(s);
    }
    if (title == null) {
        title = getTitle();
    }

    String dt = svgDocumentTitle;
    if (dt.length() != 0) {
        setTitle(title + ": " + dt);
    } else {
        int i = s.lastIndexOf("/");
        if (i == -1)
            i = s.lastIndexOf("\\");
        if (i == -1) {
            setTitle(title + ": " + s);
        } else {
            setTitle(title + ": " + s.substring(i + 1));
        }
    }

    localHistory.update(s);
    application.addVisitedURI(s);
    backAction.update();
    forwardAction.update();

    transformHistory = new TransformHistory();
    previousTransformAction.update();
    nextTransformAction.update();

    useStylesheetAction.update();
}
项目:Push2Display    文件:SVGOMSVGElement.java   
/**
 * <b>DOM</b>: Implements {@link
 * org.w3c.dom.css.ViewCSS#getComputedStyle(Element,String)}.
 */
public CSSStyleDeclaration getComputedStyle(Element elt,
                                            String pseudoElt) {
    AbstractView av = ((DocumentView)getOwnerDocument()).getDefaultView();
    return ((ViewCSS)av).getComputedStyle(elt, pseudoElt);
}
项目:Push2Display    文件:SVGDOMImplementation.java   
/**
 * Creates a ViewCSS.
 */
public ViewCSS createViewCSS(AbstractStylableDocument doc) {
    return new CSSOMSVGViewCSS(doc.getCSSEngine());
}
项目:feathers-sdk    文件:SVGOMSVGElement.java   
/**
 * <b>DOM</b>: Implements {@link
 * org.w3c.dom.css.ViewCSS#getComputedStyle(Element,String)}.
 */
public CSSStyleDeclaration getComputedStyle(Element elt,
                                            String pseudoElt) {
    AbstractView av = ((DocumentView)getOwnerDocument()).getDefaultView();
    return ((ViewCSS)av).getComputedStyle(elt, pseudoElt);
}
项目:feathers-sdk    文件:SVGDOMImplementation.java   
/**
 * Creates a ViewCSS.
 */
public ViewCSS createViewCSS(AbstractStylableDocument doc) {
    return new CSSOMSVGViewCSS(doc.getCSSEngine());
}
项目:Push2Display    文件:ExtensibleDOMImplementation.java   
/**
 * Creates a ViewCSS.
 */
public abstract ViewCSS createViewCSS(AbstractStylableDocument doc);
项目:Push2Display    文件:ExtensibleDOMImplementation.java   
/**
 * Creates a ViewCSS.
 */
public abstract ViewCSS createViewCSS(AbstractStylableDocument doc);
项目:feathers-sdk    文件:ExtensibleDOMImplementation.java   
/**
 * Creates a ViewCSS.
 */
public abstract ViewCSS createViewCSS(AbstractStylableDocument doc);