001 /* 002 * Created on Jul 8, 2008 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 005 * in compliance with 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 010 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 011 * or implied. See the License for the specific language governing permissions and limitations under 012 * the License. 013 * 014 * Copyright @2008-2010 the original author or authors. 015 */ 016 package org.fest.swing.fixture; 017 018 import org.fest.swing.core.MouseButton; 019 import org.fest.swing.core.MouseClickInfo; 020 021 /** 022 * Understands simulation of mouse input on a GUI component. 023 * 024 * @author Alex Ruiz 025 */ 026 public interface MouseInputSimulationFixture { 027 028 /** 029 * Simulates a user clicking this fixture's GUI component. 030 * @return this fixture. 031 * @throws IllegalStateException if the component is disabled. 032 * @throws IllegalStateException if the component is not showing on the screen. 033 */ 034 MouseInputSimulationFixture click(); 035 036 /** 037 * Simulates a user clicking this fixture's GUI component. 038 * @param button the button to click. 039 * @return this fixture. 040 * @throws IllegalStateException if the component is disabled. 041 * @throws IllegalStateException if the component is not showing on the screen. 042 */ 043 MouseInputSimulationFixture click(MouseButton button); 044 045 /** 046 * Simulates a user clicking this fixture's GUI component. 047 * @param mouseClickInfo specifies the button to click and the times the button should be clicked. 048 * @return this fixture. 049 * @throws NullPointerException if the given <code>MouseClickInfo</code> is <code>null</code>. 050 * @throws IllegalStateException if the component is disabled. 051 * @throws IllegalStateException if the component is not showing on the screen. 052 */ 053 MouseInputSimulationFixture click(MouseClickInfo mouseClickInfo); 054 055 /** 056 * Simulates a user double-clicking this fixture's GUI component. 057 * @return this fixture. 058 * @throws IllegalStateException if the component is disabled. 059 * @throws IllegalStateException if the component is not showing on the screen. 060 */ 061 MouseInputSimulationFixture doubleClick(); 062 063 /** 064 * Simulates a user right-clicking this fixture's GUI component. 065 * @return this fixture. 066 * @throws IllegalStateException if the component is disabled. 067 * @throws IllegalStateException if the component is not showing on the screen. 068 */ 069 MouseInputSimulationFixture rightClick(); 070 }