Source code: dog/gui/DRootPane.java
1 /*
2 * DRootPane.java
3 * Copyright (C) 1999 dog <dog@dog.net.uk>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * You may retrieve the latest version of this library from
20 * http://www.dog.net.uk/knife/
21 */
22
23 package dog.gui;
24
25 import java.awt.Component;
26 import java.awt.Cursor;
27 import java.awt.Dimension;
28 import java.awt.Font;
29 import java.awt.FontMetrics;
30 import java.awt.Frame;
31 import java.awt.Image;
32 import java.awt.Insets;
33 import java.awt.event.ActionEvent;
34 import java.net.URL;
35
36 /**
37 * Interface implemented by top-level, heavyweight components that support the
38 * double-buffering of lightweight components.
39 * These components can render a background image in various ways.
40 *
41 * @author dog@dog.net.uk
42 * @version 1.0.1
43 */
44 public interface DRootPane extends DConstants{
45
46 /**
47 * Returns the rendering mode for the background image.
48 * @see #setMode
49 */
50 public int getMode();
51
52 /**
53 * Sets the rendering mode for the background image.
54 * @param mode one of CENTER, TILE, INTEGER_TILE, CENTER_TILE, MAXIMIZE, MAXIMIZE_ASPECT, MAXIMIZE_VERTICAL, or MAXIMIZE_HORIZONTAL
55 * @see #getMode
56 */
57 public void setMode(int mode);
58
59 /**
60 * Returns the background image.
61 * @see #setBackgroundImage
62 */
63 public Image getBackgroundImage();
64
65 /**
66 * Sets the background image.
67 * @param image the background image.
68 * @see #getBackgroundImage
69 */
70 public void setBackgroundImage(Image image);
71
72 /**
73 * Sets the background image from a file.
74 * @param file the image file.
75 * @see #getBackgroundImage
76 */
77 public void setBackgroundImage(String file);
78
79 /**
80 * Sets the background image from a URL.
81 * @param url the image URL.
82 * @see #getBackgroundImage
83 */
84 public void setBackgroundImage(URL url);
85
86 /**
87 * Returns the default button in this pane.
88 */
89 public DButton getDefaultButton();
90
91 /**
92 * Sets the default button in this pane.
93 */
94 public void setDefaultButton(DButton button);
95
96 /**
97 * Activates the default button in the pane.
98 */
99 public void processDefaultAction(ActionEvent event);
100
101 /**
102 * Returns the cancel button in this pane.
103 */
104 public DButton getCancelButton();
105
106 /**
107 * Sets the cancel button in this pane.
108 */
109 public void setCancelButton(DButton button);
110
111 /**
112 * Activates the cancel button in the pane.
113 */
114 public void processCancelAction(ActionEvent event);
115
116 /**
117 * Returns the title of this pane.
118 */
119 public String getTitle();
120
121 /**
122 * Sets the title of this pane.
123 */
124 public void setTitle(String title);
125
126 /**
127 * Returns the frame this root pane represents or is part of.
128 */
129 public Frame getFrame();
130
131 /**
132 * Returns the size of this root pane.
133 */
134 public Dimension getSize();
135
136 /**
137 * Returns the insets of this root pane.
138 */
139 public Insets getInsets();
140
141 /**
142 * Returns the font metrics for the specified font in this root pane.
143 */
144 public FontMetrics getFontMetrics(Font font);
145
146 /**
147 * Returns the font for this root pane.
148 */
149 public Font getFont();
150
151 /**
152 * Adds the specified component to this pane.
153 * @param component the component to be added.
154 * @return the component.
155 */
156 public Component add(Component component);
157
158 /**
159 * Removes the specified component from this pane.
160 * @param component the component to be removed
161 * @see #add
162 */
163 public void remove(Component component);
164
165 /**
166 * Sets the cursor on this root pane.
167 * @param cursor the cursor
168 */
169 public void setCursor(Cursor cursor);
170
171 }