132 * }
133 * }</pre>
134 *
135 * @param gc used to select screen. null means primary or default screen.
136 * @param x location of dialog including border in screen coordinates
137 * @param y location of dialog including border in screen coordinates
138 * @param services to be browsable, must be non-null.
139 * @param defaultService - initial PrintService to display.
140 * @param flavor - the flavor to be printed, or null.
141 * @param attributes on input is the initial application supplied
142 * preferences. This cannot be null but may be empty.
143 * On output the attributes reflect changes made by the user.
144 * @return print service selected by the user, or null if the user
145 * cancelled the dialog.
146 * @throws HeadlessException if GraphicsEnvironment.isHeadless()
147 * returns true.
148 * @throws IllegalArgumentException if services is null or empty,
149 * or attributes is null, or the initial PrintService is not in the
150 * list of browsable services.
151 */
152 public static PrintService printDialog(GraphicsConfiguration gc,
153 int x, int y,
154 PrintService[] services,
155 PrintService defaultService,
156 DocFlavor flavor,
157 PrintRequestAttributeSet attributes)
158 throws HeadlessException
159 {
160 int defaultIndex = -1;
161
162 if (GraphicsEnvironment.isHeadless()) {
163 throw new HeadlessException();
164 } else if ((services == null) || (services.length == 0)) {
165 throw new IllegalArgumentException("services must be non-null " +
166 "and non-empty");
167 } else if (attributes == null) {
168 throw new IllegalArgumentException("attributes must be non-null");
169 }
170
171 if (defaultService != null) {
|
132 * }
133 * }</pre>
134 *
135 * @param gc used to select screen. null means primary or default screen.
136 * @param x location of dialog including border in screen coordinates
137 * @param y location of dialog including border in screen coordinates
138 * @param services to be browsable, must be non-null.
139 * @param defaultService - initial PrintService to display.
140 * @param flavor - the flavor to be printed, or null.
141 * @param attributes on input is the initial application supplied
142 * preferences. This cannot be null but may be empty.
143 * On output the attributes reflect changes made by the user.
144 * @return print service selected by the user, or null if the user
145 * cancelled the dialog.
146 * @throws HeadlessException if GraphicsEnvironment.isHeadless()
147 * returns true.
148 * @throws IllegalArgumentException if services is null or empty,
149 * or attributes is null, or the initial PrintService is not in the
150 * list of browsable services.
151 */
152 @SuppressWarnings("deprecation")
153 public static PrintService printDialog(GraphicsConfiguration gc,
154 int x, int y,
155 PrintService[] services,
156 PrintService defaultService,
157 DocFlavor flavor,
158 PrintRequestAttributeSet attributes)
159 throws HeadlessException
160 {
161 int defaultIndex = -1;
162
163 if (GraphicsEnvironment.isHeadless()) {
164 throw new HeadlessException();
165 } else if ((services == null) || (services.length == 0)) {
166 throw new IllegalArgumentException("services must be non-null " +
167 "and non-empty");
168 } else if (attributes == null) {
169 throw new IllegalArgumentException("attributes must be non-null");
170 }
171
172 if (defaultService != null) {
|