1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.g2d.svg;
\r
14 //import org.apache.batik.util.CSSConstants;
\r
17 * @author Tuukka Lehtonen
\r
19 public class StyleDesc {
\r
23 double objectOpacity;
\r
25 public StyleDesc(StrokeDesc stroke, FillDesc fill) {
\r
26 this(stroke, fill, 1.0);
\r
29 public StyleDesc(StrokeDesc stroke, FillDesc fill, double objectOpacity) {
\r
30 if (objectOpacity < 0 || objectOpacity > 1)
\r
31 throw new IllegalArgumentException("invalid object opacity: " + objectOpacity);
\r
33 this.stroke = stroke;
\r
35 this.objectOpacity = objectOpacity;
\r
38 public StrokeDesc getStroke() {
\r
42 public FillDesc getFill() {
\r
46 public double getObjectOpacity() {
\r
47 return objectOpacity;
\r
50 // public String toStyleString() {
\r
52 // if (objectOpacity >= 0.0 && objectOpacity < 1.0) {
\r
53 // s += CSSConstants.CSS_OPACITY_PROPERTY + ":" + objectOpacity + ";";
\r
55 // if (stroke != null)
\r
56 // s += stroke.toStyleString();
\r
57 // if (fill != null)
\r
58 // s += fill.toStyleString();
\r