/* / package com.sun.glass.ui.win; / / / / import… · The Chat Archive/* / package com.sun.glass.ui.win; / / / / import com.sun.glass.ui.Accessible; / /…
Download ▾
/* / package com.sun.glass.ui.win;
/ /
/ / import com.sun.glass.ui.Accessible;
/ / import com.sun.glass.ui.Application;
/ / import com.sun.glass.ui.CommonDialogs;
/ / import com.sun.glass.ui.Cursor;
/ / import com.sun.glass.ui.InvokeLaterDispatcher;
/ / import com.sun.glass.ui.Pixels;
/ / import com.sun.glass.ui.Robot;
/ / import com.sun.glass.ui.Screen;
/ / import com.sun.glass.ui.Size;
/ / import com.sun.glass.ui.Timer;
/ / import com.sun.glass.ui.View;
/ / import com.sun.glass.ui.Window;
/ / import com.sun.javafx.PlatformUtil;
/ / import com.sun.javafx.tk.Toolkit;
/ / import com.sun.prism.impl.PrismSettings;
/ / import java.io.File;
/ / import java.nio.ByteBuffer;
/ / import java.nio.IntBuffer;
/ / import java.security.AccessController;
/ / import java.security.PrivilegedAction;
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ / final class WinApplication
/ / extends Application
/ / implements InvokeLaterDispatcher.InvokeLaterSubmitter
/ / {
/ / static float overrideUIScale;
/ / static float overrideRenderScale;
/ / static float minDPIScale;
/ / static boolean forceIntegerRenderScale;
/ / private final InvokeLaterDispatcher invokeLaterDispatcher;
/ / private static boolean verbose;
/ / private static final int Process_DPI_Unaware = 0;
/ / private static final int Process_System_DPI_Aware = 1;
/ / private static final int Process_Per_Monitor_DPI_Aware = 2;
/ /
/ / private static boolean getBoolean(String paramString1, boolean paramBoolean, String paramString2) {
/ 48 / String str = System.getProperty(paramString1);
/ 49 / if (str == null) {
/ 50 / str = System.getenv(paramString1);
/ / }
/ 52 / if (str == null) {
/ 53 / return paramBoolean;
/ 55 56 57 59 63 64 65 67 68 70 72 73 74 75 77 79 80 82 91 93 94 95 96 97 98 100 101 102 104 105 106 109 116 117 118 119 121 138 139 142 144 145 146 147 148 149 151 152 154 157 163 164 166 167 169 170 171 172 178 182 190 191 195 196 197 198 200 204 211 212 215 217 218 224 225 227 233 237 241 245 249 253 257 261 265 270 274 278 282 288 292 296 300 305 306 308 312 313 315 319 323 327 335 339 340 342 348 349 354 359 365 366 367 368 370 */ }
как исправить ошибки в 182 строке, 178, 163, 142, 116 и 366 строке
Assistant
Для исправления ошибок в указанных строках вам необходимо выполнить следующие действия:
Строка 182: Добавьте вместо "paramLong" переменную "l".
Строка 178: Убедитесь, что метод "getDesiredAwarenesslevel()" возвращает значение типа int, а не float.
Строка 163: Добавьте вместо "paramRunnable" переменную "paramHandler".
Строка 142: Замените в
/ }
/
/ Boolean bool = Boolean.valueOf(Boolean.parseBoolean(str));
/
/ if (PrismSettings.verbose) {
/
/ System.out.println((bool.booleanValue() ? "" : "not ") + paramString2);
/
/ }
/
/ return bool.booleanValue();
/
/ }
/
/ private static float getFloat(String paramString1, float paramFloat, String paramString2) {
/
/ float f;
/
/ String str = System.getProperty(paramString1);
/
/ if (str == null) {
/
/ str = System.getenv(paramString1);
/
/ }
/
/ if (str == null) {
/
/ return paramFloat;
/
/ }
/
/ str = str.trim();
/
/
/
/ if (str.endsWith("%")) {
/
/ f = Integer.parseInt(str.substring(0, str.length() - 1)) / 100.0F;
/
/ } else if (str.endsWith("DPI") || str.endsWith("dpi")) {
/
/ f = Integer.parseInt(str.substring(0, str.length() - 3)) / 96.0F;
/
/ } else {
/
/ f = Float.parseFloat(str);
/
/ }
/
/ if (PrismSettings.verbose) {
/
/ System.out.println(paramString2 + f);
/
/ }
/
/ return f;
/
/ }
/
/
/
/
/
/
/
/
/
/
/
/
/
/ static {
/
/ AccessController.doPrivileged(new PrivilegedAction() {
/
/ public Void run() {
/
/ WinApplication.verbose = Boolean.getBoolean("javafx.verbose");
/
/ if (PrismSettings.allowHiDPIScaling) {
/
/ WinApplication.overrideUIScale = WinApplication.getFloat("glass.win.uiScale", -1.0F, "Forcing UI scaling factor: ");
/
/ WinApplication.overrideRenderScale = WinApplication.getFloat("glass.win.renderScale", -1.0F, "Forcing Rendering scaling factor: ");
/
/ WinApplication.minDPIScale = WinApplication.getFloat("glass.win.minHiDPI", 1.5F, "Threshold to enable UI scaling factor: ");
/
/ WinApplication.forceIntegerRenderScale = WinApplication.getBoolean("glass.win.forceIntegerRenderScale", true, "forcing integer rendering scale");
/
/ } else {
/
/ WinApplication.overrideUIScale = WinApplication.overrideRenderScale = 1.0F;
/
/ WinApplication.minDPIScale = Float.MAX_VALUE;
/
/ WinApplication.forceIntegerRenderScale = false;
/
/ }
/
/ Toolkit.loadMSWindowsLibraries();
/
/ WinApplication.loadNativeLibrary();
/
/ return null;
/
/ }
/
/ });
/
/ initIDs(overrideUIScale, overrideRenderScale, minDPIScale, forceIntegerRenderScale);
/
/ }
/
/
/
/
/
/
/
/
/
/ WinApplication() {
/
/ boolean bool = ((Boolean)AccessController.doPrivileged(() -> Boolean.valueOf(Boolean.getBoolean("javafx.embed.isEventThread")))).booleanValue();
/
/ if (!bool) {
/
/ this.invokeLaterDispatcher = new InvokeLaterDispatcher(this);
/
/ this.invokeLaterDispatcher.start();
/
/ } else {
/
/ this.invokeLaterDispatcher = null;
/
/ }
/
/ }
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/ private static int getDesiredAwarenesslevel() {
/
/ if (!PrismSettings.allowHiDPIScaling) {
/
/ return 0;
/
/ }
/
/
/
/ String str = AccessController.doPrivileged(() -> System.getProperty("javafx.glass.winDPIawareness"));
/
/
/
/ if (str != null) {
/
/ str = str.toLowerCase();
/
/ if (str.equals("aware"))
/
/ return 1;
/
/ if (str.equals("permonitor")) {
/
/ return 2;
/
/ }
/
/ if (!str.equals("unaware")) {
/
/ System.err.println("unrecognized DPI awareness request, defaulting to unaware: " + str);
/
/ }
/
/ return 0;
/
/ }
/
/
/
/ return 2;
/
/ }
/
/
/
/
/
/
/
/ protected void runLoop(Runnable paramRunnable) {
/
/ boolean bool = ((Boolean)AccessController.doPrivileged(() -> Boolean.valueOf(Boolean.getBoolean("javafx.embed.isEventThread")))).booleanValue();
/
/ int i = getDesiredAwarenesslevel();
/
/
/
/ ClassLoader classLoader = WinApplication.class.getClassLoader();
/
/ _setClassLoader(classLoader);
/
/
/
/ if (bool) {
/
/ _init(i);
/
/ setEventThread(Thread.currentThread());
/
/ paramRunnable.run();
/
/
/
/
/
/ return;
/
/ }
/
/
/
/ long l = ((Long)AccessController.doPrivileged(() -> Long.getLong("glass.win.stackSize", PlatformUtil.isWindows32Bit() ? 1048576L : 0L))).longValue();
/
/
/
/
/
/
/
/ Thread thread = AccessController.doPrivileged(() -> new Thread(null, (), "WindowsNativeRunloopThread", paramLong));
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/ setEventThread(thread);
/
/ thread.start();
/
/ }
/
/
/
/ protected void finishTerminating() {
/
/ Thread thread = getEventThread();
/
/ if (thread != null) {
/
/ _terminateLoop();
/
/ setEventThread(null);
/
/ }
/
/ super.finishTerminating();
/
/ }
/
/
/
/ public boolean shouldUpdateWindow() {
/
/ return true;
/
/ }
/
/
/
/
/
/
/
/
/
/ protected Object _enterNestedEventLoop() {
/
/ if (this.invokeLaterDispatcher != null) {
/
/ this.invokeLaterDispatcher.notifyEnteringNestedEventLoop();
/
/ }
/
/ try {
/
/ return _enterNestedEventLoopImpl();
/
/ } finally {
/
/ if (this.invokeLaterDispatcher != null) {
/
/ this.invokeLaterDispatcher.notifyLeftNestedEventLoop();
/
/ }
/
/ }
/
/ }
/
/
/
/ protected void _leaveNestedEventLoop(Object paramObject) {
/
/ if (this.invokeLaterDispatcher != null) {
/
/ this.invokeLaterDispatcher.notifyLeavingNestedEventLoop();
/
/ }
/
/ _leaveNestedEventLoopImpl(paramObject);
/
/ }
/
/
/
/
/
/
/
/ public Window createWindow(Window paramWindow, Screen paramScreen, int paramInt) {
/
/ return new WinWindow(paramWindow, paramScreen, paramInt);
/
/ }
/
/
/
/ public Window createWindow(long paramLong) {
/
/ return new WinChildWindow(paramLong);
/
/ }
/
/
/
/ public View createView() {
/
/ return new WinView();
/
/ }
/
/
/
/ public Cursor createCursor(int paramInt) {
/
/ return new WinCursor(paramInt);
/
/ }
/
/
/
/ public Cursor createCursor(int paramInt1, int paramInt2, Pixels paramPixels) {
/
/ return new WinCursor(paramInt1, paramInt2, paramPixels);
/
/ }
/
/
/
/ protected void staticCursor_setVisible(boolean paramBoolean) {
/
/ WinCursor.setVisible_impl(paramBoolean);
/
/ }
/
/
/
/ protected Size staticCursor_getBestSize(int paramInt1, int paramInt2) {
/
/ return WinCursor.getBestSize_impl(paramInt1, paramInt2);
/
/ }
/
/
/
/ public Pixels createPixels(int paramInt1, int paramInt2, ByteBuffer paramByteBuffer) {
/
/ return new WinPixels(paramInt1, paramInt2, paramByteBuffer);
/
/ }
/
/
/
/ public Pixels createPixels(int paramInt1, int paramInt2, IntBuffer paramIntBuffer) {
/
/ return new WinPixels(paramInt1, paramInt2, paramIntBuffer);
/
/ }
/
/
/
/
/
/ public Pixels createPixels(int paramInt1, int paramInt2, IntBuffer paramIntBuffer, float paramFloat) {
/
/ return new WinPixels(paramInt1, paramInt2, paramIntBuffer, paramFloat);
/
/ }
/
/
/
/ protected int staticPixels_getNativeFormat() {
/
/ return WinPixels.getNativeFormat_impl();
/
/ }
/
/
/
/ public Robot createRobot() {
/
/ return new WinRobot();
/
/ }
/
/
/
/ protected double staticScreen_getVideoRefreshPeriod() {
/
/ return 0.0D;
/
/ }
/
/
/
/
/
/
/
/ public Timer createTimer(Runnable paramRunnable) {
/
/ return new WinTimer(paramRunnable);
/
/ }
/
/
/
/ protected int staticTimer_getMinPeriod() {
/
/ return WinTimer.getMinPeriod_impl();
/
/ }
/
/
/
/ protected int staticTimer_getMaxPeriod() {
/
/ return WinTimer.getMaxPeriod_impl();
/
/ }
/
/
/
/ public Accessible createAccessible() {
/
/ return new WinAccessible();
/
/ }
/
/
/
/
/
/ protected CommonDialogs.FileChooserResult staticCommonDialogs_showFileChooser(Window paramWindow, String paramString1, String paramString2, String paramString3, int paramInt1, boolean paramBoolean, CommonDialogs.ExtensionFilter[] paramArrayOfExtensionFilter, int paramInt2) {
/
/ if (this.invokeLaterDispatcher != null) {
/
/ this.invokeLaterDispatcher.notifyEnteringNestedEventLoop();
/
/ }
/
/ return WinCommonDialogs.showFileChooser_impl(paramWindow, paramString1, paramString2, paramString3, paramInt1, paramBoolean, paramArrayOfExtensionFilter, paramInt2);
/
/ }
/
/
/
/ protected File staticCommonDialogs_showFolderChooser(Window paramWindow, String paramString1, String paramString2) {
/
/ if (this.invokeLaterDispatcher != null) {
/
/ this.invokeLaterDispatcher.notifyEnteringNestedEventLoop();
/
/ }
/
/ return WinCommonDialogs.showFolderChooser_impl(paramWindow, paramString1, paramString2);
/
/ }
/
/
/
/ protected long staticView_getMultiClickTime() {
/
/ return WinView.getMultiClickTime_impl();
/
/ }
/
/
/
/ protected int staticView_getMultiClickMaxX() {
/
/ return WinView.getMultiClickMaxX_impl();
/
/ }
/
/
/
/ protected int staticView_getMultiClickMaxY() {
/
/ return WinView.getMultiClickMaxY_impl();
/
/ }
/
/
/
/
/
/
/
/
/
/
/
/ public void submitForLaterInvocation(Runnable paramRunnable) {
/
/ _submitForLaterInvocation(paramRunnable);
/
/ }
/
/
/
/ protected void _invokeLater(Runnable paramRunnable) {
/
/ if (this.invokeLaterDispatcher != null) {
/
/ this.invokeLaterDispatcher.invokeLater(paramRunnable);
/
/ } else {
/
/ submitForLaterInvocation(paramRunnable);
/
/ }
/
/ }
/
/
/
/
/
/ public String getHighContrastTheme() {
/
/ checkEventThread();
/
/ return _getHighContrastTheme();
/
/ }
/
/
/
/
/
/ protected boolean _supportsInputMethods() {
/
/ return true;
/
/ }
/
/
/
/
/
/ protected boolean _supportsTransparentWindows() {
/
/ return true;
/
/ }
/
/
/
/
/
/
/
/ public String getDataDirectory() {
/
/ checkEventThread();
/
/ String str = AccessController.doPrivileged(() -> System.getenv("APPDATA"));
/
/ if (str == null || str.length() == 0) {
/
/ return super.getDataDirectory();
/
/ }
/
/ return str + File.separator + this.name + File.separator;
/
/ }
/
/
/
/ private static native void initIDs(float paramFloat1, float paramFloat2, float paramFloat3, boolean paramBoolean);
/
/
/
/ private native long _init(int paramInt);
/
/
/
/ private native void _setClassLoader(ClassLoader paramClassLoader);
/
/
/
/ private native void _runLoop(Runnable paramRunnable);
/
/
/
/ private native void _terminateLoop();
/
/
/
/ private native Object _enterNestedEventLoopImpl();
/
/
/
/ private native void _leaveNestedEventLoopImpl(Object paramObject);
/
/
/
/ protected native Screen[] staticScreen_getScreens();
/
/
/
/ protected native void _invokeAndWait(Runnable paramRunnable);
/
/
/
/ private native void _submitForLaterInvocation(Runnable paramRunnable);
/
/
/
/ private native String _getHighContrastTheme();
/
/
/
/ protected native boolean _supportsUnifiedWindows();
/
/
/
/ protected native int _getKeyCodeForChar(char paramChar);
/
Not yet included in a published release.