001    package echopoint.able;
002    /* 
003     * This file is part of the Echo Point Project.  This project is a collection
004     * of Components that have extended the Echo Web Application Framework.
005     *
006     * Version: MPL 1.1/GPL 2.0/LGPL 2.1
007     *
008     * The contents of this file are subject to the Mozilla Public License Version
009     * 1.1 (the "License"); you may not use this file except in compliance with
010     * the License. You may obtain a copy of the License at
011     * http://www.mozilla.org/MPL/
012     *
013     * Software distributed under the License is distributed on an "AS IS" basis,
014     * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
015     * for the specific language governing rights and limitations under the
016     * License.
017     *
018     * Alternatively, the contents of this file may be used under the terms of
019     * either the GNU General Public License Version 2 or later (the "GPL"), or
020     * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
021     * in which case the provisions of the GPL or the LGPL are applicable instead
022     * of those above. If you wish to allow use of your version of this file only
023     * under the terms of either the GPL or the LGPL, and not to allow others to
024     * use your version of this file under the terms of the MPL, indicate your
025     * decision by deleting the provisions above and replace them with the notice
026     * and other provisions required by the GPL or the LGPL. If you do not delete
027     * the provisions above, a recipient may use your version of this file under
028     * the terms of any one of the MPL, the GPL or the LGPL.
029     */
030    
031    import java.beans.PropertyChangeListener;
032    import java.beans.PropertyChangeSupport;
033    import java.io.Serializable;
034    
035    import nextapp.echo.app.Color;
036    
037    
038    /**
039     * <code>ScrollBarProperties</code> is used to contain
040     * colors for scroll bars.  Not that setting the scrollbar
041     * colors may not work an all client agents.
042     * <p>
043     * The scroll box is the square box within a scroll bar that can be 
044     * moved either up and down or left and right on a track to 
045     * change the position of the content on the screen. The scroll arrows, 
046     * located at each end of a scroll bar, are the square buttons 
047     * containing the arrows that move the content on the screen in 
048     * small increments, either up and down or left and right.
049     * <p>
050     * The gutter is the space between the track and the bottom and 
051     * right edges of the scroll box and scroll arrows of the scroll 
052     * bar. The scrollbar darkShadowColor appears outside the 
053     * scrollbar shadowColor. The track is the element of a scroll bar 
054     * on which the scroll box can slide either up and down or left and right.
055     * <p>
056     * The scroll arrows, located at each end of a scroll bar, are the 
057     * square buttons containing the arrows that move the content on 
058     * the screen in small increments, either up and down or left and 
059     * right.
060     *  
061     */
062    public class ScrollBarProperties implements Serializable {
063    
064            private Color threeDLightColor;
065            private Color arrowColor;
066            private Color baseColor;
067            private Color darkShadowColor;
068            private Color faceColor;
069            private Color hilightColor;
070            private Color shadowColor;
071            
072        private PropertyChangeSupport pcs = new PropertyChangeSupport(this);
073            
074            /**
075             * Constructs a <code>ScrollBarProperties</code> 
076             */
077            public ScrollBarProperties() {
078                    super();
079            }
080    
081            /**
082             * Constructs a <code>ScrollBarProperties</code> with the specified base
083             * color.
084             * @param baseColor - the base color to use 
085             */
086            public ScrollBarProperties(Color baseColor) {
087                    super();
088                    setBaseColor(baseColor);
089            }
090            
091            /**
092             * Adds a property change listener.
093             *
094             * @param l The listener to add.
095             */
096            public void addPropertyChangeListener(PropertyChangeListener l) {
097                pcs.addPropertyChangeListener(l);
098            }
099    
100            /**
101             * Removes a property change listener.
102             *
103             * @param l The listener to remove.
104             */
105            public void removePropertyChangeListener(PropertyChangeListener l) {
106                pcs.removePropertyChangeListener(l);
107            }
108            
109            /**
110             * @return the color of the arrow elements of a scroll arrow.
111             */
112            public Color getArrowColor() {
113                    return arrowColor;
114            }
115            /**
116             * Sets the color of the arrow elements of a scroll arrow.
117             * @param newValue -  The newValue to set.
118             */
119            public void setArrowColor(Color newValue) {
120                    Object oldValue = this.arrowColor;
121                    this.arrowColor = newValue;
122                    pcs.firePropertyChange("arrowColor", oldValue, newValue);
123            }
124            /**
125             * @return  the color of the main elements of a scroll bar, which include the scroll box, track, and scroll arrows.
126             */
127            public Color getBaseColor() {
128                    return baseColor;
129            }
130            /**
131             * Sets the color of the main elements of a scroll bar, which include the scroll box, track, and scroll arrows.
132             * This can be set in isolation to quickly set the main colors of the scroll bar.
133             * 
134             * @param newValue -  The newValue to set.
135             */
136            public void setBaseColor(Color newValue) {
137                    Object oldValue = this.baseColor;
138                    this.baseColor = newValue;
139                    pcs.firePropertyChange("baseColor", oldValue, newValue);
140            }
141            /**
142             * @return the color of the gutter of a scroll bar.
143             */
144            public Color getDarkShadowColor() {
145                    return darkShadowColor;
146            }
147            /**
148             * Sets the color of the gutter of a scroll bar.
149             * @param newValue -  The newValue to set.
150             */
151            public void setDarkShadowColor(Color newValue) {
152                    Object oldValue = this.darkShadowColor;
153                    this.darkShadowColor = newValue;
154                    pcs.firePropertyChange("darkShadow", oldValue, newValue);
155            }
156            /**
157             * @return the color of the scroll box and scroll arrows of a scroll bar.
158             */
159            public Color getFaceColor() {
160                    return faceColor;
161            }
162            /**
163             * Sets the color of the scroll box and scroll arrows of a scroll bar.
164             * @param newValue -  The newValue to set.
165             */
166            public void setFaceColor(Color newValue) {
167                    Object oldValue = this.faceColor;
168                    this.faceColor = newValue;
169                    pcs.firePropertyChange("faceColor", oldValue, newValue);
170            }
171            /**
172             * @return the color of the top and left edges of the scroll box and scroll arrows of a scroll bar.
173             */
174            public Color getHilightColor() {
175                    return hilightColor;
176            }
177            /**
178             * Sets the color of the top and left edges of the scroll box and scroll arrows of a scroll bar.
179             * @param newValue -  The newValue to set.
180             */
181            public void setHilightColor(Color newValue) {
182                    Object oldValue = this.hilightColor;
183                    this.hilightColor = newValue;
184                    pcs.firePropertyChange("hilightColor", oldValue, newValue);
185            }
186            /**
187             * @return the color of the bottom and right edges of the scroll box and scroll arrows of a scroll bar.
188             */
189            public Color getShadowColor() {
190                    return shadowColor;
191            }
192            /**
193             * Sets the color of the bottom and right edges of the scroll box and scroll arrows of a scroll bar.
194             * @param newValue -  The newValue to set.
195             */
196            public void setShadowColor(Color newValue) {
197                    Object oldValue = this.shadowColor;
198                    this.shadowColor = newValue;
199                    pcs.firePropertyChange("shadowColor", oldValue, newValue);
200            }
201            /**
202             * @return the color of the top and left edges of the scroll box and 
203             * scroll arrows of a scroll bar.
204             */
205            public Color getThreeDLightColor() {
206                    return threeDLightColor;
207            }
208            /**
209             * Sets the color of the top and left edges of the scroll box and 
210             * scroll arrows of a scroll bar.
211             * @param newValue -  The newValue to set.
212             */
213            public void setThreeDLightColor(Color newValue) {
214                    Object oldValue = this.threeDLightColor;
215                    this.threeDLightColor = newValue;
216                    pcs.firePropertyChange("threeDLightColor", oldValue, newValue);
217            }
218    }