📄 toolkit.java
字号:
/*************************************************************************//** * Creates a peer object for the specified <code>FileDialog</code>. * * @param target The <code>FileDialog</code> to create the peer for. * * @return The peer for the specified <code>FileDialog</code> object. */protected abstract FileDialogPeercreateFileDialog(FileDialog target);/*************************************************************************//** * Creates a peer object for the specified <code>CheckboxMenuItem</code>. * * @param target The <code>CheckboxMenuItem</code> to create the peer for. * * @return The peer for the specified <code>CheckboxMenuItem</code> object. */protected abstract CheckboxMenuItemPeercreateCheckboxMenuItem(CheckboxMenuItem target);/*************************************************************************//** * Creates a peer object for the specified <code>Component</code>. The * peer returned by this method is not a native windowing system peer * with its own native window. Instead, this method allows the component * to draw on its parent window as a "lightweight" widget. * * XXX: FIXME * * @param target The <code>Component</code> to create the peer for. * * @return The peer for the specified <code>Component</code> object. */protected LightweightPeercreateComponent(Component target){ return null;}/*************************************************************************//** * Creates a peer object for the specified font name. * * @param name The font to create the peer for. * @param style The font style to create the peer for. * * @return The peer for the specified font name. */protected abstract FontPeergetFontPeer(String name, int style);/*************************************************************************//** * Copies the current system colors into the specified array. This is * the interface used by the <code>SystemColors</code> class. * * @param colors The array to copy the system colors into. */protected voidloadSystemColors(int systemColors[]){}/*************************************************************************//** * Returns the dimensions of the screen in pixels. * * @return The dimensions of the screen in pixels. */public abstract DimensiongetScreenSize();/*************************************************************************//** * Returns the screen resolution in dots per square inch. * * @return The screen resolution in dots per square inch. */public abstract intgetScreenResolution();/*************************************************************************//** * Returns the color model of the screen. * * @return The color model of the screen. */public abstract ColorModelgetColorModel();/*************************************************************************//** * Returns the names of the available fonts. * * @return The names of the available fonts. */public abstract String[]getFontList();/*************************************************************************//** * Return the font metrics for the specified font * * @param name The name of the font to return metrics for. * * @return The requested font metrics. */public abstract FontMetricsgetFontMetrics(Font name);/*************************************************************************//** * Flushes any buffered data to the screen so that it is in sync with * what the AWT system has drawn to it. */public abstract voidsync();/*************************************************************************//** * Returns an image from the specified file, which must be in a * recognized format. Supported formats vary from toolkit to toolkit. * * @return name The name of the file to read the image from. */public abstract ImagegetImage(String name);/*************************************************************************//** * Returns an image from the specified URL, which must be in a * recognized format. Supported formats vary from toolkit to toolkit. * * @return url The URl to read the image from. */public abstract ImagegetImage(URL url);/*************************************************************************//** * Readies an image to be rendered on the screen. The width and height * values can be set to the default sizes for the image by passing -1 * in those parameters. * * @param image The image to prepare for rendering. * @param width The width of the image. * @param height The height of the image. * @param observer The observer to receive events about the preparation * process. * * @return <code>true</code> if the image is already prepared for rendering, * <code>false</code> otherwise. */public abstract booleanprepareImage(Image image, int width, int height, ImageObserver observer);/*************************************************************************//** * Checks the status of specified image as it is being readied for * rendering. * * @param image The image to prepare for rendering. * @param width The width of the image. * @param height The height of the image. * @param observer The observer to receive events about the preparation * process. * * @return A union of the bitmasks from * <code>java.awt.image.ImageObserver</code> that indicates the current * state of the imaging readying process. */public abstract intcheckImage(Image image, int width, int height, ImageObserver observer);/*************************************************************************//** * Creates an image using the specified <code>ImageProducer</code> * * @param producer The <code>ImageProducer</code> to create the image from. * * @return The created image. */public abstract ImagecreateImage(ImageProducer producer);/*************************************************************************//** * Creates an image from the specified portion of the byte array passed. * The array must be in a recognized format. Supported formats vary from * toolkit to toolkit. * * @param data The raw image data. * @param offset The offset into the data where the image data starts. * @param len The length of the image data. * * @return The created image. */public abstract ImagecreateImage(byte[] data, int offset, int len);/*************************************************************************//** * Creates an image from the specified byte array. The array must be in * a recognized format. Supported formats vary from toolkit to toolkit. * * @param data The raw image data. * * @return The created image. */public ImagecreateImage(byte[] data){ return(createImage(data, 0, data.length));}public abstract ImagecreateImage(String filename);public abstract ImagecreateImage(URL url);/*************************************************************************//** * Returns a instance of <code>PrintJob</code> for the specified * arguments. * * @param frame The window initiating the print job. * @param title The print job title. * @param props The print job properties. * * @return The requested print job, or <code>null</code> if the job * was cancelled. */public abstract PrintJobgetPrintJob(Frame frame, String title, Properties props);/*************************************************************************//** * Returns the system clipboard. * * @return THe system clipboard. */public abstract ClipboardgetSystemClipboard();/*************************************************************************//** * Returns the accelerator key mask for menu shortcuts. The default is * <code>Event.CTRL_MASK</code>. A toolkit must override this method * to change the default. * * @return The key mask for the menu accelerator key. */public intgetMenuShortcutKeyMask(){ return Event.CTRL_MASK;}public booleangetLockingKeyState(int keyCode){ if (keyCode != KeyEvent.VK_CAPS_LOCK && keyCode != KeyEvent.VK_NUM_LOCK && keyCode != KeyEvent.VK_SCROLL_LOCK) throw new IllegalArgumentException(); throw new UnsupportedOperationException();}public voidsetLockingKeyState(int keyCode, boolean on){ if (keyCode != KeyEvent.VK_CAPS_LOCK && keyCode != KeyEvent.VK_NUM_LOCK && keyCode != KeyEvent.VK_SCROLL_LOCK) throw new IllegalArgumentException(); throw new UnsupportedOperationException();}/*************************************************************************//** * Returns the event queue for the applet. Despite the word "System" * in the name of this method, there is no guarantee that the same queue * is shared system wide. * * @return The event queue for this applet (or application) */public final EventQueuegetSystemEventQueue(){ return(getSystemEventQueueImpl());}/*************************************************************************//** * // FIXME: What does this do? */protected abstract EventQueuegetSystemEventQueueImpl();/*************************************************************************//** * Causes a "beep" tone to be generated. */public abstract voidbeep();public CursorcreateCustomCursor(Image cursor, Point hotSpot, String name) throws IndexOutOfBoundsException{ // Presumably the only reason this isn't abstract is for backwards // compatibility? FIXME? return null;}public DimensiongetBestCursorSize(int preferredWidth, int preferredHeight){ return new Dimension (0,0);}public intgetMaximumCursorColors(){ return 0;}public final ObjectgetDesktopProperty(String propertyName){ return desktopProperties.get(propertyName);}protected final voidsetDesktopProperty(String name, Object newValue){ Object oldValue = getDesktopProperty(name); desktopProperties.put(name, newValue); changeSupport.firePropertyChange(name, oldValue, newValue);}protected ObjectlazilyLoadDesktopProperty(String name){ // FIXME - what is this?? return null;}protected voidinitializeDesktopProperties(){ // Overridden by toolkit implementation?}public voidaddPropertyChangeListener(String name, PropertyChangeListener pcl){ changeSupport.addPropertyChangeListener(name, pcl);} public voidremovePropertyChangeListener(String name, PropertyChangeListener pcl){ changeSupport.removePropertyChangeListener(name, pcl);}public voidaddAWTEventListener(AWTEventListener listener, long eventMask){ // SecurityManager s = System.getSecurityManager(); // if (s != null) // s.checkPermission(AWTPermission("listenToAllAWTEvents")); // FIXME}public voidremoveAWTEventListener(AWTEventListener listener){ // FIXME}} // class Toolkit
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -