View Javadoc

1   /*
2    * Copyright 2006-2016 The JGUIraffe Team.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License")
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package net.sf.jguiraffe.gui.builder.window;
17  
18  /**
19   * <p>
20   * Definition of an interface for platform (or GUI library) specific window
21   * manager implementations.
22   * </p>
23   * <p>
24   * Analogous to other builder components the window builder uses an interface
25   * for executing platform specific operations or creating specific objects (in
26   * this case windows). Each supported platform (like Swing or SWT) must provide
27   * an implementation of this interface hiding the specifics of this platform.
28   * </p>
29   * <p>
30   * The methods defined by this interface in the first line deal with the
31   * creation of several window types. Creating a window is a two step process:
32   * First the object representing the window is created. In the second step it is
33   * initialized. Both steps are performed by the same methods that can check
34   * their arguments to determine whether they are in the creation or the
35   * initialization phase.
36   * </p>
37   * <p>
38   * <strong>Note:</strong> This interface is not intended to be directly
39   * implemented by client code. It is subject to change even in minor releases as
40   * new features are made available. Therefore if an application needs to provide
41   * a custom implementation of this interface, it should extend an existing
42   * implementation. For instance, the {@link WindowManagerWrapper} class is a
43   * good candidate if only a subset of methods is to be modified.
44   * </p>
45   *
46   * @author Oliver Heger
47   * @version $Id: WindowManager.java 205 2012-01-29 18:29:57Z oheger $
48   */
49  public interface WindowManager
50  {
51      /**
52       * Creates a frame window (a main frame).
53       *
54       * @param builderData the builder data object
55       * @param data the data defining the window to create
56       * @param wnd the window object; if <b>null</b>, a new window is to be
57       * created; otherwise this window object must be initialized
58       * @return the new window
59       * @throws WindowBuilderException if an error occurs
60       */
61      Window createFrame(WindowBuilderData builderData, WindowData data,
62              Window wnd) throws WindowBuilderException;
63  
64      /**
65       * Creates an internal frame window.
66       *
67       * @param builderData the builder data object
68       * @param data the data defining the window to create
69       * @param wnd the window object; if <b>null</b>, a new window is to be
70       * created; otherwise this window object must be initialized
71       * @return the new window
72       * @throws WindowBuilderException if an error occurs
73       */
74      Window createInternalFrame(WindowBuilderData builderData, WindowData data,
75              Window wnd) throws WindowBuilderException;
76  
77      /**
78       * Creates a modal or non modal dialog.
79       *
80       * @param builderData the builder data object
81       * @param data the data defining the window to create
82       * @param modal the modal flag
83       * @param wnd the window object; if <b>null</b>, a new window is to be
84       * created; otherwise this window object must be initialized
85       * @return the new window
86       * @throws WindowBuilderException if an error occurs
87       */
88      Window createDialog(WindowBuilderData builderData, WindowData data,
89              boolean modal, Window wnd) throws WindowBuilderException;
90  }