Showing the changes to java/pkg/java/awt/peer (66 of 18352 files). Show all
Unified · Split
Binary file not shown.
| @@ -0,0 +1,50 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package java.awt.peer; | ||
| 27 | |||
| 28 | import java.awt.Button; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * The peer interface for {@link Button}. | ||
| 32 | * | ||
| 33 | * The peer interfaces are intended only for use in porting | ||
| 34 | * the AWT. They are not intended for use by application | ||
| 35 | * developers, and developers should not implement peers | ||
| 36 | * nor invoke any of the peer methods directly on the peer | ||
| 37 | * instances. | ||
| 38 | */ | ||
| 39 | public interface ButtonPeer extends ComponentPeer { | ||
| 40 | |||
| 41 | /** | ||
| 42 | * Sets the label that is displayed on the button. Can be {@code null} | ||
| 43 | * when the button should not display a label. | ||
| 44 | * | ||
| 45 | * @param label the label string to set | ||
| 46 | * | ||
| 47 | * @see Button#setLabel | ||
| 48 | */ | ||
| 49 | void setLabel(String label); | ||
| 50 | } | ||
Binary file not shown.
| @@ -0,0 +1,49 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.Canvas; | ||
| 28 | import java.awt.GraphicsConfiguration; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * The peer interface for {@link Canvas}. | ||
| 32 | * | ||
| 33 | * The peer interfaces are intended only for use in porting | ||
| 34 | * the AWT. They are not intended for use by application | ||
| 35 | * developers, and developers should not implement peers | ||
| 36 | * nor invoke any of the peer methods directly on the peer | ||
| 37 | * instances. | ||
| 38 | */ | ||
| 39 | public interface CanvasPeer extends ComponentPeer { | ||
| 40 | /** | ||
| 41 | * Requests a GC that best suits this Canvas. The returned GC may differ | ||
| 42 | * from the requested GC passed as the argument to this method. This method | ||
| 43 | * must return a non-null value (given the argument is non-null as well). | ||
| 44 | * | ||
| 45 | * @since 1.7 | ||
| 46 | */ | ||
| 47 | GraphicsConfiguration getAppropriateGraphicsConfiguration( | ||
| 48 | GraphicsConfiguration gc); | ||
| 49 | } | ||
Binary file not shown.
| @@ -0,0 +1,49 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 1998, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.CheckboxMenuItem; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * The peer interface for {@link CheckboxMenuItem}. | ||
| 31 | * | ||
| 32 | * The peer interfaces are intended only for use in porting | ||
| 33 | * the AWT. They are not intended for use by application | ||
| 34 | * developers, and developers should not implement peers | ||
| 35 | * nor invoke any of the peer methods directly on the peer | ||
| 36 | * instances. | ||
| 37 | */ | ||
| 38 | public interface CheckboxMenuItemPeer extends MenuItemPeer { | ||
| 39 | |||
| 40 | /** | ||
| 41 | * Sets the state of the checkbox to be checked ({@code true}) or | ||
| 42 | * unchecked ({@code false}). | ||
| 43 | * | ||
| 44 | * @param t the state to set on the checkbox | ||
| 45 | * | ||
| 46 | * @see CheckboxMenuItemPeer#setState(boolean) | ||
| 47 | */ | ||
| 48 | void setState(boolean t); | ||
| 49 | } | ||
Binary file not shown.
| @@ -0,0 +1,71 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 1998, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.*; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * The peer interface for {@link Checkbox}. | ||
| 31 | * | ||
| 32 | * The peer interfaces are intended only for use in porting | ||
| 33 | * the AWT. They are not intended for use by application | ||
| 34 | * developers, and developers should not implement peers | ||
| 35 | * nor invoke any of the peer methods directly on the peer | ||
| 36 | * instances. | ||
| 37 | */ | ||
| 38 | public interface CheckboxPeer extends ComponentPeer { | ||
| 39 | |||
| 40 | /** | ||
| 41 | * Sets the state of the checkbox to be checked ({@code true}) or | ||
| 42 | * unchecked ({@code false}). | ||
| 43 | * | ||
| 44 | * @param t the state to set on the checkbox | ||
| 45 | * | ||
| 46 | * @see Checkbox#setState(boolean) | ||
| 47 | */ | ||
| 48 | void setState(boolean state); | ||
| 49 | |||
| 50 | /** | ||
| 51 | * Sets the checkbox group for this checkbox. Checkboxes in one checkbox | ||
| 52 | * group can only be selected exclusively (like radio buttons). A value | ||
| 53 | * of {@code null} removes this checkbox from any checkbox group. | ||
| 54 | * | ||
| 55 | * @param g the checkbox group to set, or {@code null} when this | ||
| 56 | * checkbox should not be placed in any group | ||
| 57 | * | ||
| 58 | * @see Checkbox#setCheckboxGroup(CheckboxGroup) | ||
| 59 | */ | ||
| 60 | void setCheckboxGroup(CheckboxGroup g); | ||
| 61 | |||
| 62 | /** | ||
| 63 | * Sets the label that should be displayed on the ckeckbox. A value of | ||
| 64 | * {@code null} means that no label should be displayed. | ||
| 65 | * | ||
| 66 | * @param label the label to be displayed on the checkbox, or | ||
| 67 | * {@code null} when no label should be displayed. | ||
| 68 | */ | ||
| 69 | void setLabel(String label); | ||
| 70 | |||
| 71 | } | ||
Binary file not shown.
| @@ -0,0 +1,76 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.Choice; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * The peer interface for {@link Choice}. | ||
| 31 | * | ||
| 32 | * The peer interfaces are intended only for use in porting | ||
| 33 | * the AWT. They are not intended for use by application | ||
| 34 | * developers, and developers should not implement peers | ||
| 35 | * nor invoke any of the peer methods directly on the peer | ||
| 36 | * instances. | ||
| 37 | */ | ||
| 38 | public interface ChoicePeer extends ComponentPeer { | ||
| 39 | |||
| 40 | /** | ||
| 41 | * Adds an item with the string {@code item} to the combo box list | ||
| 42 | * at index {@code index}. | ||
| 43 | * | ||
| 44 | * @param item the label to be added to the list | ||
| 45 | * @param index the index where to add the item | ||
| 46 | * | ||
| 47 | * @see Choice#add(String) | ||
| 48 | */ | ||
| 49 | void add(String item, int index); | ||
| 50 | |||
| 51 | /** | ||
| 52 | * Removes the item at index {@code index} from the combo box list. | ||
| 53 | * | ||
| 54 | * @param index the index where to remove the item | ||
| 55 | * | ||
| 56 | * @see Choice#remove(int) | ||
| 57 | */ | ||
| 58 | void remove(int index); | ||
| 59 | |||
| 60 | /** | ||
| 61 | * Removes all items from the combo box list. | ||
| 62 | * | ||
| 63 | * @see Choice#removeAll() | ||
| 64 | */ | ||
| 65 | void removeAll(); | ||
| 66 | |||
| 67 | /** | ||
| 68 | * Selects the item at index {@code index}. | ||
| 69 | * | ||
| 70 | * @param index the index which should be selected | ||
| 71 | * | ||
| 72 | * @see Choice#select(int) | ||
| 73 | */ | ||
| 74 | void select(int index); | ||
| 75 | |||
| 76 | } | ||
Binary file not shown.
| @@ -0,0 +1,555 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package java.awt.peer; | ||
| 27 | |||
| 28 | import java.awt.*; | ||
| 29 | import java.awt.event.PaintEvent; | ||
| 30 | import java.awt.image.ImageProducer; | ||
| 31 | import java.awt.image.ImageObserver; | ||
| 32 | import java.awt.image.ColorModel; | ||
| 33 | import java.awt.image.VolatileImage; | ||
| 34 | import java.awt.GraphicsConfiguration; | ||
| 35 | import sun.awt.CausedFocusEvent; | ||
| 36 | import sun.java2d.pipe.Region; | ||
| 37 | |||
| 38 | |||
| 39 | /** | ||
| 40 | * The peer interface for {@link Component}. This is the top level peer | ||
| 41 | * interface for widgets and defines the bulk of methods for AWT component | ||
| 42 | * peers. Most component peers have to implement this interface (via one | ||
| 43 | * of the subinterfaces), except menu components, which implement | ||
| 44 | * {@link MenuComponentPeer}. | ||
| 45 | * | ||
| 46 | * The peer interfaces are intended only for use in porting | ||
| 47 | * the AWT. They are not intended for use by application | ||
| 48 | * developers, and developers should not implement peers | ||
| 49 | * nor invoke any of the peer methods directly on the peer | ||
| 50 | * instances. | ||
| 51 | */ | ||
| 52 | public interface ComponentPeer { | ||
| 53 | |||
| 54 | /** | ||
| 55 | * Operation for {@link #setBounds(int, int, int, int, int)}, indicating | ||
| 56 | * a change in the component location only. | ||
| 57 | * | ||
| 58 | * @see #setBounds(int, int, int, int, int) | ||
| 59 | */ | ||
| 60 | public static final int SET_LOCATION = 1; | ||
| 61 | |||
| 62 | /** | ||
| 63 | * Operation for {@link #setBounds(int, int, int, int, int)}, indicating | ||
| 64 | * a change in the component size only. | ||
| 65 | * | ||
| 66 | * @see #setBounds(int, int, int, int, int) | ||
| 67 | */ | ||
| 68 | public static final int SET_SIZE = 2; | ||
| 69 | |||
| 70 | /** | ||
| 71 | * Operation for {@link #setBounds(int, int, int, int, int)}, indicating | ||
| 72 | * a change in the component size and location. | ||
| 73 | * | ||
| 74 | * @see #setBounds(int, int, int, int, int) | ||
| 75 | */ | ||
| 76 | public static final int SET_BOUNDS = 3; | ||
| 77 | |||
| 78 | /** | ||
| 79 | * Operation for {@link #setBounds(int, int, int, int, int)}, indicating | ||
| 80 | * a change in the component client size. This is used for setting | ||
| 81 | * the 'inside' size of windows, without the border insets. | ||
| 82 | * | ||
| 83 | * @see #setBounds(int, int, int, int, int) | ||
| 84 | */ | ||
| 85 | public static final int SET_CLIENT_SIZE = 4; | ||
| 86 | |||
| 87 | /** | ||
| 88 | * Resets the setBounds() operation to DEFAULT_OPERATION. This is not | ||
| 89 | * passed into {@link #setBounds(int, int, int, int, int)}. | ||
| 90 | * | ||
| 91 | * TODO: This is only used internally and should probably be moved outside | ||
| 92 | * the peer interface. | ||
| 93 | * | ||
| 94 | * @see Component#setBoundsOp | ||
| 95 | */ | ||
| 96 | public static final int RESET_OPERATION = 5; | ||
| 97 | |||
| 98 | /** | ||
| 99 | * A flag that is used to suppress checks for embedded frames. | ||
| 100 | * | ||
| 101 | * TODO: This is only used internally and should probably be moved outside | ||
| 102 | * the peer interface. | ||
| 103 | */ | ||
| 104 | public static final int NO_EMBEDDED_CHECK = (1 << 14); | ||
| 105 | |||
| 106 | /** | ||
| 107 | * The default operation, which is to set size and location. | ||
| 108 | * | ||
| 109 | * TODO: This is only used internally and should probably be moved outside | ||
| 110 | * the peer interface. | ||
| 111 | * | ||
| 112 | * @see Component#setBoundsOp | ||
| 113 | */ | ||
| 114 | public static final int DEFAULT_OPERATION = SET_BOUNDS; | ||
| 115 | |||
| 116 | /** | ||
| 117 | * Determines if a component has been obscured, i.e. by an overlapping | ||
| 118 | * window or similar. This is used by JViewport for optimizing performance. | ||
| 119 | * This doesn't have to be implemented, when | ||
| 120 | * {@link #canDetermineObscurity()} returns {@code false}. | ||
| 121 | * | ||
| 122 | * @return {@code true} when the component has been obscured, | ||
| 123 | * {@code false} otherwise | ||
| 124 | * | ||
| 125 | * @see #canDetermineObscurity() | ||
| 126 | * @see javax.swing.JViewport#needsRepaintAfterBlit | ||
| 127 | */ | ||
| 128 | boolean isObscured(); | ||
| 129 | |||
| 130 | /** | ||
| 131 | * Returns {@code true} when the peer can determine if a component | ||
| 132 | * has been obscured, {@code false} false otherwise. | ||
| 133 | * | ||
| 134 | * @return {@code true} when the peer can determine if a component | ||
| 135 | * has been obscured, {@code false} false otherwise | ||
| 136 | * | ||
| 137 | * @see #isObscured() | ||
| 138 | * @see javax.swing.JViewport#needsRepaintAfterBlit | ||
| 139 | */ | ||
| 140 | boolean canDetermineObscurity(); | ||
| 141 | |||
| 142 | /** | ||
| 143 | * Makes a component visible or invisible. | ||
| 144 | * | ||
| 145 | * @param v {@code true} to make a component visible, | ||
| 146 | * {@code false} to make it invisible | ||
| 147 | * | ||
| 148 | * @see Component#setVisible(boolean) | ||
| 149 | */ | ||
| 150 | void setVisible(boolean v); | ||
| 151 | |||
| 152 | /** | ||
| 153 | * Enables or disables a component. Disabled components are usually grayed | ||
| 154 | * out and cannot be activated. | ||
| 155 | * | ||
| 156 | * @param e {@code true} to enable the component, {@code false} | ||
| 157 | * to disable it | ||
| 158 | * | ||
| 159 | * @see Component#setEnabled(boolean) | ||
| 160 | */ | ||
| 161 | void setEnabled(boolean e); | ||
| 162 | |||
| 163 | /** | ||
| 164 | * Paints the component to the specified graphics context. This is called | ||
| 165 | * by {@link Component#paintAll(Graphics)} to paint the component. | ||
| 166 | * | ||
| 167 | * @param g the graphics context to paint to | ||
| 168 | * | ||
| 169 | * @see Component#paintAll(Graphics) | ||
| 170 | */ | ||
| 171 | void paint(Graphics g); | ||
| 172 | |||
| 173 | /** | ||
| 174 | * Prints the component to the specified graphics context. This is called | ||
| 175 | * by {@link Component#printAll(Graphics)} to print the component. | ||
| 176 | * | ||
| 177 | * @param g the graphics context to print to | ||
| 178 | * | ||
| 179 | * @see Component#printAll(Graphics) | ||
| 180 | */ | ||
| 181 | void print(Graphics g); | ||
| 182 | |||
| 183 | /** | ||
| 184 | * Sets the location or size or both of the component. The location is | ||
| 185 | * specified relative to the component's parent. The {@code op} | ||
| 186 | * parameter specifies which properties change. If it is | ||
| 187 | * {@link #SET_LOCATION}, then only the location changes (and the size | ||
| 188 | * parameters can be ignored). If {@code op} is {@link #SET_SIZE}, | ||
| 189 | * then only the size changes (and the location can be ignored). If | ||
| 190 | * {@code op} is {@link #SET_BOUNDS}, then both change. There is a | ||
| 191 | * special value {@link #SET_CLIENT_SIZE}, which is used only for | ||
| 192 | * window-like components to set the size of the client (i.e. the 'inner' | ||
| 193 | * size, without the insets of the window borders). | ||
| 194 | * | ||
| 195 | * @param x the X location of the component | ||
| 196 | * @param y the Y location of the component | ||
| 197 | * @param width the width of the component | ||
| 198 | * @param height the height of the component | ||
| 199 | * @param op the operation flag | ||
| 200 | * | ||
| 201 | * @see #SET_BOUNDS | ||
| 202 | * @see #SET_LOCATION | ||
| 203 | * @see #SET_SIZE | ||
| 204 | * @see #SET_CLIENT_SIZE | ||
| 205 | */ | ||
| 206 | void setBounds(int x, int y, int width, int height, int op); | ||
| 207 | |||
| 208 | /** | ||
| 209 | * Called to let the component peer handle events. | ||
| 210 | * | ||
| 211 | * @param e the AWT event to handle | ||
| 212 | * | ||
| 213 | * @see Component#dispatchEvent(AWTEvent) | ||
| 214 | */ | ||
| 215 | void handleEvent(AWTEvent e); | ||
| 216 | |||
| 217 | /** | ||
| 218 | * Called to coalesce paint events. | ||
| 219 | * | ||
| 220 | * @param e the paint event to consider to coalesce | ||
| 221 | * | ||
| 222 | * @see EventQueue#coalescePaintEvent | ||
| 223 | */ | ||
| 224 | void coalescePaintEvent(PaintEvent e); | ||
| 225 | |||
| 226 | /** | ||
| 227 | * Determines the location of the component on the screen. | ||
| 228 | * | ||
| 229 | * @return the location of the component on the screen | ||
| 230 | * | ||
| 231 | * @see Component#getLocationOnScreen() | ||
| 232 | */ | ||
| 233 | Point getLocationOnScreen(); | ||
| 234 | |||
| 235 | /** | ||
| 236 | * Determines the preferred size of the component. | ||
| 237 | * | ||
| 238 | * @return the preferred size of the component | ||
| 239 | * | ||
| 240 | * @see Component#getPreferredSize() | ||
| 241 | */ | ||
| 242 | Dimension getPreferredSize(); | ||
| 243 | |||
| 244 | /** | ||
| 245 | * Determines the minimum size of the component. | ||
| 246 | * | ||
| 247 | * @return the minimum size of the component | ||
| 248 | * | ||
| 249 | * @see Component#getMinimumSize() | ||
| 250 | */ | ||
| 251 | Dimension getMinimumSize(); | ||
| 252 | |||
| 253 | /** | ||
| 254 | * Returns the color model used by the component. | ||
| 255 | * | ||
| 256 | * @return the color model used by the component | ||
| 257 | * | ||
| 258 | * @see Component#getColorModel() | ||
| 259 | */ | ||
| 260 | ColorModel getColorModel(); | ||
| 261 | |||
| 262 | /** | ||
| 263 | * Returns the toolkit that is responsible for the component. | ||
| 264 | * | ||
| 265 | * @return the toolkit that is responsible for the component | ||
| 266 | * | ||
| 267 | * @see Component#getToolkit() | ||
| 268 | */ | ||
| 269 | Toolkit getToolkit(); | ||
| 270 | |||
| 271 | /** | ||
| 272 | * Returns a graphics object to paint on the component. | ||
| 273 | * | ||
| 274 | * @return a graphics object to paint on the component | ||
| 275 | * | ||
| 276 | * @see Component#getGraphics() | ||
| 277 | */ | ||
| 278 | // TODO: Maybe change this to force Graphics2D, since many things will | ||
| 279 | // break with plain Graphics nowadays. | ||
| 280 | Graphics getGraphics(); | ||
| 281 | |||
| 282 | /** | ||
| 283 | * Returns a font metrics object to determine the metrics properties of | ||
| 284 | * the specified font. | ||
| 285 | * | ||
| 286 | * @param font the font to determine the metrics for | ||
| 287 | * | ||
| 288 | * @return a font metrics object to determine the metrics properties of | ||
| 289 | * the specified font | ||
| 290 | * | ||
| 291 | * @see Component#getFontMetrics(Font) | ||
| 292 | */ | ||
| 293 | FontMetrics getFontMetrics(Font font); | ||
| 294 | |||
| 295 | /** | ||
| 296 | * Disposes all resources held by the component peer. This is called | ||
| 297 | * when the component has been disconnected from the component hierarchy | ||
| 298 | * and is about to be garbage collected. | ||
| 299 | * | ||
| 300 | * @see Component#removeNotify() | ||
| 301 | */ | ||
| 302 | void dispose(); | ||
| 303 | |||
| 304 | /** | ||
| 305 | * Sets the foreground color of this component. | ||
| 306 | * | ||
| 307 | * @param c the foreground color to set | ||
| 308 | * | ||
| 309 | * @see Component#setForeground(Color) | ||
| 310 | */ | ||
| 311 | void setForeground(Color c); | ||
| 312 | |||
| 313 | /** | ||
| 314 | * Sets the background color of this component. | ||
| 315 | * | ||
| 316 | * @param c the background color to set | ||
| 317 | * | ||
| 318 | * @see Component#setBackground(Color) | ||
| 319 | */ | ||
| 320 | void setBackground(Color c); | ||
| 321 | |||
| 322 | /** | ||
| 323 | * Sets the font of this component. | ||
| 324 | * | ||
| 325 | * @param f the font of this component | ||
| 326 | * | ||
| 327 | * @see Component#setFont(Font) | ||
| 328 | */ | ||
| 329 | void setFont(Font f); | ||
| 330 | |||
| 331 | /** | ||
| 332 | * Updates the cursor of the component. | ||
| 333 | * | ||
| 334 | * @see Component#updateCursorImmediately | ||
| 335 | */ | ||
| 336 | void updateCursorImmediately(); | ||
| 337 | |||
| 338 | /** | ||
| 339 | * Requests focus on this component. | ||
| 340 | * | ||
| 341 | * @param lightweightChild the actual lightweight child that requests the | ||
| 342 | * focus | ||
| 343 | * @param temporary {@code true} if the focus change is temporary, | ||
| 344 | * {@code false} otherwise | ||
| 345 | * @param focusedWindowChangeAllowed {@code true} if changing the | ||
| 346 | * focus of the containing window is allowed or not | ||
| 347 | * @param time the time of the focus change request | ||
| 348 | * @param cause the cause of the focus change request | ||
| 349 | * | ||
| 350 | * @return {@code true} if the focus change is guaranteed to be | ||
| 351 | * granted, {@code false} otherwise | ||
| 352 | */ | ||
| 353 | boolean requestFocus(Component lightweightChild, boolean temporary, | ||
| 354 | boolean focusedWindowChangeAllowed, long time, | ||
| 355 | CausedFocusEvent.Cause cause); | ||
| 356 | |||
| 357 | /** | ||
| 358 | * Returns {@code true} when the component takes part in the focus | ||
| 359 | * traversal, {@code false} otherwise. | ||
| 360 | * | ||
| 361 | * @return {@code true} when the component takes part in the focus | ||
| 362 | * traversal, {@code false} otherwise | ||
| 363 | */ | ||
| 364 | boolean isFocusable(); | ||
| 365 | |||
| 366 | /** | ||
| 367 | * Creates an image using the specified image producer. | ||
| 368 | * | ||
| 369 | * @param producer the image producer from which the image pixels will be | ||
| 370 | * produced | ||
| 371 | * | ||
| 372 | * @return the created image | ||
| 373 | * | ||
| 374 | * @see Component#createImage(ImageProducer) | ||
| 375 | */ | ||
| 376 | Image createImage(ImageProducer producer); | ||
| 377 | |||
| 378 | /** | ||
| 379 | * Creates an empty image with the specified width and height. This is | ||
| 380 | * generally used as a non-accelerated backbuffer for drawing onto the | ||
| 381 | * component (e.g. by Swing). | ||
| 382 | * | ||
| 383 | * @param width the width of the image | ||
| 384 | * @param height the height of the image | ||
| 385 | * | ||
| 386 | * @return the created image | ||
| 387 | * | ||
| 388 | * @see Component#createImage(int, int) | ||
| 389 | */ | ||
| 390 | // TODO: Maybe make that return a BufferedImage, because some stuff will | ||
| 391 | // break if a different kind of image is returned. | ||
| 392 | Image createImage(int width, int height); | ||
| 393 | |||
| 394 | /** | ||
| 395 | * Creates an empty volatile image with the specified width and height. | ||
| 396 | * This is generally used as an accelerated backbuffer for drawing onto | ||
| 397 | * the component (e.g. by Swing). | ||
| 398 | * | ||
| 399 | * @param width the width of the image | ||
| 400 | * @param height the height of the image | ||
| 401 | * | ||
| 402 | * @return the created volatile image | ||
| 403 | * | ||
| 404 | * @see Component#createVolatileImage(int, int) | ||
| 405 | */ | ||
| 406 | // TODO: Include capabilities here and fix Component#createVolatileImage | ||
| 407 | VolatileImage createVolatileImage(int width, int height); | ||
| 408 | |||
| 409 | /** | ||
| 410 | * Prepare the specified image for rendering on this component. This should | ||
| 411 | * start loading the image (if not already loaded) and create an | ||
| 412 | * appropriate screen representation. | ||
| 413 | * | ||
| 414 | * @param img the image to prepare | ||
| 415 | * @param w the width of the screen representation | ||
| 416 | * @param h the height of the screen representation | ||
| 417 | * @param o an image observer to observe the progress | ||
| 418 | * | ||
| 419 | * @return {@code true} if the image is already fully prepared, | ||
| 420 | * {@code false} otherwise | ||
| 421 | * | ||
| 422 | * @see Component#prepareImage(Image, int, int, ImageObserver) | ||
| 423 | */ | ||
| 424 | boolean prepareImage(Image img, int w, int h, ImageObserver o); | ||
| 425 | |||
| 426 | /** | ||
| 427 | * Determines the status of the construction of the screen representaion | ||
| 428 | * of the specified image. | ||
| 429 | * | ||
| 430 | * @param img the image to check | ||
| 431 | * @param w the target width | ||
| 432 | * @param h the target height | ||
| 433 | * @param o the image observer to notify | ||
| 434 | * | ||
| 435 | * @return the status as bitwise ORed ImageObserver flags | ||
| 436 | * | ||
| 437 | * @see Component#checkImage(Image, int, int, ImageObserver) | ||
| 438 | */ | ||
| 439 | int checkImage(Image img, int w, int h, ImageObserver o); | ||
| 440 | |||
| 441 | /** | ||
| 442 | * Returns the graphics configuration that corresponds to this component. | ||
| 443 | * | ||
| 444 | * @return the graphics configuration that corresponds to this component | ||
| 445 | * | ||
| 446 | * @see Component#getGraphicsConfiguration() | ||
| 447 | */ | ||
| 448 | GraphicsConfiguration getGraphicsConfiguration(); | ||
| 449 | |||
| 450 | /** | ||
| 451 | * Determines if the component handles wheel scrolling itself. Otherwise | ||
| 452 | * it is delegated to the component's parent. | ||
| 453 | * | ||
| 454 | * @return {@code true} if the component handles wheel scrolling, | ||
| 455 | * {@code false} otherwise | ||
| 456 | * | ||
| 457 | * @see Component#dispatchEventImpl(AWTEvent) | ||
| 458 | */ | ||
| 459 | boolean handlesWheelScrolling(); | ||
| 460 | |||
| 461 | /** | ||
| 462 | * Create {@code numBuffers} flipping buffers with the specified | ||
| 463 | * buffer capabilities. | ||
| 464 | * | ||
| 465 | * @param numBuffers the number of buffers to create | ||
| 466 | * @param caps the buffer capabilities | ||
| 467 | * | ||
| 468 | * @throws AWTException if flip buffering is not supported | ||
| 469 | * | ||
| 470 | * @see Component.FlipBufferStrategy#createBuffers | ||
| 471 | */ | ||
| 472 | void createBuffers(int numBuffers, BufferCapabilities caps) | ||
| 473 | throws AWTException; | ||
| 474 | |||
| 475 | /** | ||
| 476 | * Returns the back buffer as image. | ||
| 477 | * | ||
| 478 | * @return the back buffer as image | ||
| 479 | * | ||
| 480 | * @see Component.FlipBufferStrategy#getBackBuffer | ||
| 481 | */ | ||
| 482 | Image getBackBuffer(); | ||
| 483 | |||
| 484 | /** | ||
| 485 | * Move the back buffer to the front buffer. | ||
| 486 | * | ||
| 487 | * @param x1 the area to be flipped, upper left X coordinate | ||
| 488 | * @param y1 the area to be flipped, upper left Y coordinate | ||
| 489 | * @param x2 the area to be flipped, lower right X coordinate | ||
| 490 | * @param y2 the area to be flipped, lower right Y coordinate | ||
| 491 | * @param flipAction the flip action to perform | ||
| 492 | * | ||
| 493 | * @see Component.FlipBufferStrategy#flip | ||
| 494 | */ | ||
| 495 | void flip(int x1, int y1, int x2, int y2, BufferCapabilities.FlipContents flipAction); | ||
| 496 | |||
| 497 | /** | ||
| 498 | * Destroys all created buffers. | ||
| 499 | * | ||
| 500 | * @see Component.FlipBufferStrategy#destroyBuffers | ||
| 501 | */ | ||
| 502 | void destroyBuffers(); | ||
| 503 | |||
| 504 | /** | ||
| 505 | * Reparents this peer to the new parent referenced by | ||
| 506 | * {@code newContainer} peer. Implementation depends on toolkit and | ||
| 507 | * container. | ||
| 508 | * | ||
| 509 | * @param newContainer peer of the new parent container | ||
| 510 | * | ||
| 511 | * @since 1.5 | ||
| 512 | */ | ||
| 513 | void reparent(ContainerPeer newContainer); | ||
| 514 | |||
| 515 | /** | ||
| 516 | * Returns whether this peer supports reparenting to another parent without | ||
| 517 | * destroying the peer. | ||
| 518 | * | ||
| 519 | * @return true if appropriate reparent is supported, false otherwise | ||
| 520 | * | ||
| 521 | * @since 1.5 | ||
| 522 | */ | ||
| 523 | boolean isReparentSupported(); | ||
| 524 | |||
| 525 | /** | ||
| 526 | * Used by lightweight implementations to tell a ComponentPeer to layout | ||
| 527 | * its sub-elements. For instance, a lightweight Checkbox needs to layout | ||
| 528 | * the box, as well as the text label. | ||
| 529 | * | ||
| 530 | * @see Component#validate() | ||
| 531 | */ | ||
| 532 | void layout(); | ||
| 533 | |||
| 534 | /** | ||
| 535 | * Applies the shape to the native component window. | ||
| 536 | * @since 1.7 | ||
| 537 | * | ||
| 538 | * @see Component#applyCompoundShape | ||
| 539 | */ | ||
| 540 | void applyShape(Region shape); | ||
| 541 | |||
| 542 | /** | ||
| 543 | * Lowers this component at the bottom of the above HW peer. If the above parameter | ||
| 544 | * is null then the method places this component at the top of the Z-order. | ||
| 545 | */ | ||
| 546 | void setZOrder(ComponentPeer above); | ||
| 547 | |||
| 548 | /** | ||
| 549 | * Updates internal data structures related to the component's GC. | ||
| 550 | * | ||
| 551 | * @return if the peer needs to be recreated for the changes to take effect | ||
| 552 | * @since 1.7 | ||
| 553 | */ | ||
| 554 | boolean updateGraphicsData(GraphicsConfiguration gc); | ||
| 555 | } | ||
Binary file not shown.
| @@ -0,0 +1,79 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 2005, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.*; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * The peer interface for {@link Container}. This is the parent interface | ||
| 31 | * for all container like widgets. | ||
| 32 | * | ||
| 33 | * The peer interfaces are intended only for use in porting | ||
| 34 | * the AWT. They are not intended for use by application | ||
| 35 | * developers, and developers should not implement peers | ||
| 36 | * nor invoke any of the peer methods directly on the peer | ||
| 37 | * instances. | ||
| 38 | */ | ||
| 39 | public interface ContainerPeer extends ComponentPeer { | ||
| 40 | |||
| 41 | /** | ||
| 42 | * Returns the insets of this container. Insets usually is the space that | ||
| 43 | * is occupied by things like borders. | ||
| 44 | * | ||
| 45 | * @return the insets of this container | ||
| 46 | */ | ||
| 47 | Insets getInsets(); | ||
| 48 | |||
| 49 | /** | ||
| 50 | * Notifies the peer that validation of the component tree is about to | ||
| 51 | * begin. | ||
| 52 | * | ||
| 53 | * @see Container#validate() | ||
| 54 | */ | ||
| 55 | void beginValidate(); | ||
| 56 | |||
| 57 | /** | ||
| 58 | * Notifies the peer that validation of the component tree is finished. | ||
| 59 | * | ||
| 60 | * @see Container#validate() | ||
| 61 | */ | ||
| 62 | void endValidate(); | ||
| 63 | |||
| 64 | /** | ||
| 65 | * Notifies the peer that layout is about to begin. This is called | ||
| 66 | * before the container itself and its children are laid out. | ||
| 67 | * | ||
| 68 | * @see Container#validateTree() | ||
| 69 | */ | ||
| 70 | void beginLayout(); | ||
| 71 | |||
| 72 | /** | ||
| 73 | * Notifies the peer that layout is finished. This is called after the | ||
| 74 | * container and its children have been laid out. | ||
| 75 | * | ||
| 76 | * @see Container#validateTree() | ||
| 77 | */ | ||
| 78 | void endLayout(); | ||
| 79 | } | ||
Binary file not shown.
| @@ -0,0 +1,107 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package java.awt.peer; | ||
| 27 | |||
| 28 | |||
| 29 | import java.io.File; | ||
| 30 | import java.io.IOException; | ||
| 31 | import java.net.URI; | ||
| 32 | import java.awt.Desktop.Action; | ||
| 33 | |||
| 34 | /** | ||
| 35 | * The {@code DesktopPeer} interface provides methods for the operation | ||
| 36 | * of open, edit, print, browse and mail with the given URL or file, by | ||
| 37 | * launching the associated application. | ||
| 38 | * <p> | ||
| 39 | * Each platform has an implementation class for this interface. | ||
| 40 | * | ||
| 41 | */ | ||
| 42 | public interface DesktopPeer { | ||
| 43 | |||
| 44 | /** | ||
| 45 | * Returns whether the given action is supported on the current platform. | ||
| 46 | * @param action the action type to be tested if it's supported on the | ||
| 47 | * current platform. | ||
| 48 | * @return {@code true} if the given action is supported on | ||
| 49 | * the current platform; {@code false} otherwise. | ||
| 50 | */ | ||
| 51 | boolean isSupported(Action action); | ||
| 52 | |||
| 53 | /** | ||
| 54 | * Launches the associated application to open the given file. The | ||
| 55 | * associated application is registered to be the default file viewer for | ||
| 56 | * the file type of the given file. | ||
| 57 | * | ||
| 58 | * @param file the given file. | ||
| 59 | * @throws IOException If the given file has no associated application, | ||
| 60 | * or the associated application fails to be launched. | ||
| 61 | */ | ||
| 62 | void open(File file) throws IOException; | ||
| 63 | |||
| 64 | /** | ||
| 65 | * Launches the associated editor and opens the given file for editing. The | ||
| 66 | * associated editor is registered to be the default editor for the file | ||
| 67 | * type of the given file. | ||
| 68 | * | ||
| 69 | * @param file the given file. | ||
| 70 | * @throws IOException If the given file has no associated editor, or | ||
| 71 | * the associated application fails to be launched. | ||
| 72 | */ | ||
| 73 | void edit(File file) throws IOException; | ||
| 74 | |||
| 75 | /** | ||
| 76 | * Prints the given file with the native desktop printing facility, using | ||
| 77 | * the associated application's print command. | ||
| 78 | * | ||
| 79 | * @param file the given file. | ||
| 80 | * @throws IOException If the given file has no associated application | ||
| 81 | * that can be used to print it. | ||
| 82 | */ | ||
| 83 | void print(File file) throws IOException; | ||
| 84 | |||
| 85 | /** | ||
| 86 | * Launches the mail composing window of the user default mail client, | ||
| 87 | * filling the message fields including to, cc, etc, with the values | ||
| 88 | * specified by the given mailto URL. | ||
| 89 | * | ||
| 90 | * @param uri represents a mailto URL with specified values of the message. | ||
| 91 | * The syntax of mailto URL is defined by | ||
| 92 | * <a href="http://www.ietf.org/rfc/rfc2368.txt">RFC2368: The mailto | ||
| 93 | * URL scheme</a> | ||
| 94 | * @throws IOException If the user default mail client is not found, | ||
| 95 | * or it fails to be launched. | ||
| 96 | */ | ||
| 97 | void mail(URI mailtoURL) throws IOException; | ||
| 98 | |||
| 99 | /** | ||
| 100 | * Launches the user default browser to display the given URI. | ||
| 101 | * | ||
| 102 | * @param uri the given URI. | ||
| 103 | * @throws IOException If the user default browser is not found, | ||
| 104 | * or it fails to be launched. | ||
| 105 | */ | ||
| 106 | void browse(URI url) throws IOException; | ||
| 107 | } | ||
Binary file not shown.
| @@ -0,0 +1,70 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package java.awt.peer; | ||
| 27 | |||
| 28 | import java.awt.*; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * The peer interface for {@link Dialog}. This adds a couple of dialog specific | ||
| 32 | * features to the {@link WindowPeer} interface. | ||
| 33 | * | ||
| 34 | * The peer interfaces are intended only for use in porting | ||
| 35 | * the AWT. They are not intended for use by application | ||
| 36 | * developers, and developers should not implement peers | ||
| 37 | * nor invoke any of the peer methods directly on the peer | ||
| 38 | * instances. | ||
| 39 | */ | ||
| 40 | public interface DialogPeer extends WindowPeer { | ||
| 41 | |||
| 42 | /** | ||
| 43 | * Sets the title on the dialog window. | ||
| 44 | * | ||
| 45 | * @param title the title to set | ||
| 46 | * | ||
| 47 | * @see Dialog#setTitle(String) | ||
| 48 | */ | ||
| 49 | void setTitle(String title); | ||
| 50 | |||
| 51 | /** | ||
| 52 | * Sets if the dialog should be resizable or not. | ||
| 53 | * | ||
| 54 | * @param resizeable {@code true} when the dialog should be resizable, | ||
| 55 | * {@code false} if not | ||
| 56 | * | ||
| 57 | * @see Dialog#setResizable(boolean) | ||
| 58 | */ | ||
| 59 | void setResizable(boolean resizeable); | ||
| 60 | |||
| 61 | /** | ||
| 62 | * Block the specified windows. This is used for modal dialogs. | ||
| 63 | * | ||
| 64 | * @param windows the windows to block | ||
| 65 | * | ||
| 66 | * @see Dialog#modalShow() | ||
| 67 | * @see Dialog#blockWindows() | ||
| 68 | */ | ||
| 69 | void blockWindows(java.util.List<Window> windows); | ||
| 70 | } | ||
Binary file not shown.
| @@ -0,0 +1,69 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package java.awt.peer; | ||
| 27 | |||
| 28 | import java.awt.FileDialog; | ||
| 29 | import java.io.FilenameFilter; | ||
| 30 | |||
| 31 | /** | ||
| 32 | * The peer interface for {@link FileDialog}. | ||
| 33 | * | ||
| 34 | * The peer interfaces are intended only for use in porting | ||
| 35 | * the AWT. They are not intended for use by application | ||
| 36 | * developers, and developers should not implement peers | ||
| 37 | * nor invoke any of the peer methods directly on the peer | ||
| 38 | * instances. | ||
| 39 | */ | ||
| 40 | public interface FileDialogPeer extends DialogPeer { | ||
| 41 | |||
| 42 | /** | ||
| 43 | * Sets the selected file for this file dialog. | ||
| 44 | * | ||
| 45 | * @param file the file to set as selected file, or {@code null} for | ||
| 46 | * no selected file | ||
| 47 | * | ||
| 48 | * @see FileDialog#setFile(String) | ||
| 49 | */ | ||
| 50 | void setFile(String file); | ||
| 51 | |||
| 52 | /** | ||
| 53 | * Sets the current directory for this file dialog. | ||
| 54 | * | ||
| 55 | * @param dir the directory to set | ||
| 56 | * | ||
| 57 | * @see FileDialog#setDirectory(String) | ||
| 58 | */ | ||
| 59 | void setDirectory(String dir); | ||
| 60 | |||
| 61 | /** | ||
| 62 | * Sets the filename filter for filtering the displayed files. | ||
| 63 | * | ||
| 64 | * @param filter the filter to set | ||
| 65 | * | ||
| 66 | * @see FileDialog#setFilenameFilter(FilenameFilter) | ||
| 67 | */ | ||
| 68 | void setFilenameFilter(FilenameFilter filter); | ||
| 69 | } | ||
Binary file not shown.
| @@ -0,0 +1,39 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package java.awt.peer; | ||
| 27 | |||
| 28 | /** | ||
| 29 | * The peer interface for fonts. This is only a marker interface and not | ||
| 30 | * used by AWT itself. | ||
| 31 | * | ||
| 32 | * The peer interfaces are intended only for use in porting | ||
| 33 | * the AWT. They are not intended for use by application | ||
| 34 | * developers, and developers should not implement peers | ||
| 35 | * nor invoke any of the peer methods directly on the peer | ||
| 36 | * instances. | ||
| 37 | */ | ||
| 38 | public interface FontPeer { | ||
| 39 | } | ||
Binary file not shown.
| @@ -0,0 +1,128 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package java.awt.peer; | ||
| 27 | |||
| 28 | import java.awt.*; | ||
| 29 | |||
| 30 | import sun.awt.EmbeddedFrame; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * The peer interface for {@link Frame}. This adds a couple of frame specific | ||
| 34 | * methods to the {@link WindowPeer} interface. | ||
| 35 | * | ||
| 36 | * The peer interfaces are intended only for use in porting | ||
| 37 | * the AWT. They are not intended for use by application | ||
| 38 | * developers, and developers should not implement peers | ||
| 39 | * nor invoke any of the peer methods directly on the peer | ||
| 40 | * instances. | ||
| 41 | */ | ||
| 42 | public interface FramePeer extends WindowPeer { | ||
| 43 | |||
| 44 | /** | ||
| 45 | * Sets the title on the frame. | ||
| 46 | * | ||
| 47 | * @param title the title to set | ||
| 48 | * | ||
| 49 | * @see Frame#setTitle(String) | ||
| 50 | */ | ||
| 51 | void setTitle(String title); | ||
| 52 | |||
| 53 | /** | ||
| 54 | * Sets the menu bar for the frame. | ||
| 55 | * | ||
| 56 | * @param mb the menu bar to set | ||
| 57 | * | ||
| 58 | * @see Frame#setMenuBar(MenuBar) | ||
| 59 | */ | ||
| 60 | void setMenuBar(MenuBar mb); | ||
| 61 | |||
| 62 | /** | ||
| 63 | * Sets if the frame should be resizable or not. | ||
| 64 | * | ||
| 65 | * @param resizeable {@code true} when the frame should be resizable, | ||
| 66 | * {@code false} if not | ||
| 67 | * | ||
| 68 | * @see Frame#setResizable(boolean) | ||
| 69 | */ | ||
| 70 | void setResizable(boolean resizeable); | ||
| 71 | |||
| 72 | /** | ||
| 73 | * Changes the state of the frame. | ||
| 74 | * | ||
| 75 | * @param state the new state | ||
| 76 | * | ||
| 77 | * @see Frame#setExtendedState(int) | ||
| 78 | */ | ||
| 79 | void setState(int state); | ||
| 80 | |||
| 81 | /** | ||
| 82 | * Returns the current state of the frame. | ||
| 83 | * | ||
| 84 | * @return the current state of the frame | ||
| 85 | * | ||
| 86 | * @see Frame#getExtendedState() | ||
| 87 | */ | ||
| 88 | int getState(); | ||
| 89 | |||
| 90 | /** | ||
| 91 | * Sets the bounds of the frame when it becomes maximized. | ||
| 92 | * | ||
| 93 | * @param bounds the maximized bounds of the frame | ||
| 94 | * | ||
| 95 | * @see Frame#setMaximizedBounds(Rectangle) | ||
| 96 | */ | ||
| 97 | void setMaximizedBounds(Rectangle bounds); | ||
| 98 | |||
| 99 | /** | ||
| 100 | * Sets the size and location for embedded frames. (On embedded frames, | ||
| 101 | * setLocation() and setBounds() always set the frame to (0,0) for | ||
| 102 | * backwards compatibility. | ||
| 103 | * | ||
| 104 | * @param x the X location | ||
| 105 | * @param y the Y location | ||
| 106 | * @param width the width of the frame | ||
| 107 | * @param height the height of the frame | ||
| 108 | * | ||
| 109 | * @see EmbeddedFrame#setBoundsPrivate(int, int, int, int) | ||
| 110 | */ | ||
| 111 | // TODO: This is only used in EmbeddedFrame, and should probably be moved | ||
| 112 | // into an EmbeddedFramePeer which would extend FramePeer | ||
| 113 | void setBoundsPrivate(int x, int y, int width, int height); | ||
| 114 | |||
| 115 | /** | ||
| 116 | * Returns the size and location for embedded frames. (On embedded frames, | ||
| 117 | * setLocation() and setBounds() always set the frame to (0,0) for | ||
| 118 | * backwards compatibility. | ||
| 119 | * | ||
| 120 | * @return the bounds of an embedded frame | ||
| 121 | * | ||
| 122 | * @see EmbeddedFrame#getBoundsPrivate() | ||
| 123 | */ | ||
| 124 | // TODO: This is only used in EmbeddedFrame, and should probably be moved | ||
| 125 | // into an EmbeddedFramePeer which would extend FramePeer | ||
| 126 | Rectangle getBoundsPrivate(); | ||
| 127 | |||
| 128 | } | ||
Binary file not shown.
| @@ -0,0 +1,72 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package java.awt.peer; | ||
| 27 | |||
| 28 | import java.awt.Component; | ||
| 29 | import java.awt.Window; | ||
| 30 | |||
| 31 | /** | ||
| 32 | * The native peer interface for {@link KeyboardFocusManager}. | ||
| 33 | */ | ||
| 34 | public interface KeyboardFocusManagerPeer { | ||
| 35 | |||
| 36 | /** | ||
| 37 | * Returns the currently focused window. | ||
| 38 | * | ||
| 39 | * @return the currently focused window | ||
| 40 | * | ||
| 41 | * @see KeyboardFocusManager#getNativeFocusedWindow() | ||
| 42 | */ | ||
| 43 | Window getCurrentFocusedWindow(); | ||
| 44 | |||
| 45 | /** | ||
| 46 | * Sets the component that should become the focus owner. | ||
| 47 | * | ||
| 48 | * @param comp the component to become the focus owner | ||
| 49 | * | ||
| 50 | * @see KeyboardFocusManager#setNativeFocusOwner(Component) | ||
| 51 | */ | ||
| 52 | void setCurrentFocusOwner(Component comp); | ||
| 53 | |||
| 54 | /** | ||
| 55 | * Returns the component that currently owns the input focus. | ||
| 56 | * | ||
| 57 | * @return the component that currently owns the input focus | ||
| 58 | * | ||
| 59 | * @see KeyboardFocusManager#getNativeFocusOwner() | ||
| 60 | */ | ||
| 61 | Component getCurrentFocusOwner(); | ||
| 62 | |||
| 63 | /** | ||
| 64 | * Clears the current global focus owner. | ||
| 65 | * | ||
| 66 | * @param activeWindow | ||
| 67 | * | ||
| 68 | * @see KeyboardFocusManager#clearGlobalFocusOwner() | ||
| 69 | */ | ||
| 70 | void clearGlobalFocusOwner(Window activeWindow); | ||
| 71 | |||
| 72 | } | ||
Binary file not shown.
| @@ -0,0 +1,60 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.Label; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * The peer interface for {@link Label}. | ||
| 31 | * | ||
| 32 | * The peer interfaces are intended only for use in porting | ||
| 33 | * the AWT. They are not intended for use by application | ||
| 34 | * developers, and developers should not implement peers | ||
| 35 | * nor invoke any of the peer methods directly on the peer | ||
| 36 | * instances. | ||
| 37 | */ | ||
| 38 | public interface LabelPeer extends ComponentPeer { | ||
| 39 | |||
| 40 | /** | ||
| 41 | * Sets the text to be displayed on the label. | ||
| 42 | * | ||
| 43 | * @param label the text to be displayed on the label | ||
| 44 | * | ||
| 45 | * @see Label#setText | ||
| 46 | */ | ||
| 47 | void setText(String label); | ||
| 48 | |||
| 49 | /** | ||
| 50 | * Sets the alignment of the label text. | ||
| 51 | * | ||
| 52 | * @param alignment the alignment of the label text | ||
| 53 | * | ||
| 54 | * @see Label#setAlignment(int) | ||
| 55 | * @see Label#CENTER | ||
| 56 | * @see Label#RIGHT | ||
| 57 | * @see Label#LEFT | ||
| 58 | */ | ||
| 59 | void setAlignment(int alignment); | ||
| 60 | } | ||
Binary file not shown.
| @@ -0,0 +1,44 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package java.awt.peer; | ||
| 27 | |||
| 28 | /** | ||
| 29 | * The LightweightPeer interface marks a component as depending upon | ||
| 30 | * a native container so window related events can be routed to the | ||
| 31 | * component. Since this only applies to components and their | ||
| 32 | * extensions, this interface extends ComponentPeer. | ||
| 33 | * <p> | ||
| 34 | * The peer interfaces are intended only for use in porting | ||
| 35 | * the AWT. They are not intended for use by application | ||
| 36 | * developers, and developers should not implement peers | ||
| 37 | * nor invoke any of the peer methods directly on the peer | ||
| 38 | * instances. | ||
| 39 | * | ||
| 40 | * @author Timothy Prinzing | ||
| 41 | */ | ||
| 42 | public interface LightweightPeer extends ComponentPeer { | ||
| 43 | |||
| 44 | } | ||
Binary file not shown.
| @@ -0,0 +1,138 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 1998, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.Dimension; | ||
| 28 | import java.awt.List; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * The peer interface for {@link List}. | ||
| 32 | * | ||
| 33 | * The peer interfaces are intended only for use in porting | ||
| 34 | * the AWT. They are not intended for use by application | ||
| 35 | * developers, and developers should not implement peers | ||
| 36 | * nor invoke any of the peer methods directly on the peer | ||
| 37 | * instances. | ||
| 38 | */ | ||
| 39 | public interface ListPeer extends ComponentPeer { | ||
| 40 | |||
| 41 | /** | ||
| 42 | * Returns the indices of the list items that are currently selected. | ||
| 43 | * The returned array is not required to be a copy, the callers of this | ||
| 44 | * method already make sure it is not modified. | ||
| 45 | * | ||
| 46 | * @return the indices of the list items that are currently selected | ||
| 47 | * | ||
| 48 | * @see List#getSelectedIndexes() | ||
| 49 | */ | ||
| 50 | int[] getSelectedIndexes(); | ||
| 51 | |||
| 52 | /** | ||
| 53 | * Adds an item to the list at the specified index. | ||
| 54 | * | ||
| 55 | * @param item the item to add to the list | ||
| 56 | * @param index the index where to add the item into the list | ||
| 57 | * | ||
| 58 | * @see List#add(String, int) | ||
| 59 | */ | ||
| 60 | void add(String item, int index); | ||
| 61 | |||
| 62 | /** | ||
| 63 | * Deletes items from the list. All items from start to end should are | ||
| 64 | * deleted, including the item at the start and end indices. | ||
| 65 | * | ||
| 66 | * @param start the first item to be deleted | ||
| 67 | * @param end the last item to be deleted | ||
| 68 | */ | ||
| 69 | void delItems(int start, int end); | ||
| 70 | |||
| 71 | /** | ||
| 72 | * Removes all items from the list. | ||
| 73 | * | ||
| 74 | * @see List#removeAll() | ||
| 75 | */ | ||
| 76 | void removeAll(); | ||
| 77 | |||
| 78 | /** | ||
| 79 | * Selects the item at the specified {@code index}. | ||
| 80 | * | ||
| 81 | * @param index the index of the item to select | ||
| 82 | * | ||
| 83 | * @see List#select(int) | ||
| 84 | */ | ||
| 85 | void select(int index); | ||
| 86 | |||
| 87 | /** | ||
| 88 | * De-selects the item at the specified {@code index}. | ||
| 89 | * | ||
| 90 | * @param index the index of the item to de-select | ||
| 91 | * | ||
| 92 | * @see List#deselect(int) | ||
| 93 | */ | ||
| 94 | void deselect(int index); | ||
| 95 | |||
| 96 | /** | ||
| 97 | * Makes sure that the item at the specified {@code index} is visible, | ||
| 98 | * by scrolling the list or similar. | ||
| 99 | * | ||
| 100 | * @param index the index of the item to make visible | ||
| 101 | * | ||
| 102 | * @see List#makeVisible(int) | ||
| 103 | */ | ||
| 104 | void makeVisible(int index); | ||
| 105 | |||
| 106 | /** | ||
| 107 | * Toggles multiple selection mode on or off. | ||
| 108 | * | ||
| 109 | * @param m {@code true} for multiple selection mode, | ||
| 110 | * {@code false} for single selection mode | ||
| 111 | * | ||
| 112 | * @see List#setMultipleMode(boolean) | ||
| 113 | */ | ||
| 114 | void setMultipleMode(boolean m); | ||
| 115 | |||
| 116 | /** | ||
| 117 | * Returns the preferred size for a list with the specified number of rows. | ||
| 118 | * | ||
| 119 | * @param rows the number of rows | ||
| 120 | * | ||
| 121 | * @return the preferred size of the list | ||
| 122 | * | ||
| 123 | * @see List#getPreferredSize(int) | ||
| 124 | */ | ||
| 125 | Dimension getPreferredSize(int rows); | ||
| 126 | |||
| 127 | /** | ||
| 128 | * Returns the minimum size for a list with the specified number of rows. | ||
| 129 | * | ||
| 130 | * @param rows the number of rows | ||
| 131 | * | ||
| 132 | * @return the minimum size of the list | ||
| 133 | * | ||
| 134 | * @see List#getMinimumSize(int) | ||
| 135 | */ | ||
| 136 | Dimension getMinimumSize(int rows); | ||
| 137 | |||
| 138 | } | ||
Binary file not shown.
| @@ -0,0 +1,67 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 1998, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.Menu; | ||
| 28 | import java.awt.MenuBar; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * The peer interface for {@link MenuBar}. | ||
| 32 | * | ||
| 33 | * The peer interfaces are intended only for use in porting | ||
| 34 | * the AWT. They are not intended for use by application | ||
| 35 | * developers, and developers should not implement peers | ||
| 36 | * nor invoke any of the peer methods directly on the peer | ||
| 37 | * instances. | ||
| 38 | */ | ||
| 39 | public interface MenuBarPeer extends MenuComponentPeer { | ||
| 40 | |||
| 41 | /** | ||
| 42 | * Adds a menu to the menu bar. | ||
| 43 | * | ||
| 44 | * @param m the menu to add | ||
| 45 | * | ||
| 46 | * @see MenuBar#add(Menu) | ||
| 47 | */ | ||
| 48 | void addMenu(Menu m); | ||
| 49 | |||
| 50 | /** | ||
| 51 | * Deletes a menu from the menu bar. | ||
| 52 | * | ||
| 53 | * @param index the index of the menu to remove | ||
| 54 | * | ||
| 55 | * @see MenuBar#remove(int) | ||
| 56 | */ | ||
| 57 | void delMenu(int index); | ||
| 58 | |||
| 59 | /** | ||
| 60 | * Adds a help menu to the menu bar. | ||
| 61 | * | ||
| 62 | * @param m the help menu to add | ||
| 63 | * | ||
| 64 | * @see MenuBar#setHelpMenu(Menu) | ||
| 65 | */ | ||
| 66 | void addHelpMenu(Menu m); | ||
| 67 | } | ||
Binary file not shown.
| @@ -0,0 +1,57 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 2003, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.Font; | ||
| 28 | import java.awt.MenuComponent; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * The base interface for all kinds of menu components. This is used by | ||
| 32 | * {@link MenuComponent}. | ||
| 33 | * | ||
| 34 | * The peer interfaces are intended only for use in porting | ||
| 35 | * the AWT. They are not intended for use by application | ||
| 36 | * developers, and developers should not implement peers | ||
| 37 | * nor invoke any of the peer methods directly on the peer | ||
| 38 | * instances. | ||
| 39 | */ | ||
| 40 | public interface MenuComponentPeer { | ||
| 41 | |||
| 42 | /** | ||
| 43 | * Disposes the menu component. | ||
| 44 | * | ||
| 45 | * @see MenuComponent#removeNotify() | ||
| 46 | */ | ||
| 47 | void dispose(); | ||
| 48 | |||
| 49 | /** | ||
| 50 | * Sets the font for the menu component. | ||
| 51 | * | ||
| 52 | * @param f the font to use for the menu component | ||
| 53 | * | ||
| 54 | * @see MenuComponent#setFont(Font) | ||
| 55 | */ | ||
| 56 | void setFont(Font f); | ||
| 57 | } | ||
Binary file not shown.
| @@ -0,0 +1,55 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 1998, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.MenuItem; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * The peer interface for menu items. This is used by {@link MenuItem}. | ||
| 31 | * | ||
| 32 | * The peer interfaces are intended only for use in porting | ||
| 33 | * the AWT. They are not intended for use by application | ||
| 34 | * developers, and developers should not implement peers | ||
| 35 | * nor invoke any of the peer methods directly on the peer | ||
| 36 | * instances. | ||
| 37 | */ | ||
| 38 | public interface MenuItemPeer extends MenuComponentPeer { | ||
| 39 | |||
| 40 | /** | ||
| 41 | * Sets the label to be displayed in this menu item. | ||
| 42 | * | ||
| 43 | * @param label the label to be displayed | ||
| 44 | */ | ||
| 45 | void setLabel(String label); | ||
| 46 | |||
| 47 | /** | ||
| 48 | * Enables or disables the menu item. | ||
| 49 | * | ||
| 50 | * @param e {@code true} to enable the menu item, {@code false} | ||
| 51 | * to disable it | ||
| 52 | */ | ||
| 53 | void setEnabled(boolean e); | ||
| 54 | |||
| 55 | } | ||
Binary file not shown.
| @@ -0,0 +1,65 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 1998, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.Menu; | ||
| 28 | import java.awt.MenuItem; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * The peer interface for menus. This is used by {@link Menu}. | ||
| 32 | * | ||
| 33 | * The peer interfaces are intended only for use in porting | ||
| 34 | * the AWT. They are not intended for use by application | ||
| 35 | * developers, and developers should not implement peers | ||
| 36 | * nor invoke any of the peer methods directly on the peer | ||
| 37 | * instances. | ||
| 38 | */ | ||
| 39 | public interface MenuPeer extends MenuItemPeer { | ||
| 40 | |||
| 41 | /** | ||
| 42 | * Adds a separator (e.g. a horizontal line or similar) to the menu. | ||
| 43 | * | ||
| 44 | * @see Menu#addSeparator() | ||
| 45 | */ | ||
| 46 | void addSeparator(); | ||
| 47 | |||
| 48 | /** | ||
| 49 | * Adds the specified menu item to the menu. | ||
| 50 | * | ||
| 51 | * @param item the menu item to add | ||
| 52 | * | ||
| 53 | * @see Menu#add(MenuItem) | ||
| 54 | */ | ||
| 55 | void addItem(MenuItem item); | ||
| 56 | |||
| 57 | /** | ||
| 58 | * Removes the menu item at the specified index. | ||
| 59 | * | ||
| 60 | * @param index the index of the item to remove | ||
| 61 | * | ||
| 62 | * @see Menu#remove(int) | ||
| 63 | */ | ||
| 64 | void delItem(int index); | ||
| 65 | } | ||
Binary file not shown.
| @@ -0,0 +1,69 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package java.awt.peer; | ||
| 27 | |||
| 28 | import java.awt.Window; | ||
| 29 | import java.awt.Point; | ||
| 30 | |||
| 31 | /** | ||
| 32 | * Peer interface for {@link MouseInfo}. This is used to get some additional | ||
| 33 | * information about the mouse. | ||
| 34 | * | ||
| 35 | * The peer interfaces are intended only for use in porting | ||
| 36 | * the AWT. They are not intended for use by application | ||
| 37 | * developers, and developers should not implement peers | ||
| 38 | * nor invoke any of the peer methods directly on the peer | ||
| 39 | * instances. | ||
| 40 | */ | ||
| 41 | public interface MouseInfoPeer { | ||
| 42 | |||
| 43 | /** | ||
| 44 | * This method does two things: it fills the point fields with | ||
| 45 | * the current coordinates of the mouse cursor and returns the | ||
| 46 | * number of the screen device where the pointer is located. | ||
| 47 | * The number of the screen device is only returned for independent | ||
| 48 | * devices (which are not parts of a virtual screen device). | ||
| 49 | * For virtual screen devices, 0 is returned. | ||
| 50 | * Mouse coordinates are also calculated depending on whether | ||
| 51 | * or not the screen device is virtual. For virtual screen | ||
| 52 | * devices, pointer coordinates are calculated in the virtual | ||
| 53 | * coordinate system. Otherwise, coordinates are calculated in | ||
| 54 | * the coordinate system of the screen device where the pointer | ||
| 55 | * is located. | ||
| 56 | * See java.awt.GraphicsConfiguration documentation for more | ||
| 57 | * details about virtual screen devices. | ||
| 58 | */ | ||
| 59 | int fillPointWithCoords(Point point); | ||
| 60 | |||
| 61 | /** | ||
| 62 | * Returns whether or not the window is located under the mouse | ||
| 63 | * pointer. The window is considered to be under the mouse pointer | ||
| 64 | * if it is showing on the screen, and the mouse pointer is above | ||
| 65 | * the part of the window that is not obscured by any other windows. | ||
| 66 | */ | ||
| 67 | boolean isWindowUnderMouse(Window w); | ||
| 68 | |||
| 69 | } | ||
Binary file not shown.
| @@ -0,0 +1,39 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | /** | ||
| 28 | * The peer interface for {@link Panel}. This is a subinterface of | ||
| 29 | * ContainerPeer and does not declare any additional methods because a Panel | ||
| 30 | * is just that, a concrete Container. | ||
| 31 | * | ||
| 32 | * The peer interfaces are intended only for use in porting | ||
| 33 | * the AWT. They are not intended for use by application | ||
| 34 | * developers, and developers should not implement peers | ||
| 35 | * nor invoke any of the peer methods directly on the peer | ||
| 36 | * instances. | ||
| 37 | */ | ||
| 38 | public interface PanelPeer extends ContainerPeer { | ||
| 39 | } | ||
Binary file not shown.
| @@ -0,0 +1,50 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.Event; | ||
| 28 | import java.awt.PopupMenu; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * The peer interface for {@link PopupMenu}. | ||
| 32 | * | ||
| 33 | * The peer interfaces are intended only for use in porting | ||
| 34 | * the AWT. They are not intended for use by application | ||
| 35 | * developers, and developers should not implement peers | ||
| 36 | * nor invoke any of the peer methods directly on the peer | ||
| 37 | * instances. | ||
| 38 | */ | ||
| 39 | public interface PopupMenuPeer extends MenuPeer { | ||
| 40 | |||
| 41 | /** | ||
| 42 | * Shows the popup menu. | ||
| 43 | * | ||
| 44 | * @param e a synthetic event describing the origin and location of the | ||
| 45 | * popup menu | ||
| 46 | * | ||
| 47 | * @see PopupMenu#show(java.awt.Component, int, int) | ||
| 48 | */ | ||
| 49 | void show(Event e); | ||
| 50 | } | ||
Binary file not shown.
| @@ -0,0 +1,124 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package java.awt.peer; | ||
| 27 | |||
| 28 | import java.awt.*; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * RobotPeer defines an interface whereby toolkits support automated testing | ||
| 32 | * by allowing native input events to be generated from Java code. | ||
| 33 | * | ||
| 34 | * This interface should not be directly imported by code outside the | ||
| 35 | * java.awt.* hierarchy; it is not to be considered public and is subject | ||
| 36 | * to change. | ||
| 37 | * | ||
| 38 | * @author Robi Khan | ||
| 39 | */ | ||
| 40 | public interface RobotPeer | ||
| 41 | { | ||
| 42 | /** | ||
| 43 | * Moves the mouse pointer to the specified screen location. | ||
| 44 | * | ||
| 45 | * @param x the X location on screen | ||
| 46 | * @param y the Y location on screen | ||
| 47 | * | ||
| 48 | * @see Robot#mouseMove(int, int) | ||
| 49 | */ | ||
| 50 | void mouseMove(int x, int y); | ||
| 51 | |||
| 52 | /** | ||
| 53 | * Simulates a mouse press with the specified button(s). | ||
| 54 | * | ||
| 55 | * @param buttons the button mask | ||
| 56 | * | ||
| 57 | * @see Robot#mousePress(int) | ||
| 58 | */ | ||
| 59 | void mousePress(int buttons); | ||
| 60 | |||
| 61 | /** | ||
| 62 | * Simulates a mouse release with the specified button(s). | ||
| 63 | * | ||
| 64 | * @param buttons the button mask | ||
| 65 | * | ||
| 66 | * @see Robot#mouseRelease(int) | ||
| 67 | */ | ||
| 68 | void mouseRelease(int buttons); | ||
| 69 | |||
| 70 | /** | ||
| 71 | * Simulates mouse wheel action. | ||
| 72 | * | ||
| 73 | * @param wheelAmt number of notches to move the mouse wheel | ||
| 74 | * | ||
| 75 | * @see Robot#mouseWheel(int) | ||
| 76 | */ | ||
| 77 | void mouseWheel(int wheelAmt); | ||
| 78 | |||
| 79 | /** | ||
| 80 | * Simulates a key press of the specified key. | ||
| 81 | * | ||
| 82 | * @param keycode the key code to press | ||
| 83 | * | ||
| 84 | * @see Robot#keyPress(int) | ||
| 85 | */ | ||
| 86 | void keyPress(int keycode); | ||
| 87 | |||
| 88 | /** | ||
| 89 | * Simulates a key release of the specified key. | ||
| 90 | * | ||
| 91 | * @param keycode the key code to release | ||
| 92 | * | ||
| 93 | * @see Robot#keyRelease(int) | ||
| 94 | */ | ||
| 95 | void keyRelease(int keycode); | ||
| 96 | |||
| 97 | /** | ||
| 98 | * Gets the RGB value of the specified pixel on screen. | ||
| 99 | * | ||
| 100 | * @param x the X screen coordinate | ||
| 101 | * @param y the Y screen coordinate | ||
| 102 | * | ||
| 103 | * @return the RGB value of the specified pixel on screen | ||
| 104 | * | ||
| 105 | * @see Robot#getPixelColor(int, int) | ||
| 106 | */ | ||
| 107 | int getRGBPixel(int x, int y); | ||
| 108 | |||
| 109 | /** | ||
| 110 | * Gets the RGB values of the specified screen area as an array. | ||
| 111 | * | ||
| 112 | * @param bounds the screen area to capture the RGB values from | ||
| 113 | * | ||
| 114 | * @return the RGB values of the specified screen area | ||
| 115 | * | ||
| 116 | * @see Robot#createScreenCapture(Rectangle) | ||
| 117 | */ | ||
| 118 | int[] getRGBPixels(Rectangle bounds); | ||
| 119 | |||
| 120 | /** | ||
| 121 | * Disposes the robot peer when it is not needed anymore. | ||
| 122 | */ | ||
| 123 | void dispose(); | ||
| 124 | } | ||
Binary file not shown.
| @@ -0,0 +1,97 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.Adjustable; | ||
| 28 | import java.awt.ScrollPane; | ||
| 29 | import java.awt.ScrollPaneAdjustable; | ||
| 30 | |||
| 31 | /** | ||
| 32 | * The peer interface for {@link ScrollPane}. | ||
| 33 | * | ||
| 34 | * The peer interfaces are intended only for use in porting | ||
| 35 | * the AWT. They are not intended for use by application | ||
| 36 | * developers, and developers should not implement peers | ||
| 37 | * nor invoke any of the peer methods directly on the peer | ||
| 38 | * instances. | ||
| 39 | */ | ||
| 40 | public interface ScrollPanePeer extends ContainerPeer { | ||
| 41 | |||
| 42 | /** | ||
| 43 | * Returns the height of the horizontal scroll bar. | ||
| 44 | * | ||
| 45 | * @return the height of the horizontal scroll bar | ||
| 46 | * | ||
| 47 | * @see ScrollPane#getHScrollbarHeight() | ||
| 48 | */ | ||
| 49 | int getHScrollbarHeight(); | ||
| 50 | |||
| 51 | /** | ||
| 52 | * Returns the width of the vertical scroll bar. | ||
| 53 | * | ||
| 54 | * @return the width of the vertical scroll bar | ||
| 55 | * | ||
| 56 | * @see ScrollPane#getVScrollbarWidth() | ||
| 57 | */ | ||
| 58 | int getVScrollbarWidth(); | ||
| 59 | |||
| 60 | /** | ||
| 61 | * Sets the scroll position of the child. | ||
| 62 | * | ||
| 63 | * @param x the X coordinate of the scroll position | ||
| 64 | * @param y the Y coordinate of the scroll position | ||
| 65 | * | ||
| 66 | * @see ScrollPane#setScrollPosition(int, int) | ||
| 67 | */ | ||
| 68 | void setScrollPosition(int x, int y); | ||
| 69 | |||
| 70 | /** | ||
| 71 | * Called when the child component changes its size. | ||
| 72 | * | ||
| 73 | * @param w the new width of the child component | ||
| 74 | * @param h the new height of the child component | ||
| 75 | * | ||
| 76 | * @see ScrollPane#layout() | ||
| 77 | */ | ||
| 78 | void childResized(int w, int h); | ||
| 79 | |||
| 80 | /** | ||
| 81 | * Sets the unit increment of one of the scroll pane's adjustables. | ||
| 82 | * | ||
| 83 | * @param adj the scroll pane adjustable object | ||
| 84 | * @param u the unit increment | ||
| 85 | * | ||
| 86 | * @see ScrollPaneAdjustable#setUnitIncrement(int) | ||
| 87 | */ | ||
| 88 | void setUnitIncrement(Adjustable adj, int u); | ||
| 89 | |||
| 90 | /** | ||
| 91 | * Sets the value for one of the scroll pane's adjustables. | ||
| 92 | * | ||
| 93 | * @param adj the scroll pane adjustable object | ||
| 94 | * @param v the value to set | ||
| 95 | */ | ||
| 96 | void setValue(Adjustable adj, int v); | ||
| 97 | } | ||
Binary file not shown.
| @@ -0,0 +1,69 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 1998, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.Scrollbar; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * The peer interface for {@link Scrollbar}. | ||
| 31 | * | ||
| 32 | * The peer interfaces are intended only for use in porting | ||
| 33 | * the AWT. They are not intended for use by application | ||
| 34 | * developers, and developers should not implement peers | ||
| 35 | * nor invoke any of the peer methods directly on the peer | ||
| 36 | * instances. | ||
| 37 | */ | ||
| 38 | public interface ScrollbarPeer extends ComponentPeer { | ||
| 39 | |||
| 40 | /** | ||
| 41 | * Sets the parameters for the scrollbar. | ||
| 42 | * | ||
| 43 | * @param value the current value | ||
| 44 | * @param visible how much of the whole scale is visible | ||
| 45 | * @param minimum the minimum value | ||
| 46 | * @param maximum the maximum value | ||
| 47 | * | ||
| 48 | * @see Scrollbar#setValues(int, int, int, int) | ||
| 49 | */ | ||
| 50 | void setValues(int value, int visible, int minimum, int maximum); | ||
| 51 | |||
| 52 | /** | ||
| 53 | * Sets the line increment of the scrollbar. | ||
| 54 | * | ||
| 55 | * @param l the line increment | ||
| 56 | * | ||
| 57 | * @see Scrollbar#setLineIncrement(int) | ||
| 58 | */ | ||
| 59 | void setLineIncrement(int l); | ||
| 60 | |||
| 61 | /** | ||
| 62 | * Sets the page increment of the scrollbar. | ||
| 63 | * | ||
| 64 | * @param l the page increment | ||
| 65 | * | ||
| 66 | * @see Scrollbar#setPageIncrement(int) | ||
| 67 | */ | ||
| 68 | void setPageIncrement(int l); | ||
| 69 | } | ||
Binary file not shown.
| @@ -0,0 +1,45 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package java.awt.peer; | ||
| 27 | |||
| 28 | import java.awt.Dimension; | ||
| 29 | import java.awt.SystemTray; | ||
| 30 | |||
| 31 | /** | ||
| 32 | * The peer interface for {@link SystemTray}. This doesn't need to be | ||
| 33 | * implemented if {@link SystemTray#isSupported()} returns false. | ||
| 34 | */ | ||
| 35 | public interface SystemTrayPeer { | ||
| 36 | |||
| 37 | /** | ||
| 38 | * Returns the size of the system tray icon. | ||
| 39 | * | ||
| 40 | * @return the size of the system tray icon | ||
| 41 | * | ||
| 42 | * @see SystemTray#getTrayIconSize() | ||
| 43 | */ | ||
| 44 | Dimension getTrayIconSize(); | ||
| 45 | } | ||
Binary file not shown.
| @@ -0,0 +1,88 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 1998, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.Dimension; | ||
| 28 | import java.awt.TextArea; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * The peer interface for {@link TexTArea}. | ||
| 32 | * | ||
| 33 | * The peer interfaces are intended only for use in porting | ||
| 34 | * the AWT. They are not intended for use by application | ||
| 35 | * developers, and developers should not implement peers | ||
| 36 | * nor invoke any of the peer methods directly on the peer | ||
| 37 | * instances. | ||
| 38 | */ | ||
| 39 | public interface TextAreaPeer extends TextComponentPeer { | ||
| 40 | |||
| 41 | /** | ||
| 42 | * Inserts the specified text at the specified position in the document. | ||
| 43 | * | ||
| 44 | * @param text the text to insert | ||
| 45 | * @param pos the position to insert | ||
| 46 | * | ||
| 47 | * @see TextArea#insert(String, int) | ||
| 48 | */ | ||
| 49 | void insert(String text, int pos); | ||
| 50 | |||
| 51 | /** | ||
| 52 | * Replaces a range of text by the specified string | ||
| 53 | * | ||
| 54 | * @param text the replacement string | ||
| 55 | * @param start the begin of the range to replace | ||
| 56 | * @param end the end of the range to replace | ||
| 57 | * | ||
| 58 | * @see TextArea#replaceRange(String, int, int) | ||
| 59 | */ | ||
| 60 | void replaceRange(String text, int start, int end); | ||
| 61 | |||
| 62 | /** | ||
| 63 | * Returns the preferred size of a textarea with the specified number of | ||
| 64 | * columns and rows. | ||
| 65 | * | ||
| 66 | * @param rows the number of rows | ||
| 67 | * @param columns the number of columns | ||
| 68 | * | ||
| 69 | * @return the preferred size of a textarea | ||
| 70 | * | ||
| 71 | * @see TextArea#getPreferredSize(int, int) | ||
| 72 | */ | ||
| 73 | Dimension getPreferredSize(int rows, int columns); | ||
| 74 | |||
| 75 | /** | ||
| 76 | * Returns the minimum size of a textarea with the specified number of | ||
| 77 | * columns and rows. | ||
| 78 | * | ||
| 79 | * @param rows the number of rows | ||
| 80 | * @param columns the number of columns | ||
| 81 | * | ||
| 82 | * @return the minimum size of a textarea | ||
| 83 | * | ||
| 84 | * @see TextArea#getMinimumSize(int, int) | ||
| 85 | */ | ||
| 86 | Dimension getMinimumSize(int rows, int columns); | ||
| 87 | |||
| 88 | } | ||
Binary file not shown.
| @@ -0,0 +1,121 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.TextComponent; | ||
| 28 | import java.awt.im.InputMethodRequests; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * The peer interface for {@link TextComponent}. | ||
| 32 | * | ||
| 33 | * The peer interfaces are intended only for use in porting | ||
| 34 | * the AWT. They are not intended for use by application | ||
| 35 | * developers, and developers should not implement peers | ||
| 36 | * nor invoke any of the peer methods directly on the peer | ||
| 37 | * instances. | ||
| 38 | */ | ||
| 39 | public interface TextComponentPeer extends ComponentPeer { | ||
| 40 | |||
| 41 | /** | ||
| 42 | * Sets if the text component should be editable or not. | ||
| 43 | * | ||
| 44 | * @param editable {@code true} for editable text components, | ||
| 45 | * {@code false} for non-editable text components | ||
| 46 | * | ||
| 47 | * @see TextComponent#setEditable(boolean) | ||
| 48 | */ | ||
| 49 | void setEditable(boolean editable); | ||
| 50 | |||
| 51 | /** | ||
| 52 | * Returns the current content of the text component. | ||
| 53 | * | ||
| 54 | * @return the current content of the text component | ||
| 55 | * | ||
| 56 | * @see TextComponent#getText() | ||
| 57 | */ | ||
| 58 | String getText(); | ||
| 59 | |||
| 60 | /** | ||
| 61 | * Sets the content for the text component. | ||
| 62 | * | ||
| 63 | * @param l the content to set | ||
| 64 | * | ||
| 65 | * @see TextComponent#setText(String) | ||
| 66 | */ | ||
| 67 | void setText(String l); | ||
| 68 | |||
| 69 | /** | ||
| 70 | * Returns the start index of the current selection. | ||
| 71 | * | ||
| 72 | * @return the start index of the current selection | ||
| 73 | * | ||
| 74 | * @see TextComponent#getSelectionStart() | ||
| 75 | */ | ||
| 76 | int getSelectionStart(); | ||
| 77 | |||
| 78 | /** | ||
| 79 | * Returns the end index of the current selection. | ||
| 80 | * | ||
| 81 | * @return the end index of the current selection | ||
| 82 | * | ||
| 83 | * @see TextComponent#getSelectionEnd() | ||
| 84 | */ | ||
| 85 | int getSelectionEnd(); | ||
| 86 | |||
| 87 | /** | ||
| 88 | * Selects an area of the text component. | ||
| 89 | * | ||
| 90 | * @param selStart the start index of the new selection | ||
| 91 | * @param selEnd the end index of the new selection | ||
| 92 | * | ||
| 93 | * @see TextComponent#select(int, int) | ||
| 94 | */ | ||
| 95 | void select(int selStart, int selEnd); | ||
| 96 | |||
| 97 | /** | ||
| 98 | * Sets the caret position of the text component. | ||
| 99 | * | ||
| 100 | * @param pos the caret position to set | ||
| 101 | * | ||
| 102 | * @see TextComponent#setCaretPosition(int) | ||
| 103 | */ | ||
| 104 | void setCaretPosition(int pos); | ||
| 105 | |||
| 106 | /** | ||
| 107 | * Returns the current caret position. | ||
| 108 | * | ||
| 109 | * @return the current caret position | ||
| 110 | * | ||
| 111 | * @see TextComponent#getCaretPosition() | ||
| 112 | */ | ||
| 113 | int getCaretPosition(); | ||
| 114 | |||
| 115 | /** | ||
| 116 | * Returns the input method requests. | ||
| 117 | * | ||
| 118 | * @return the input method requests | ||
| 119 | */ | ||
| 120 | InputMethodRequests getInputMethodRequests(); | ||
| 121 | } | ||
Binary file not shown.
| @@ -0,0 +1,74 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 1998, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | package java.awt.peer; | ||
| 26 | |||
| 27 | import java.awt.Dimension; | ||
| 28 | import java.awt.TextField; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * The peer interface for {@link TextField}. | ||
| 32 | * | ||
| 33 | * The peer interfaces are intended only for use in porting | ||
| 34 | * the AWT. They are not intended for use by application | ||
| 35 | * developers, and developers should not implement peers | ||
| 36 | * nor invoke any of the peer methods directly on the peer | ||
| 37 | * instances. | ||
| 38 | */ | ||
| 39 | public interface TextFieldPeer extends TextComponentPeer { | ||
| 40 | |||
| 41 | /** | ||
| 42 | * Sets the echo character. | ||
| 43 | * | ||
| 44 | * @param echoChar the echo character to set | ||
| 45 | * | ||
| 46 | * @see TextField#getEchoChar() | ||
| 47 | */ | ||
| 48 | void setEchoChar(char echoChar); | ||
| 49 | |||
| 50 | /** | ||
| 51 | * Returns the preferred size of the text field with the specified number | ||
| 52 | * of columns. | ||
| 53 | * | ||
| 54 | * @param columns the number of columns | ||
| 55 | * | ||
| 56 | * @return the preferred size of the text field | ||
| 57 | * | ||
| 58 | * @see TextField#getPreferredSize(int) | ||
| 59 | */ | ||
| 60 | Dimension getPreferredSize(int columns); | ||
| 61 | |||
| 62 | /** | ||
| 63 | * Returns the minimum size of the text field with the specified number | ||
| 64 | * of columns. | ||
| 65 | * | ||
| 66 | * @param columns the number of columns | ||
| 67 | * | ||
| 68 | * @return the minimum size of the text field | ||
| 69 | * | ||
| 70 | * @see TextField#getMinimumSize(int) | ||
| 71 | */ | ||
| 72 | Dimension getMinimumSize(int columns); | ||
| 73 | |||
| 74 | } | ||
Binary file not shown.
| @@ -0,0 +1,80 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package java.awt.peer; | ||
| 27 | |||
| 28 | import java.awt.SystemTray; | ||
| 29 | import java.awt.TrayIcon; | ||
| 30 | |||
| 31 | /** | ||
| 32 | * The peer interface for the {@link TrayIcon}. This doesn't need to be | ||
| 33 | * implemented if {@link SystemTray#isSupported()} returns false. | ||
| 34 | */ | ||
| 35 | public interface TrayIconPeer { | ||
| 36 | |||
| 37 | /** | ||
| 38 | * Disposes the tray icon and releases and resources held by it. | ||
| 39 | * | ||
| 40 | * @see TrayIcon#removeNotify() | ||
| 41 | */ | ||
| 42 | void dispose(); | ||
| 43 | |||
| 44 | /** | ||
| 45 | * Sets the tool tip for the tray icon. | ||
| 46 | * | ||
| 47 | * @param tooltip the tooltip to set | ||
| 48 | * | ||
| 49 | * @see TrayIcon#setToolTip(String) | ||
| 50 | */ | ||
| 51 | void setToolTip(String tooltip); | ||
| 52 | |||
| 53 | /** | ||
| 54 | * Updates the icon image. This is supposed to display the current icon | ||
| 55 | * from the TrayIcon component in the actual tray icon. | ||
| 56 | * | ||
| 57 | * @see TrayIcon#setImage(java.awt.Image) | ||
| 58 | * @see TrayIcon#setImageAutoSize(boolean) | ||
| 59 | */ | ||
| 60 | void updateImage(); | ||
| 61 | |||
| 62 | /** | ||
| 63 | * Displays a message at the tray icon. | ||
| 64 | * | ||
| 65 | * @param caption the message caption | ||
| 66 | * @param text the actual message text | ||
| 67 | * @param messageType the message type | ||
| 68 | * | ||
| 69 | * @see TrayIcon#displayMessage(String, String, java.awt.TrayIcon.MessageType) | ||
| 70 | */ | ||
| 71 | void displayMessage(String caption, String text, String messageType); | ||
| 72 | |||
| 73 | /** | ||
| 74 | * Shows the popup menu of this tray icon at the specified position. | ||
| 75 | * | ||
| 76 | * @param x the X location for the popup menu | ||
| 77 | * @param y the Y location for the popup menu | ||
| 78 | */ | ||
| 79 | void showPopupMenu(int x, int y); | ||
| 80 | } | ||
Binary file not shown.
| @@ -0,0 +1,123 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package java.awt.peer; | ||
| 27 | |||
| 28 | import java.awt.*; | ||
| 29 | |||
| 30 | import java.awt.image.BufferedImage; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * The peer interface for {@link Window}. | ||
| 34 | * | ||
| 35 | * The peer interfaces are intended only for use in porting | ||
| 36 | * the AWT. They are not intended for use by application | ||
| 37 | * developers, and developers should not implement peers | ||
| 38 | * nor invoke any of the peer methods directly on the peer | ||
| 39 | * instances. | ||
| 40 | */ | ||
| 41 | public interface WindowPeer extends ContainerPeer { | ||
| 42 | |||
| 43 | /** | ||
| 44 | * Makes this window the topmost window on the desktop. | ||
| 45 | * | ||
| 46 | * @see Window#toFront() | ||
| 47 | */ | ||
| 48 | void toFront(); | ||
| 49 | |||
| 50 | /** | ||
| 51 | * Makes this window the bottommost window on the desktop. | ||
| 52 | * | ||
| 53 | * @see Window#toBack() | ||
| 54 | */ | ||
| 55 | void toBack(); | ||
| 56 | |||
| 57 | /** | ||
| 58 | * Sets if the window should always stay on top of all other windows or | ||
| 59 | * not. | ||
| 60 | * | ||
| 61 | * @param alwaysOnTop if the window should always stay on top of all other | ||
| 62 | * windows or not | ||
| 63 | * | ||
| 64 | * @see Window#setAlwaysOnTop(boolean) | ||
| 65 | */ | ||
| 66 | void setAlwaysOnTop(boolean alwaysOnTop); | ||
| 67 | |||
| 68 | /** | ||
| 69 | * Updates the window's focusable state. | ||
| 70 | * | ||
| 71 | * @see Window#setFocusableWindowState(boolean) | ||
| 72 | */ | ||
| 73 | void updateFocusableWindowState(); | ||
| 74 | |||
| 75 | /** | ||
| 76 | * Sets if this window is blocked by a modal dialog or not. | ||
| 77 | * | ||
| 78 | * @param blocker the blocking modal dialog | ||
| 79 | * @param blocked {@code true} to block the window, {@code false} | ||
| 80 | * to unblock it | ||
| 81 | */ | ||
| 82 | void setModalBlocked(Dialog blocker, boolean blocked); | ||
| 83 | |||
| 84 | /** | ||
| 85 | * Updates the minimum size on the peer. | ||
| 86 | * | ||
| 87 | * @see Window#setMinimumSize(Dimension) | ||
| 88 | */ | ||
| 89 | void updateMinimumSize(); | ||
| 90 | |||
| 91 | /** | ||
| 92 | * Updates the icons for the window. | ||
| 93 | * | ||
| 94 | * @see Window#setIconImages(java.util.List) | ||
| 95 | */ | ||
| 96 | void updateIconImages(); | ||
| 97 | |||
| 98 | /** | ||
| 99 | * Sets the level of opacity for the window. | ||
| 100 | * | ||
| 101 | * @see Window#setOpacity(float) | ||
| 102 | */ | ||
| 103 | void setOpacity(float opacity); | ||
| 104 | |||
| 105 | /** | ||
| 106 | * Enables the per-pixel alpha support for the window. | ||
| 107 | * | ||
| 108 | * @see Window#setBackground(Color) | ||
| 109 | */ | ||
| 110 | void setOpaque(boolean isOpaque); | ||
| 111 | |||
| 112 | /** | ||
| 113 | * Updates the native part of non-opaque window. | ||
| 114 | * | ||
| 115 | * @see Window#setBackground(Color) | ||
| 116 | */ | ||
| 117 | void updateWindow(); | ||
| 118 | |||
| 119 | /** | ||
| 120 | * Instructs the peer to update the position of the security warning. | ||
| 121 | */ | ||
| 122 | void repositionSecurityWarning(); | ||
| 123 | } | ||
| @@ -0,0 +1,39 @@ | |||
| 1 | <../../../../../mkconfig | ||
| 2 | |||
| 3 | TARG=\ | ||
| 4 | ButtonPeer.dis\ | ||
| 5 | CanvasPeer.dis\ | ||
| 6 | CheckboxMenuItemPeer.dis\ | ||
| 7 | CheckboxPeer.dis\ | ||
| 8 | ChoicePeer.dis\ | ||
| 9 | ComponentPeer.dis\ | ||
| 10 | ContainerPeer.dis\ | ||
| 11 | DesktopPeer.dis\ | ||
| 12 | DialogPeer.dis\ | ||
| 13 | FileDialogPeer.dis\ | ||
| 14 | FontPeer.dis\ | ||
| 15 | FramePeer.dis\ | ||
| 16 | KeyboardFocusManagerPeer.dis\ | ||
| 17 | LabelPeer.dis\ | ||
| 18 | LightweightPeer.dis\ | ||
| 19 | ListPeer.dis\ | ||
| 20 | MenuBarPeer.dis\ | ||
| 21 | MenuComponentPeer.dis\ | ||
| 22 | MenuItemPeer.dis\ | ||
| 23 | MenuPeer.dis\ | ||
| 24 | MouseInfoPeer.dis\ | ||
| 25 | PanelPeer.dis\ | ||
| 26 | PopupMenuPeer.dis\ | ||
| 27 | RobotPeer.dis\ | ||
| 28 | ScrollbarPeer.dis\ | ||
| 29 | ScrollPanePeer.dis\ | ||
| 30 | SystemTrayPeer.dis\ | ||
| 31 | TextAreaPeer.dis\ | ||
| 32 | TextComponentPeer.dis\ | ||
| 33 | TextFieldPeer.dis\ | ||
| 34 | TrayIconPeer.dis\ | ||
| 35 | WindowPeer.dis\ | ||
| 36 | |||
| 37 | DISBIN=$ROOT/java/dis/java/java/java/awt/peer | ||
| 38 | |||
| 39 | <$ROOT/mkfiles/mkjava | ||
| @@ -0,0 +1,51 @@ | |||
| 1 | <!-- | ||
| 2 | Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | |||
| 5 | This code is free software; you can redistribute it and/or modify it | ||
| 6 | under the terms of the GNU General Public License version 2 only, as | ||
| 7 | published by the Free Software Foundation. Oracle designates this | ||
| 8 | particular file as subject to the "Classpath" exception as provided | ||
| 9 | by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | |||
| 11 | This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | accompanied this code). | ||
| 16 | |||
| 17 | You should have received a copy of the GNU General Public License version | ||
| 18 | 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | |||
| 21 | Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | or visit www.oracle.com if you need additional information or have any | ||
| 23 | questions. | ||
| 24 | --> | ||
| 25 | |||
| 26 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | ||
| 27 | <html> | ||
| 28 | <body bgcolor="white"> | ||
| 29 | |||
| 30 | Provides for interfacing with the underlying window system. | ||
| 31 | It is for accessing the platform-specific facilities in order to | ||
| 32 | build AWT toolkits. It is only used by AWT toolkit developers. | ||
| 33 | |||
| 34 | |||
| 35 | <h2>Package Specification</h2> | ||
| 36 | |||
| 37 | ##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT ##### | ||
| 38 | <ul> | ||
| 39 | <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a> | ||
| 40 | </ul> | ||
| 41 | |||
| 42 | <h2>Related Documentation</h2> | ||
| 43 | |||
| 44 | For overviews, tutorials, examples, guides, and tool documentation, please see: | ||
| 45 | <ul> | ||
| 46 | <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a> | ||
| 47 | </ul> | ||
| 48 | |||
| 49 | |||
| 50 | </body> | ||
| 51 | </html> | ||