2007 * 1.0f (which means that it is translucent), {@code false} otherwise 2008 * @see GraphicsDevice.WindowTranslucency#TRANSLUCENT 2009 */ 2010 public static boolean isContainingTopLevelTranslucent(Component c) { 2011 Window w = getContainingWindow(c); 2012 return w != null && ((Window)w).getOpacity() < 1.0f; 2013 } 2014 2015 /** 2016 * Returns whether the native system requires using the peer.updateWindow() 2017 * method to update the contents of a non-opaque window, or if usual 2018 * painting procedures are sufficient. The default return value covers 2019 * the X11 systems. On MS Windows this method is overriden in WToolkit 2020 * to return true. 2021 */ 2022 public boolean needUpdateWindow() { 2023 return false; 2024 } 2025 2026 /** 2027 * Descendants of the SunToolkit should override and put their own logic here. 2028 */ 2029 public int getNumberOfButtons(){ 2030 return 3; 2031 } 2032 2033 /** 2034 * Checks that the given object implements/extends the given 2035 * interface/class. 2036 * 2037 * Note that using the instanceof operator causes a class to be loaded. 2038 * Using this method doesn't load a class and it can be used instead of 2039 * the instanceof operator for performance reasons. 2040 * 2041 * @param obj Object to be checked 2042 * @param type The name of the interface/class. Must be 2043 * fully-qualified interface/class name. 2044 * @return true, if this object implements/extends the given 2045 * interface/class, false, otherwise, or if obj or type is null 2046 */ | 2007 * 1.0f (which means that it is translucent), {@code false} otherwise 2008 * @see GraphicsDevice.WindowTranslucency#TRANSLUCENT 2009 */ 2010 public static boolean isContainingTopLevelTranslucent(Component c) { 2011 Window w = getContainingWindow(c); 2012 return w != null && ((Window)w).getOpacity() < 1.0f; 2013 } 2014 2015 /** 2016 * Returns whether the native system requires using the peer.updateWindow() 2017 * method to update the contents of a non-opaque window, or if usual 2018 * painting procedures are sufficient. The default return value covers 2019 * the X11 systems. On MS Windows this method is overriden in WToolkit 2020 * to return true. 2021 */ 2022 public boolean needUpdateWindow() { 2023 return false; 2024 } 2025 2026 /** 2027 * Returns the background color of the window on X11 and Windows systems. 2028 * 2029 * On Mac platforms this method is overriden in LWCToolkit to return 2030 * purely transparent color for non-opaque windows as we need to draw 2031 * pure transparent pixel into a CALayer as the background color to 2032 * implement translucent windows. 2033 */ 2034 public Color getLayerBackground(Window w) { 2035 return w.getBackground(); 2036 } 2037 2038 /** 2039 * Descendants of the SunToolkit should override and put their own logic here. 2040 */ 2041 public int getNumberOfButtons(){ 2042 return 3; 2043 } 2044 2045 /** 2046 * Checks that the given object implements/extends the given 2047 * interface/class. 2048 * 2049 * Note that using the instanceof operator causes a class to be loaded. 2050 * Using this method doesn't load a class and it can be used instead of 2051 * the instanceof operator for performance reasons. 2052 * 2053 * @param obj Object to be checked 2054 * @param type The name of the interface/class. Must be 2055 * fully-qualified interface/class name. 2056 * @return true, if this object implements/extends the given 2057 * interface/class, false, otherwise, or if obj or type is null 2058 */ |