1 /*
2  * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.  Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
10  *
11  * This code is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14  * version 2 for more details (a copy is included in the LICENSE file that
15  * accompanied this code).
16  *
17  * You should have received a copy of the GNU General Public License version
18  * 2 along with this work; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22  * or visit www.oracle.com if you need additional information or have any
23  * questions.
24  */
25 package javax.swing.plaf.nimbus;
26 
27 import java.awt.Color;
28 
29 /**
30  * ShadowEffect - base class with all the standard properties for shadow effects
31  *
32  * @author Created by Jasper Potts (Jun 18, 2007)
33  */
34 abstract class ShadowEffect extends Effect {
35     protected Color color = Color.BLACK;
36     /** Opacity a float 0-1 for percentage */
37     protected float opacity = 0.75f;
38     /** Angle in degrees between 0-360 */
39     protected int angle = 135;
40     /** Distance in pixels */
41     protected int distance = 5;
42     /** The shadow spread between 0-100 % */
43     protected int spread = 0;
44     /** Size in pixels */
45     protected int size = 5;
46 
47     // =================================================================================================================
48     // Bean methods
49 
getColor()50     Color getColor() {
51         return color;
52     }
53 
setColor(Color color)54     void setColor(Color color) {
55         Color old = getColor();
56         this.color = color;
57     }
58 
getOpacity()59     float getOpacity() {
60         return opacity;
61     }
62 
setOpacity(float opacity)63     void setOpacity(float opacity) {
64         float old = getOpacity();
65         this.opacity = opacity;
66     }
67 
getAngle()68     int getAngle() {
69         return angle;
70     }
71 
setAngle(int angle)72     void setAngle(int angle) {
73         int old = getAngle();
74         this.angle = angle;
75     }
76 
getDistance()77     int getDistance() {
78         return distance;
79     }
80 
setDistance(int distance)81     void setDistance(int distance) {
82         int old = getDistance();
83         this.distance = distance;
84     }
85 
getSpread()86     int getSpread() {
87         return spread;
88     }
89 
setSpread(int spread)90     void setSpread(int spread) {
91         int old = getSpread();
92         this.spread = spread;
93     }
94 
getSize()95     int getSize() {
96         return size;
97     }
98 
setSize(int size)99     void setSize(int size) {
100         int old = getSize();
101         this.size = size;
102     }
103 }
104