2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / libjava / javax / swing / plaf / basic / BasicSplitPaneUI.java
blob5c1c7f25e4f84c7feb2b516d2bf0a8e9c6435132
1 /* BasicSplitPaneUI.java
2 Copyright (C) 2003 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)
9 any later version.
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
19 02111-1307 USA.
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.
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. */
38 package javax.swing.plaf.basic;
40 import java.awt.Component;
41 import java.awt.Dimension;
42 import java.awt.Graphics;
43 import java.awt.Insets;
44 import java.awt.event.ActionListener;
45 import java.awt.event.FocusListener;
46 import java.beans.PropertyChangeListener;
47 import javax.swing.JComponent;
48 import javax.swing.JSplitPane;
49 import javax.swing.KeyStroke;
50 import javax.swing.plaf.ComponentUI;
51 import javax.swing.plaf.SplitPaneUI;
53 /**
54 * FIXME: Stubbed to allow compiling other classes,
55 * no real implementation.
57 public class BasicSplitPaneUI
58 extends SplitPaneUI
60 protected static final String NON_CONTINUOUS_DIVIDER
61 = "nonContinuousDivider";
63 protected static int KEYBOARD_DIVIDER_MOVE_OFFSET;
65 protected JSplitPane splitPane;
66 protected BasicSplitPaneDivider divider;
67 protected PropertyChangeListener propertyChangeListener;
68 protected FocusListener focusListener;
69 protected int dividerSize;
70 protected Component nonContinuousLayoutDivider;
71 protected boolean draggingHW;
72 protected int beginDragDividerLocation;
73 protected KeyStroke upKey;
74 protected KeyStroke downKey;
75 protected KeyStroke leftKey;
76 protected KeyStroke rightKey;
77 protected KeyStroke homeKey;
78 protected KeyStroke endKey;
79 protected KeyStroke dividerResizeToggleKey;
80 protected ActionListener keyboardUpLeftListener;
81 protected ActionListener keyboardDownRightListener;
82 protected ActionListener keyboardHomeListener;
83 protected ActionListener keyboardEndListener;
84 protected ActionListener keyboardResizeToggleListener;
86 public static ComponentUI createUI(JComponent c)
88 BasicSplitPaneUI newUI;
90 newUI = new BasicSplitPaneUI();
91 newUI.installUI(c);
92 return newUI;
95 public BasicSplitPaneUI()
97 propertyChangeListener = createPropertyChangeListener();
98 focusListener = createFocusListener();
101 public void installUI(JComponent c)
105 protected void installDefaults()
109 protected void installListeners()
113 protected void installKeyboardListeners()
117 protected void installKeyboardActions()
121 public void uninstallUI(JComponent c)
125 protected void uninstallDefaults()
129 protected void uninstallListeners()
133 protected void uninstallKeyboardActions()
137 protected PropertyChangeListener createPropertyChangeListener()
139 return null;
142 protected FocusListener createFocusListener()
144 return null;
147 protected ActionListener createKeyboardUpLeftListener()
149 return null;
152 protected ActionListener createKeyboardDownRightListener()
154 return null;
157 protected ActionListener createKeyboardHomeListener()
159 return null;
162 protected ActionListener createKeyboardEndListener()
164 return null;
167 protected ActionListener createKeyboardResizeToggleListener()
169 return null;
172 public int getOrientation()
174 return splitPane.getOrientation();
177 public void setOrientation(int orientation)
182 public boolean isContinuousLayout()
184 return false;
187 public void setContinuousLayout(boolean b)
191 public int getLastDragLocation()
193 return 0;
196 public void setLastDragLocation(int l)
201 public BasicSplitPaneDivider getDivider()
203 return divider;
207 protected Component createDefaultNonContinuousLayoutDivider()
209 return null;
212 protected void setNonContinuousLayoutDivider(Component newDivider)
214 setNonContinuousLayoutDivider(newDivider, true /* false? */);
217 protected void setNonContinuousLayoutDivider(Component newDivider,
218 boolean rememberSizes)
220 nonContinuousLayoutDivider = newDivider;
223 public Component getNonContinuousLayoutDivider()
225 return nonContinuousLayoutDivider;
228 public JSplitPane getSplitPane()
230 return splitPane;
233 public BasicSplitPaneDivider createDefaultDivider()
235 return null;
238 public void resetToPreferredSizes(JSplitPane jc)
242 public void setDividerLocation(JSplitPane jc, int location)
246 public int getDividerLocation(JSplitPane jc)
248 return 0;
251 public int getMinimumDividerLocation(JSplitPane jc)
253 return 0;
256 public int getMaximumDividerLocation(JSplitPane jc)
258 return 0;
261 public void finishedPaintingChildren(JSplitPane jc, Graphics g)
265 public void paint(Graphics g, JComponent jc)
269 public Dimension getPreferredSize(JComponent jc)
271 return null;
274 public Dimension getMinimumSize(JComponent jc)
276 return null;
279 public Dimension getMaximumSize(JComponent jc)
281 return null;
284 public Insets getInsets(JComponent jc)
286 return new Insets(0, 0, 0, 0);
289 protected void resetLayoutManager()
293 protected void startDragging()
297 protected void dragDividerTo(int location)
301 protected void finishDraggingTo(int location)
305 protected int getDividerBorderSize()
307 return 0;