2 Copyright (C) 2002 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
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)
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.
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
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
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. */
44 import javax
.accessibility
.*;
45 import javax
.swing
.plaf
.*;
49 * @author Andrew Selkirk
52 public class JToolBar
extends JComponent
53 implements SwingConstants
, Accessible
56 //-------------------------------------------------------------
57 // Classes ----------------------------------------------------
58 //-------------------------------------------------------------
63 protected class AccessibleJToolBar
extends AccessibleJComponent
{
65 //-------------------------------------------------------------
66 // Initialization ---------------------------------------------
67 //-------------------------------------------------------------
70 * Constructor AccessibleJToolBar
71 * @param component TODO
73 protected AccessibleJToolBar(JToolBar component
) {
76 } // AccessibleJToolBar()
79 //-------------------------------------------------------------
80 // Methods ----------------------------------------------------
81 //-------------------------------------------------------------
84 * getAccessibleStateSet
85 * @returns AccessibleStateSet
87 public AccessibleStateSet
getAccessibleStateSet() {
89 } // getAccessibleStateSet()
93 * @returns AccessibleRole
95 public AccessibleRole
getAccessibleRole() {
96 return AccessibleRole
.TOOL_BAR
;
97 } // getAccessibleRole()
100 } // AccessibleJToolBar
105 public static class Separator
extends JSeparator
{
107 //-------------------------------------------------------------
108 // Variables --------------------------------------------------
109 //-------------------------------------------------------------
114 private Dimension size
;
117 //-------------------------------------------------------------
118 // Initialization ---------------------------------------------
119 //-------------------------------------------------------------
122 * Constructor Separator
129 * Constructor Separator
132 public Separator(Dimension size
) {
137 //-------------------------------------------------------------
138 // Methods ----------------------------------------------------
139 //-------------------------------------------------------------
145 public String
getUIClassID() {
153 public Dimension
getPreferredSize() {
155 } // getPreferredSize()
161 public Dimension
getMaximumSize() {
163 } // getMaximumSize()
169 public Dimension
getMinimumSize() {
171 } // getMinimumSize()
177 public Dimension
getSeparatorSize() {
179 } // getSeparatorSize()
185 public void setSeparatorSize(Dimension size
) {
187 } // setSeparatorSize()
193 //-------------------------------------------------------------
194 // Variables --------------------------------------------------
195 //-------------------------------------------------------------
200 private static final String uiClassID
= "ToolBarUI";
205 private boolean paintBorder
;
210 private Insets margin
;
215 private boolean floatable
;
220 private int orientation
;
223 //-------------------------------------------------------------
224 // Initialization ---------------------------------------------
225 //-------------------------------------------------------------
228 * Constructor JToolBar
235 * Constructor JToolBar
236 * @param orientation TODO
238 public JToolBar(int orientation
) {
243 * Constructor JToolBar
246 public JToolBar(String name
) {
251 * Constructor JToolBar
253 * @param orientation TODO
255 public JToolBar(String name
, int orientation
) {
260 //-------------------------------------------------------------
261 // Methods ----------------------------------------------------
262 //-------------------------------------------------------------
267 * @exception IOException TODO
269 private void writeObject(ObjectOutputStream stream
) throws IOException
{
278 public JButton
add(Action action
) {
284 * @param graphics TODO
286 protected void paintBorder(Graphics graphics
) {
294 public ToolBarUI
getUI() {
295 return (ToolBarUI
) ui
;
302 public void setUI(ToolBarUI ui
) {
309 public void updateUI() {
310 setUI((ToolBarUI
) UIManager
.get(this));
318 public String
getUIClassID() {
324 * @param component TODO
327 public int getComponentIndex(Component component
) {
329 } // getComponentIndex()
332 * getComponentAtIndex
336 public Component
getComponentAtIndex(int index
) {
338 } // getComponentAtIndex()
344 public Insets
getMargin() {
352 public void setMargin(Insets margin
) {
360 public boolean isBorderPainted() {
361 return false; // TODO
362 } // isBorderPainted()
366 * @param painted TODO
368 public void setBorderPainted(boolean painted
) {
370 } // setBorderPainted()
376 public boolean isFloatable() {
377 return false; // TODO
382 * @param floatable TODO
384 public void setFloatable(boolean floatable
) {
392 public int getOrientation() {
394 } // getOrientation()
398 * @param orientation TODO
400 public void setOrientation(int orientation
) {
402 } // setOrientation()
407 public void addSeparator() {
415 public void addSeparator(Dimension size
) {
420 * createActionComponent
424 protected JButton
createActionComponent(Action action
) {
426 } // createActionComponent()
429 * createActionChangeListener
431 * @returns PropertyChangeListener
433 protected PropertyChangeListener
createActionChangeListener(JButton button
) {
435 } // createActionChangeListener()
439 * @param component TODO
440 * @param constraints TODO
443 protected void addImpl(Component component
, Object constraints
, int index
) {
451 protected String
paramString() {
456 * getAccessibleContext
457 * @returns AccessibleContext
459 public AccessibleContext
getAccessibleContext() {
460 if (accessibleContext
== null) {
461 accessibleContext
= new AccessibleJToolBar(this);
463 return accessibleContext
;
464 } // getAccessibleContext()