This commit is contained in:
Chris Hegarty 2013-10-15 13:54:01 +01:00
commit 3486abb2c7
470 changed files with 6932 additions and 2763 deletions

View File

@ -173,6 +173,12 @@ class JarMetaIndex {
*/
private HashMap<String, HashSet<String>> knownPrefixMap = new HashMap<>();
/**
* Special value for the HashSet to indicate that there are classes in
* the top-level package.
*/
private static final String TOP_LEVEL = "TOP";
/*
* A class for mapping package prefixes to the number of
* levels of package elements to include.
@ -212,7 +218,7 @@ class JarMetaIndex {
/*
* We add maximum 5 second level entries to "sun", "java" and
* We add maximum 5 second level entries to "sun", "jdk", "java" and
* "javax" entries. Tune this parameter to get a balance on the
* cold start and footprint.
*/
@ -223,6 +229,7 @@ class JarMetaIndex {
JarMetaIndex(String fileName) throws IOException {
jar = new JarFile(fileName);
knownPrefixMap.put("sun", new HashSet<String>());
knownPrefixMap.put("jdk", new HashSet<String>());
knownPrefixMap.put("java", new HashSet<String>());
knownPrefixMap.put("javax", new HashSet<String>());
}
@ -336,12 +343,12 @@ class JarMetaIndex {
return false;
}
String secondPkgElement = name.substring(firstSlashIndex + 1,
name.indexOf("/",
firstSlashIndex + 1));
/* Add the second level package name to the corresponding hashset. */
if (secondPkgElement != null) {
int secondSlashIndex = name.indexOf("/", firstSlashIndex+1);
if (secondSlashIndex == -1) {
pkgSet.add(TOP_LEVEL);
} else {
String secondPkgElement = name.substring(firstSlashIndex+1, secondSlashIndex);
pkgSet.add(secondPkgElement);
}
@ -368,8 +375,9 @@ class JarMetaIndex {
if (setSize == 0) {
continue;
}
else if (setSize > JarMetaIndex.MAX_PKGS_WITH_KNOWN_PREFIX) {
indexSet.add(key + "/");
if (setSize > JarMetaIndex.MAX_PKGS_WITH_KNOWN_PREFIX ||
pkgSetStartsWithKey.contains(TOP_LEVEL)) {
indexSet.add(key + "/");
} else {
/* If the set contains less than MAX_PKGS_WITH_KNOWN_PREFIX, add
* them to the indexSet of the MetaIndex object.

View File

@ -983,8 +983,6 @@ ifeq ($(OPENJDK_TARGET_OS),macosx)
JARINDEX:=true))
endif
##########################################################################################
# This file is imported from hotspot in Import.gmk. Copying it into images/lib so that
# all jars can be found in one place when creating images in Images.gmk. It needs to be
# done here so that clean targets can be simple and accurate.

View File

@ -155,7 +155,7 @@ public class AppleScriptEngine implements ScriptEngine {
TRACE("init()");
// set up our context
/* TODO -- name of current executable? bad java documentation at:
* http://java.sun.com/javase/6/docs/api/javax/script/ScriptEngine.html#FILENAME */
* http://docs.oracle.com/javase/6/docs/api/javax/script/ScriptEngine.html#FILENAME */
put(ScriptEngine.FILENAME, "");
put(ScriptEngine.ENGINE, getEngine());
put(ScriptEngine.ENGINE_VERSION, getEngineVersion());

View File

@ -31,10 +31,6 @@ import java.util.*;
import com.apple.eawt.AppEvent.*;
interface _OpenAppHandler {
void handleOpenApp();
}
@SuppressWarnings("deprecation")
class _AppEventLegacyHandler implements AboutHandler, PreferencesHandler, _OpenAppHandler, AppReOpenedListener, OpenFilesHandler, PrintFilesHandler, QuitHandler {
final _AppEventHandler parent;

View File

@ -0,0 +1,30 @@
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.apple.eawt;
interface _OpenAppHandler {
void handleOpenApp();
}

View File

@ -25,141 +25,11 @@
package com.apple.laf;
import java.awt.*;
import javax.swing.*;
import javax.swing.plaf.UIResource;
import sun.swing.SwingUtilities2;
class AquaComboBoxRenderer extends AquaComboBoxRendererInternal implements UIResource {
public AquaComboBoxRenderer(final JComboBox comboBox) {
super(comboBox);
}
}
class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer {
final JComboBox fComboBox;
boolean fSelected;
boolean fChecked;
boolean fInList;
boolean fEditable;
boolean fDrawCheckedItem = true;
// Provides space for a checkbox, and is translucent
public AquaComboBoxRendererInternal(final JComboBox comboBox) {
super();
fComboBox = comboBox;
}
// Don't include checkIcon space, because this is also used for button size calculations
// - the popup-size calc will get checkIcon space from getInsets
public Dimension getPreferredSize() {
// From BasicComboBoxRenderer - trick to avoid zero-height items
final Dimension size;
final String text = getText();
if ((text == null) || ("".equals(text))) {
setText(" ");
size = super.getPreferredSize();
setText("");
} else {
size = super.getPreferredSize();
}
return size;
}
// Don't paint the border here, it gets painted by the UI
protected void paintBorder(final Graphics g) {
}
public int getBaseline(int width, int height) {
return super.getBaseline(width, height) - 1;
}
// Really means is the one with the mouse over it
public Component getListCellRendererComponent(final JList list, final Object value, int index, final boolean isSelected, final boolean cellHasFocus) {
fInList = (index >= 0); // When the button wants the item painted, it passes in -1
fSelected = isSelected;
if (index < 0) {
index = fComboBox.getSelectedIndex();
}
// changed this to not ask for selected index but directly compare the current item and selected item
// different from basic because basic has no concept of checked, just has the last one selected,
// and the user changes selection. We have selection and a check mark.
// we used to call fComboBox.getSelectedIndex which ends up being a very bad call for large checkboxes
// it does a linear compare of every object in the checkbox until it finds the selected one, so if
// we have a 5000 element list we will 5000 * (selected index) .equals() of objects.
// See Radar #3141307
// Fix for Radar # 3204287 where we ask for an item at a negative index!
if (index >= 0) {
final Object item = fComboBox.getItemAt(index);
fChecked = fInList && item != null && item.equals(fComboBox.getSelectedItem());
} else {
fChecked = false;
}
fEditable = fComboBox.isEditable();
if (isSelected) {
if (fEditable) {
setBackground(UIManager.getColor("List.selectionBackground"));
setForeground(UIManager.getColor("List.selectionForeground"));
} else {
setBackground(list.getSelectionBackground());
setForeground(list.getSelectionForeground());
}
} else {
if (fEditable) {
setBackground(UIManager.getColor("List.background"));
setForeground(UIManager.getColor("List.foreground"));
} else {
setBackground(list.getBackground());
setForeground(list.getForeground());
}
}
setFont(list.getFont());
if (value instanceof Icon) {
setIcon((Icon)value);
} else {
setText((value == null) ? " " : value.toString());
}
return this;
}
public Insets getInsets(Insets insets) {
if (insets == null) insets = new Insets(0, 0, 0, 0);
insets.top = 1;
insets.bottom = 1;
insets.right = 5;
insets.left = (fInList && !fEditable ? 16 + 7 : 5);
return insets;
}
protected void setDrawCheckedItem(final boolean drawCheckedItem) {
this.fDrawCheckedItem = drawCheckedItem;
}
// Paint this component, and a checkbox if it's the selected item and not in the button
protected void paintComponent(final Graphics g) {
if (fInList) {
if (fSelected && !fEditable) {
AquaMenuPainter.instance().paintSelectedMenuItemBackground(g, getWidth(), getHeight());
} else {
g.setColor(getBackground());
g.fillRect(0, 0, getWidth(), getHeight());
}
if (fChecked && !fEditable && fDrawCheckedItem) {
final int y = getHeight() - 4;
g.setColor(getForeground());
SwingUtilities2.drawString(fComboBox, g, "\u2713", 6, y);
}
}
super.paintComponent(g);
}
}

View File

@ -0,0 +1,157 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.apple.laf;
import sun.swing.SwingUtilities2;
import javax.swing.*;
import java.awt.*;
class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer {
final JComboBox fComboBox;
boolean fSelected;
boolean fChecked;
boolean fInList;
boolean fEditable;
boolean fDrawCheckedItem = true;
// Provides space for a checkbox, and is translucent
public AquaComboBoxRendererInternal(final JComboBox comboBox) {
super();
fComboBox = comboBox;
}
// Don't include checkIcon space, because this is also used for button size calculations
// - the popup-size calc will get checkIcon space from getInsets
public Dimension getPreferredSize() {
// From BasicComboBoxRenderer - trick to avoid zero-height items
final Dimension size;
final String text = getText();
if ((text == null) || ("".equals(text))) {
setText(" ");
size = super.getPreferredSize();
setText("");
} else {
size = super.getPreferredSize();
}
return size;
}
// Don't paint the border here, it gets painted by the UI
protected void paintBorder(final Graphics g) {
}
public int getBaseline(int width, int height) {
return super.getBaseline(width, height) - 1;
}
// Really means is the one with the mouse over it
public Component getListCellRendererComponent(final JList list, final Object value, int index, final boolean isSelected, final boolean cellHasFocus) {
fInList = (index >= 0); // When the button wants the item painted, it passes in -1
fSelected = isSelected;
if (index < 0) {
index = fComboBox.getSelectedIndex();
}
// changed this to not ask for selected index but directly compare the current item and selected item
// different from basic because basic has no concept of checked, just has the last one selected,
// and the user changes selection. We have selection and a check mark.
// we used to call fComboBox.getSelectedIndex which ends up being a very bad call for large checkboxes
// it does a linear compare of every object in the checkbox until it finds the selected one, so if
// we have a 5000 element list we will 5000 * (selected index) .equals() of objects.
// See Radar #3141307
// Fix for Radar # 3204287 where we ask for an item at a negative index!
if (index >= 0) {
final Object item = fComboBox.getItemAt(index);
fChecked = fInList && item != null && item.equals(fComboBox.getSelectedItem());
} else {
fChecked = false;
}
fEditable = fComboBox.isEditable();
if (isSelected) {
if (fEditable) {
setBackground(UIManager.getColor("List.selectionBackground"));
setForeground(UIManager.getColor("List.selectionForeground"));
} else {
setBackground(list.getSelectionBackground());
setForeground(list.getSelectionForeground());
}
} else {
if (fEditable) {
setBackground(UIManager.getColor("List.background"));
setForeground(UIManager.getColor("List.foreground"));
} else {
setBackground(list.getBackground());
setForeground(list.getForeground());
}
}
setFont(list.getFont());
if (value instanceof Icon) {
setIcon((Icon)value);
} else {
setText((value == null) ? " " : value.toString());
}
return this;
}
public Insets getInsets(Insets insets) {
if (insets == null) insets = new Insets(0, 0, 0, 0);
insets.top = 1;
insets.bottom = 1;
insets.right = 5;
insets.left = (fInList && !fEditable ? 16 + 7 : 5);
return insets;
}
protected void setDrawCheckedItem(final boolean drawCheckedItem) {
this.fDrawCheckedItem = drawCheckedItem;
}
// Paint this component, and a checkbox if it's the selected item and not in the button
protected void paintComponent(final Graphics g) {
if (fInList) {
if (fSelected && !fEditable) {
AquaMenuPainter.instance().paintSelectedMenuItemBackground(g, getWidth(), getHeight());
} else {
g.setColor(getBackground());
g.fillRect(0, 0, getWidth(), getHeight());
}
if (fChecked && !fEditable && fDrawCheckedItem) {
final int y = getHeight() - 4;
g.setColor(getForeground());
SwingUtilities2.drawString(fComboBox, g, "\u2713", 6, y);
}
}
super.paintComponent(g);
}
}

View File

@ -281,12 +281,16 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
actionMap.put("aquaSelectPageUp", highlightPageUpAction);
actionMap.put("aquaSelectPageDown", highlightPageDownAction);
actionMap.put("aquaHidePopup", hideAction);
SwingUtilities.replaceUIActionMap(comboBox, actionMap);
}
abstract class ComboBoxAction extends AbstractAction {
private abstract class ComboBoxAction extends AbstractAction {
public void actionPerformed(final ActionEvent e) {
if (!comboBox.isEnabled() || !comboBox.isShowing()) return;
if (!comboBox.isEnabled() || !comboBox.isShowing()) {
return;
}
if (comboBox.isPopupVisible()) {
final AquaComboBoxUI ui = (AquaComboBoxUI)comboBox.getUI();
@ -302,7 +306,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
/**
* Hilight _but do not select_ the next item in the list.
*/
Action highlightNextAction = new ComboBoxAction() {
private Action highlightNextAction = new ComboBoxAction() {
@Override
public void performComboBoxAction(AquaComboBoxUI ui) {
final int si = listBox.getSelectedIndex();
@ -318,7 +322,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
/**
* Hilight _but do not select_ the previous item in the list.
*/
Action highlightPreviousAction = new ComboBoxAction() {
private Action highlightPreviousAction = new ComboBoxAction() {
@Override
void performComboBoxAction(final AquaComboBoxUI ui) {
final int si = listBox.getSelectedIndex();
@ -330,7 +334,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
}
};
Action highlightFirstAction = new ComboBoxAction() {
private Action highlightFirstAction = new ComboBoxAction() {
@Override
void performComboBoxAction(final AquaComboBoxUI ui) {
listBox.setSelectedIndex(0);
@ -338,7 +342,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
}
};
Action highlightLastAction = new ComboBoxAction() {
private Action highlightLastAction = new ComboBoxAction() {
@Override
void performComboBoxAction(final AquaComboBoxUI ui) {
final int size = listBox.getModel().getSize();
@ -347,7 +351,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
}
};
Action highlightPageUpAction = new ComboBoxAction() {
private Action highlightPageUpAction = new ComboBoxAction() {
@Override
void performComboBoxAction(final AquaComboBoxUI ui) {
final int current = listBox.getSelectedIndex();
@ -367,7 +371,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
}
};
Action highlightPageDownAction = new ComboBoxAction() {
private Action highlightPageDownAction = new ComboBoxAction() {
@Override
void performComboBoxAction(final AquaComboBoxUI ui) {
final int current = listBox.getSelectedIndex();
@ -482,13 +486,13 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
// This is somewhat messy. The difference here from BasicComboBoxUI.EnterAction is that
// arrow up or down does not automatically select the
static final Action triggerSelectionAction = new AbstractAction() {
private static final Action triggerSelectionAction = new AbstractAction() {
public void actionPerformed(final ActionEvent e) {
triggerSelectionEvent((JComboBox)e.getSource(), e);
}
};
static final Action toggleSelectionAction = new AbstractAction() {
private static final Action toggleSelectionAction = new AbstractAction() {
public void actionPerformed(final ActionEvent e) {
final JComboBox comboBox = (JComboBox)e.getSource();
if (!comboBox.isEnabled()) return;
@ -506,6 +510,18 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
}
};
private static Action hideAction = new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
final JComboBox comboBox = (JComboBox)e.getSource();
if (comboBox.isPopupVisible()) {
comboBox.firePopupMenuCanceled();
comboBox.setPopupVisible(false);
}
}
};
public void applySizeFor(final JComponent c, final Size size) {
if (arrowButton == null) return;
final Border border = arrowButton.getBorder();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -209,7 +209,7 @@ public class AquaKeyBindings {
LateBoundInputMap getComboBoxInputMap() {
return new LateBoundInputMap(new SimpleBinding(new String[] {
"ESCAPE", "hidePopup",
"ESCAPE", "aquaHidePopup",
"PAGE_UP", "aquaSelectPageUp",
"PAGE_DOWN", "aquaSelectPageDown",
"HOME", "aquaSelectHome",

View File

@ -73,8 +73,9 @@ public class AquaMenuBarUI extends BasicMenuBarUI implements ScreenMenuBarProvid
public Dimension getPreferredSize(final JComponent c) {
if (isScreenMenuBar((JMenuBar)c)) {
if (setScreenMenuBar((JFrame)(c.getTopLevelAncestor()))) ;
return new Dimension(0, 0);
if (setScreenMenuBar((JFrame)(c.getTopLevelAncestor()))) {
return new Dimension(0, 0);
}
}
return null;
}

View File

@ -181,6 +181,9 @@ public final class CGraphicsEnvironment extends SunGraphicsEnvironment {
initDevices();
d = devices.get(mainDisplayID);
if (d == null) {
throw new AWTError("no screen devices");
}
}
return d;
}

View File

@ -385,11 +385,6 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
// ---- PEER METHODS ---- //
@Override
public Toolkit getToolkit() {
return LWToolkit.getLWToolkit();
}
// Just a helper method
public LWToolkit getLWToolkit() {
return LWToolkit.getLWToolkit();
@ -1010,13 +1005,13 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
@Override
public boolean prepareImage(Image img, int w, int h, ImageObserver o) {
// TODO: is it a right/complete implementation?
return getToolkit().prepareImage(img, w, h, o);
return Toolkit.getDefaultToolkit().prepareImage(img, w, h, o);
}
@Override
public int checkImage(Image img, int w, int h, ImageObserver o) {
// TODO: is it a right/complete implementation?
return getToolkit().checkImage(img, w, h, o);
return Toolkit.getDefaultToolkit().checkImage(img, w, h, o);
}
@Override

View File

@ -71,13 +71,14 @@ abstract class LWTextComponentPeer<T extends TextComponent, D extends JComponent
}
setEditable(getTarget().isEditable());
setText(getTarget().getText());
setCaretPosition(getTarget().getCaretPosition());
getTarget().addInputMethodListener(this);
final int start = getTarget().getSelectionStart();
final int end = getTarget().getSelectionEnd();
if (end > start) {
// Should be called after setText() and setCaretPosition()
select(start, end);
}
setCaretPosition(getTarget().getCaretPosition());
firstChangeSkipped = true;
}
@ -122,7 +123,7 @@ abstract class LWTextComponentPeer<T extends TextComponent, D extends JComponent
}
@Override
public final void setText(final String l) {
public final void setText(final String text) {
synchronized (getDelegateLock()) {
// JTextArea.setText() posts two different events (remove & insert).
// Since we make no differences between text events,
@ -130,7 +131,7 @@ abstract class LWTextComponentPeer<T extends TextComponent, D extends JComponent
// JTextArea.setText() is called.
final Document document = getTextComponent().getDocument();
document.removeDocumentListener(this);
getTextComponent().setText(l);
getTextComponent().setText(text);
revalidate();
if (firstChangeSkipped) {
postEvent(new TextEvent(getTarget(),

View File

@ -317,9 +317,25 @@ public class LWWindowPeer
op |= SET_SIZE;
}
// Don't post ComponentMoved/Resized and Paint events
// until we've got a notification from the delegate
Rectangle cb = constrainBounds(x, y, w, h);
setBounds(cb.x, cb.y, cb.width, cb.height, op, false, false);
// Get updated bounds, so we don't have to handle 'op' here manually
Rectangle r = getBounds();
platformWindow.setBounds(r.x, r.y, r.width, r.height);
}
public Rectangle constrainBounds(Rectangle bounds) {
return constrainBounds(bounds.x, bounds.y, bounds.width, bounds.height);
}
public Rectangle constrainBounds(int x, int y, int w, int h) {
if (w < MINIMUM_WIDTH) {
w = MINIMUM_WIDTH;
}
if (h < MINIMUM_HEIGHT) {
h = MINIMUM_HEIGHT;
}
@ -334,12 +350,7 @@ public class LWWindowPeer
h = maxH;
}
// Don't post ComponentMoved/Resized and Paint events
// until we've got a notification from the delegate
setBounds(x, y, w, h, op, false, false);
// Get updated bounds, so we don't have to handle 'op' here manually
Rectangle r = getBounds();
platformWindow.setBounds(r.x, r.y, r.width, r.height);
return new Rectangle(x, y, w, h);
}
@Override
@ -393,8 +404,12 @@ public class LWWindowPeer
@Override
public void setModalBlocked(Dialog blocker, boolean blocked) {
synchronized (getPeerTreeLock()) {
this.blocker = !blocked ? null :
(LWWindowPeer) AWTAccessor.getComponentAccessor().getPeer(blocker);
ComponentPeer peer = AWTAccessor.getComponentAccessor().getPeer(blocker);
if (blocked && (peer instanceof LWWindowPeer)) {
this.blocker = (LWWindowPeer) peer;
} else {
this.blocker = null;
}
}
platformWindow.setModalBlocked(blocked);
@ -1146,8 +1161,11 @@ public class LWWindowPeer
return false;
}
Window currentActive = KeyboardFocusManager.
getCurrentKeyboardFocusManager().getActiveWindow();
AppContext targetAppContext = AWTAccessor.getComponentAccessor().getAppContext(getTarget());
KeyboardFocusManager kfm = AWTAccessor.getKeyboardFocusManagerAccessor()
.getCurrentKeyboardFocusManager(targetAppContext);
Window currentActive = kfm.getActiveWindow();
Window opposite = LWKeyboardFocusManagerPeer.getInstance().
getCurrentFocusedWindow();

View File

@ -26,6 +26,7 @@
package sun.lwawt.macosx;
import java.awt.*;
import java.awt.dnd.DropTarget;
import sun.awt.dnd.SunDropTargetContextPeer;
import sun.awt.dnd.SunDropTargetEvent;
@ -38,7 +39,7 @@ final class CDropTargetContextPeer extends SunDropTargetContextPeer {
private long fNativeDropTransfer = 0;
private long fNativeDataAvailable = 0;
private Object fNativeData = null;
private boolean insideTarget = true;
private DropTarget insideTarget = null;
Object awtLockAccess = new Object();
@ -88,26 +89,19 @@ final class CDropTargetContextPeer extends SunDropTargetContextPeer {
return fNativeData;
}
// We need to take care of dragExit message because for some reason it is not being
// generated for lightweight components
// We need to take care of dragEnter and dragExit messages because
// native system generates them only for heavyweights
@Override
protected void processMotionMessage(SunDropTargetEvent event, boolean operationChanged) {
Component eventSource = (Component)event.getComponent();
Point screenPoint = event.getPoint();
SwingUtilities.convertPointToScreen(screenPoint, eventSource);
Rectangle screenBounds = new Rectangle(eventSource.getLocationOnScreen().x,
eventSource.getLocationOnScreen().y,
eventSource.getWidth(), eventSource.getHeight());
if(insideTarget) {
if(!screenBounds.contains(screenPoint)) {
boolean eventInsideTarget = isEventInsideTarget(event);
if (event.getComponent().getDropTarget() == insideTarget) {
if (!eventInsideTarget) {
processExitMessage(event);
insideTarget = false;
return;
}
} else {
if(screenBounds.contains(screenPoint)) {
if (eventInsideTarget) {
processEnterMessage(event);
insideTarget = true;
} else {
return;
}
@ -115,17 +109,52 @@ final class CDropTargetContextPeer extends SunDropTargetContextPeer {
super.processMotionMessage(event, operationChanged);
}
/**
* Could be called when DnD enters a heavyweight or synthesized in processMotionMessage
*/
@Override
protected void processEnterMessage(SunDropTargetEvent event) {
Component c = event.getComponent();
DropTarget dt = event.getComponent().getDropTarget();
if (isEventInsideTarget(event)
&& dt != insideTarget
&& c.isShowing()
&& dt != null
&& dt.isActive()) {
insideTarget = dt;
super.processEnterMessage(event);
}
}
/**
* Could be called when DnD exits a heavyweight or synthesized in processMotionMessage
*/
@Override
protected void processExitMessage(SunDropTargetEvent event) {
if (event.getComponent().getDropTarget() == insideTarget) {
insideTarget = null;
super.processExitMessage(event);
}
}
@Override
protected void processDropMessage(SunDropTargetEvent event) {
Component eventSource = (Component)event.getComponent();
if (isEventInsideTarget(event)) {
super.processDropMessage(event);
insideTarget = null;
}
}
private boolean isEventInsideTarget(SunDropTargetEvent event) {
Component eventSource = event.getComponent();
Point screenPoint = event.getPoint();
SwingUtilities.convertPointToScreen(screenPoint, eventSource);
Rectangle screenBounds = new Rectangle(eventSource.getLocationOnScreen().x,
eventSource.getLocationOnScreen().y,
eventSource.getWidth(), eventSource.getHeight());
if(screenBounds.contains(screenPoint)) {
super.processDropMessage(event);
}
Point locationOnScreen = eventSource.getLocationOnScreen();
Rectangle screenBounds = new Rectangle(locationOnScreen.x,
locationOnScreen.y,
eventSource.getWidth(),
eventSource.getHeight());
return screenBounds.contains(screenPoint);
}
@Override

View File

@ -326,11 +326,6 @@ class CFileDialog implements FileDialogPeer {
return getMinimumSize();
}
@Override
public Toolkit getToolkit() {
return Toolkit.getDefaultToolkit();
}
@Override
public void handleEvent(AWTEvent e) {
}

View File

@ -210,7 +210,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
private boolean undecorated; // initialized in getInitialStyleBits()
private Rectangle normalBounds = null; // not-null only for undecorated maximized windows
private CPlatformResponder responder;
private volatile boolean zoomed = false; // from native perspective
public CPlatformWindow() {
super(0, true);
@ -231,7 +230,9 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
contentView.initialize(peer, responder);
final long ownerPtr = owner != null ? owner.getNSWindowPtr() : 0L;
final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(), ownerPtr, styleBits, 0, 0, 0, 0);
Rectangle bounds = _peer.constrainBounds(_target.getBounds());
final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(),
ownerPtr, styleBits, bounds.x, bounds.y, bounds.width, bounds.height);
setPtr(nativeWindowPtr);
if (target instanceof javax.swing.RootPaneContainer) {
@ -466,7 +467,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
}
private boolean isMaximized() {
return undecorated ? this.normalBounds != null : zoomed;
return undecorated ? this.normalBounds != null
: CWrapper.NSWindow.isZoomed(getNSWindowPtr());
}
private void maximize() {
@ -474,7 +476,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
return;
}
if (!undecorated) {
zoomed = true;
CWrapper.NSWindow.zoom(getNSWindowPtr());
} else {
deliverZoom(true);
@ -496,7 +497,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
return;
}
if (!undecorated) {
zoomed = false;
CWrapper.NSWindow.zoom(getNSWindowPtr());
} else {
deliverZoom(false);

View File

@ -68,6 +68,7 @@ public final class CWrapper {
public static native void miniaturize(long window);
public static native void deminiaturize(long window);
public static native boolean isZoomed(long window);
public static native void zoom(long window);
public static native void makeFirstResponder(long window, long responder);

View File

@ -76,5 +76,6 @@ FILE_NAME=application/x-java-file-list;class=java.util.List
text/uri-list=application/x-java-file-list;class=java.util.List
PNG=image/x-java-image;class=java.awt.Image
JFIF=image/x-java-image;class=java.awt.Image
TIFF=image/x-java-image;class=java.awt.Image
RICH_TEXT=text/rtf
HTML=text/html;charset=utf-8;eoln="\r\n";terminators=1

View File

@ -366,7 +366,7 @@ AWT_ASSERT_APPKIT_THREAD;
- (BOOL) canBecomeMainWindow {
AWT_ASSERT_APPKIT_THREAD;
if(!self.isEnabled){
if (!self.isEnabled) {
// Native system can bring up the NSWindow to
// the top even if the window is not main.
// We should bring up the modal dialog manually
@ -377,7 +377,7 @@ AWT_ASSERT_APPKIT_THREAD;
if (platformWindow != NULL) {
static JNF_MEMBER_CACHE(jm_checkBlockingAndOrder, jc_CPlatformWindow,
"checkBlockingAndOrder", "()Z");
JNFCallVoidMethod(env, platformWindow, jm_checkBlockingAndOrder);
JNFCallBooleanMethod(env, platformWindow, jm_checkBlockingAndOrder);
(*env)->DeleteLocalRef(env, platformWindow);
}
}

View File

@ -477,6 +477,8 @@ extern JNFClassInfo jc_CDropTargetContextPeer;
sDraggingExited = FALSE;
sDraggingLocation = [sender draggingLocation];
NSPoint javaLocation = [fView convertPoint:sDraggingLocation fromView:nil];
javaLocation.y = fView.window.frame.size.height - javaLocation.y;
DLog5(@"+ dragEnter: loc native %f, %f, java %f, %f\n", sDraggingLocation.x, sDraggingLocation.y, javaLocation.x, javaLocation.y);
////////// BEGIN Calculate the current drag actions //////////
@ -570,8 +572,7 @@ extern JNFClassInfo jc_CDropTargetContextPeer;
// Should we notify Java things have changed?
if (sDraggingError == FALSE && notifyJava) {
NSPoint javaLocation = [fView convertPoint:sDraggingLocation fromView:nil];
// For some reason even after the convertPoint drag events come with the y coordinate reverted
javaLocation.y = fView.window.frame.size.height - javaLocation.y;
javaLocation.y = fView.window.frame.size.height - javaLocation.y;
//DLog5(@" : dragMoved: loc native %f, %f, java %f, %f\n", sDraggingLocation.x, sDraggingLocation.y, javaLocation.x, javaLocation.y);
jlongArray formats = sDraggingFormats;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -93,6 +93,14 @@ canChooseDirectories:(BOOL)inChooseDirectories
- (void)safeSaveOrLoad {
NSSavePanel *thePanel = nil;
/*
* 8013553: turns off extension hiding for the native file dialog.
* This way is used because setExtensionHidden(NO) doesn't work
* as expected.
*/
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setBool:NO forKey:@"NSNavLastUserSetHideExtensionButtonState"];
if (fMode == java_awt_FileDialog_SAVE) {
thePanel = [NSSavePanel savePanel];
[thePanel setAllowsOtherFileTypes:YES];
@ -110,7 +118,7 @@ canChooseDirectories:(BOOL)inChooseDirectories
if (fMode == java_awt_FileDialog_LOAD) {
NSOpenPanel *openPanel = (NSOpenPanel *)thePanel;
[openPanel setAllowsMultipleSelection:fMultipleMode];
[openPanel setCanChooseFiles:YES];
[openPanel setCanChooseFiles:!fChooseDirectories];
[openPanel setCanChooseDirectories:fChooseDirectories];
[openPanel setCanCreateDirectories:YES];
}

View File

@ -435,6 +435,29 @@ JNF_COCOA_ENTER(env);
JNF_COCOA_EXIT(env);
}
/*
* Class: sun_lwawt_macosx_CWrapper$NSWindow
* Method: isZoomed
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_isZoomed
(JNIEnv *env, jclass cls, jlong windowPtr)
{
__block jboolean isZoomed = JNI_FALSE;
JNF_COCOA_ENTER(env);
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
isZoomed = [window isZoomed];
}];
JNF_COCOA_EXIT(env);
return isZoomed;
}
/*
* Class: sun_lwawt_macosx_CWrapper$NSWindow
* Method: zoom

View File

@ -227,7 +227,7 @@ static void AWT_NSUncaughtExceptionHandler(NSException *exception) {
id jrsAppKitAWTClass = objc_getClass("JRSAppKitAWT");
SEL markAppSel = @selector(markAppIsDaemon);
if (![jrsAppKitAWTClass respondsToSelector:markAppSel]) return NO;
return (BOOL)[jrsAppKitAWTClass performSelector:markAppSel];
return [jrsAppKitAWTClass performSelector:markAppSel] ? YES : NO;
}
+ (void)appKitIsRunning:(id)arg {
@ -337,6 +337,8 @@ AWT_ASSERT_APPKIT_THREAD;
// Headless mode trumps either ordinary AWT or SWT-in-AWT mode. Declare us a daemon and return.
if (headless) {
// Note that we don't install run loop observers in headless mode
// because we don't need them (see 7174704)
if (!forceEmbeddedMode) {
setUpAppKitThreadName();
}

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.imageio.plugins.bmp;
public class BMPCompressionTypes {
private static final String[] compressionTypeNames =
{"BI_RGB", "BI_RLE8", "BI_RLE4", "BI_BITFIELDS", "BI_JPEG", "BI_PNG"};
static int getType(String typeString) {
for (int i = 0; i < compressionTypeNames.length; i++)
if (compressionTypeNames[i].equals(typeString))
return i;
return 0;
}
static String getName(int type) {
return compressionTypeNames[type];
}
public static String[] getCompressionTypes() {
return compressionTypeNames.clone();
}
}

View File

@ -47,7 +47,4 @@ public interface BMPConstants {
static final int BI_BITFIELDS = 3;
static final int BI_JPEG = 4;
static final int BI_PNG = 5;
static final String[] compressionTypeNames =
{"BI_RGB", "BI_RLE8", "BI_RLE4", "BI_BITFIELDS", "BI_JPEG", "BI_PNG"};
}

View File

@ -25,7 +25,6 @@
package com.sun.imageio.plugins.bmp;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.image.ColorModel;
import java.awt.image.ComponentSampleModel;
@ -42,7 +41,6 @@ import java.awt.image.Raster;
import java.awt.image.RenderedImage;
import java.awt.image.SampleModel;
import java.awt.image.SinglePixelPackedSampleModel;
import java.awt.image.WritableRaster;
import java.awt.image.BufferedImage;
import java.io.IOException;
@ -51,22 +49,16 @@ import java.nio.ByteOrder;
import java.util.Iterator;
import javax.imageio.IIOImage;
import javax.imageio.IIOException;
import javax.imageio.ImageIO;
import javax.imageio.ImageTypeSpecifier;
import javax.imageio.ImageWriteParam;
import javax.imageio.ImageWriter;
import javax.imageio.metadata.IIOMetadata;
import javax.imageio.metadata.IIOMetadataNode;
import javax.imageio.metadata.IIOMetadataFormatImpl;
import javax.imageio.metadata.IIOInvalidTreeException;
import javax.imageio.spi.ImageWriterSpi;
import javax.imageio.stream.ImageOutputStream;
import javax.imageio.event.IIOWriteProgressListener;
import javax.imageio.event.IIOWriteWarningListener;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.imageio.plugins.bmp.BMPImageWriteParam;
import com.sun.imageio.plugins.common.ImageUtil;
@ -129,7 +121,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
meta.compression = getPreferredCompressionType(imageType);
if (param != null
&& param.getCompressionMode() == ImageWriteParam.MODE_EXPLICIT) {
meta.compression = getCompressionType(param.getCompressionType());
meta.compression = BMPCompressionTypes.getType(param.getCompressionType());
}
meta.bitsPerPixel = (short)imageType.getColorModel().getPixelSize();
return meta;
@ -308,7 +300,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
switch(bmpParam.getCompressionMode()) {
case ImageWriteParam.MODE_EXPLICIT:
compressionType = getCompressionType(bmpParam.getCompressionType());
compressionType = BMPCompressionTypes.getType(bmpParam.getCompressionType());
break;
case ImageWriteParam.MODE_COPY_FROM_METADATA:
compressionType = bmpImageMetadata.compression;
@ -323,12 +315,12 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
if (!canEncodeImage(compressionType, colorModel, sampleModel)) {
throw new IOException("Image can not be encoded with compression type "
+ compressionTypeNames[compressionType]);
+ BMPCompressionTypes.getName(compressionType));
}
byte r[] = null, g[] = null, b[] = null, a[] = null;
if (compressionType == BMPConstants.BI_BITFIELDS) {
if (compressionType == BI_BITFIELDS) {
bitsPerPixel =
DataBuffer.getDataTypeSize(sampleModel.getDataType());
@ -372,7 +364,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
// an exception related to unsupported image format
throw new IOException("Image can not be encoded with " +
"compression type " +
compressionTypeNames[compressionType]);
BMPCompressionTypes.getName(compressionType));
}
}
writeMaskToPalette(rmask, 0, r, g, b, a);
@ -511,8 +503,8 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
* Images with any other compression type must be wrote in the
* bottom-up layout.
*/
if (compressionType == BMPConstants.BI_RGB ||
compressionType == BMPConstants.BI_BITFIELDS)
if (compressionType == BI_RGB ||
compressionType == BI_BITFIELDS)
{
isTopDown = bmpParam.isTopDown();
} else {
@ -543,7 +535,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
if (isPalette == true) {
// write palette
if (compressionType == BMPConstants.BI_BITFIELDS) {
if (compressionType == BI_BITFIELDS) {
// write masks for red, green and blue components.
for (int i=0; i<3; i++) {
int mask = (a[i]&0xFF) + ((r[i]&0xFF)*0x100) + ((g[i]&0xFF)*0x10000) + ((b[i]&0xFF)*0x1000000);
@ -571,8 +563,8 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
int l;
if (compressionType == BMPConstants.BI_JPEG ||
compressionType == BMPConstants.BI_PNG) {
if (compressionType == BI_JPEG ||
compressionType == BI_PNG) {
// prepare embedded buffer
embedded_stream = new ByteArrayOutputStream();
@ -657,7 +649,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
pos = sppsm.getOffset(startX, startY);
}
if (compressionType == BMPConstants.BI_RGB || compressionType == BMPConstants.BI_BITFIELDS){
if (compressionType == BI_RGB || compressionType == BI_BITFIELDS){
switch(dataType) {
case DataBuffer.TYPE_BYTE:
byte[] bdata =
@ -687,7 +679,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
for(int k=0; k<padding; k++) {
stream.writeByte(0);
}
} else if (compressionType == BMPConstants.BI_RLE4) {
} else if (compressionType == BI_RLE4) {
if (bpixels == null || bpixels.length < scanlineBytes)
bpixels = new byte[scanlineBytes];
src.getPixels(srcRect.x, srcRect.y,
@ -696,7 +688,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
bpixels[h] = (byte)pixels[h];
}
encodeRLE4(bpixels, scanlineBytes);
} else if (compressionType == BMPConstants.BI_RLE8) {
} else if (compressionType == BI_RLE8) {
//byte[] bdata =
// ((DataBufferByte)src.getDataBuffer()).getData();
//System.out.println("bdata.length="+bdata.length);
@ -734,8 +726,8 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
processImageProgress(100.0f * (((float)i) / ((float)h)));
}
if (compressionType == BMPConstants.BI_RLE4 ||
compressionType == BMPConstants.BI_RLE8) {
if (compressionType == BI_RLE4 ||
compressionType == BI_RLE8) {
// Write the RLE EOF marker and
stream.writeByte(0);
stream.writeByte(1);
@ -793,7 +785,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
break;
case 4:
if (compressionType == BMPConstants.BI_RLE4){
if (compressionType == BI_RLE4){
byte[] bipixels = new byte[scanlineBytes];
for (int h=0; h<scanlineBytes; h++) {
bipixels[h] = (byte)pixels[l++];
@ -814,7 +806,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
break;
case 8:
if(compressionType == BMPConstants.BI_RLE8) {
if(compressionType == BI_RLE8) {
for (int h=0; h<scanlineBytes; h++) {
bpixels[h] = (byte)pixels[l++];
}
@ -841,7 +833,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
*/
for (int j = 0, m = 0; j < scanlineBytes; m++) {
spixels[m] = 0;
if (compressionType == BMPConstants.BI_RGB) {
if (compressionType == BI_RGB) {
/*
* please note that despite other cases,
* the 16bpp BI_RGB requires the RGB data order
@ -910,7 +902,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
*/
for (int j = 0, m = 0; j < scanlineBytes; m++) {
ipixels[m] = 0;
if (compressionType == BMPConstants.BI_RGB) {
if (compressionType == BI_RGB) {
ipixels[m] =
((0xff & pixels[j + 2]) << 16) |
((0xff & pixels[j + 1]) << 8) |
@ -945,8 +937,8 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
}
// Write out the padding
if (compressionType == BMPConstants.BI_RGB ||
compressionType == BMPConstants.BI_BITFIELDS)
if (compressionType == BI_RGB ||
compressionType == BI_BITFIELDS)
{
for(k=0; k<padding; k++) {
stream.writeByte(0);
@ -1329,17 +1321,10 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
stream = null;
}
private int getCompressionType(String typeString) {
for (int i = 0; i < BMPConstants.compressionTypeNames.length; i++)
if (BMPConstants.compressionTypeNames[i].equals(typeString))
return i;
return 0;
}
private void writeEmbedded(IIOImage image,
ImageWriteParam bmpParam) throws IOException {
String format =
compressionType == BMPConstants.BI_JPEG ? "jpeg" : "png";
compressionType == BI_JPEG ? "jpeg" : "png";
Iterator iterator = ImageIO.getImageWritersByFormatName(format);
ImageWriter writer = null;
if (iterator.hasNext())

View File

@ -219,7 +219,7 @@ public class BMPMetadata extends IIOMetadata implements BMPConstants {
// CompressionTypeName
IIOMetadataNode subNode = new IIOMetadataNode("CompressionTypeName");
subNode.setAttribute("value", compressionTypeNames[compression]);
subNode.setAttribute("value", BMPCompressionTypes.getName(compression));
node.appendChild(subNode);
return node;
}

View File

@ -25,11 +25,8 @@
package com.sun.imageio.plugins.gif;
import javax.imageio.ImageTypeSpecifier;
import javax.imageio.metadata.IIOInvalidTreeException;
import javax.imageio.metadata.IIOMetadata;
import javax.imageio.metadata.IIOMetadataNode;
import javax.imageio.metadata.IIOMetadataFormat;
import javax.imageio.metadata.IIOMetadataFormatImpl;
import org.w3c.dom.Node;
@ -41,7 +38,7 @@ public class GIFStreamMetadata extends GIFMetadata {
static final String
nativeMetadataFormatName = "javax_imageio_gif_stream_1.0";
public static final String[] versionStrings = { "87a", "89a" };
static final String[] versionStrings = { "87a", "89a" };
public String version; // 87a or 89a
public int logicalScreenWidth;
@ -52,7 +49,7 @@ public class GIFStreamMetadata extends GIFMetadata {
public int backgroundColorIndex; // Valid if globalColorTable != null
public boolean sortFlag; // Valid if globalColorTable != null
public static final String[] colorTableSizes = {
static final String[] colorTableSizes = {
"2", "4", "8", "16", "32", "64", "128", "256"
};

View File

@ -25,14 +25,11 @@
package com.sun.imageio.plugins.jpeg;
import javax.imageio.metadata.IIOMetadataFormatImpl;
import javax.imageio.ImageTypeSpecifier;
import javax.imageio.plugins.jpeg.JPEGQTable;
import javax.imageio.plugins.jpeg.JPEGHuffmanTable;
import java.awt.image.ColorModel;
import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
import java.awt.color.ColorSpace;
import java.awt.color.ICC_ColorSpace;
@ -172,9 +169,9 @@ public class JPEG {
public static final String vendor = "Oracle Corporation";
public static final String version = "0.5";
// Names of the formats we can read or write
public static final String [] names = {"JPEG", "jpeg", "JPG", "jpg"};
public static final String [] suffixes = {"jpg", "jpeg"};
public static final String [] MIMETypes = {"image/jpeg"};
static final String [] names = {"JPEG", "jpeg", "JPG", "jpg"};
static final String [] suffixes = {"jpg", "jpeg"};
static final String [] MIMETypes = {"image/jpeg"};
public static final String nativeImageMetadataFormatName =
"javax_imageio_jpeg_image_1.0";
public static final String nativeImageMetadataFormatClassName =
@ -201,12 +198,12 @@ public class JPEG {
public static final int NUM_JCS_CODES = JCS_YCCK+1;
/** IJG can handle up to 4-channel JPEGs */
public static final int [] [] bandOffsets = {{0},
static final int [] [] bandOffsets = {{0},
{0, 1},
{0, 1, 2},
{0, 1, 2, 3}};
public static final int [] bOffsRGB = { 2, 1, 0 };
static final int [] bOffsRGB = { 2, 1, 0 };
/* These are kept in the inner class to avoid static initialization
* of the CMM class until someone actually needs it.

View File

@ -29,12 +29,10 @@ import java.awt.image.ColorModel;
import java.awt.image.IndexColorModel;
import java.awt.image.SampleModel;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.StringTokenizer;
import javax.imageio.ImageTypeSpecifier;
import javax.imageio.metadata.IIOInvalidTreeException;
import javax.imageio.metadata.IIOMetadata;
import javax.imageio.metadata.IIOMetadataFormat;
import javax.imageio.metadata.IIOMetadataFormatImpl;
import javax.imageio.metadata.IIOMetadataNode;
import org.w3c.dom.Node;
@ -49,42 +47,42 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
= "com.sun.imageio.plugins.png.PNGMetadataFormat";
// Color types for IHDR chunk
public static final String[] IHDR_colorTypeNames = {
static final String[] IHDR_colorTypeNames = {
"Grayscale", null, "RGB", "Palette",
"GrayAlpha", null, "RGBAlpha"
};
public static final int[] IHDR_numChannels = {
static final int[] IHDR_numChannels = {
1, 0, 3, 3, 2, 0, 4
};
// Bit depths for IHDR chunk
public static final String[] IHDR_bitDepths = {
static final String[] IHDR_bitDepths = {
"1", "2", "4", "8", "16"
};
// Compression methods for IHDR chunk
public static final String[] IHDR_compressionMethodNames = {
static final String[] IHDR_compressionMethodNames = {
"deflate"
};
// Filter methods for IHDR chunk
public static final String[] IHDR_filterMethodNames = {
static final String[] IHDR_filterMethodNames = {
"adaptive"
};
// Interlace methods for IHDR chunk
public static final String[] IHDR_interlaceMethodNames = {
static final String[] IHDR_interlaceMethodNames = {
"none", "adam7"
};
// Compression methods for iCCP chunk
public static final String[] iCCP_compressionMethodNames = {
static final String[] iCCP_compressionMethodNames = {
"deflate"
};
// Compression methods for zTXt chunk
public static final String[] zTXt_compressionMethodNames = {
static final String[] zTXt_compressionMethodNames = {
"deflate"
};
@ -95,12 +93,12 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
public static final int PHYS_UNIT_METER = 1;
// Unit specifiers for pHYs chunk
public static final String[] unitSpecifierNames = {
static final String[] unitSpecifierNames = {
"unknown", "meter"
};
// Rendering intents for sRGB chunk
public static final String[] renderingIntentNames = {
static final String[] renderingIntentNames = {
"Perceptual", // 0
"Relative colorimetric", // 1
"Saturation", // 2
@ -109,7 +107,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
};
// Color space types for Chroma->ColorSpaceType node
public static final String[] colorSpaceTypeNames = {
static final String[] colorSpaceTypeNames = {
"GRAY", null, "RGB", "RGB",
"GRAY", null, "RGB"
};

View File

@ -85,42 +85,42 @@ public class WBMPImageReaderSpi extends ImageReaderSpi {
ImageInputStream stream = (ImageInputStream)source;
stream.mark();
int type = stream.readByte(); // TypeField
int fixHeaderField = stream.readByte();
// check WBMP "header"
if (type != 0 || fixHeaderField != 0) {
// while WBMP reader does not support ext WBMP headers
try {
int type = stream.readByte(); // TypeField
int fixHeaderField = stream.readByte();
// check WBMP "header"
if (type != 0 || fixHeaderField != 0) {
// while WBMP reader does not support ext WBMP headers
return false;
}
int width = ReaderUtil.readMultiByteInteger(stream);
int height = ReaderUtil.readMultiByteInteger(stream);
// check image dimension
if (width <= 0 || height <= 0) {
return false;
}
long dataLength = stream.length();
if (dataLength == -1) {
// We can't verify that amount of data in the stream
// corresponds to image dimension because we do not know
// the length of the data stream.
// Assuming that wbmp image are used for mobile devices,
// let's introduce an upper limit for image dimension.
// In case if exact amount of raster data is unknown,
// let's reject images with dimension above the limit.
return (width < MAX_WBMP_WIDTH) && (height < MAX_WBMP_HEIGHT);
}
dataLength -= stream.getStreamPosition();
long scanSize = (width / 8) + ((width % 8) == 0 ? 0 : 1);
return (dataLength == scanSize * height);
} finally {
stream.reset();
return false;
}
int width = ReaderUtil.readMultiByteInteger(stream);
int height = ReaderUtil.readMultiByteInteger(stream);
// check image dimension
if (width <= 0 || height <= 0) {
stream.reset();
return false;
}
long dataLength = stream.length();
if (dataLength == -1) {
// We can't verify that amount of data in the stream
// corresponds to image dimension because we do not know
// the length of the data stream.
// Assuming that wbmp image are used for mobile devices,
// let's introduce an upper limit for image dimension.
// In case if exact amount of raster data is unknown,
// let's reject images with dimension above the limit.
stream.reset();
return (width < MAX_WBMP_WIDTH) && (height < MAX_WBMP_HEIGHT);
}
dataLength -= stream.getStreamPosition();
stream.reset();
long scanSize = (width / 8) + ((width % 8) == 0 ? 0 : 1);
return (dataLength == scanSize * height);
}
public ImageReader createReaderInstance(Object extension)

View File

@ -187,9 +187,18 @@ final class JSSecurityManager {
static <T> List<T> getProviders(final Class<T> providerClass) {
List<T> p = new ArrayList<>();
// ServiceLoader creates "lazy" iterator instance, so it doesn't,
// require do be called from privileged section
final Iterator<T> ps = ServiceLoader.load(providerClass).iterator();
// ServiceLoader creates "lazy" iterator instance, but it ensures that
// next/hasNext run with permissions that are restricted by whatever
// creates the ServiceLoader instance, so it requires to be called from
// privileged section
final PrivilegedAction<Iterator<T>> psAction =
new PrivilegedAction<Iterator<T>>() {
@Override
public Iterator<T> run() {
return ServiceLoader.load(providerClass).iterator();
}
};
final Iterator<T> ps = AccessController.doPrivileged(psAction);
// the iterator's hasNext() method looks through classpath for
// the provider class names, so it requires read permissions

View File

@ -35,7 +35,7 @@ import org.w3c.dom.Element;
/**
* Handles SubjectKeyIdentifier (SKI) for X.509v3.
*
* @see <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/cert/X509Extension.html">
* @see <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/security/cert/X509Extension.html">
* Interface X509Extension</A>
*/
public class XMLX509SKI extends SignatureElementProxy implements XMLX509DataContent {

View File

@ -56,7 +56,7 @@ import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverS
* </PRE>
*
* @see <A HREF="http://www.javaworld.com/javaworld/javatips/jw-javatip42_p.html">Java Tip 42: Write Java apps that work with proxy-based firewalls</A>
* @see <A HREF="http://java.sun.com/j2se/1.4/docs/guide/net/properties.html">SUN J2SE docs for network properties</A>
* @see <A HREF="http://docs.oracle.com/javase/1.4.2/docs/guide/net/properties.html">SUN J2SE docs for network properties</A>
* @see <A HREF="http://metalab.unc.edu/javafaq/javafaq.html#proxy">The JAVA FAQ Question 9.5: How do I make Java work with a proxy server?</A>
*/
public class ResolverDirectHTTP extends ResourceResolverSpi {

View File

@ -143,11 +143,11 @@ public class Applet extends Panel {
* For example, suppose an applet is contained
* within the document:
* <blockquote><pre>
* http://java.sun.com/products/jdk/1.2/index.html
* http://www.oracle.com/technetwork/java/index.html
* </pre></blockquote>
* The document base is:
* <blockquote><pre>
* http://java.sun.com/products/jdk/1.2/index.html
* http://www.oracle.com/technetwork/java/index.html
* </pre></blockquote>
*
* @return the {@link java.net.URL} of the document that contains this

View File

@ -54,11 +54,11 @@ public interface AppletStub {
* For example, suppose an applet is contained
* within the document:
* <blockquote><pre>
* http://java.sun.com/products/jdk/1.2/index.html
* http://www.oracle.com/technetwork/java/index.html
* </pre></blockquote>
* The document base is:
* <blockquote><pre>
* http://java.sun.com/products/jdk/1.2/index.html
* http://www.oracle.com/technetwork/java/index.html
* </pre></blockquote>
*
* @return the {@link java.net.URL} of the document that contains the

View File

@ -96,7 +96,7 @@ import java.util.Hashtable;
* alt="Diagram of an applet demonstrating BorderLayout.
* Each section of the BorderLayout contains a Button corresponding to its position in the layout, one of:
* North, West, Center, East, or South."
* ALIGN=center HSPACE=10 VSPACE=7>
* style="float:center; margin: 7px 10px;">
* <p>
* The code for this applet is as follows:
* <p>

View File

@ -40,7 +40,7 @@ import javax.accessibility.*;
* under the Solaris operating system:
* <p>
* <img src="doc-files/Button-1.gif" alt="The following context describes the graphic"
* ALIGN=center HSPACE=10 VSPACE=7>
* style="float:center; margin: 7px 10px;">
* <p>
* The first view shows the button as it appears normally.
* The second view shows the button

View File

@ -53,7 +53,7 @@ import javax.accessibility.*;
* created by this code example:
* <p>
* <img src="doc-files/Checkbox-1.gif" alt="The following context describes the graphic."
* ALIGN=center HSPACE=10 VSPACE=7>
* style="float:center; margin: 7px 10px;">
* <p>
* The button labeled <code>one</code> is in the "on" state, and the
* other two are in the "off" state. In this example, which uses the

View File

@ -48,7 +48,7 @@ package java.awt;
* <p>
* <img src="doc-files/CheckboxGroup-1.gif"
* alt="Shows three checkboxes, arranged vertically, labeled one, two, and three. Checkbox one is in the on state."
* ALIGN=center HSPACE=10 VSPACE=7>
* style="float:center; margin: 7px 10px;">
* <p>
* @author Sami Shaio
* @see java.awt.Checkbox

View File

@ -44,7 +44,7 @@ import sun.awt.AWTAccessor;
* <p>
* <img src="doc-files/MenuBar-1.gif"
* alt="Menu labeled Examples, containing items Basic, Simple, Check, and More Examples. The Check item is a CheckBoxMenuItem instance, in the off state."
* ALIGN=center HSPACE=10 VSPACE=7>
* style="float:center; margin: 7px 10px;">
* <p>
* The item labeled <code>Check</code> shows a check box menu item
* in its "off" state.

View File

@ -52,7 +52,7 @@ import javax.accessibility.*;
* it appears as follows in its normal state:
* <p>
* <img src="doc-files/Choice-1.gif" alt="The following text describes the graphic"
* ALIGN=center HSPACE=10 VSPACE=7>
* style="float:center; margin: 7px 10px;">
* <p>
* In the picture, <code>"Green"</code> is the current choice.
* Pushing the mouse button down on the object causes a menu to

View File

@ -823,7 +823,7 @@ public class Color implements Paint, java.io.Serializable {
* <p>
* The integer that is returned by <code>HSBtoRGB</code> encodes the
* value of a color in bits 0-23 of an integer value that is the same
* format used by the method {@link #getRGB() <code>getRGB</code>}.
* format used by the method {@link #getRGB() getRGB}.
* This integer can be supplied as an argument to the
* <code>Color</code> constructor that takes a single integer argument.
* @param hue the hue component of the color

View File

@ -173,10 +173,10 @@ import sun.util.logging.PlatformLogger;
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
* <a href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">Painting in AWT and Swing</a>.
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
* <p>
* For details on the focus subsystem, see
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html">
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
* How to Use the Focus Subsystem</a>,
* a section in <em>The Java Tutorial</em>, and the
* <a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>
@ -1223,10 +1223,6 @@ public abstract class Component implements ImageObserver, MenuContainer,
* be called on the toolkit thread.
*/
final Toolkit getToolkitImpl() {
ComponentPeer peer = this.peer;
if ((peer != null) && ! (peer instanceof LightweightPeer)){
return peer.getToolkit();
}
Container parent = this.parent;
if (parent != null) {
return parent.getToolkitImpl();
@ -3205,7 +3201,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
* <a href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">Painting in AWT and Swing</a>.
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
*
* @param g the graphics context to use for painting
* @see #update
@ -3240,7 +3236,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
* <a href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">Painting in AWT and Swing</a>.
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
*
* @param g the specified context to use for updating
* @see #paint
@ -3301,7 +3297,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
* <a href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">Painting in AWT and Swing</a>.
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
*
* @see #update(Graphics)
@ -3319,7 +3315,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
* <a href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">Painting in AWT and Swing</a>.
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
*
* @param tm maximum time in milliseconds before update
* @see #paint
@ -3341,7 +3337,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
* <a href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">Painting in AWT and Swing</a>.
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
*
* @param x the <i>x</i> coordinate
* @param y the <i>y</i> coordinate
@ -3366,7 +3362,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
* <a href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">Painting in AWT and Swing</a>.
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
*
* @param tm maximum time in milliseconds before update
* @param x the <i>x</i> coordinate

View File

@ -75,7 +75,7 @@ import sun.security.action.GetBooleanAction;
* (and hence to the bottom of the stacking order).
* <p>
* <b>Note</b>: For details on the focus subsystem, see
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html">
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
* How to Use the Focus Subsystem</a>,
* a section in <em>The Java Tutorial</em>, and the
* <a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>

View File

@ -54,7 +54,7 @@ import java.awt.peer.ComponentPeer;
* impact, the focusability of the Component itself.
* <p>
* Please see
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html">
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
* How to Use the Focus Subsystem</a>,
* a section in <em>The Java Tutorial</em>, and the
* <a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>

View File

@ -49,7 +49,7 @@ import sun.awt.TimedWindowEvent;
* Container's FocusTraversalPolicy.
* <p>
* Please see
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html">
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
* How to Use the Focus Subsystem</a>,
* a section in <em>The Java Tutorial</em>, and the
* <a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>

View File

@ -35,7 +35,7 @@ import java.lang.annotation.Native;
* (see {@link GraphicsDevice#isDisplayChangeSupported}).
* <p>
* For more information on full-screen exclusive mode API, see the
* <a href="http://java.sun.com/docs/books/tutorial/extra/fullscreen/index.html">
* <a href="http://docs.oracle.com/javase/tutorial/extra/fullscreen/index.html">
* Full-Screen Exclusive Mode API Tutorial</a>.
*
* @see GraphicsDevice

View File

@ -652,7 +652,7 @@ public class EventQueue {
* Dispatches an event. The manner in which the event is
* dispatched depends upon the type of the event and the
* type of the event's source object:
* <p> </p>
* <p>
* <table border=1 summary="Event types, source types, and dispatch methods">
* <tr>
* <th>Event Type</th>
@ -680,7 +680,7 @@ public class EventQueue {
* <td>No action (ignored)</td>
* </tr>
* </table>
* <p> </p>
* <p>
* @param event an instance of <code>java.awt.AWTEvent</code>,
* or a subclass of it
* @throws NullPointerException if <code>event</code> is <code>null</code>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -457,9 +457,16 @@ public class FileDialog extends Dialog {
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* <code>null</code>
* as the file.
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile

View File

@ -54,7 +54,7 @@ import java.io.IOException;
* <p>
* <img src="doc-files/FlowLayout-1.gif"
* ALT="Graphic of Layout for Three Buttons"
* ALIGN=center HSPACE=10 VSPACE=7>
* style="float:center; margin: 7px 10px;">
* <p>
* Here is the code for this applet:
* <p>

View File

@ -49,7 +49,7 @@ package java.awt;
* policy is used to perform the search operation.
* <p>
* Please see
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html">
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
* How to Use the Focus Subsystem</a>,
* a section in <em>The Java Tutorial</em>, and the
* <a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>

View File

@ -127,7 +127,7 @@ import static sun.font.EAttribute.*;
* <p>
* For a discussion of the relative advantages and disadvantages of using
* physical or logical fonts, see the
* <a href="http://java.sun.com/j2se/corejava/intl/reference/faqs/index.html#desktop-rendering">Internationalization FAQ</a>
* <a href="http://www.oracle.com/technetwork/java/javase/tech/faq-jsp-138165.html">Internationalization FAQ</a>
* document.
*
* <h4>Font Faces and Names</h4>

View File

@ -51,8 +51,8 @@ import java.text.CharacterIterator;
* <li>{@link #charsWidth(char[], int, int)}
* </ul>
* <p>
* <img src="doc-files/FontMetrics-1.gif" alt="The letter 'p' showing its 'reference point'" border=15 align
* ALIGN=right HSPACE=10 VSPACE=7>
* <img src="doc-files/FontMetrics-1.gif" alt="The letter 'p' showing its 'reference point'"
* style="border:15px; float:right; margin: 7px 10px;">
* Note that the implementations of these methods are
* inefficient, so they are usually overridden with more efficient
* toolkit-specific implementations.

View File

@ -83,7 +83,7 @@ import javax.accessibility.*;
* <img src="doc-files/MultiScreen.gif"
* alt="Diagram of virtual device encompassing three physical screens and one primary physical screen. The primary physical screen
* shows (0,0) coords while a different physical screen shows (-80,-100) coords."
* ALIGN=center HSPACE=10 VSPACE=7>
* style="float:center; margin: 7px 10px;">
* <p>
* In such an environment, when calling <code>setLocation</code>,
* you must pass a virtual coordinate to this method. Similarly,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -69,7 +69,7 @@ import sun.awt.SunToolkit;
* </pre>
* <p>
* For more information on full-screen exclusive mode API, see the
* <a href="http://java.sun.com/docs/books/tutorial/extra/fullscreen/index.html">
* <a href="http://docs.oracle.com/javase/tutorial/extra/fullscreen/index.html">
* Full-Screen Exclusive Mode API Tutorial</a>.
*
* @see GraphicsEnvironment
@ -334,11 +334,12 @@ public abstract class GraphicsDevice {
}
/**
* Returns the <code>Window</code> object representing the
* Returns the {@code Window} object representing the
* full-screen window if the device is in full-screen mode.
*
* @return the full-screen window, or <code>null</code> if the device is
* not in full-screen mode.
* @return the full-screen window, or {@code null} if the device is
* not in full-screen mode. The {@code Window} object can differ
* from the object previously set by {@code setFullScreenWindow}.
* @see #setFullScreenWindow(Window)
* @since 1.4
*/

View File

@ -125,9 +125,9 @@ import java.util.Arrays;
* <center><table BORDER=0 WIDTH=800
* SUMMARY="absolute, relative and baseline values as described above">
* <tr>
* <th><P ALIGN="LEFT">Absolute Values</th>
* <th><P ALIGN="LEFT">Orientation Relative Values</th>
* <th><P ALIGN="LEFT">Baseline Relative Values</th>
* <th><P STYLE="TEXT-ALIGN:LEFT">Absolute Values</th>
* <th><P STYLE="TEXT-ALIGN:LEFT">Orientation Relative Values</th>
* <th><P STYLE="TEXT-ALIGN:LEFT">Baseline Relative Values</th>
* </tr>
* <tr>
* <td>
@ -201,7 +201,7 @@ import java.util.Arrays;
* <tr ALIGN=CENTER>
* <td>
* <img src="doc-files/GridBagLayout-baseline.png"
* alt="The following text describes this graphic (Figure 1)." ALIGN=center>
* alt="The following text describes this graphic (Figure 1)." style="float:center">
* </td>
* </table></center>
* This layout consists of three components:
@ -255,10 +255,10 @@ import java.util.Arrays;
* <center><table WIDTH=600 summary="layout">
* <tr ALIGN=CENTER>
* <td>
* <img src="doc-files/GridBagLayout-1.gif" alt="The preceeding text describes this graphic (Figure 1)." ALIGN=center HSPACE=10 VSPACE=7>
* <img src="doc-files/GridBagLayout-1.gif" alt="The preceeding text describes this graphic (Figure 1)." style="float:center; margin: 7px 10px;">
* </td>
* <td>
* <img src="doc-files/GridBagLayout-2.gif" alt="The preceeding text describes this graphic (Figure 2)." ALIGN=center HSPACE=10 VSPACE=7>
* <img src="doc-files/GridBagLayout-2.gif" alt="The preceeding text describes this graphic (Figure 2)." style="float:center; margin: 7px 10px;">
* </td>
* <tr ALIGN=CENTER>
* <td>Figure 2: Horizontal, Left-to-Right</td>

View File

@ -55,7 +55,7 @@ package java.awt;
* If the container's <code>ComponentOrientation</code> property is horizontal
* and right-to-left, the example produces the output shown in Figure 2.
* <p>
* <center><table WIDTH=600 summary="layout">
* <table style="float:center" WIDTH=600 summary="layout">
* <tr ALIGN=CENTER>
* <td><img SRC="doc-files/GridLayout-1.gif"
* alt="Shows 6 buttons in rows of 2. Row 1 shows buttons 1 then 2.
@ -73,7 +73,7 @@ package java.awt;
*
* <td>Figure 2: Horizontal, Right-to-Left</td>
* </tr>
* </table></center>
* </table>
* <p>
* When both the number of rows and the number of columns have
* been set to non-zero values, either by a constructor or

View File

@ -88,7 +88,7 @@ import sun.awt.AWTAccessor;
* ClassLoader.
* <p>
* Please see
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html">
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
* How to Use the Focus Subsystem</a>,
* a section in <em>The Java Tutorial</em>, and the
* <a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>
@ -590,6 +590,7 @@ public abstract class KeyboardFocusManager
*
* @see Component#requestFocus()
* @see java.awt.event.FocusEvent#FOCUS_LOST
* @since 1.8
*/
public void clearFocusOwner() {
if (getFocusOwner() != null) {

View File

@ -46,7 +46,7 @@ import javax.accessibility.*;
* produces the following labels:
* <p>
* <img src="doc-files/Label-1.gif" alt="Two labels: 'Hi There!' and 'Another label'"
* ALIGN=center HSPACE=10 VSPACE=7>
* style="float:center; margin: 7px 10px;">
*
* @author Sami Shaio
* @since JDK1.0

View File

@ -94,7 +94,7 @@ import java.beans.ConstructorProperties;
* of the three cycle methods:
* <p>
* <center>
* <img src = "doc-files/LinearGradientPaint.png">
* <img src = "doc-files/LinearGradientPaint.png" alt="LinearGradientPaint">
* </center>
*
* @see java.awt.Paint

View File

@ -61,7 +61,7 @@ import javax.accessibility.*;
* scrolling list:
* <p>
* <img src="doc-files/List-1.gif"
* alt="Shows a list containing: Venus, Earth, JavaSoft, and Mars. Javasoft is selected." ALIGN=center HSPACE=10 VSPACE=7>
* alt="Shows a list containing: Venus, Earth, JavaSoft, and Mars. Javasoft is selected." style="float:center; margin: 7px 10px;">
* <p>
* If the List allows multiple selections, then clicking on
* an item that is already selected deselects it. In the preceding

View File

@ -45,7 +45,7 @@ import javax.accessibility.*;
* <img src="doc-files/MenuBar-1.gif"
* alt="Diagram of MenuBar containing 2 menus: Examples and Options.
* Examples menu is expanded showing items: Basic, Simple, Check, and More Examples."
* ALIGN=center HSPACE=10 VSPACE=7>
* style="float:center; margin: 7px 10px;">
* <p>
* A menu bar handles keyboard shortcuts for menu items, passing them
* along to its child menus.

View File

@ -42,8 +42,8 @@ import sun.awt.AWTAccessor;
* <p>
* This picture of a menu bar shows five menu items:
* <IMG SRC="doc-files/MenuBar-1.gif" alt="The following text describes this graphic."
* ALIGN=CENTER HSPACE=10 VSPACE=7>
* <br CLEAR=LEFT>
* style="float:center; margin: 7px 10px;">
* <br style="clear:left;">
* The first two items are simple menu items, labeled
* <code>"Basic"</code> and <code>"Simple"</code>.
* Following these two items is a separator, which is itself

View File

@ -80,14 +80,14 @@ import java.beans.ConstructorProperties;
* from the focus point. The following figure shows that the distance AB
* is equal to the distance BC, and the distance AD is equal to the distance DE.
* <center>
* <img src = "doc-files/RadialGradientPaint-3.png">
* <img src = "doc-files/RadialGradientPaint-3.png" alt="RadialGradientPaint-3">
* </center>
* If the gradient and graphics rendering transforms are uniformly scaled and
* the user sets the focus so that it coincides with the center of the circle,
* the gradient color proportions are equal for any line drawn from the center.
* The following figure shows the distances AB, BC, AD, and DE. They are all equal.
* <center>
* <img src = "doc-files/RadialGradientPaint-4.png">
* <img src = "doc-files/RadialGradientPaint-4.png" alt="RadialGradientPaint-4">
* </center>
* Note that some minor variations in distances may occur due to sampling at
* the granularity of a pixel.
@ -117,7 +117,7 @@ import java.beans.ConstructorProperties;
* (centered) focus for each of the three cycle methods:
* <p>
* <center>
* <img src = "doc-files/RadialGradientPaint-1.png">
* <img src = "doc-files/RadialGradientPaint-1.png" alt="RadialGradientPaint-1">
* </center>
*
* <p>
@ -141,7 +141,7 @@ import java.beans.ConstructorProperties;
* focus for each of the three cycle methods:
* <p>
* <center>
* <img src = "doc-files/RadialGradientPaint-2.png">
* <img src = "doc-files/RadialGradientPaint-2.png" alt="RadialGradientPaint-2">
* </center>
*
* @see java.awt.Paint

View File

@ -42,7 +42,7 @@ import javax.accessibility.*;
* the red, green, and blue components of a color:
* <p>
* <img src="doc-files/Scrollbar-1.gif" alt="Image shows 3 vertical sliders, side-by-side."
* ALIGN=center HSPACE=10 VSPACE=7>
* style="float:center; margin: 7px 10px;">
* <p>
* Each scroll bar in this example could be created with
* code similar to the following:
@ -60,7 +60,7 @@ import javax.accessibility.*;
* <p>
* <img src="doc-files/Scrollbar-2.gif"
* alt="Image shows horizontal slider with starting range of 0 and ending range of 300. The slider thumb is labeled 60."
* ALIGN=center HSPACE=10 VSPACE=7>
* style="float:center; margin: 7px 10px;">
* <p>
* The value range represented by the bubble in this example
* is the <em>visible amount</em>. The horizontal scroll bar
@ -295,7 +295,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible {
* Constructs a new vertical scroll bar.
* The default properties of the scroll bar are listed in
* the following table:
* <p> </p>
* <p>
* <table border=1 summary="Scrollbar default properties">
* <tr>
* <th>Property</th>

View File

@ -361,7 +361,7 @@ public class SystemTray {
/**
* Adds a {@code PropertyChangeListener} to the list of listeners for the
* specific property. The following properties are currently supported:
* <p> </p>
* <p>
* <table border=1 summary="SystemTray properties">
* <tr>
* <th>Property</th>
@ -384,7 +384,7 @@ public class SystemTray {
* The property is accessed by the {@link #getSystemTray} method.</td>
* </tr>
* </table>
* <p> </p>
* <p>
* The {@code listener} listens to property changes only in this context.
* <p>
* If {@code listener} is {@code null}, no exception is thrown

View File

@ -42,7 +42,7 @@ import javax.accessibility.*;
* The following image shows the appearance of a text area:
* <p>
* <img src="doc-files/TextArea-1.gif" alt="A TextArea showing the word 'Hello!'"
* ALIGN=center HSPACE=10 VSPACE=7>
* style="float:center; margin: 7px 10px;">
* <p>
* This text area could be created by the following line of code:
* <p>

View File

@ -822,37 +822,6 @@ public class TextComponent extends Component implements Accessible {
// Accessibility support
////////////////
/**
*
*/
int getIndexAtPoint(Point p) {
return -1;
/* To be fully implemented in a future release
if (peer == null) {
return -1;
}
TextComponentPeer peer = (TextComponentPeer)this.peer;
return peer.getIndexAtPoint(p.x, p.y);
*/
}
/**
*
*/
Rectangle getCharacterBounds(int i) {
return null;
/* To be fully implemented in a future release
if (peer == null) {
return null;
}
TextComponentPeer peer = (TextComponentPeer)this.peer;
return peer.getCharacterBounds(i);
*/
}
/**
* Gets the AccessibleContext associated with this TextComponent.
* For text components, the AccessibleContext takes the form of an
@ -963,7 +932,7 @@ public class TextComponent extends Component implements Accessible {
* @return the zero-based index of the character under Point p.
*/
public int getIndexAtPoint(Point p) {
return TextComponent.this.getIndexAtPoint(p);
return -1;
}
/**
@ -976,7 +945,7 @@ public class TextComponent extends Component implements Accessible {
* @return the screen coordinates of the character's bounding box
*/
public Rectangle getCharacterBounds(int i) {
return TextComponent.this.getCharacterBounds(i);
return null;
}
/**

View File

@ -42,7 +42,7 @@ import javax.accessibility.*;
* display the predefined text <code>"Hello"</code>.
* <p>
* <img src="doc-files/TextField-1.gif" alt="The preceding text describes this image."
* ALIGN=center HSPACE=10 VSPACE=7>
* style="float:center; margin: 7px 10px;">
* <p>
* Here is the code that produces these four text fields:
* <p>

View File

@ -83,7 +83,7 @@ import sun.util.CoreResourceBundleControl;
* <p>
* <li>Moving the focus from one component to another.
* <br>For more information, see
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html#transferTiming">Timing
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html#transferTiming">Timing
* Focus Transfers</a>, a section in
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/">The Swing
* Tutorial</a>.

View File

@ -85,7 +85,7 @@ import sun.util.logging.PlatformLogger;
* <p>
* <img src="doc-files/MultiScreen.gif"
* alt="Diagram shows virtual device containing 4 physical screens. Primary physical screen shows coords (0,0), other screen shows (-80,-100)."
* ALIGN=center HSPACE=10 VSPACE=7>
* style="float:center; margin: 7px 10px;">
* <p>
* In such an environment, when calling {@code setLocation},
* you must pass a virtual coordinate to this method. Similarly,
@ -226,6 +226,7 @@ public class Window extends Container implements Accessible {
boolean syncLWRequests = false;
transient boolean beforeFirstShow = true;
private transient boolean disposing = false;
transient WindowDisposerRecord disposerRecord = null;
static final int OPENED = 0x01;
@ -437,18 +438,28 @@ public class Window extends Container implements Accessible {
transient Object anchor = new Object();
static class WindowDisposerRecord implements sun.java2d.DisposerRecord {
final WeakReference<Window> owner;
WeakReference<Window> owner;
final WeakReference<Window> weakThis;
final WeakReference<AppContext> context;
WindowDisposerRecord(AppContext context, Window victim) {
owner = new WeakReference<Window>(victim.getOwner());
weakThis = victim.weakThis;
this.context = new WeakReference<AppContext>(context);
}
public void updateOwner() {
Window victim = weakThis.get();
owner = (victim == null)
? null
: new WeakReference<Window>(victim.getOwner());
}
public void dispose() {
Window parent = owner.get();
if (parent != null) {
parent.removeOwnedWindow(weakThis);
if (owner != null) {
Window parent = owner.get();
if (parent != null) {
parent.removeOwnedWindow(weakThis);
}
}
AppContext ac = context.get();
if (null != ac) {
@ -502,6 +513,8 @@ public class Window extends Container implements Accessible {
}
modalExclusionType = Dialog.ModalExclusionType.NO_EXCLUDE;
disposerRecord = new WindowDisposerRecord(appContext, this);
sun.java2d.Disposer.addRecord(anchor, disposerRecord);
SunToolkit.checkAndSetPolicy(this);
}
@ -617,11 +630,16 @@ public class Window extends Container implements Accessible {
this.parent = owner;
if (owner != null) {
owner.addOwnedWindow(weakThis);
if (owner.isAlwaysOnTop()) {
try {
setAlwaysOnTop(true);
} catch (SecurityException ignore) {
}
}
}
// Fix for 6758673: this call is moved here from init(gc), because
// WindowDisposerRecord requires a proper value of parent field.
Disposer.addRecord(anchor, new WindowDisposerRecord(appContext, this));
disposerRecord.updateOwner();
}
/**
@ -1022,7 +1040,9 @@ public class Window extends Container implements Accessible {
closeSplashScreen();
Dialog.checkShouldBeBlocked(this);
super.show();
locationByPlatform = false;
synchronized (getTreeLock()) {
this.locationByPlatform = false;
}
for (int i = 0; i < ownedWindowList.size(); i++) {
Window child = ownedWindowList.elementAt(i).get();
if ((child != null) && child.showWithParent) {
@ -1095,6 +1115,9 @@ public class Window extends Container implements Accessible {
modalBlocker.unblockWindow(this);
}
super.hide();
synchronized (getTreeLock()) {
this.locationByPlatform = false;
}
}
final void clearMostRecentFocusOwnerOnHide() {
@ -2180,8 +2203,8 @@ public class Window extends Container implements Accessible {
* windows. To detect if always-on-top windows are supported by the
* current platform, use {@link Toolkit#isAlwaysOnTopSupported()} and
* {@link Window#isAlwaysOnTopSupported()}. If always-on-top mode
* isn't supported by the toolkit or for this window, calling this
* method has no effect.
* isn't supported for this window or this window's toolkit does not
* support always-on-top windows, calling this method has no effect.
* <p>
* If a SecurityManager is installed, the calling thread must be
* granted the AWTPermission "setWindowAlwaysOnTop" in
@ -2194,11 +2217,13 @@ public class Window extends Container implements Accessible {
* windows
* @throws SecurityException if the calling thread does not have
* permission to set the value of always-on-top property
*
* @see #isAlwaysOnTop
* @see #toFront
* @see #toBack
* @see AWTPermission
* @see #isAlwaysOnTopSupported
* @see #getToolkit
* @see Toolkit#isAlwaysOnTopSupported
* @since 1.5
*/
@ -2224,6 +2249,15 @@ public class Window extends Container implements Accessible {
}
firePropertyChange("alwaysOnTop", oldAlwaysOnTop, alwaysOnTop);
}
for (WeakReference<Window> ref : ownedWindowList) {
Window window = ref.get();
if (window != null) {
try {
window.setAlwaysOnTop(alwaysOnTop);
} catch (SecurityException ignore) {
}
}
}
}
/**
@ -2231,11 +2265,13 @@ public class Window extends Container implements Accessible {
* window. Some platforms may not support always-on-top windows, some
* may support only some kinds of top-level windows; for example,
* a platform may not support always-on-top modal dialogs.
* @return {@code true}, if the always-on-top mode is
* supported by the toolkit and for this window,
* {@code false}, if always-on-top mode is not supported
* for this window or toolkit doesn't support always-on-top windows.
*
* @return {@code true}, if the always-on-top mode is supported for
* this window and this window's toolkit supports always-on-top windows,
* {@code false} otherwise
*
* @see #setAlwaysOnTop(boolean)
* @see #getToolkit
* @see Toolkit#isAlwaysOnTopSupported
* @since 1.6
*/
@ -2774,6 +2810,7 @@ public class Window extends Container implements Accessible {
void connectOwnedWindow(Window child) {
child.parent = this;
addOwnedWindow(child.weakThis);
child.disposerRecord.updateOwner();
}
private void addToWindowList() {
@ -2936,7 +2973,8 @@ public class Window extends Container implements Accessible {
weakThis = new WeakReference<>(this);
anchor = new Object();
sun.java2d.Disposer.addRecord(anchor, new WindowDisposerRecord(appContext, this));
disposerRecord = new WindowDisposerRecord(appContext, this);
sun.java2d.Disposer.addRecord(anchor, disposerRecord);
addToWindowList();
initGC(null);

View File

@ -93,7 +93,7 @@ import static sun.security.util.SecurityConstants.GET_CLASSLOADER_PERMISSION;
* the same results.
* <p>
* For more information on the using data transfer with Swing see
* the <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/dnd.html">
* the <a href="http://docs.oracle.com/javase/tutorial/uiswing/dnd/index.html">
* How to Use Drag and Drop and Data Transfer</a>,
* section in <em>Java Tutorial</em>.
*

View File

@ -32,7 +32,7 @@ import java.io.IOException;
* for a transfer operation.
* <p>
* For information on using data transfer with Swing, see
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/dnd.html">
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/dnd/index.html">
* How to Use Drag and Drop and Data Transfer</a>,
* a section in <em>The Java Tutorial</em>, for more information.
*

View File

@ -52,7 +52,7 @@ import java.lang.annotation.Native;
* in the range from {@code ACTION_FIRST} to {@code ACTION_LAST}.
*
* @see ActionListener
* @see <a href="http://java.sun.com/docs/books/tutorial/uiswing/events/actionlistener.html">Tutorial: How to Write an Action Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/actionlistener.html">Tutorial: How to Write an Action Listener</a>
*
* @author Carl Quinn
* @since 1.1

View File

@ -37,7 +37,7 @@ import java.util.EventListener;
* invoked.
*
* @see ActionEvent
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/eventmodel.html">Tutorial: Java 1.1 Event Model</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/actionlistener.html">How to Write an Action Listener</a>
*
* @author Carl Quinn
* @since 1.1

View File

@ -44,7 +44,7 @@ package java.awt.event;
*
* @see ComponentEvent
* @see ComponentListener
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/componentlistener.html">Tutorial: Writing a Component Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/componentlistener.html">Tutorial: Writing a Component Listener</a>
*
* @author Carl Quinn
* @since 1.1

View File

@ -60,7 +60,7 @@ import java.lang.annotation.Native;
*
* @see ComponentAdapter
* @see ComponentListener
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/componentlistener.html">Tutorial: Writing a Component Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/componentlistener.html">Tutorial: Writing a Component Listener</a>
*
* @author Carl Quinn
* @since 1.1

View File

@ -46,7 +46,7 @@ import java.util.EventListener;
*
* @see ComponentAdapter
* @see ComponentEvent
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/componentlistener.html">Tutorial: Writing a Component Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/componentlistener.html">Tutorial: Writing a Component Listener</a>
*
* @author Carl Quinn
* @since 1.1

View File

@ -44,7 +44,7 @@ package java.awt.event;
*
* @see ContainerEvent
* @see ContainerListener
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/containerlistener.html">Tutorial: Writing a Container Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/containerlistener.html">Tutorial: Writing a Container Listener</a>
*
* @author Amy Fowler
* @since 1.1

View File

@ -52,7 +52,7 @@ import java.awt.Component;
*
* @see ContainerAdapter
* @see ContainerListener
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/containerlistener.html">Tutorial: Writing a Container Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/containerlistener.html">Tutorial: Writing a Container Listener</a>
*
* @author Tim Prinzing
* @author Amy Fowler

View File

@ -46,7 +46,7 @@ import java.util.EventListener;
*
* @see ContainerAdapter
* @see ContainerEvent
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/containerlistener.html">Tutorial: Writing a Container Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/containerlistener.html">Tutorial: Writing a Container Listener</a>
*
* @author Tim Prinzing
* @author Amy Fowler

View File

@ -44,7 +44,7 @@ package java.awt.event;
*
* @see FocusEvent
* @see FocusListener
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/focuslistener.html">Tutorial: Writing a Focus Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/focuslistener.html">Tutorial: Writing a Focus Listener</a>
*
* @author Carl Quinn
* @since 1.1

View File

@ -57,7 +57,7 @@ import sun.awt.SunToolkit;
*
* @see FocusAdapter
* @see FocusListener
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/focuslistener.html">Tutorial: Writing a Focus Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/focuslistener.html">Tutorial: Writing a Focus Listener</a>
*
* @author Carl Quinn
* @author Amy Fowler

View File

@ -42,7 +42,7 @@ import java.util.EventListener;
*
* @see FocusAdapter
* @see FocusEvent
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/focuslistener.html">Tutorial: Writing a Focus Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/focuslistener.html">Tutorial: Writing a Focus Listener</a>
*
* @author Carl Quinn
* @since 1.1

View File

@ -445,7 +445,7 @@ public abstract class InputEvent extends ComponentEvent {
* <PRE>
* int onmask = SHIFT_DOWN_MASK | BUTTON1_DOWN_MASK;
* int offmask = CTRL_DOWN_MASK;
* if ((event.getModifiersEx() & (onmask | offmask)) == onmask) {
* if ((event.getModifiersEx() &amp; (onmask | offmask)) == onmask) {
* ...
* }
* </PRE>

View File

@ -58,7 +58,7 @@ import java.awt.ItemSelectable;
*
* @see java.awt.ItemSelectable
* @see ItemListener
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/itemlistener.html">Tutorial: Writing an Item Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/itemlistener.html">Tutorial: Writing an Item Listener</a>
*
* @since 1.1
*/

View File

@ -40,7 +40,7 @@ import java.util.EventListener;
*
* @see java.awt.ItemSelectable
* @see ItemEvent
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/itemlistener.html">Tutorial: Writing an Item Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/itemlistener.html">Tutorial: Writing an Item Listener</a>
*
* @since 1.1
*/

View File

@ -46,7 +46,7 @@ package java.awt.event;
*
* @see KeyEvent
* @see KeyListener
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/keylistener.html">Tutorial: Writing a Key Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/keylistener.html">Tutorial: Writing a Key Listener</a>
*
* @since 1.1
*/

View File

@ -145,7 +145,7 @@ import sun.awt.AWTAccessor;
*
* @see KeyAdapter
* @see KeyListener
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/keylistener.html">Tutorial: Writing a Key Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/keylistener.html">Tutorial: Writing a Key Listener</a>
*
* @since 1.1
*/

View File

@ -63,7 +63,7 @@ package java.awt.event;
* @see MouseListener
* @see MouseMotionListener
* @see MouseWheelListener
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/mouselistener.html">Tutorial: Writing a Mouse Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/mouselistener.html">Tutorial: Writing a Mouse Listener</a>
*
* @since 1.1
*/

View File

@ -146,12 +146,12 @@ import sun.awt.SunToolkit;
* {@link InputEvent#getMaskForButton(int) getMaskForButton(button)} method may be used
* as button masks.
* <p>
* <code>MOUSE_DRAGGED</code> events are delivered to the <code>Component</code>
* {@code MOUSE_DRAGGED} events are delivered to the {@code Component}
* in which the mouse button was pressed until the mouse button is released
* (regardless of whether the mouse position is within the bounds of the
* <code>Component</code>). Due to platform-dependent Drag&Drop implementations,
* <code>MOUSE_DRAGGED</code> events may not be delivered during a native
* Drag&Drop operation.
* {@code Component}). Due to platform-dependent Drag&amp;Drop implementations,
* {@code MOUSE_DRAGGED} events may not be delivered during a native
* Drag&amp;Drop operation.
*
* In a multi-screen environment mouse drag events are delivered to the
* <code>Component</code> even if the mouse position is outside the bounds of the
@ -182,8 +182,8 @@ import sun.awt.SunToolkit;
* @see MouseMotionAdapter
* @see MouseMotionListener
* @see MouseWheelListener
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/mouselistener.html">Tutorial: Writing a Mouse Listener</a>
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/mousemotionlistener.html">Tutorial: Writing a Mouse Motion Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/mouselistener.html">Tutorial: Writing a Mouse Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/mousemotionlistener.html">Tutorial: Writing a Mouse Motion Listener</a>
*
* @since 1.1
*/
@ -327,7 +327,7 @@ public class MouseEvent extends InputEvent {
* For all other events the count will be 0.
*
* @serial
* @see #getClickCount().
* @see #getClickCount()
*/
int clickCount;
@ -403,7 +403,7 @@ public class MouseEvent extends InputEvent {
/**
* Initialize JNI field and method IDs for fields that may be
accessed from C.
* accessed from C.
*/
private static native void initIDs();

View File

@ -50,7 +50,7 @@ import java.util.EventListener;
*
* @see MouseAdapter
* @see MouseEvent
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/mouselistener.html">Tutorial: Writing a Mouse Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/mouselistener.html">Tutorial: Writing a Mouse Listener</a>
*
* @since 1.1
*/

View File

@ -49,7 +49,7 @@ package java.awt.event;
*
* @see MouseEvent
* @see MouseMotionListener
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/mousemotionlistener.html">Tutorial: Writing a Mouse Motion Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/mousemotionlistener.html">Tutorial: Writing a Mouse Motion Listener</a>
*
* @since 1.1
*/

View File

@ -47,7 +47,7 @@ import java.util.EventListener;
*
* @see MouseMotionAdapter
* @see MouseEvent
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/mousemotionlistener.html">Tutorial: Writing a Mouse Motion Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/mousemotionlistener.html">Tutorial: Writing a Mouse Motion Listener</a>
*
* @since 1.1
*/

View File

@ -45,7 +45,7 @@ package java.awt.event;
*
* @see WindowEvent
* @see WindowListener
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/windowlistener.html">Tutorial: Writing a Window Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/windowlistener.html">Tutorial: Writing a Window Listener</a>
*
* @author Carl Quinn
* @author Amy Fowler

View File

@ -52,7 +52,7 @@ import sun.awt.SunToolkit;
*
* @see WindowAdapter
* @see WindowListener
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/windowlistener.html">Tutorial: Writing a Window Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/windowlistener.html">Tutorial: Writing a Window Listener</a>
*
* @since JDK1.1
*/

View File

@ -47,7 +47,7 @@ import java.util.EventListener;
*
* @see WindowAdapter
* @see WindowEvent
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/windowlistener.html">Tutorial: Writing a Window Listener</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/windowlistener.html">Tutorial: Writing a Window Listener</a>
*
* @since 1.4
*/

View File

@ -44,7 +44,7 @@ import java.util.EventListener;
*
* @see WindowAdapter
* @see WindowEvent
* @see <a href="http://java.sun.com/docs/books/tutorial/uiswing/events/windowlistener.html">Tutorial: How to Write Window Listeners</a>
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/windowlistener.html">Tutorial: How to Write Window Listeners</a>
*
* @since 1.1
*/

Some files were not shown because too many files have changed in this diff Show More