/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 6614214
* @summary Verifies that we enter the fs mode on the correct screen.
* Here is how to test: start the test on on a multi-screen system.
* Verify that the display is correctly tracked by dragging the frame back
* and forth between screens. Then verify that the correct device enters
* the full-screen mode - when "Enter FS mode" is pressed it should enter on
* the device where the frame is.
*
* Then change the order of the monitors in the DisplayProperties dialog,
* (while the app is running) and see that it still works.
* Restart the app, verify again.
*
* Now change the primary monitor on the system and verify with the
* app running, as well as after restarting it that we still enter the
* fs mode on the right device.
*
*/
public class DeviceIdentificationTest {
f.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
f.dispose();
}
});
f.addComponentListener(new ComponentAdapter() {
public void componentMoved(ComponentEvent e) {
f.setTitle("Currently on: "+
f.getGraphicsConfiguration().getDevice());
}
});
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
GraphicsDevice gds[] =
int i = 0;
i++;
}
}
});
p.add(b);
b = new Button("Print My Device");
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
p.add(b);
b = new Button("Create FS Frame on my Device");
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
};
fsf.setUndecorated(true);
public void mouseClicked(MouseEvent e) {
}
});
}
});
p.add(b);
f.add("North", p);
p = new Panel();
b = new Button("Test Passed");
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
f.dispose();
}
});
p.add(b);
b = new Button("Test Failed");
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
f.dispose();
throw new RuntimeException("Test FAILED");
}
});
p.add(b);
f.add("South", p);
f.pack();
f.setVisible(true);
}
}