hillion 02/02/20 04:53:22
Modified: resources/org/apache/batik/apps/svgbrowser/resources
GUI.properties
sources/org/apache/batik/css/parser Parser.java
sources/org/apache/batik/util CSSConstants.java
Added: sources/org/apache/batik/css/parser
AbstractAttributeCondition.java
AbstractCombinatorCondition.java
AbstractDescendantSelector.java
AbstractElementSelector.java
AbstractSiblingSelector.java
DefaultAndCondition.java
DefaultAttributeCondition.java
DefaultBeginHyphenAttributeCondition.java
DefaultChildSelector.java
DefaultClassCondition.java
DefaultConditionFactory.java
DefaultConditionalSelector.java
DefaultDescendantSelector.java
DefaultDirectAdjacentSelector.java
DefaultElementSelector.java DefaultIdCondition.java
DefaultLangCondition.java
DefaultOneOfAttributeCondition.java
DefaultPseudoClassCondition.java
DefaultPseudoElementSelector.java
DefaultSelectorFactory.java
Log:
Removed dependancies of the CSS parser with the CSS engine.
Revision Changes Path
1.44 +8 -8
xml-batik/resources/org/apache/batik/apps/svgbrowser/resources/GUI.properties
Index: GUI.properties
===================================================================
RCS file:
/home/cvs/xml-batik/resources/org/apache/batik/apps/svgbrowser/resources/GUI.properties,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- GUI.properties 18 Feb 2002 09:11:58 -0000 1.43
+++ GUI.properties 20 Feb 2002 12:53:21 -0000 1.44
@@ -9,7 +9,7 @@
# The viewer's GUI resources.
#
# Author: [EMAIL PROTECTED]
-# $Id: GUI.properties,v 1.43 2002/02/18 09:11:58 hillion Exp $
+# $Id: GUI.properties,v 1.44 2002/02/20 12:53:21 hillion Exp $
#
ViewSource.width = 750
@@ -99,7 +99,7 @@
Exit.accelerator = Ctrl+Q
Print.type = ITEM
-Print.text = Print
+Print.text = Print...
Print.icon = resources/print.gif
Print.mnemonic = P
Print.action = PrintAction
@@ -169,7 +169,7 @@
View.mnemonic = V
ThumbnailDialog.type = ITEM
-ThumbnailDialog.text = Thumbnail
+ThumbnailDialog.text = Thumbnail...
ThumbnailDialog.icon = resources/blank.gif
ThumbnailDialog.mnemonic = M
ThumbnailDialog.action = ThumbnailDialogAction
@@ -221,14 +221,14 @@
NextTransform.accelerator = Ctrl+L
SetTransform.type = ITEM
-SetTransform.text = Transform
+SetTransform.text = Transform...
SetTransform.icon = resources/blank.gif
SetTransform.mnemonic = S
SetTransform.action = SetTransformAction
-SetTransform.accelerator = Ctrl+S
+SetTransform.accelerator = Ctrl+E
ViewSource.type = ITEM
-ViewSource.text = View Source
+ViewSource.text = View Source...
ViewSource.icon = resources/source.gif
ViewSource.mnemonic = V
ViewSource.action = ViewSourceAction
@@ -294,14 +294,14 @@
Tools.mnemonic = T
Monitor.type = ITEM
-Monitor.text = Memory Monitor
+Monitor.text = Memory Monitor...
Monitor.icon = resources/monitor.gif
Monitor.mnemonic = M
Monitor.action = MonitorAction
Monitor.accelerator = Ctrl+M
DOMViewer.type = ITEM
-DOMViewer.text = DOM Viewer
+DOMViewer.text = DOM Viewer...
DOMViewer.icon = resources/domtree.gif
DOMViewer.mnemonic = D
DOMViewer.action = DOMViewerAction
1.20 +7 -6 xml-batik/sources/org/apache/batik/css/parser/Parser.java
Index: Parser.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/css/parser/Parser.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- Parser.java 18 Feb 2002 09:11:58 -0000 1.19
+++ Parser.java 20 Feb 2002 12:53:21 -0000 1.20
@@ -18,8 +18,6 @@
import java.util.MissingResourceException;
import java.util.StringTokenizer;
-import org.apache.batik.css.sac.CSSOMConditionFactory;
-import org.apache.batik.css.sac.CSSOMSelectorFactory;
import org.apache.batik.util.CSSConstants;
import org.apache.batik.util.EncodingUtilities;
import org.apache.batik.util.ParsedURL;
@@ -45,7 +43,7 @@
* This class implements the {@link org.w3c.css.sac.Parser} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
- * @version $Id: Parser.java,v 1.19 2002/02/18 09:11:58 hillion Exp $
+ * @version $Id: Parser.java,v 1.20 2002/02/20 12:53:21 hillion Exp $
*/
public class Parser implements ExtendedParser, Localizable {
@@ -74,17 +72,20 @@
/**
* The document handler.
*/
- protected DocumentHandler documentHandler = DefaultDocumentHandler.INSTANCE;
+ protected DocumentHandler documentHandler =
+ DefaultDocumentHandler.INSTANCE;
/**
* The selector factory.
*/
- protected SelectorFactory selectorFactory = CSSOMSelectorFactory.INSTANCE;
+ protected SelectorFactory selectorFactory =
+ DefaultSelectorFactory.INSTANCE;
/**
* The condition factory.
*/
- protected ConditionFactory conditionFactory = CSSOMConditionFactory.INSTANCE;
+ protected ConditionFactory conditionFactory =
+ DefaultConditionFactory.INSTANCE;
/**
* The error handler.
1.1
xml-batik/sources/org/apache/batik/css/parser/AbstractAttributeCondition.java
Index: AbstractAttributeCondition.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
import org.w3c.css.sac.AttributeCondition;
/**
* This class provides an abstract implementation of the {@link
* org.w3c.css.sac.AttributeCondition} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: AbstractAttributeCondition.java,v 1.1 2002/02/20 12:53:21 hillion
Exp $
*/
public abstract class AbstractAttributeCondition
implements AttributeCondition {
/**
* The attribute value.
*/
protected String value;
/**
* Creates a new AbstractAttributeCondition object.
*/
protected AbstractAttributeCondition(String value) {
this.value = value;
}
/**
* <b>SAC</b>: Implements {@link AttributeCondition#getValue()}.
*/
public String getValue() {
return value;
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/AbstractCombinatorCondition.java
Index: AbstractCombinatorCondition.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
import org.w3c.css.sac.CombinatorCondition;
import org.w3c.css.sac.Condition;
/**
* This class provides an abstract implementation of the
* {@link org.w3c.css.sac.CombinatorCondition} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: AbstractCombinatorCondition.java,v 1.1 2002/02/20 12:53:21 hillion
Exp $
*/
public abstract class AbstractCombinatorCondition
implements CombinatorCondition {
/**
* The first condition.
*/
protected Condition firstCondition;
/**
* The second condition.
*/
protected Condition secondCondition;
/**
* Creates a new CombinatorCondition object.
*/
protected AbstractCombinatorCondition(Condition c1, Condition c2) {
firstCondition = c1;
secondCondition = c2;
}
/**
* <b>SAC</b>: Implements {@link CombinatorCondition#getFirstCondition()}.
*/
public Condition getFirstCondition() {
return firstCondition;
}
/**
* <b>SAC</b>: Implements {@link CombinatorCondition#getSecondCondition()}.
*/
public Condition getSecondCondition() {
return secondCondition;
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/AbstractDescendantSelector.java
Index: AbstractDescendantSelector.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
import org.w3c.css.sac.DescendantSelector;
import org.w3c.css.sac.Selector;
import org.w3c.css.sac.SimpleSelector;
/**
* This class provides an abstract implementation of the
* {@link DescendantSelector} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: AbstractDescendantSelector.java,v 1.1 2002/02/20 12:53:21 hillion
Exp $
*/
public abstract class AbstractDescendantSelector
implements DescendantSelector {
/**
* The ancestor selector.
*/
protected Selector ancestorSelector;
/**
* The simple selector.
*/
protected SimpleSelector simpleSelector;
/**
* Creates a new DescendantSelector object.
*/
protected AbstractDescendantSelector(Selector ancestor,
SimpleSelector simple) {
ancestorSelector = ancestor;
simpleSelector = simple;
}
/**
* <b>SAC</b>: Implements {@link DescendantSelector#getAncestorSelector()}.
*/
public Selector getAncestorSelector() {
return ancestorSelector;
}
/**
* <b>SAC</b>: Implements {@link DescendantSelector#getSimpleSelector()}.
*/
public SimpleSelector getSimpleSelector() {
return simpleSelector;
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/AbstractElementSelector.java
Index: AbstractElementSelector.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
import org.w3c.css.sac.ElementSelector;
/**
* This class provides an abstract implementation of the
* {@link ElementSelector} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: AbstractElementSelector.java,v 1.1 2002/02/20 12:53:21 hillion Exp $
*/
public abstract class AbstractElementSelector
implements ElementSelector {
/**
* The namespace URI.
*/
protected String namespaceURI;
/**
* The local name.
*/
protected String localName;
/**
* Creates a new ElementSelector object.
*/
protected AbstractElementSelector(String uri, String name) {
namespaceURI = uri;
localName = name;
}
/**
* <b>SAC</b>: Implements {@link ElementSelector#getNamespaceURI()}.
*/
public String getNamespaceURI() {
return namespaceURI;
}
/**
* <b>SAC</b>: Implements {@link ElementSelector#getLocalName()}.
*/
public String getLocalName() {
return localName;
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/AbstractSiblingSelector.java
Index: AbstractSiblingSelector.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
import org.w3c.css.sac.SiblingSelector;
import org.w3c.css.sac.Selector;
import org.w3c.css.sac.SimpleSelector;
/**
* This class provides an abstract implementation of the {@link
* org.w3c.css.sac.SiblingSelector} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: AbstractSiblingSelector.java,v 1.1 2002/02/20 12:53:21 hillion Exp $
*/
public abstract class AbstractSiblingSelector
implements SiblingSelector {
/**
* The node type.
*/
protected short nodeType;
/**
* The selector.
*/
protected Selector selector;
/**
* The simple selector.
*/
protected SimpleSelector simpleSelector;
/**
* Creates a new SiblingSelector object.
*/
protected AbstractSiblingSelector(short type,
Selector sel,
SimpleSelector simple) {
nodeType = type;
selector = sel;
simpleSelector = simple;
}
/**
* Returns the node type.
*/
public short getNodeType() {
return nodeType;
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.SiblingSelector#getSelector()}.
*/
public Selector getSelector() {
return selector;
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.SiblingSelector#getSiblingSelector()}.
*/
public SimpleSelector getSiblingSelector() {
return simpleSelector;
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/DefaultAndCondition.java
Index: DefaultAndCondition.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
import org.w3c.css.sac.Condition;
/**
* This class provides an implementation of the
* {@link org.w3c.css.sac.CombinatorCondition} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: DefaultAndCondition.java,v 1.1 2002/02/20 12:53:21 hillion Exp $
*/
public class DefaultAndCondition extends AbstractCombinatorCondition {
/**
* Creates a new CombinatorCondition object.
*/
public DefaultAndCondition(Condition c1, Condition c2) {
super(c1, c2);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.Condition#getConditionType()}.
*/
public short getConditionType() {
return SAC_AND_CONDITION;
}
/**
* Returns a text representation of this object.
*/
public String toString() {
return "" + getFirstCondition() + getSecondCondition();
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/DefaultAttributeCondition.java
Index: DefaultAttributeCondition.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
import org.w3c.dom.Element;
/**
* This class provides an implementation of the
* {@link org.w3c.css.sac.AttributeCondition} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: DefaultAttributeCondition.java,v 1.1 2002/02/20 12:53:21 hillion
Exp $
*/
public class DefaultAttributeCondition extends AbstractAttributeCondition {
/**
* The attribute's local name.
*/
protected String localName;
/**
* The attribute's namespace URI.
*/
protected String namespaceURI;
/**
* Whether this condition applies to specified attributes.
*/
protected boolean specified;
/**
* Creates a new DefaultAttributeCondition object.
*/
public DefaultAttributeCondition(String localName,
String namespaceURI,
boolean specified,
String value) {
super(value);
this.localName = localName;
this.namespaceURI = namespaceURI;
this.specified = specified;
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.Condition#getConditionType()}.
*/
public short getConditionType() {
return SAC_ATTRIBUTE_CONDITION;
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.AttributeCondition#getNamespaceURI()}.
*/
public String getNamespaceURI() {
return namespaceURI;
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.AttributeCondition#getLocalName()}.
*/
public String getLocalName() {
return localName;
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.AttributeCondition#getSpecified()}.
*/
public boolean getSpecified() {
return specified;
}
/**
* Returns a text representation of this object.
*/
public String toString() {
if (value == null) {
return "[" + localName + "]";
}
return "[" + localName + "=\"" + value + "\"]";
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/DefaultBeginHyphenAttributeCondition.java
Index: DefaultBeginHyphenAttributeCondition.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
/**
* This class provides an implementation of the
* {@link org.w3c.css.sac.AttributeCondition} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: DefaultBeginHyphenAttributeCondition.java,v 1.1 2002/02/20 12:53:21
hillion Exp $
*/
public class DefaultBeginHyphenAttributeCondition
extends DefaultAttributeCondition {
/**
* Creates a new DefaultAttributeCondition object.
*/
public DefaultBeginHyphenAttributeCondition(String localName,
String namespaceURI,
boolean specified,
String value) {
super(localName, namespaceURI, specified, value);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.Condition#getConditionType()}.
*/
public short getConditionType() {
return SAC_BEGIN_HYPHEN_ATTRIBUTE_CONDITION;
}
/**
* Returns a text representation of this object.
*/
public String toString() {
return "[" + getLocalName() + "|=\"" + getValue() + "\"]";
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/DefaultChildSelector.java
Index: DefaultChildSelector.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
import org.w3c.css.sac.Selector;
import org.w3c.css.sac.SimpleSelector;
/**
* This class provides an implementation of the
* {@link org.w3c.css.sac.DescendantSelector} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: DefaultChildSelector.java,v 1.1 2002/02/20 12:53:21 hillion Exp $
*/
public class DefaultChildSelector extends AbstractDescendantSelector {
/**
* Creates a new DefaultChildSelector object.
*/
public DefaultChildSelector(Selector ancestor, SimpleSelector simple) {
super(ancestor, simple);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.Selector#getSelectorType()}.
*/
public short getSelectorType() {
return SAC_CHILD_SELECTOR;
}
/**
* Returns a representation of the selector.
*/
public String toString() {
SimpleSelector s = getSimpleSelector();
if (s.getSelectorType() == SAC_PSEUDO_ELEMENT_SELECTOR) {
return "" + getAncestorSelector() + s;
}
return getAncestorSelector() + " > " + s;
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/DefaultClassCondition.java
Index: DefaultClassCondition.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
/**
* This class provides an implementation of the
* {@link org.w3c.css.sac.AttributeCondition} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: DefaultClassCondition.java,v 1.1 2002/02/20 12:53:21 hillion Exp $
*/
public class DefaultClassCondition extends DefaultAttributeCondition {
/**
* Creates a new DefaultAttributeCondition object.
*/
public DefaultClassCondition(String namespaceURI,
String value) {
super("class", namespaceURI, true, value);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.Condition#getConditionType()}.
*/
public short getConditionType() {
return SAC_CLASS_CONDITION;
}
/**
* Returns a text representation of this object.
*/
public String toString() {
return "." + getValue();
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/DefaultConditionFactory.java
Index: DefaultConditionFactory.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
import org.w3c.css.sac.AttributeCondition;
import org.w3c.css.sac.CombinatorCondition;
import org.w3c.css.sac.Condition;
import org.w3c.css.sac.ConditionFactory;
import org.w3c.css.sac.ContentCondition;
import org.w3c.css.sac.CSSException;
import org.w3c.css.sac.LangCondition;
import org.w3c.css.sac.NegativeCondition;
import org.w3c.css.sac.PositionalCondition;
/**
* This class provides an implementation of the
* {@link org.w3c.css.sac.ConditionFactory} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: DefaultConditionFactory.java,v 1.1 2002/02/20 12:53:21 hillion Exp $
*/
public class DefaultConditionFactory implements ConditionFactory {
/**
* The instance of this class.
*/
public final static ConditionFactory INSTANCE =
new DefaultConditionFactory();
/**
* This class does not need to be instantiated.
*/
protected DefaultConditionFactory() {
}
/**
* <b>SAC</b>: Implements {@link
* ConditionFactory#createAndCondition(Condition,Condition)}.
*/
public CombinatorCondition createAndCondition(Condition first,
Condition second)
throws CSSException {
return new DefaultAndCondition(first, second);
}
/**
* <b>SAC</b>: Implements {@link
* ConditionFactory#createOrCondition(Condition,Condition)}.
*/
public CombinatorCondition createOrCondition(Condition first,
Condition second)
throws CSSException {
throw new CSSException("Not implemented in CSS2");
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.ConditionFactory#createNegativeCondition(Condition)}.
*/
public NegativeCondition createNegativeCondition(Condition condition)
throws CSSException {
throw new CSSException("Not implemented in CSS2");
}
/**
* <b>SAC</b>: Implements {@link
* ConditionFactory#createPositionalCondition(int,boolean,boolean)}.
*/
public PositionalCondition createPositionalCondition(int position,
boolean typeNode,
boolean type)
throws CSSException {
throw new CSSException("Not implemented in CSS2");
}
/**
* <b>SAC</b>: Implements {@link
*ConditionFactory#createAttributeCondition(String,String,boolean,String)}.
*/
public AttributeCondition createAttributeCondition(String localName,
String namespaceURI,
boolean specified,
String value)
throws CSSException {
return new DefaultAttributeCondition(localName, namespaceURI,
specified, value);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.ConditionFactory#createIdCondition(String)}.
*/
public AttributeCondition createIdCondition(String value)
throws CSSException {
return new DefaultIdCondition(value);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.ConditionFactory#createLangCondition(String)}.
*/
public LangCondition createLangCondition(String lang) throws CSSException {
return new DefaultLangCondition(lang);
}
/**
* <b>SAC</b>: Implements {@link
ConditionFactory#createOneOfAttributeCondition(String,String,boolean,String)}.
*/
public AttributeCondition createOneOfAttributeCondition(String localName,
String nsURI,
boolean specified,
String value)
throws CSSException {
return new DefaultOneOfAttributeCondition(localName, nsURI, specified,
value);
}
/**
* <b>SAC</b>: Implements {@link
*
ConditionFactory#createBeginHyphenAttributeCondition(String,String,boolean,String)}.
*/
public AttributeCondition createBeginHyphenAttributeCondition
(String localName,
String namespaceURI,
boolean specified,
String value)
throws CSSException {
return new DefaultBeginHyphenAttributeCondition
(localName, namespaceURI, specified, value);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.ConditionFactory#createClassCondition(String,String)}.
*/
public AttributeCondition createClassCondition(String namespaceURI,
String value)
throws CSSException {
return new DefaultClassCondition(namespaceURI, value);
}
/**
* <b>SAC</b>: Implements {@link
* ConditionFactory#createPseudoClassCondition(String,String)}.
*/
public AttributeCondition createPseudoClassCondition(String namespaceURI,
String value)
throws CSSException {
return new DefaultPseudoClassCondition(namespaceURI, value);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.ConditionFactory#createOnlyChildCondition()}.
*/
public Condition createOnlyChildCondition() throws CSSException {
throw new CSSException("Not implemented in CSS2");
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.ConditionFactory#createOnlyTypeCondition()}.
*/
public Condition createOnlyTypeCondition() throws CSSException {
throw new CSSException("Not implemented in CSS2");
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.ConditionFactory#createContentCondition(String)}.
*/
public ContentCondition createContentCondition(String data)
throws CSSException {
throw new CSSException("Not implemented in CSS2");
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/DefaultConditionalSelector.java
Index: DefaultConditionalSelector.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
import org.w3c.css.sac.Condition;
import org.w3c.css.sac.ConditionalSelector;
import org.w3c.css.sac.SimpleSelector;
/**
* This class provides an implementation of the
* {@link org.w3c.css.sac.ConditionalSelector} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: DefaultConditionalSelector.java,v 1.1 2002/02/20 12:53:21 hillion
Exp $
*/
public class DefaultConditionalSelector implements ConditionalSelector {
/**
* The simple selector.
*/
protected SimpleSelector simpleSelector;
/**
* The condition.
*/
protected Condition condition;
/**
* Creates a new ConditionalSelector object.
*/
public DefaultConditionalSelector(SimpleSelector s, Condition c) {
simpleSelector = s;
condition = c;
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.Selector#getSelectorType()}.
*/
public short getSelectorType() {
return SAC_CONDITIONAL_SELECTOR;
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.ConditionalSelector#getSimpleSelector()}.
*/
public SimpleSelector getSimpleSelector() {
return simpleSelector;
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.ConditionalSelector#getCondition()}.
*/
public Condition getCondition() {
return condition;
}
/**
* Returns a representation of the selector.
*/
public String toString() {
return "" + simpleSelector + condition;
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/DefaultDescendantSelector.java
Index: DefaultDescendantSelector.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
import org.w3c.css.sac.Selector;
import org.w3c.css.sac.SimpleSelector;
/**
* This class provides an implementation for the
* {@link org.w3c.css.sac.DescendantSelector} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: DefaultDescendantSelector.java,v 1.1 2002/02/20 12:53:21 hillion
Exp $
*/
public class DefaultDescendantSelector extends AbstractDescendantSelector {
/**
* Creates a new DefaultDescendantSelector object.
*/
public DefaultDescendantSelector(Selector ancestor,
SimpleSelector simple) {
super(ancestor, simple);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.Selector#getSelectorType()}.
*/
public short getSelectorType() {
return SAC_DESCENDANT_SELECTOR;
}
/**
* Returns a representation of the selector.
*/
public String toString() {
return getAncestorSelector() + " " + getSimpleSelector();
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/DefaultDirectAdjacentSelector.java
Index: DefaultDirectAdjacentSelector.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
import org.w3c.css.sac.Selector;
import org.w3c.css.sac.SimpleSelector;
/**
* This class provides an implementation for the
* {@link org.w3c.css.sac.DescendantSelector} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: DefaultDirectAdjacentSelector.java,v 1.1 2002/02/20 12:53:21
hillion Exp $
*/
public class DefaultDirectAdjacentSelector extends AbstractSiblingSelector {
/**
* Creates a new DefaultDirectAdjacentSelector object.
*/
public DefaultDirectAdjacentSelector(short type,
Selector parent,
SimpleSelector simple) {
super(type, parent, simple);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.Selector#getSelectorType()}.
*/
public short getSelectorType() {
return SAC_DIRECT_ADJACENT_SELECTOR;
}
/**
* Returns a representation of the selector.
*/
public String toString() {
return getSelector() + " + " + getSiblingSelector();
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/DefaultElementSelector.java
Index: DefaultElementSelector.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
/**
* This class implements the {@link org.w3c.css.sac.ElementSelector} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: DefaultElementSelector.java,v 1.1 2002/02/20 12:53:21 hillion Exp $
*/
public class DefaultElementSelector extends AbstractElementSelector {
/**
* Creates a new ElementSelector object.
*/
public DefaultElementSelector(String uri, String name) {
super(uri, name);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.Selector#getSelectorType()}.
*/
public short getSelectorType() {
return SAC_ELEMENT_NODE_SELECTOR;
}
/**
* Returns a representation of the selector.
*/
public String toString() {
String name = getLocalName();
if (name == null) {
return "*";
}
return name;
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/DefaultIdCondition.java
Index: DefaultIdCondition.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
/**
* This class provides an implementation of the
* {@link org.w3c.css.sac.AttributeCondition} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: DefaultIdCondition.java,v 1.1 2002/02/20 12:53:21 hillion Exp $
*/
public class DefaultIdCondition extends AbstractAttributeCondition {
/**
* Creates a new DefaultAttributeCondition object.
*/
public DefaultIdCondition(String value) {
super(value);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.Condition#getConditionType()}.
*/
public short getConditionType() {
return SAC_ID_CONDITION;
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.AttributeCondition#getNamespaceURI()}.
*/
public String getNamespaceURI() {
return null;
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.AttributeCondition#getLocalName()}.
*/
public String getLocalName() {
return "id";
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.AttributeCondition#getSpecified()}.
*/
public boolean getSpecified() {
return true;
}
/**
* Returns a text representation of this object.
*/
public String toString() {
return "#" + getValue();
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/DefaultLangCondition.java
Index: DefaultLangCondition.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
import org.w3c.css.sac.LangCondition;
/**
* This class provides an implementation of the
* {@link org.w3c.css.sac.LangCondition} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: DefaultLangCondition.java,v 1.1 2002/02/20 12:53:21 hillion Exp $
*/
public class DefaultLangCondition implements LangCondition {
/**
* The language.
*/
protected String lang;
/**
* Creates a new LangCondition object.
*/
public DefaultLangCondition(String lang) {
this.lang = lang;
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.Condition#getConditionType()}.
*/
public short getConditionType() {
return SAC_LANG_CONDITION;
}
/**
* <b>SAC</b>: Implements {@link org.w3c.css.sac.LangCondition#getLang()}.
*/
public String getLang() {
return lang;
}
/**
* Returns a text representation of this object.
*/
public String toString() {
return ":lang(" + lang + ")";
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/DefaultOneOfAttributeCondition.java
Index: DefaultOneOfAttributeCondition.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
/**
* This class provides an implementation of the
* {@link org.w3c.css.sac.AttributeCondition} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: DefaultOneOfAttributeCondition.java,v 1.1 2002/02/20 12:53:21
hillion Exp $
*/
public class DefaultOneOfAttributeCondition extends DefaultAttributeCondition {
/**
* Creates a new DefaultAttributeCondition object.
*/
public DefaultOneOfAttributeCondition(String localName,
String namespaceURI,
boolean specified,
String value) {
super(localName, namespaceURI, specified, value);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.Condition#getConditionType()}.
*/
public short getConditionType() {
return SAC_ONE_OF_ATTRIBUTE_CONDITION;
}
/**
* Returns a text representation of this object.
*/
public String toString() {
return "[" + getLocalName() + "~=\"" + getValue() + "\"]";
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/DefaultPseudoClassCondition.java
Index: DefaultPseudoClassCondition.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
/**
* This class provides an implementation of the
* {@link org.w3c.css.sac.AttributeCondition} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: DefaultPseudoClassCondition.java,v 1.1 2002/02/20 12:53:21 hillion
Exp $
*/
public class DefaultPseudoClassCondition extends AbstractAttributeCondition {
/**
* The namespaceURI.
*/
protected String namespaceURI;
/**
* Creates a new DefaultAttributeCondition object.
*/
public DefaultPseudoClassCondition(String namespaceURI, String value) {
super(value);
this.namespaceURI = namespaceURI;
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.Condition#getConditionType()}.
*/
public short getConditionType() {
return SAC_PSEUDO_CLASS_CONDITION;
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.AttributeCondition#getNamespaceURI()}.
*/
public String getNamespaceURI() {
return namespaceURI;
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.AttributeCondition#getLocalName()}.
*/
public String getLocalName() {
return null;
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.AttributeCondition#getSpecified()}.
*/
public boolean getSpecified() {
return false;
}
/**
* Returns a text representation of this object.
*/
public String toString() {
return ":" + getValue();
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/DefaultPseudoElementSelector.java
Index: DefaultPseudoElementSelector.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
/**
* This class implements the {@link org.w3c.css.sac.ElementSelector} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: DefaultPseudoElementSelector.java,v 1.1 2002/02/20 12:53:21 hillion
Exp $
*/
public class DefaultPseudoElementSelector extends AbstractElementSelector {
/**
* Creates a new ElementSelector object.
*/
public DefaultPseudoElementSelector(String uri, String name) {
super(uri, name);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.Selector#getSelectorType()}.
*/
public short getSelectorType() {
return SAC_PSEUDO_ELEMENT_SELECTOR;
}
/**
* Returns a representation of the selector.
*/
public String toString() {
return ":" + getLocalName();
}
}
1.1
xml-batik/sources/org/apache/batik/css/parser/DefaultSelectorFactory.java
Index: DefaultSelectorFactory.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.parser;
import org.w3c.css.sac.CSSException;
import org.w3c.css.sac.CharacterDataSelector;
import org.w3c.css.sac.Condition;
import org.w3c.css.sac.ConditionalSelector;
import org.w3c.css.sac.DescendantSelector;
import org.w3c.css.sac.ElementSelector;
import org.w3c.css.sac.NegativeSelector;
import org.w3c.css.sac.ProcessingInstructionSelector;
import org.w3c.css.sac.Selector;
import org.w3c.css.sac.SelectorFactory;
import org.w3c.css.sac.SiblingSelector;
import org.w3c.css.sac.SimpleSelector;
/**
* This class implements the {@link org.w3c.css.sac.SelectorFactory} interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
* @version $Id: DefaultSelectorFactory.java,v 1.1 2002/02/20 12:53:21 hillion Exp $
*/
public class DefaultSelectorFactory implements SelectorFactory {
/**
* The instance of this class.
*/
public final static SelectorFactory INSTANCE =
new DefaultSelectorFactory();
/**
* This class does not need to be instantiated.
*/
protected DefaultSelectorFactory() {
}
/**
* <b>SAC</b>: Implements {@link
* SelectorFactory#createConditionalSelector(SimpleSelector,Condition)}.
*/
public ConditionalSelector createConditionalSelector
(SimpleSelector selector,
Condition condition)
throws CSSException {
return new DefaultConditionalSelector(selector, condition);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.SelectorFactory#createAnyNodeSelector()}.
*/
public SimpleSelector createAnyNodeSelector() throws CSSException {
throw new CSSException("Not implemented in CSS2");
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.SelectorFactory#createRootNodeSelector()}.
*/
public SimpleSelector createRootNodeSelector() throws CSSException {
throw new CSSException("Not implemented in CSS2");
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.SelectorFactory#createNegativeSelector(SimpleSelector)}.
*/
public NegativeSelector createNegativeSelector(SimpleSelector selector)
throws CSSException {
throw new CSSException("Not implemented in CSS2");
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.SelectorFactory#createElementSelector(String,String)}.
*/
public ElementSelector createElementSelector(String namespaceURI,
String tagName)
throws CSSException {
return new DefaultElementSelector(namespaceURI, tagName);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.SelectorFactory#createTextNodeSelector(String)}.
*/
public CharacterDataSelector createTextNodeSelector(String data)
throws CSSException {
throw new CSSException("Not implemented in CSS2");
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.SelectorFactory#createCDataSectionSelector(String)}.
*/
public CharacterDataSelector createCDataSectionSelector(String data)
throws CSSException {
throw new CSSException("Not implemented in CSS2");
}
/**
* <b>SAC</b>: Implements {@link
* SelectorFactory#createProcessingInstructionSelector(String,String)}.
*/
public ProcessingInstructionSelector createProcessingInstructionSelector
(String target,
String data) throws CSSException {
throw new CSSException("Not implemented in CSS2");
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.SelectorFactory#createCommentSelector(String)}.
*/
public CharacterDataSelector createCommentSelector(String data)
throws CSSException {
throw new CSSException("Not implemented in CSS2");
}
/**
* <b>SAC</b>: Implements {@link
* SelectorFactory#createPseudoElementSelector(String,String)}.
*/
public ElementSelector createPseudoElementSelector(String namespaceURI,
String pseudoName)
throws CSSException {
return new DefaultPseudoElementSelector(namespaceURI, pseudoName);
}
/**
* <b>SAC</b>: Implements {@link
* SelectorFactory#createDescendantSelector(Selector,SimpleSelector)}.
*/
public DescendantSelector createDescendantSelector
(Selector parent,
SimpleSelector descendant)
throws CSSException {
return new DefaultDescendantSelector(parent, descendant);
}
/**
* <b>SAC</b>: Implements {@link
* SelectorFactory#createChildSelector(Selector,SimpleSelector)}.
*/
public DescendantSelector createChildSelector(Selector parent,
SimpleSelector child)
throws CSSException {
return new DefaultChildSelector(parent, child);
}
/**
* <b>SAC</b>: Implements {@link
* SelectorFactory#createDirectAdjacentSelector(short,Selector,SimpleSelector)}.
*/
public SiblingSelector createDirectAdjacentSelector
(short nodeType,
Selector child,
SimpleSelector directAdjacent)
throws CSSException {
return new DefaultDirectAdjacentSelector(nodeType, child,
directAdjacent);
}
}
1.20 +2 -1 xml-batik/sources/org/apache/batik/util/CSSConstants.java
Index: CSSConstants.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/util/CSSConstants.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- CSSConstants.java 11 Feb 2002 13:14:30 -0000 1.19
+++ CSSConstants.java 20 Feb 2002 12:53:22 -0000 1.20
@@ -13,7 +13,7 @@
* Important: Constants must not contain uppercase characters.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a>
- * @version $Id: CSSConstants.java,v 1.19 2002/02/11 13:14:30 hillion Exp $
+ * @version $Id: CSSConstants.java,v 1.20 2002/02/20 12:53:22 hillion Exp $
*/
public interface CSSConstants {
@@ -60,6 +60,7 @@
String CSS_KERNING_PROPERTY = "kerning";
String CSS_LETTER_SPACING_PROPERTY = "letter-spacing";
String CSS_LIGHTING_COLOR_PROPERTY = "lighting-color";
+ String CSS_LINE_HEIGHT_PROPERTY = "line-height";
String CSS_MARKER_PROPERTY = "marker";
String CSS_MARKER_END_PROPERTY = "marker-end";
String CSS_MARKER_MID_PROPERTY = "marker-mid";
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]