⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 displayaccess.java

📁 有关j2me的很好的例子可以研究一下
💻 JAVA
字号:
/* * @(#)DisplayAccess.java	1.12 01/08/12 * * Copyright (c) 2000-2001 Sun Microsystems, Inc., 901 San Antonio Road, * Palo Alto, CA 94303, U.S.A.  All Rights Reserved. *  * Sun Microsystems, Inc. has intellectual property rights relating * to the technology embodied in this software.  In particular, and * without limitation, these intellectual property rights may include * one or more U.S. patents, foreign patents, or pending * applications.  Sun, Sun Microsystems, the Sun logo, Java, KJava, * and all Sun-based and Java-based marks are trademarks or * registered trademarks of Sun Microsystems, Inc.  in the United * States and other countries. * * This software is distributed under licenses restricting its use, * copying, distribution, and decompilation.  No part of this * software may be reproduced in any form by any means without prior * written authorization of Sun and its licensors, if any. * * FEDERAL ACQUISITIONS:  Commercial Software -- Government Users * Subject to Standard License Terms and Conditions */package com.sun.midp.lcdui;import javax.microedition.lcdui.Display;/** * Public interface for an object that is used to provide internal access * to a Display object, across package boundaries.  The object implements * this interface, and is created inside the same package as Display,  so * that it has access to private instance data of Display as necessary. */public interface DisplayAccess {    /**     * Get the Display object that is associated with this DisplayAccess.     * @return Display The Display object.     */    Display getDisplay();    /**     * Called by event delivery when an abstract Command is fired.     * The parameter is an index into the list of Commands that are     * current, i.e. those associated with the visible Screen.     * @param id The integer id of the Command that fired (as returned     *           by Command.getID())     */    void commandAction(int id);    /**     * Called by event delivery when a pen event is processed.     * The type is one of EventHandler.PRESSED, EventHandler.RELEASED,     * or EventHandler.DRAGGED.     * @param type The type of event (press, release or drag)     * @param x The x coordinate of the location of the pen          * @param y The y coordinate of the location of the pen          */    void pointerEvent(int type, int x, int y);    /**     * Called by event delivery when a key event is processed.     * The type is one of EventHandler.PRESSED, EventHandler.RELEASED,     * or EventHandler.REPEATED.     * @param type The type of event (press, release or repeat)     * @param keyCode The key code for the key that registered the event     */    void keyEvent(int type, int keyCode);    /**     * Called by event delivery when an internal timer is processed.     * (This is not the same as the Timer events provided in java.util.Timer).     * The type is one of EventHandler.REPAINT or EventHandler.SCREEN.     * @param type The type of event (repaint or screen change).     */    void timerEvent(int type);    /* suspend and resume repaint processing */    /* this helps prevent animation from clobbering the display */    /* while native processing (e.g. a menu) is in charge */    /**     * Called when the system needs to temporarily prevent the application     * from painting the screen.  The primary use of this method is to allow     * a system service to temporarily utilize the screen, e.g. to provide     * input method or abstract command processing.     *     * This method should prevent application-based paints (i.e. those     * generated by Canvas.repaint(), Canvas.serviceRepaints() or some     * internal paint method on another kind of Displayable) from changing     * the contents of the screen in any way.     */    void suspendPainting();    /**     * Called when the system is ready to give up its control over the     * screen.  The application should receive a request for a full     * repaint when this is called, and is subsequently free to process     * paint events from Canvas.repaint(), Canvas.serviceRepaints() or     * internal paint methods on Displayable.     */    void resumePainting();    /**     * This is for the benefit of the MIDLet manager; it is called to tell     * the Display that its MIDLet has become the "foreground midlet" and     * is therefore allowed to receive events and to paint, or has lost      * the foreground and should relinquish those privileges.     *     * @param hasForeground A flag indicating the foreground status.     */    void setForeground(boolean hasForeground);    /**     * Called by event delivery when an input method event is processed.     * @param str The string from the input method.     */    void inputMethodEvent(String str);    /**     * Get the flag indicating that the most recent call to setCurrent     * was for a non-null Displayable.     * This allows the implementation of the hint provided     * to the MIDlet schedule to determine which MIDlet to make foreground.     *     * @return <code>true</code> if the MIDlet has a screen to display;     * otherwise <code>false</code> if MIDlet has indicated that it     * does not need the display.     */    boolean hasCurrent();}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -