]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.g2d/src/org/simantics/g2d/svg/StyleDesc.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / svg / StyleDesc.java
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
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.g2d.svg;\r
13 \r
14 //import org.apache.batik.util.CSSConstants;\r
15 \r
16 /**\r
17  * @author Tuukka Lehtonen\r
18  */\r
19 public class StyleDesc {\r
20     \r
21     StrokeDesc stroke;\r
22     FillDesc fill;\r
23     double objectOpacity;\r
24     \r
25     public StyleDesc(StrokeDesc stroke, FillDesc fill) {\r
26         this(stroke, fill, 1.0);\r
27     }\r
28     \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
32         \r
33         this.stroke = stroke;\r
34         this.fill = fill;\r
35         this.objectOpacity = objectOpacity;\r
36     }\r
37     \r
38     public StrokeDesc getStroke() {\r
39         return stroke;\r
40     }\r
41 \r
42     public FillDesc getFill() {\r
43         return fill;\r
44     }\r
45     \r
46     public double getObjectOpacity() {\r
47         return objectOpacity;\r
48     }\r
49     \r
50 //    public String toStyleString() {\r
51 //        String s = "";\r
52 //        if (objectOpacity >= 0.0 && objectOpacity < 1.0) {\r
53 //            s += CSSConstants.CSS_OPACITY_PROPERTY + ":" + objectOpacity + ";";\r
54 //        }\r
55 //        if (stroke != null)\r
56 //            s += stroke.toStyleString();\r
57 //        if (fill != null)\r
58 //            s += fill.toStyleString();\r
59 //        return s;\r
60 //    }\r
61 \r
62 }\r