]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/utils/CompositeStroke.java
G2DParentNode handles "undefined" child bounds separately
[simantics/platform.git] / bundles / org.simantics.scenegraph / src / org / simantics / scenegraph / utils / CompositeStroke.java
1 /*
2 Copyright 2006 Jerry Huxtable
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8    http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15  */
16
17 package org.simantics.scenegraph.utils;
18
19 import java.awt.Shape;
20 import java.awt.Stroke;
21
22 /**
23  * Taken from http://www.jhlabs.com/java/java2d/strokes/
24  */
25 public class CompositeStroke implements Stroke {
26     private final Stroke stroke1, stroke2;
27
28     public CompositeStroke( Stroke stroke1, Stroke stroke2 ) {
29         this.stroke1 = stroke1;
30         this.stroke2 = stroke2;
31     }
32
33     @Override
34     public Shape createStrokedShape( Shape shape ) {
35         return stroke2.createStrokedShape( stroke1.createStrokedShape( shape ) );
36     }
37 }