]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.g2d/src/org/simantics/g2d/svg/StyleDesc.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / svg / StyleDesc.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.g2d.svg;
13
14 //import org.apache.batik.util.CSSConstants;
15
16 /**
17  * @author Tuukka Lehtonen
18  */
19 public class StyleDesc {
20     
21     StrokeDesc stroke;
22     FillDesc fill;
23     double objectOpacity;
24     
25     public StyleDesc(StrokeDesc stroke, FillDesc fill) {
26         this(stroke, fill, 1.0);
27     }
28     
29     public StyleDesc(StrokeDesc stroke, FillDesc fill, double objectOpacity) {
30         if (objectOpacity < 0 || objectOpacity > 1)
31             throw new IllegalArgumentException("invalid object opacity: " + objectOpacity);
32         
33         this.stroke = stroke;
34         this.fill = fill;
35         this.objectOpacity = objectOpacity;
36     }
37     
38     public StrokeDesc getStroke() {
39         return stroke;
40     }
41
42     public FillDesc getFill() {
43         return fill;
44     }
45     
46     public double getObjectOpacity() {
47         return objectOpacity;
48     }
49     
50 //    public String toStyleString() {
51 //        String s = "";
52 //        if (objectOpacity >= 0.0 && objectOpacity < 1.0) {
53 //            s += CSSConstants.CSS_OPACITY_PROPERTY + ":" + objectOpacity + ";";
54 //        }
55 //        if (stroke != null)
56 //            s += stroke.toStyleString();
57 //        if (fill != null)
58 //            s += fill.toStyleString();
59 //        return s;
60 //    }
61
62 }