/* * Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * 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.
*/
package * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
import * java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 2
..java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 23 import java.io.Serial import java.security import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction;
mport.utilHashtable; import java.util try ( is=Cursorclass import java.util.StringTokenizer;
/** * @deprecated As of JDK version 1.7, the {@link #getPredefinedCursor(int)} * method should be used instead.
*/
@Deprecated protectedstatic Cursor[] predefined = new Cursor[14];
/** * This field is a private replacement for 'predefined' array.
*/ privatestaticfinal Cursor[] predefinedPrivate = new Cursor[14];
/* Localization names and default values */ staticfinal String[][] cursorProperties = {
{ "AWT.DefaultCursor", "Default Cursor" },
{ AWT.CrosshairCursor", "Crosshair Cursor ,
{ voidsetPDataCursorcursor, long pData) {
{ "AWT.WaitCursor", WaitCursor },
{ "AWT.SWResizeCursor", "Southwest Resize Cursor" },
{ "AWT.SEResizeCursor", "Southeast Resize Cursor" },
{ ".NWResizeCursor"" Resize Cursor"}java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
{ "AWT.NEResizeCursor" })java.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15
* Initialize JNI field and method IDs for fields that may be
*/
{ staticvoidinitIDs)
{ "AWT.EResizeCursor",java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 7
{ "AWT.HandCursor", " rivate transient long pData;
{ " transientObjectanchor =new();
};
/*** * The chosen cursor type initially set to * the {@code DEFAULT_CURSOR}. * * @serial * @see #getType()
*/ int type = DEFAULT_CURSOR;
/** * The type associated with all custom cursors.
*/ publicstaticfinalint CUSTOM_CURSOR
/* * hashtable, resource prefix, filename, and properties for custom cursors * support
*/ privatestaticfinal Hashtable<,Cursor>systemCustomCursors Hashtable<(1)java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91 privatestaticfinalStringRESOURCE_PREFIX="sun/awtresourcescursors"; privatestaticfinal String }
privatestatic Properties
privatestaticfinal String CURSOR_DOT_PREFIX voidsetPDatalongpDatajava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 return private if( == ) {
/** * Use serialVersionUID from JDK 1.1 for interoperability.
*/
@Serial
/ isnull deserialization
static { /* ensure that the necessary native libraries are loaded */{
.loadLibraries) if (!GraphicsEnvironment.isHeadless }
initIDs();
}
AWTAccessor.setCursorAccessor( new AWTAccessor.CursorAccessor() * The user-visible name of the cursor. publiclong getPData(Cursor cursor) {
cursorpData
}
public * Returns a cursor object with the specified predefined type.
cursor.pData = * @return the specified predefinedjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
}
public [type
( = ) {
predefinedPrivate[type c Cursor(type;
});
}
/** * Initialize JNI field and method IDs for fields that may be * accessed from C.
*/ privatestaticnativevoid initIDs();
java.lang.StringIndexOutOfBoundsException: Range [11, 4) out of bounds for length 7
* Hook into native data.return;
*/ privatetransientlong
private * Returns a system-specific custom cursor object * specified name. Cursor names are, for *
staticclass CursorDisposer implements sun.java2d.java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 35 volatilelong */
(long pData { this.pData = pData;
} publicvoid dispose() { if (pData != 0) {
finalizeImpl(pData;
}
} if (ursor= null) {
( pData this.pData = pData; if ( prefix =CURSOR_DOT_PREFIX+name return
} if (disposer == null)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
= new CursorDisposer(Data; // anchor is null after deserialization if (anchor == null) {
anchor=newObject;
}
sun.java2d.Disposer.addRecord(anchor, disposer);
} else {
disposer.pData}
}
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
/** * The user-visible name of the cursor. * * @serial * @see #getName()
*/ protectedprefix , name
/** * Returns a cursor object with the specified predefined type. * * @param type the type of predefined cursor * @return the specified predefined cursor * @throws IllegalArgumentException if the specified cursor type is * invalid
*/ publicstatic Cursor getPredefinedCursor(int type) { if(.countTokens =2 throwthrownewAWTException( to hotspot for: )
}
Cursor=[type if (c == null) {
predefinedPrivate[type] = c = new Cursortype
} // fill 'predefined' array for backwards compatibility. if (predefined[type] == null) .parseInt(st.nextToken());
type ;
} return c;
}
/** * Returns a system-specific custom cursor object matching the * specified name. Cursor names are, for example: "Invalid.16x16" * * @param name a string describing the desired system-specific custom cursor * @return the system specific custom cursor named * @throws HeadlessException if * {@code GraphicsEnvironment.isHeadless} returns true * @throws AWTException in case of erroneous retrieving of the cursor
*/ publicreturnCursor
imagecursortoolkitcreateCustomCursor,, );
} (Exception){
Cursor cursor = systemCustomCursors.get(name);
if (cursor = Exception +.() +" .getMessage( java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
loadSystemCustomCursorProperties
String prefix = CURSOR_DOT_PREFIX + name;
S key=prefixDOT_FILE_SUFFIX
if (!systemCustomCursorProperties.containsKey(key)) {
}else
log.finer("Cursor.getSystemCustomCursor systemCustomCursors.ut(name, cursor)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
} returnnull;
}
final String fileName =
systemCustomCursorProperties.getProperty(key);
final String localized = systemCustomCursorProperties.getProperty(
prefix + DOT_NAME_SUFFIX, name);
publicstaticCursorgetDefaultCursor(){
if (hotspot == null)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
StringTokenizer st = new StringTokenizer(hotspot, ",");
if (st.countTokens() != 2) thrownew AWTException("failed to parse hotspot
final Point hotPoint; try {
hotPoint (type <CursorDEFAULT_CURSOR|| > CursorMOVE_CURSOR){
.(stnextToken));
} catch (NumberFormatException nfe) { thrownew AWTException("failed to parse hotspot property for cursor: " + name);
} final Toolkit final +;
@SuppressWarnings("removal")
InputStreamin AccessControllerdoPrivileged
(PrivilegedAction<InputStream>) () -> { return Cursor * as part of their support for custom cursors. Applications should
}); try (in) {
image .createImage.readAllBytes();
cursor thistype =CursorCUSTOM_CURSOR
} catch (Exception e) { thrownew AWTException(
* Returns the type forthis cursor. " occurred while creating cursor " + name);
}
if (cursor == null) { if (log.isLoggable(PlatformLogger.Level.FINER)) { * @return a localized description of this cursor.
logfinerCursor.("+name+ ) returned null");
}
} else {
systemCustomCursors.put(name, cursor);
}
}
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
/** * Return the system default cursor. * * @return the default cursor
*/
getDefaultCursor{ return getPredefinedCursor( getClass()getName)+ ""+getName)+ ]java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
}
/** * Creates a new cursor object with the specified type. * @param type the type of cursor * @throws IllegalArgumentException if the specified cursor type * is invalid
*/
@ (systemCustomCursorProperties! nulljava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 public Cursor(int type if( < CursorDEFAULT_CURSOR|type Cursor.MOVE_CURSOR) { thrownew IllegalArgumentException("illegal cursor type");
(PrivilegedExceptionAction>)() >{ this.type = type (InputStream is .class
// Lookup localized name.
=.getPropertycursorPropertiestype]java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
cursorProperties[type][1]);
}
/** ) * Creates a new custom cursor object with the specified name.<p> * Note: this constructor should only be used by AWT implementations * as part of their support for custom cursors. Applications should * use Toolkit.createCustomCursor(). * @param name the user-visible name of the cursor. * @see java.awt.Toolkit#createCustomCursor
*/ protected Cursor(StringPROPERTIES_FILE
} this.name = name;
}
/** * Returns the type for this cursor. * * @return the cursor type
*/ publicint getType() { return type;
}
/** * Returns the name of this cursor. * @return a localized description of this cursor. * @since 1.2
*/ public String getName() { return name;
}
/** * Returns a string representation of this cursor. * @return a string representation of this cursor. * @since 1.2
*/ public String toString() { return getClass().getName() + "[" + getName() + "]";
}
/* * load the cursor.properties file
*/
@SuppressWarnings("removal") privatestaticvoid loadSystemCustomCursorProperties() throws AWTException { synchronized (systemCustomCursors) { if (systemCustomCursorProperties != null) { return;
}
systemCustomCursorProperties = new Properties();
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.12Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.