1 /* 2 * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package com.sun.javafx.tk; 27 28 /** 29 * TKStageListener - Listener for the Stage Peer TKStage to pass updates and events back to the stage 30 * 31 */ 32 public interface TKStageListener { 33 34 /** 35 * The stages peer's location have changed so we need to update the scene 36 * 37 * @param x the new X 38 * @param y The new Y 39 */ 40 public void changedLocation(float x, float y); 41 42 /** 43 * The stages peer's size have changed so we need to update the scene 44 * 45 * @param width The new Width 46 * @param height The new Height 47 */ 48 public void changedSize(float width, float height); 49 50 /** 51 * The stage's peer should now be displayed with a new UI scale 52 * 53 * @param xScale the new recommended horizontal scale 54 * @param yScale the new recommended vertical scale 55 */ 56 public void changedScale(float xScale, float yScale); 57 58 /** 59 * The stages peer focused state has changed. 60 * 61 * @param focused True if the stage's peer now contains the focus 62 * @param cause The cause of (de)activation 63 */ 64 public void changedFocused(boolean focused, FocusCause cause); 65 66 /** 67 * The stages peer has become iconified or uniconified 68 * 69 * @param iconified True if the stage's peer is now iconified 70 */ 71 public void changedIconified(boolean iconified); 72 73 /** 74 * The stages peer has become maximized or unmaximized 75 * 76 * @param maximized True if the stage's peer is now maximized 77 */ 78 public void changedMaximized(boolean maximized); 79 80 /** 81 * The stages peer has changed it's "always on top" flag. 82 * @param alwaysOnTop 83 */ 84 public void changedAlwaysOnTop(boolean alwaysOnTop); 85 86 /** 87 * The stages peer has become resizable or nonresizable 88 * 89 * @param resizable True if the stage's peer is now resizable 90 */ 91 public void changedResizable(boolean resizable); 92 93 /** 94 * The stages peer has changed its full screen status 95 * 96 * @param fs True if the stage's peer is now full screen, false otherwise 97 */ 98 public void changedFullscreen(boolean fs); 99 100 /** 101 * The stage's peer has moved to another screen. 102 * 103 * @param from An object that identifies the old screen (may be null) 104 * @param to An object that identifies the new screen 105 */ 106 public void changedScreen(Object from, Object to); 107 108 /** 109 * Called if the window is closing do to something that has happened on the peer. For 110 * example the user clicking the close button or choosing quit from the application menu 111 * on a mac or right click close on the task bar on windows. 112 */ 113 public void closing(); 114 115 /** 116 * Called if the stages peer has closed. For example the platform closes the 117 * window after user has clicked the close button on its parent window. 118 */ 119 public void closed(); 120 121 /** 122 * Focus grab has been reset for the stage peer. 123 * 124 * Called after a previous call to {@link TKStage#grabFocus} when the grab 125 * is reset either by user action (e.g. clicking the titlebar of the 126 * stage), or via a call to {@link TKStage#ungrabFocus}. 127 */ 128 public void focusUngrab(); 129 }