001 /*
002 * This file is part of the Echo Point Project. This project is a collection
003 * of Components that have extended the Echo Web Application Framework.
004 *
005 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
006 *
007 * The contents of this file are subject to the Mozilla Public License Version
008 * 1.1 (the "License"); you may not use this file except in compliance with
009 * the License. You may obtain a copy of the License at
010 * http://www.mozilla.org/MPL/
011 *
012 * Software distributed under the License is distributed on an "AS IS" basis,
013 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
014 * for the specific language governing rights and limitations under the
015 * License.
016 *
017 * Alternatively, the contents of this file may be used under the terms of
018 * either the GNU General Public License Version 2 or later (the "GPL"), or
019 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
020 * in which case the provisions of the GPL or the LGPL are applicable instead
021 * of those above. If you wish to allow use of your version of this file only
022 * under the terms of either the GPL or the LGPL, and not to allow others to
023 * use your version of this file under the terms of the MPL, indicate your
024 * decision by deleting the provisions above and replace them with the notice
025 * and other provisions required by the GPL or the LGPL. If you do not delete
026 * the provisions above, a recipient may use your version of this file under
027 * the terms of any one of the MPL, the GPL or the LGPL.
028 */
029 package echopoint;
030
031 import nextapp.echo.app.Border;
032 import nextapp.echo.app.Extent;
033 import nextapp.echo.app.Insets;
034 import echopoint.able.*;
035
036 /**
037 * <code>AbleComponent</code> is an abstract Component that implements
038 * a number of the 'able interfaces and serves as the base for other components
039 */
040
041 public abstract class AbleComponent extends ComponentEx implements AccessKeyable, Borderable, MouseCursorable, Insetable, Sizeable, ToolTipable {
042
043 /**
044 * @see echopoint.able.AccessKeyable#getAccessKey()
045 */
046 public String getAccessKey() {
047 return (String) get(PROPERTY_ACCESS_KEY);
048 }
049
050 /**
051 *
052 * @see echopoint.able.Borderable#getBorder()
053 */
054 public Border getBorder() {
055 return (Border) get(PROPERTY_BORDER);
056 }
057
058 /**
059 * @see echopoint.able.Heightable#getHeight()
060 */
061 public Extent getHeight() {
062 return (Extent) get(PROPERTY_HEIGHT);
063 }
064
065 /**
066 * @see echopoint.able.Insetable#getInsets()
067 */
068 public Insets getInsets() {
069 return (Insets) get(PROPERTY_INSETS);
070 }
071
072 /**
073 * @see echopoint.able.MouseCursorable#getMouseCursor()
074 */
075 public int getMouseCursor() {
076 return get(PROPERTY_MOUSE_CURSOR,CURSOR_AUTO);
077 }
078
079 /**
080 * @see echopoint.able.MouseCursorable#getMouseCursorUri()
081 */
082 public String getMouseCursorUri() {
083 return (String) get(PROPERTY_MOUSE_CURSOR_URI);
084 }
085
086 /**
087 * @see echopoint.able.Insetable#getOutsets()
088 */
089 public Insets getOutsets() {
090 return (Insets) get(PROPERTY_OUTSETS);
091 }
092
093 /**
094 * @see echopoint.able.Widthable#getWidth()
095 */
096 public Extent getWidth() {
097 return (Extent) get(PROPERTY_WIDTH);
098 }
099
100 /**
101 * @see echopoint.able.AccessKeyable#setAccessKey(java.lang.String)
102 */
103 public void setAccessKey(String newValue) {
104 set(PROPERTY_ACCESS_KEY,newValue);
105 }
106
107 /**
108 * @see echopoint.able.Borderable#setBorder(nextapp.echo.app.Border)
109 */
110 public void setBorder(Border newValue) {
111 set(PROPERTY_BORDER,newValue);
112 }
113
114 /**
115 * @see echopoint.able.Heightable#setHeight(nextapp.echo.app.Extent)
116 */
117 public void setHeight(Extent newValue) {
118 set(PROPERTY_HEIGHT,newValue);
119 }
120
121 /**
122 * @see echopoint.able.Insetable#setInsets(nextapp.echo.app.Insets)
123 */
124 public void setInsets(Insets newValue) {
125 set(PROPERTY_INSETS,newValue);
126 }
127
128 /**
129 * @see echopoint.able.MouseCursorable#setMouseCursor(int)
130 */
131 public void setMouseCursor(int mouseCursor) {
132 set(PROPERTY_MOUSE_CURSOR,mouseCursor);
133 }
134
135 /**
136 * @see echopoint.able.MouseCursorable#setMouseCursorUri(java.lang.String)
137 */
138 public void setMouseCursorUri(String mouseCursorURI) {
139 set(PROPERTY_MOUSE_CURSOR_URI,mouseCursorURI);
140 }
141
142 /**
143 * @see echopoint.able.Insetable#setOutsets(nextapp.echo.app.Insets)
144 */
145 public void setOutsets(Insets newValue) {
146 set(PROPERTY_OUTSETS,newValue);
147 }
148
149 /**
150 * @see echopoint.able.Widthable#setWidth(nextapp.echo.app.Extent)
151 */
152 public void setWidth(Extent newValue) {
153 set(PROPERTY_WIDTH,newValue);
154 }
155
156 /**
157 * @see echopoint.able.ToolTipable#getToolTipText()
158 */
159 public String getToolTipText() {
160 return (String) get(PROPERTY_TOOL_TIP_TEXT);
161 }
162
163 /**
164 * @see echopoint.able.ToolTipable#setToolTipText(java.lang.String)
165 */
166 public void setToolTipText(String newValue) {
167 set(PROPERTY_TOOL_TIP_TEXT, newValue);
168
169 }
170 }