| 1 | /* JSeparator.java --
|
|---|
| 2 | Copyright (C) 2002 Free Software Foundation, Inc.
|
|---|
| 3 |
|
|---|
| 4 | This file is part of GNU Classpath.
|
|---|
| 5 |
|
|---|
| 6 | GNU Classpath is free software; you can redistribute it and/or modify
|
|---|
| 7 | it under the terms of the GNU General Public License as published by
|
|---|
| 8 | the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 9 | any later version.
|
|---|
| 10 |
|
|---|
| 11 | GNU Classpath is distributed in the hope that it will be useful, but
|
|---|
| 12 | WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|---|
| 14 | General Public License for more details.
|
|---|
| 15 |
|
|---|
| 16 | You should have received a copy of the GNU General Public License
|
|---|
| 17 | along with GNU Classpath; see the file COPYING. If not, write to the
|
|---|
| 18 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|---|
| 19 | 02111-1307 USA.
|
|---|
| 20 |
|
|---|
| 21 | Linking this library statically or dynamically with other modules is
|
|---|
| 22 | making a combined work based on this library. Thus, the terms and
|
|---|
| 23 | conditions of the GNU General Public License cover the whole
|
|---|
| 24 | combination.
|
|---|
| 25 |
|
|---|
| 26 | As a special exception, the copyright holders of this library give you
|
|---|
| 27 | permission to link this library with independent modules to produce an
|
|---|
| 28 | executable, regardless of the license terms of these independent
|
|---|
| 29 | modules, and to copy and distribute the resulting executable under
|
|---|
| 30 | terms of your choice, provided that you also meet, for each linked
|
|---|
| 31 | independent module, the terms and conditions of the license of that
|
|---|
| 32 | module. An independent module is a module which is not derived from
|
|---|
| 33 | or based on this library. If you modify this library, you may extend
|
|---|
| 34 | this exception to your version of the library, but you are not
|
|---|
| 35 | obligated to do so. If you do not wish to do so, delete this
|
|---|
| 36 | exception statement from your version. */
|
|---|
| 37 |
|
|---|
| 38 | package javax.swing;
|
|---|
| 39 |
|
|---|
| 40 | // Imports
|
|---|
| 41 | import java.io.*;
|
|---|
| 42 | import javax.accessibility.*;
|
|---|
| 43 | import javax.swing.plaf.*;
|
|---|
| 44 |
|
|---|
| 45 | /**
|
|---|
| 46 | * JSeparator
|
|---|
| 47 | * @author Andrew Selkirk
|
|---|
| 48 | * @version 1.0
|
|---|
| 49 | */
|
|---|
| 50 | public class JSeparator extends JComponent
|
|---|
| 51 | implements SwingConstants, Accessible {
|
|---|
| 52 |
|
|---|
| 53 | //-------------------------------------------------------------
|
|---|
| 54 | // Classes ----------------------------------------------------
|
|---|
| 55 | //-------------------------------------------------------------
|
|---|
| 56 |
|
|---|
| 57 | /**
|
|---|
| 58 | * AccessibleJSeparator
|
|---|
| 59 | */
|
|---|
| 60 | protected class AccessibleJSeparator extends AccessibleJComponent {
|
|---|
| 61 |
|
|---|
| 62 | //-------------------------------------------------------------
|
|---|
| 63 | // Variables --------------------------------------------------
|
|---|
| 64 | //-------------------------------------------------------------
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 | //-------------------------------------------------------------
|
|---|
| 68 | // Initialization ---------------------------------------------
|
|---|
| 69 | //-------------------------------------------------------------
|
|---|
| 70 |
|
|---|
| 71 | /**
|
|---|
| 72 | * Constructor AccessibleJSeparator
|
|---|
| 73 | * @param component TODO
|
|---|
| 74 | */
|
|---|
| 75 | protected AccessibleJSeparator(JSeparator component) {
|
|---|
| 76 | super(component);
|
|---|
| 77 | // TODO
|
|---|
| 78 | } // AccessibleJSeparator()
|
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 | //-------------------------------------------------------------
|
|---|
| 82 | // Methods ----------------------------------------------------
|
|---|
| 83 | //-------------------------------------------------------------
|
|---|
| 84 |
|
|---|
| 85 | /**
|
|---|
| 86 | * getAccessibleRole
|
|---|
| 87 | * @returns AccessibleRole
|
|---|
| 88 | */
|
|---|
| 89 | public AccessibleRole getAccessibleRole() {
|
|---|
| 90 | return AccessibleRole.SEPARATOR;
|
|---|
| 91 | } // getAccessibleRole()
|
|---|
| 92 |
|
|---|
| 93 |
|
|---|
| 94 | } // AccessibleJSeparator
|
|---|
| 95 |
|
|---|
| 96 |
|
|---|
| 97 | //-------------------------------------------------------------
|
|---|
| 98 | // Variables --------------------------------------------------
|
|---|
| 99 | //-------------------------------------------------------------
|
|---|
| 100 |
|
|---|
| 101 | /**
|
|---|
| 102 | * uiClassID
|
|---|
| 103 | */
|
|---|
| 104 | private static final String uiClassID = "SeparatorUI";
|
|---|
| 105 |
|
|---|
| 106 | /**
|
|---|
| 107 | * orientation
|
|---|
| 108 | */
|
|---|
| 109 | private int orientation;
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 | //-------------------------------------------------------------
|
|---|
| 113 | // Initialization ---------------------------------------------
|
|---|
| 114 | //-------------------------------------------------------------
|
|---|
| 115 |
|
|---|
| 116 | /**
|
|---|
| 117 | * Constructor JSeparator
|
|---|
| 118 | */
|
|---|
| 119 | public JSeparator() {
|
|---|
| 120 | this(HORIZONTAL);
|
|---|
| 121 | } // JSeparator()
|
|---|
| 122 |
|
|---|
| 123 | /**
|
|---|
| 124 | * Constructor JSeparator
|
|---|
| 125 | * @param value0 TODO
|
|---|
| 126 | */
|
|---|
| 127 | public JSeparator(int orientation) {
|
|---|
| 128 | this.orientation = orientation;
|
|---|
| 129 | // TODO
|
|---|
| 130 | } // JSeparator()
|
|---|
| 131 |
|
|---|
| 132 |
|
|---|
| 133 | //-------------------------------------------------------------
|
|---|
| 134 | // Methods ----------------------------------------------------
|
|---|
| 135 | //-------------------------------------------------------------
|
|---|
| 136 |
|
|---|
| 137 | /**
|
|---|
| 138 | * writeObject
|
|---|
| 139 | * @param stream TODO
|
|---|
| 140 | * @exception IOException TODO
|
|---|
| 141 | */
|
|---|
| 142 | private void writeObject(ObjectOutputStream stream) throws IOException {
|
|---|
| 143 | // TODO
|
|---|
| 144 | } // writeObject()
|
|---|
| 145 |
|
|---|
| 146 | /**
|
|---|
| 147 | * getUI
|
|---|
| 148 | * @returns SeparatorUI
|
|---|
| 149 | */
|
|---|
| 150 | public SeparatorUI getUI() {
|
|---|
| 151 | return (SeparatorUI) ui;
|
|---|
| 152 | } // getUI()
|
|---|
| 153 |
|
|---|
| 154 | /**
|
|---|
| 155 | * setUI
|
|---|
| 156 | * @param ui TODO
|
|---|
| 157 | */
|
|---|
| 158 | public void setUI(SeparatorUI ui) {
|
|---|
| 159 | super.setUI(ui);
|
|---|
| 160 | } // setUI()
|
|---|
| 161 |
|
|---|
| 162 | /**
|
|---|
| 163 | * updateUI
|
|---|
| 164 | */
|
|---|
| 165 | public void updateUI() {
|
|---|
| 166 | setUI((SeparatorUI) UIManager.get(this));
|
|---|
| 167 | invalidate();
|
|---|
| 168 | } // updateUI()
|
|---|
| 169 |
|
|---|
| 170 | /**
|
|---|
| 171 | * getUIClassID
|
|---|
| 172 | * @returns String
|
|---|
| 173 | */
|
|---|
| 174 | public String getUIClassID() {
|
|---|
| 175 | return uiClassID;
|
|---|
| 176 | } // getUIClassID()
|
|---|
| 177 |
|
|---|
| 178 | /**
|
|---|
| 179 | * getOrientation
|
|---|
| 180 | * @returns int
|
|---|
| 181 | */
|
|---|
| 182 | public int getOrientation() {
|
|---|
| 183 | return orientation;
|
|---|
| 184 | } // getOrientation()
|
|---|
| 185 |
|
|---|
| 186 | /**
|
|---|
| 187 | * setOrientation
|
|---|
| 188 | * @param orientation TODO
|
|---|
| 189 | */
|
|---|
| 190 | public void setOrientation(int orientation) {
|
|---|
| 191 | this.orientation = orientation;
|
|---|
| 192 | // TODO
|
|---|
| 193 | } // setOrientation()
|
|---|
| 194 |
|
|---|
| 195 | /**
|
|---|
| 196 | * paramString
|
|---|
| 197 | * @returns String
|
|---|
| 198 | */
|
|---|
| 199 | protected String paramString() {
|
|---|
| 200 | return null; // TODO
|
|---|
| 201 | } // paramString()
|
|---|
| 202 |
|
|---|
| 203 | /**
|
|---|
| 204 | * isFocusTraversable
|
|---|
| 205 | * @returns boolean
|
|---|
| 206 | */
|
|---|
| 207 | public boolean isFocusTraversable() {
|
|---|
| 208 | return false;
|
|---|
| 209 | } // isFocusTraversable()
|
|---|
| 210 |
|
|---|
| 211 | /**
|
|---|
| 212 | * getAccessibleContext
|
|---|
| 213 | * @returns AccessibleContext
|
|---|
| 214 | */
|
|---|
| 215 | public AccessibleContext getAccessibleContext() {
|
|---|
| 216 | if (accessibleContext == null) {
|
|---|
| 217 | accessibleContext = new AccessibleJSeparator(this);
|
|---|
| 218 | } // if
|
|---|
| 219 | return accessibleContext;
|
|---|
| 220 | } // getAccessibleContext()
|
|---|
| 221 |
|
|---|
| 222 |
|
|---|
| 223 | } // JSeparator
|
|---|