diff options
author | Florian Thienel | 2010-11-10 22:00:46 +0000 |
---|---|---|
committer | Florian Thienel | 2010-11-10 22:00:46 +0000 |
commit | 82c4021ac2b0b38e4aaa74b1d252949f1498c130 (patch) | |
tree | 846dddb5cd4b94d94d4c5efdd3cd187b437dfba9 | |
parent | c3007e87e1b612db4f48a00197f84b92e9bf1072 (diff) | |
download | org.eclipse.mylyn.docs.vex-82c4021ac2b0b38e4aaa74b1d252949f1498c130.tar.gz org.eclipse.mylyn.docs.vex-82c4021ac2b0b38e4aaa74b1d252949f1498c130.tar.xz org.eclipse.mylyn.docs.vex-82c4021ac2b0b38e4aaa74b1d252949f1498c130.zip |
bug 329636 use LengthProperty to represent width and height
Signed-off-by: Florian Thienel <florian@thienel.org>
4 files changed, 6 insertions, 70 deletions
diff --git a/sourceediting/plugins/org.eclipse.wst.xml.vex.core/src/org/eclipse/wst/xml/vex/core/internal/css/HeightProperty.java b/sourceediting/plugins/org.eclipse.wst.xml.vex.core/src/org/eclipse/wst/xml/vex/core/internal/css/HeightProperty.java deleted file mode 100644 index bba7bc22..00000000 --- a/sourceediting/plugins/org.eclipse.wst.xml.vex.core/src/org/eclipse/wst/xml/vex/core/internal/css/HeightProperty.java +++ /dev/null @@ -1,29 +0,0 @@ -/*******************************************************************************
- * Copyright (c) 2010 Mohamadou Nassourou and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mohamadou Nassourou - Bug 298912 - rudimentary support for images
- *******************************************************************************/
-package org.eclipse.wst.xml.vex.core.internal.css;
-
-import org.eclipse.wst.xml.vex.core.internal.provisional.dom.I.VEXElement;
-import org.w3c.css.sac.LexicalUnit;
-
-public class HeightProperty extends AbstractProperty {
-
- public static final float DEFAULT = 50.0f;
-
- public HeightProperty() {
- super(CSS.HEIGHT);
- }
-
- public Object calculate(final LexicalUnit lexicalUnit, final Styles parentStyles, final Styles styles, VEXElement element) {
- if (lexicalUnit != null)
- return new Float(Math.max(DEFAULT, lexicalUnit.getFloatValue()));
- return DEFAULT;
- }
-}
\ No newline at end of file diff --git a/sourceediting/plugins/org.eclipse.wst.xml.vex.core/src/org/eclipse/wst/xml/vex/core/internal/css/StyleSheet.java b/sourceediting/plugins/org.eclipse.wst.xml.vex.core/src/org/eclipse/wst/xml/vex/core/internal/css/StyleSheet.java index ce468374..93c05b2e 100644 --- a/sourceediting/plugins/org.eclipse.wst.xml.vex.core/src/org/eclipse/wst/xml/vex/core/internal/css/StyleSheet.java +++ b/sourceediting/plugins/org.eclipse.wst.xml.vex.core/src/org/eclipse/wst/xml/vex/core/internal/css/StyleSheet.java @@ -94,8 +94,8 @@ public class StyleSheet { CSS.BORDER_RIGHT_STYLE, IProperty.AXIS_HORIZONTAL), new BorderWidthProperty(CSS.BORDER_TOP_WIDTH, CSS.BORDER_TOP_STYLE, IProperty.AXIS_VERTICAL), new BorderSpacingProperty(), - new HeightProperty(), - new WidthProperty(), + new LengthProperty(CSS.HEIGHT, IProperty.AXIS_VERTICAL), + new LengthProperty(CSS.WIDTH, IProperty.AXIS_HORIZONTAL), new BackgroundImageProperty() }; diff --git a/sourceediting/plugins/org.eclipse.wst.xml.vex.core/src/org/eclipse/wst/xml/vex/core/internal/css/Styles.java b/sourceediting/plugins/org.eclipse.wst.xml.vex.core/src/org/eclipse/wst/xml/vex/core/internal/css/Styles.java index b8727a65..4aa08a2f 100644 --- a/sourceediting/plugins/org.eclipse.wst.xml.vex.core/src/org/eclipse/wst/xml/vex/core/internal/css/Styles.java +++ b/sourceediting/plugins/org.eclipse.wst.xml.vex.core/src/org/eclipse/wst/xml/vex/core/internal/css/Styles.java @@ -263,18 +263,12 @@ public class Styles { this.font = font; } - public float getElementWidth() { - final Float value = (Float) this.values.get(CSS.WIDTH); - if (value == null) - return WidthProperty.DEFAULT; - return value.floatValue(); + public RelativeLength getElementWidth() { + return (RelativeLength) this.values.get(CSS.WIDTH); } - public float getElementHeight() { - final Float value = (Float) this.values.get(CSS.HEIGHT); - if (value == null) - return HeightProperty.DEFAULT; - return value.floatValue(); + public RelativeLength getElementHeight() { + return (RelativeLength) this.values.get(CSS.HEIGHT); } public boolean hasBackgroundImage() { diff --git a/sourceediting/plugins/org.eclipse.wst.xml.vex.core/src/org/eclipse/wst/xml/vex/core/internal/css/WidthProperty.java b/sourceediting/plugins/org.eclipse.wst.xml.vex.core/src/org/eclipse/wst/xml/vex/core/internal/css/WidthProperty.java deleted file mode 100644 index c9dfa9fe..00000000 --- a/sourceediting/plugins/org.eclipse.wst.xml.vex.core/src/org/eclipse/wst/xml/vex/core/internal/css/WidthProperty.java +++ /dev/null @@ -1,29 +0,0 @@ -/*******************************************************************************
- * Copyright (c) 2010 Mohamadou Nassourou and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mohamadou Nassourou - Bug 298912 - rudimentary support for images
- *******************************************************************************/
-package org.eclipse.wst.xml.vex.core.internal.css;
-
-import org.eclipse.wst.xml.vex.core.internal.provisional.dom.I.VEXElement;
-import org.w3c.css.sac.LexicalUnit;
-
-public class WidthProperty extends AbstractProperty {
-
- public static final float DEFAULT = 50.0f;
-
- public WidthProperty() {
- super(CSS.WIDTH);
- }
-
- public Object calculate(final LexicalUnit lexicalUnit, final Styles parentStyles, final Styles styles, VEXElement element) {
- if (lexicalUnit != null)
- return new Float(Math.max(DEFAULT, lexicalUnit.getFloatValue()));
- return DEFAULT;
- }
-}
\ No newline at end of file |