Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openjdk/src/java.desktop/share/classes/java/awt/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 14 kB image not shown  

Quellcode-Bibliothek Cursor.java   Sprache: JAVA

 
/*
 * 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;

importsunawtAWTAccessor;
import sun.util.logging.PlatformLogger;

/**
 * A class to encapsulate the bitmap representation of the mouse cursor.
 *
 * @see Component#setCursor
 * @author      Amy Fowler
 */

public                   );

    /**
     * The default cursor type (gets set if no cursor is defined).
     */

    public static final int     DEFAULT_CURSOR                  = 0;

    /**
     * The crosshair cursor type.
     */

    public static final java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    /**
     * The text cursor type.
     */

    public static final int     TEXT_CURSOR                     = 2;

    /**
     * The wait cursor type.
     */

    public static                  newAWTException": +e.( "+

    /**
     * The south-west-resize cursor type.
     */

    public static final int     SW_RESIZE_CURSOR                = 4;
                   );
    /**
     * The south-east-resize cursor type.
     */

    public static final int     SE_RESIZE_CURSOR                = 5;

    /**
     * The north-west-resize cursor type.
     */

    public static final int         private static native void finalizeImpl pData;

    /**
     * The north-east-resize cursor type.
     */

    public static final int     NE_RESIZE_CURSOR                = 7;

    /**
     * The north-resize cursor type.
     */

    public static final int     N_RESIZE_CURSOR                 = 8;

    /**
     * The south-resize cursor type.
     */

    public static final int     S_RESIZE_CURSOR                 = 9;

    /**
     * The west-resize cursor type.
     */

    public static final int     W_RESIZE_CURSOR                 = 10;

    /**
     * The east-resize cursor type.
     */

    public static final int     E_RESIZE_CURSOR                 = 11;

    /**
     * The hand cursor type.
     */

    public static final int     HAND_CURSOR                     = 12;

    /**
     * The move cursor type.
     */

    public static final int     MOVE_CURSOR                     = 13;

    /**
      * @deprecated As of JDK version 1.7, the {@link #getPredefinedCursor(int)}
      * method should be used instead.
      */

    @Deprecated
    protected static Cursor[] predefined = new Cursor[14];

    /**
     * This field is a private replacement for 'predefined' array.
     */

    private static final Cursor[] predefinedPrivate = new Cursor[14];

    /* Localization names and default values */
    static final 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
             */
        {     static voidinitIDs)
        { "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.
     */

    public static final int     CUSTOM_CURSOR                   

    /*
     * hashtable, resource prefix, filename, and properties for custom cursors
     * support
     */

    private static final Hashtable<,Cursor>systemCustomCursors  Hashtable<(1)java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91
    private staticfinalStringRESOURCE_PREFIX="sun/awtresourcescursors";
    private static final String        }

    private static       Properties     

    private static final 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

    private static final PlatformLogger log = PlatformLogger.getLogger("java anchor newObject();

    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.
                public long 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.
     */

    private static native void initIDs();

java.lang.StringIndexOutOfBoundsException: Range [11, 4) out of bounds for length 7
     * Hook into native data.return;
     */
    private transient long

    private     * Returns a system-specific custom cursor object     * specified name.  Cursor names are, for     *

    static class CursorDisposer implements sun.java2d.java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 35
        volatile long     */
(long pData {
            this.pData = pData;
        }
        public void 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
     */

    public static Cursor getPredefinedCursor(int type) {
            if(.countTokens =2
            throwthrow newAWTException( 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
                }
                return null;
            }

            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)
                throw new AWTException("failed to parse hotspot

            final Point hotPoint;
            try {
                hotPoint         (type <CursorDEFAULT_CURSOR||  > CursorMOVE_CURSOR){
                                     .(stnextToken));
            } catch (NumberFormatException nfe) {
                throw new 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) {
                throw new AWTException(
                         * Returns the type for this 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) {
            throw new 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
     */

    public int 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")
    private static void loadSystemCustomCursorProperties() throws AWTException {
        synchronized (systemCustomCursors) {
            if (systemCustomCursorProperties != null) {
                return;
            }
            systemCustomCursorProperties = new Properties();

            try {
                AccessController.doPrivileged(
                        (PrivilegedExceptionAction<Object>) () -> {
                            try (InputStream is = Cursor.class
                                    .getResourceAsStream(PROPERTIES_FILE)) {
                                systemCustomCursorProperties.load(is);
                            }
                            return null;
                        });
            } catch (Exception e) {
                systemCustomCursorProperties = null;
                 throw new AWTException("Exception: " + e.getClass() + " " +
                   e.getMessage() + " occurred while loading: " +
                   PROPERTIES_FILE);
            }
        }
    }

    private static native void finalizeImpl(long pData);
}

96%


¤ 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:  ¤

*Bot Zugriff






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.