KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > java > swing > plaf > nimbus > ShadowEffect


1 /*
2  * @(#)ShadowEffect.java 1.2 07/12/12
3  *
4  * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package com.sun.java.swing.plaf.nimbus;
8
9 import java.awt.Color JavaDoc;
10
11 /**
12  * ShadowEffect - base class with all the standard properties for shadow effects
13  *
14  * @author Created by Jasper Potts (Jun 18, 2007)
15  * @version 1.0
16  */

17 abstract class ShadowEffect extends Effect {
18     protected Color JavaDoc color = Color.BLACK;
19     /** Opacity a float 0-1 for percentage */
20     protected float opacity = 0.75f;
21     /** Angle in degrees between 0-360 */
22     protected int angle = 135;
23     /** Distance in pixels */
24     protected int distance = 5;
25     /** The shadow spread between 0-100 % */
26     protected int spread = 0;
27     /** Size in pixels */
28     protected int size = 5;
29
30     // =================================================================================================================
31
// Bean methods
32

33     Color JavaDoc getColor() {
34         return color;
35     }
36
37     void setColor(Color JavaDoc color) {
38         Color JavaDoc old = getColor();
39         this.color = color;
40     }
41
42     float getOpacity() {
43         return opacity;
44     }
45
46     void setOpacity(float opacity) {
47         float old = getOpacity();
48         this.opacity = opacity;
49     }
50
51     int getAngle() {
52         return angle;
53     }
54
55     void setAngle(int angle) {
56         int old = getAngle();
57         this.angle = angle;
58     }
59
60     int getDistance() {
61         return distance;
62     }
63
64     void setDistance(int distance) {
65         int old = getDistance();
66         this.distance = distance;
67     }
68
69     int getSpread() {
70         return spread;
71     }
72
73     void setSpread(int spread) {
74         int old = getSpread();
75         this.spread = spread;
76     }
77
78     int getSize() {
79         return size;
80     }
81
82     void setSize(int size) {
83         int old = getSize();
84         this.size = size;
85     }
86 }
87
Popular Tags