001 /*
002 * Created on Jun 3, 2009
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
005 * the License. You may obtain a copy of the License at
006 *
007 * http://www.apache.org/licenses/LICENSE-2.0
008 *
009 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
010 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
011 * specific language governing permissions and limitations under the License.
012 *
013 * Copyright @2009-2010 the original author or authors.
014 */
015 package org.fest.swing.util;
016
017 import java.awt.AWTException;
018 import java.awt.Robot;
019
020 /**
021 * Understands creation of AWT <code>{@link Robot}</code>s.
022 *
023 * @author Alex Ruiz
024 */
025 public class RobotFactory {
026
027 /**
028 * Constructs a <code>{@link Robot}</code> object in the coordinate system of the primary screen.
029 * @return the created <code>Robot</code>.
030 * @throws AWTException if the platform configuration does not allow low-level input control. This exception is always
031 * thrown when <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code>.
032 * @throws SecurityException if <code>createRobot</code> permission is not granted.
033 */
034 public Robot newRobotInPrimaryScreen() throws AWTException {
035 return new Robot();
036 }
037 }