--- a/src/java.desktop/share/classes/java/awt/SequencedEvent.java Mon Mar 19 10:11:07 2018 -0700
+++ b/src/java.desktop/share/classes/java/awt/SequencedEvent.java Mon Mar 19 10:46:31 2018 -0700
@@ -135,11 +135,7 @@
if (Thread.currentThread() instanceof EventDispatchThread) {
EventDispatchThread edt = (EventDispatchThread)
Thread.currentThread();
- edt.pumpEvents(SentEvent.ID, new Conditional() {
- public boolean evaluate() {
- return !SequencedEvent.this.isFirstOrDisposed();
- }
- });
+ edt.pumpEvents(ID, () -> !SequencedEvent.this.isFirstOrDisposed());
} else {
if (fxAppThreadIsDispatchThread) {
fxCheckSequenceThread.start();
--- a/src/java.desktop/share/classes/javax/swing/JList.java Mon Mar 19 10:11:07 2018 -0700
+++ b/src/java.desktop/share/classes/javax/swing/JList.java Mon Mar 19 10:46:31 2018 -0700
@@ -2269,10 +2269,12 @@
int iMin = sm.getMinSelectionIndex();
int iMax = sm.getMaxSelectionIndex();
-
- if ((iMin < 0) || (iMax < 0)) {
+ int size = dm.getSize();
+
+ if ((iMin < 0) || (iMax < 0) || (iMin >= size)) {
return new Object[0];
}
+ iMax = iMax < size ? iMax : size - 1;
Object[] rvTmp = new Object[1+ (iMax - iMin)];
int n = 0;
@@ -2304,10 +2306,12 @@
int iMin = sm.getMinSelectionIndex();
int iMax = sm.getMaxSelectionIndex();
-
- if ((iMin < 0) || (iMax < 0)) {
+ int size = dm.getSize();
+
+ if ((iMin < 0) || (iMax < 0) || (iMin >= size)) {
return Collections.emptyList();
}
+ iMax = iMax < size ? iMax : size - 1;
List<E> selectedItems = new ArrayList<E>();
for(int i = iMin; i <= iMax; i++) {
@@ -2353,7 +2357,8 @@
@BeanProperty(bound = false)
public E getSelectedValue() {
int i = getMinSelectionIndex();
- return (i == -1) ? null : getModel().getElementAt(i);
+ return ((i == -1) || (i >= getModel().getSize())) ? null :
+ getModel().getElementAt(i);
}
--- a/src/java.desktop/share/classes/javax/swing/text/html/ImageView.java Mon Mar 19 10:11:07 2018 -0700
+++ b/src/java.desktop/share/classes/javax/swing/text/html/ImageView.java Mon Mar 19 10:46:31 2018 -0700
@@ -928,11 +928,11 @@
}
synchronized(ImageView.this) {
- if ((changed & 1) == 1 && (state & WIDTH_FLAG) == 0) {
- width = newWidth;
+ if ((changed & 1) == 1 && (state & HEIGHT_FLAG) == 0) {
+ height = newHeight;
}
- if ((changed & 2) == 2 && (state & HEIGHT_FLAG) == 0) {
- height = newHeight;
+ if ((changed & 2) == 2 && (state & WIDTH_FLAG) == 0) {
+ width = newWidth;
}
if ((state & LOADING_FLAG) == LOADING_FLAG) {
// No need to resize or repaint, still in the process of
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/event/SequencedEvent/SequencedEventTest.java Mon Mar 19 10:46:31 2018 -0700
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2018, 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8152974
+ * @key headful
+ * @summary AWT hang occurrs when sequenced events arrive out of sequence
+ * @run main SequencedEventTest
+ */
+import sun.awt.AppContext;
+import sun.awt.SunToolkit;
+
+import java.awt.Robot;
+import java.awt.Point;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.AWTEvent;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.InputEvent;
+import java.lang.reflect.Constructor;
+import java.util.concurrent.CountDownLatch;
+
+import javax.swing.JFrame;
+import javax.swing.JButton;
+import javax.swing.SwingUtilities;
+import javax.swing.JTextArea;
+
+public class SequencedEventTest extends JFrame implements ActionListener {
+ private JButton spamMeButton;
+ private static Robot robot;
+ private static SequencedEventTest window;
+ private static AppContext context;
+
+ public static void main(String[] args) throws Exception {
+ SwingUtilities.invokeAndWait(() -> {
+ window = new SequencedEventTest();
+ window.setVisible(true);
+ });
+
+ robot = new Robot();
+ robot.waitForIdle();
+
+ Point pt = window.spamMeButton.getLocationOnScreen();
+ Dimension d = window.spamMeButton.getSize();
+
+ robot.mouseMove(pt.x + d.width / 2, pt.y + d.height / 2);
+ robot.waitForIdle();
+ robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+ robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+ /*
+ *Cannot have robot.waitForIdle() here since it will block the test forever,
+ * in the case of failure and the test will timeout.
+ */
+
+ try {
+ /*
+ * Wait for 2 seconds, and then see if all the sequenced events are dispatched.
+ */
+ Thread.sleep(2000);
+ AWTEvent ev = Toolkit.getDefaultToolkit().getSystemEventQueue().
+ peekEvent(java.awt.event.FocusEvent.FOCUS_LAST + 1);
+
+ if (ev != null)
+ throw new RuntimeException("Test case failed!");
+ } catch (InterruptedException e) {
+ throw new RuntimeException("Test case failed." + e.getMessage());
+ }
+
+ /*
+ * In the case of failure, the cleanup job cannot be executed, since it
+ * will block the test.
+ */
+ System.out.println("Test case succeeded.");
+ context.dispose();
+ SwingUtilities.invokeAndWait(() -> window.dispose());
+ }
+
+ public SequencedEventTest() {
+ super("Test Window");
+
+ setLayout(new FlowLayout());
+ JTextArea textBlock = new JTextArea("Lorem ipsum dolor sit amet...");
+ add(textBlock);
+
+ spamMeButton = new JButton("Press me!");
+ spamMeButton.addActionListener(this);
+ add(spamMeButton);
+ setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ pack();
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if(e.getSource() == spamMeButton) {
+ AWTEvent eventOne = getSequencedEvent();
+ AWTEvent eventFour = getSequencedEvent();
+ ThreadGroup tg = new ThreadGroup("TestThreadGroup" );
+ CountDownLatch latch = new CountDownLatch(1);
+ Thread t = new Thread(tg, () -> {
+ context = SunToolkit.createNewAppContext();
+ AWTEvent eventTwo = getSequencedEvent();
+ AWTEvent eventThree = getSequencedEvent();
+
+ Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(eventThree);
+ Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new ActionEvent(this, 0, null));
+ Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new ActionEvent(this, 1, null));
+ Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(eventTwo);
+
+ latch.countDown();
+ });
+
+ t.start();
+ try {
+ latch.await();
+ }catch (InterruptedException ex) {
+ throw new RuntimeException("Test case failed.");
+ }
+
+ Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(eventFour);
+ Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new ActionEvent(this, 2, null));
+ Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new ActionEvent(this, 3, null));
+ Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(eventOne);
+
+ try {
+ t.join();
+ } catch (InterruptedException ex) {
+ throw new RuntimeException("Test case failed.");
+ }
+ }
+ }
+
+ private AWTEvent getSequencedEvent()
+ {
+ AWTEvent wrapMe = new AWTEvent(this, AWTEvent.RESERVED_ID_MAX) {};
+
+ try {
+ /*
+ * SequencedEvent is a package private class, which cannot be instantiated
+ * by importing. So use reflection to create an instance.
+ */
+ Class<? extends AWTEvent> seqClass = (Class<? extends AWTEvent>) Class.forName("java.awt.SequencedEvent");
+ Constructor<? extends AWTEvent> seqConst = seqClass.getConstructor(AWTEvent.class);
+ seqConst.setAccessible(true);;
+ return seqConst.newInstance(wrapMe);
+ } catch (Throwable err) {
+ throw new RuntimeException("Unable to instantiate SequencedEvent",err);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/swing/JEditorPane/8195095/ImageViewTest.java Mon Mar 19 10:46:31 2018 -0700
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2018, 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @key headful
+ * @bug 8195095
+ * @summary Tests if Images are scaled correctly in JEditorPane.
+ * @run main ImageViewTest
+ */
+import java.awt.Robot;
+import java.awt.Point;
+import java.awt.Color;
+import java.awt.Insets;
+
+import javax.swing.JEditorPane;
+import javax.swing.SwingUtilities;
+import javax.swing.JFrame;
+import javax.swing.WindowConstants;
+
+public class ImageViewTest {
+
+ private static final int WIDTH = 200;
+ private static final int HEIGHT = 200;
+ private static JFrame f;
+
+ private static JEditorPane editorPane1;
+ private static JEditorPane editorPane2;
+ private static JEditorPane editorPane3;
+ private static JEditorPane editorPane4;
+
+ private static void test(Robot r, JEditorPane editorPane) throws Exception {
+
+ SwingUtilities.invokeAndWait(() -> {
+ f = new JFrame();
+ editorPane.setEditable(false);
+ f.add(editorPane);
+ f.setSize(220,240);
+ f.setLocationRelativeTo(null);
+
+ f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+ f.setVisible(true);
+ });
+
+ r.waitForIdle();
+ r.delay(500);
+
+ SwingUtilities.invokeAndWait(() -> {
+ Insets insets = editorPane.getInsets();
+ Point loc = editorPane.getLocationOnScreen();
+
+ final Color blue = Color.BLUE;
+ final int offset = 10;
+
+ Color center = r.getPixelColor(loc.x + insets.left + WIDTH / 2,
+ loc.y + insets.top + HEIGHT / 2);
+ Color left = r.getPixelColor(loc.x + insets.left + offset,
+ loc.y + insets.top + HEIGHT / 2);
+ Color right = r.getPixelColor(loc.x + insets.left + WIDTH - offset,
+ loc.y + insets.top + HEIGHT / 2);
+ Color bottom = r.getPixelColor(loc.x + insets.left + WIDTH / 2,
+ loc.y + insets.top + HEIGHT - offset);
+ Color top = r.getPixelColor(loc.x + insets.left + WIDTH / 2,
+ loc.y + insets.top + offset);
+
+ f.dispose();
+
+ System.out.println("center color: " + center);
+ System.out.println("left color: " + left);
+ System.out.println("right color: " + right);
+ System.out.println("bottom color: " + bottom);
+ System.out.println("top color: " + top);
+ System.out.println();
+
+ if (!(blue.equals(center) && blue.equals(left) && blue.equals(right) &&
+ blue.equals(top) && blue.equals(bottom))) {
+ throw new RuntimeException("Test failed: Image not scaled correctly");
+ }
+ });
+
+ r.waitForIdle();
+ }
+
+ public static void main(String[] args) throws Exception {
+
+ final String ABSOLUTE_FILE_PATH = ImageViewTest.class.getResource("circle.png").getPath();
+
+ System.out.println(ABSOLUTE_FILE_PATH);
+
+ Robot r = new Robot();
+
+ SwingUtilities.invokeAndWait(() -> {
+ editorPane1 = new JEditorPane("text/html",
+ "<img height=\"200\" src=\"file:///" + ABSOLUTE_FILE_PATH + "\"");
+
+ editorPane2 = new JEditorPane("text/html",
+ "<img width=\"200\" src=\"file:///" + ABSOLUTE_FILE_PATH + "\"");
+
+ editorPane3 = new JEditorPane("text/html",
+ "<img width=\"200\" height=\"200\" src=\"file:///" + ABSOLUTE_FILE_PATH + "\"");
+
+ editorPane4 = new JEditorPane("text/html",
+ "<img src=\"file:///" + ABSOLUTE_FILE_PATH + "\"");
+
+ });
+
+ r.waitForIdle();
+
+ System.out.println("Test with only height set to 200");
+ test(r, editorPane1);
+
+ System.out.println("Test with only width set to 200");
+ test(r, editorPane2);
+
+ System.out.println("Test with none of them set");
+ test(r, editorPane3);
+
+ System.out.println("Test with both of them set to 200");
+ test(r, editorPane4);
+
+ System.out.println("Test Passed.");
+ }
+}
Binary file test/jdk/javax/swing/JEditorPane/8195095/circle.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/swing/JList/GetSelectedValueTest.java Mon Mar 19 10:46:31 2018 -0700
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2018, 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.
+ *
+ * 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.
+ */
+/*
+ * @test
+ * @key headful
+ * @bug 7108280
+ * @summary Verifies that getSelectedValue works fine without crash when
+ * the setSelectionInterval was called with indices outside the
+ * range of data present in DataModel
+ * @run main GetSelectedValueTest
+ */
+
+import javax.swing.SwingUtilities;
+import javax.swing.DefaultListModel;
+import javax.swing.JList;
+import javax.swing.ListSelectionModel;
+import java.util.Objects;
+
+public class GetSelectedValueTest {
+ public static void main(String[] args) throws Exception {
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ // Create a JList with 2 elements
+ DefaultListModel dlm = new DefaultListModel();
+ JList list = new JList<String>(dlm);
+ list.setSelectionMode(
+ ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+ dlm.addElement("1");
+ dlm.addElement("2");
+
+ // Set the selection interval from 0-2 (3 elements instead
+ // of 2). The getSelectedValue should return the first
+ // selected element
+ list.setSelectionInterval(0, 2);
+ checkSelectedIndex(list, "1");
+
+ //here the smallest selection index is bigger than number of
+ // elements in list. This should return null.
+ list.setSelectionInterval(4, 5);
+ checkSelectedIndex(list,null);
+ }
+ });
+ }
+
+ static void checkSelectedIndex(JList list, Object value)
+ throws RuntimeException {
+ Object selectedObject = list.getSelectedValue();
+ if (!Objects.equals(value, selectedObject)) {
+ System.out.println("Expected: " + value);
+ System.out.println("Actual: " + selectedObject);
+ throw new RuntimeException("Wrong selection");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/swing/JList/GetSelectedValuesListTest.java Mon Mar 19 10:46:31 2018 -0700
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2018, 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.
+ *
+ * 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.
+ */
+/*
+ * @test
+ * @key headful
+ * @bug 7108280
+ * @summary Verifies that getSelectedValuesList works fine without crash when
+ * the setSelectionInterval was called with indices outside the
+ * range of data present in DataModel
+ * @run main GetSelectedValuesListTest
+ */
+
+import javax.swing.SwingUtilities;
+import javax.swing.DefaultListModel;
+import javax.swing.JList;
+import javax.swing.ListSelectionModel;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+
+public class GetSelectedValuesListTest {
+ public static void main(String[] args) throws Exception {
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ // Create a JList with 2 elements
+ DefaultListModel dlm = new DefaultListModel();
+ JList list = new JList<String>(dlm);
+ list.setSelectionMode(
+ ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+ dlm.addElement("1");
+ dlm.addElement("2");
+
+ // Set the selection interval from 0-2 (3 elements instead
+ // of 2). The getSelectedValuesList should return the list of
+ // objects present in the list in the given interval
+ list.setSelectionInterval(0, 2);
+ checkSelection(list, List.of("1", "2"));
+
+ //here the selection interval is set greater than number of
+ // elements in list. This should return empty list
+ list.setSelectionInterval(4, 10);
+ checkSelection(list, Collections.emptyList());
+
+ // This will set the selection interval from 0 to 2 index.
+ // The getSelectedValuesList should return the list of
+ // objects present in the list in the given interval
+ list.getSelectionModel().setSelectionInterval(0, 2);
+ checkSelection(list, List.of("1", "2"));
+ }
+ });
+ }
+
+ static void checkSelection(JList list, List<String> selectionList)
+ throws RuntimeException
+ {
+ List<String> listSelection = list.getSelectedValuesList();
+ if (!listSelection.equals(selectionList)) {
+ System.out.println("Expected: " + selectionList);
+ System.out.println("Actual: " + listSelection);
+ throw new RuntimeException("Wrong selection from " +
+ "getSelectedValuesList");
+ }
+
+ Object[] arraySelection = list.getSelectedValues();
+ if (!Arrays.equals(arraySelection, selectionList.toArray())) {
+ System.out.println("Expected: " + selectionList);
+ System.out.println("Actual: " + Arrays.asList(arraySelection));
+ throw new RuntimeException("Wrong selection from " +
+ "getSelectedValues");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/SwingSet/src/TableDemoTest.java Mon Mar 19 10:46:31 2018 -0700
@@ -0,0 +1,349 @@
+/*
+ * Copyright (c) 2018, 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.
+ *
+ * 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.
+ */
+
+import static com.sun.swingset3.demos.table.TableDemo.COLUMN1_NAME;
+import static com.sun.swingset3.demos.table.TableDemo.COLUMN2_NAME;
+import static com.sun.swingset3.demos.table.TableDemo.COLUMN3_NAME;
+import static com.sun.swingset3.demos.table.TableDemo.COLUMN4_NAME;
+import static com.sun.swingset3.demos.table.TableDemo.DEMO_TITLE;
+import static com.sun.swingset3.demos.table.TableDemo.ROW_HEIGHT;
+import static org.jemmy2ext.JemmyExt.EXACT_STRING_COMPARATOR;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JTable;
+
+import org.jtregext.GuiTestListener;
+import org.netbeans.jemmy.ClassReference;
+import org.netbeans.jemmy.operators.JCheckBoxOperator;
+import org.netbeans.jemmy.operators.JFrameOperator;
+import org.netbeans.jemmy.operators.JTableHeaderOperator;
+import org.netbeans.jemmy.operators.JTableOperator;
+import org.netbeans.jemmy.operators.JTextFieldOperator;
+import org.testng.annotations.Listeners;
+import org.testng.annotations.Test;
+
+import com.sun.swingset3.demos.table.OscarCandidate;
+import com.sun.swingset3.demos.table.OscarTableModel;
+import com.sun.swingset3.demos.table.TableDemo;
+
+/*
+ * @test
+ * @key headful
+ * @summary Verifies SwingSet3 TableDemo page by checking different properties
+ * of the JTable like number of row, number of columns and actions like
+ * selection of cell, sorting based on column, filtering based on text and
+ * moving of the column
+ *
+ * @library /sanity/client/lib/jemmy/src
+ * @library /sanity/client/lib/Extensions/src
+ * @library /sanity/client/lib/SwingSet3/src
+ * @modules java.desktop
+ * java.logging
+ * @build org.jemmy2ext.JemmyExt
+ * @build com.sun.swingset3.demos.table.TableDemo
+ * @run testng TableDemoTest
+ */
+@Listeners(GuiTestListener.class)
+public class TableDemoTest {
+
+ private final static int MAX_ROW_COUNT = 524;
+ private final static int MAX_COL_COUNT = 4;
+
+ private final static String FILTER_TEXT = "Sunrise";
+ private final static String FILTER_RESET_TEXT = "";
+
+ private final static int [] SELECT_ROW_INDICES ={10, 11, 18};
+
+ private final static int MOVE_COL_START_INDEX = 1;
+ private final static int MOVE_COL_END_INDEX = 2;
+ private final static String MOVE_COL_VAL_TEXT1 = "Sunrise";
+ private final static String MOVE_COL_VAL_TEXT2 = "Most Unique Artistic Picture";
+ private final static int MOVE_COL_VAL_ROW = 0;
+
+ private final static int SORT_COL = 1;
+ private final static int[] SORT_VAL_ROWS =new int[] {0, 250, 523};
+ private final static String[][] ASC_PRE_SORT_ROW_VAL = new String[][] {
+ {"1928", "Best Actor", "The Way of All Flesh", "[Emil Jannings]"},
+ {"1933", "Best Director", "Cavalcade", "[Frank Lloyd]"},
+ {"1936", "Best Engineering Effects", "My Man Godfrey", "[Eric Hatch, Morris Ryskind]"}};
+ private final static String[][] ASC_POST_SORT_ROW_VAL = new String[][] {
+ {"1928", "Best Actor", "The Way of All Flesh", "[Emil Jannings]"},
+ {"1936", "Best Director", "My Man Godfrey", "[Gregory La Cava]"},
+ {"1928", "Most Unique Artistic Picture", "The Crowd", "[]"}};
+ private final static String[][] DESC_POST_SORT_ROW_VAL = new String[][] {
+ {"1928", "Most Unique Artistic Picture", "Sunrise", "[]"},
+ {"1934", "Best Engineering Effects", "Viva Villa!", "[Ben Hecht]"},
+ {"1936", "Best Actor", "San Francisco", "[Spencer Tracy]"}};
+
+ /**
+ * Tests the different properties of JTable like number of rows, number
+ * of columns and actions like selection of cell, sorting based on column,
+ * filtering based on text and moving of the column.
+ *
+ * @throws Exception
+ */
+ @Test
+ public void test() throws Exception {
+
+ new ClassReference(TableDemo.class.getCanonicalName()).startApplication();
+
+ JFrameOperator frameOperator = new JFrameOperator(DEMO_TITLE);
+ frameOperator.setComparator(EXACT_STRING_COMPARATOR);
+ frameOperator.setVerification(true);
+ JTableOperator tableOperator = new JTableOperator(frameOperator);
+ JTableHeaderOperator tableHeaderOperator = new JTableHeaderOperator(frameOperator);
+
+ checkTableBasicProperties(tableOperator);
+ checkCellSelection(tableOperator);
+ checkSortTable(tableOperator, tableHeaderOperator);
+ checkMoveColumn(tableOperator, tableHeaderOperator);
+ checkFilterTable(frameOperator, tableOperator);
+ }
+
+ /**
+ * Verifies the table basic properties number of columns, rows and row height
+ *
+ * @param tableOperator
+ */
+ private void checkTableBasicProperties(JTableOperator tableOperator) {
+ tableOperator.waitStateOnQueue(comp
+ -> MAX_COL_COUNT == ((JTable)comp).getColumnCount());
+ waitRowCount(tableOperator, MAX_ROW_COUNT);
+ tableOperator.waitStateOnQueue(comp
+ -> ROW_HEIGHT == ((JTable)comp).getRowHeight());
+ }
+
+ /**
+ * Selects one table cell and verifies the selected cell's row number and column number
+ *
+ * @param tableOperator
+ */
+ private void checkCellSelection(JTableOperator tableOperator) {
+ int noOfColumns = tableOperator.getColumnCount();
+ for (int i = 0; i < SELECT_ROW_INDICES.length; i++) {
+ int rowIndex = SELECT_ROW_INDICES[i];
+ for (int j = 0; j < noOfColumns; j++) {
+ int colIndex = j;
+ tableOperator.clickOnCell(rowIndex, colIndex);
+ tableOperator.waitStateOnQueue(comp
+ -> rowIndex == ((JTable)comp).getSelectedRow() &&
+ colIndex == ((JTable)comp).getSelectedColumn());
+ }
+ }
+ }
+
+ /**
+ * Filter table based on specific text and winners check box, and verifies row count
+ *
+ * @param frameOperator
+ * @param tableOperator
+ */
+ private void checkFilterTable(JFrameOperator frameOperator,
+ JTableOperator tableOperator) {
+
+ int [] filterRowCount = getFilteredCount(tableOperator, FILTER_TEXT);
+ JTextFieldOperator filterField = new JTextFieldOperator(frameOperator);
+ JCheckBoxOperator winnersCheckbox = new JCheckBoxOperator(frameOperator);
+
+ // Filtering based on FILTER_TEXT
+ filterField.setText(FILTER_TEXT);
+ waitRowCount(tableOperator, filterRowCount[0]);
+
+ // Filtering based on WinnersCheckbox
+ winnersCheckbox.setSelected(true);
+ waitRowCount(tableOperator, filterRowCount[1]);
+
+ // Resets the winners check box
+ winnersCheckbox.setSelected(false);
+ waitRowCount(tableOperator, filterRowCount[0]);
+
+ // Resets the filter text field
+ filterField.setText(FILTER_RESET_TEXT);
+ waitRowCount(tableOperator, MAX_ROW_COUNT);
+
+ }
+
+ private int[] getFilteredCount(JTableOperator tableOperator, String filterText){
+ OscarTableModel tableModel = (OscarTableModel)tableOperator.getModel();
+ int noOfRows = tableModel.getRowCount();
+ int filteredRowCount = 0;
+ int filteredWinnersRowCount = 0;
+ for (int i = 0; i < noOfRows; i++) {
+ OscarCandidate candidate = tableModel.getCandidate(i);
+ if(isMovieOrPersonsContainsText(candidate, filterText)){
+ filteredRowCount++;
+ if(candidate.isWinner()) {
+ filteredWinnersRowCount++;
+ }
+ }
+ }
+ return new int[] {filteredRowCount, filteredWinnersRowCount};
+ }
+
+ private boolean isMovieOrPersonsContainsText(
+ OscarCandidate candidate, String filterText){
+ String movie = candidate.getMovieTitle();
+ if(movie != null && movie.contains(filterText)) {
+ return true;
+ } else {
+ List<String> persons = candidate.getPersons();
+ for (String person : persons) {
+ if(person != null && person.contains(filterText)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Moves to swap the columns, move again to reset back, verify column name
+ * and cell values in both the scenarios.
+ *
+ * @param tableOperator
+ * @param tableHeaderOperator
+ */
+ private void checkMoveColumn(JTableOperator tableOperator,
+ JTableHeaderOperator tableHeaderOperator) {
+
+ String[] columnNames = {COLUMN1_NAME, COLUMN3_NAME, COLUMN2_NAME, COLUMN4_NAME};
+ // Moving the column from 'start index' to 'end index'
+ moveColumn(tableOperator, tableHeaderOperator, columnNames,
+ MOVE_COL_START_INDEX, MOVE_COL_END_INDEX);
+
+ // Resets the columns to original position(from 'end index' to 'start index')
+ columnNames[1] = COLUMN2_NAME;
+ columnNames[2] = COLUMN3_NAME;
+ moveColumn(tableOperator, tableHeaderOperator, columnNames,
+ MOVE_COL_END_INDEX, MOVE_COL_START_INDEX);
+ }
+
+ /**
+ * Moves to swap the columns, verify column name and cell values.
+ *
+ * @param tableOperator
+ * @param tableHeaderOperator
+ * @param columnNames
+ * @param moveCol
+ * @param moveToCol
+ */
+ private void moveColumn(JTableOperator tableOperator, JTableHeaderOperator tableHeaderOperator,
+ String[] columnNames, int moveCol, int moveToCol){
+
+ tableHeaderOperator.moveColumn(moveCol, moveToCol);
+ checkColumnNames(tableOperator, columnNames);
+ tableOperator.waitCell(MOVE_COL_VAL_TEXT1, MOVE_COL_VAL_ROW, moveCol);
+ tableOperator.waitCell(MOVE_COL_VAL_TEXT2, MOVE_COL_VAL_ROW, moveToCol);
+ }
+
+ private void checkColumnNames(JTableOperator tableOperator, String[] columnNames) {
+ for (int i = 0; i < tableOperator.getColumnCount(); i++) {
+ int columnIndex = i;
+ tableOperator.waitStateOnQueue(comp -> columnNames[columnIndex].equals(
+ ((JTable)comp).getColumnModel().getColumn(columnIndex).getHeaderValue()));
+ }
+ }
+
+ /**
+ * Sorts the table based on one particular column in ascending and descending order,
+ * and verifies cell values
+ *
+ * @param tableOperator
+ * @param tableHeaderOperator
+ */
+ private void checkSortTable(JTableOperator tableOperator,
+ JTableHeaderOperator tableHeaderOperator) {
+
+ // Verifying the row values before sort
+ checkTableRows(tableOperator, ASC_PRE_SORT_ROW_VAL);
+
+ // Getting all award category values before stating the sort
+ // to prepare the expected result
+ ArrayList<String> awardCats = new ArrayList<>();
+ for (int i = 0; i < tableOperator.getRowCount(); i++) {
+ awardCats.add((String) tableOperator.getValueAt(i, SORT_COL));
+ }
+ // Sorting awardCats(expected result) in ascending order
+ awardCats.sort((s1, s2) -> s1.compareTo(s2));
+
+ // Sorting table based on column 'Award Category' in ascending order
+ sortTable(tableOperator, tableHeaderOperator, awardCats,
+ ASC_POST_SORT_ROW_VAL);
+
+ // Sorting awardCats(expected result) in descending order
+ awardCats.sort((s1, s2) -> s2.compareTo(s1));
+ // Sorting table based on column 'Award Category' in descending order
+ sortTable(tableOperator, tableHeaderOperator, awardCats,
+ DESC_POST_SORT_ROW_VAL);
+
+ }
+
+ private void checkColumnSorted(JTableOperator tableOperator,
+ ArrayList<String> awardCatExp){
+ ArrayList<String> awardCatActual = new ArrayList<>();
+ for (int i = 0; i < tableOperator.getRowCount(); i++) {
+ awardCatActual.add((String) tableOperator.getValueAt(i, SORT_COL));
+ }
+ tableOperator.waitStateOnQueue(comp -> awardCatExp.equals(awardCatActual));
+ }
+
+ private void checkTableRows(JTableOperator tableOperator, String[][] rowValues) {
+ for (int i = 0; i < SORT_VAL_ROWS.length; i++) {
+ tableOperator.waitCell(rowValues[i][0], SORT_VAL_ROWS[i], 0);
+ tableOperator.waitCell(rowValues[i][1], SORT_VAL_ROWS[i], 1);
+ tableOperator.waitCell(rowValues[i][2], SORT_VAL_ROWS[i], 2);
+ tableOperator.waitCell(rowValues[i][3], SORT_VAL_ROWS[i], 3);
+ }
+ }
+
+ /**
+ * Sorts the table based on one particular column and verifies cell values
+ *
+ * @param tableOperator
+ * @param tableHeaderOperator
+ * @param awardCatExp
+ * @param rowValues
+ */
+ private void sortTable(JTableOperator tableOperator, JTableHeaderOperator tableHeaderOperator,
+ ArrayList<String> awardCatExp, String[][] rowValues) {
+
+ tableHeaderOperator.selectColumn(SORT_COL);
+ checkColumnSorted(tableOperator, awardCatExp);
+ // Verifying the row values after sort
+ checkTableRows(tableOperator, rowValues);
+ }
+
+ /**
+ * Waits the number of rows on table equal to the count specified
+ *
+ * @param tableOperator
+ * @param count
+ */
+ private void waitRowCount(JTableOperator tableOperator, int count) {
+ tableOperator.waitStateOnQueue(comp
+ -> count == ((JTable)comp).getRowCount());
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/HyperlinkCellRenderer.java Mon Mar 19 10:46:31 2018 -0700
@@ -0,0 +1,326 @@
+/*
+ * Copyright (c) 2018, 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.
+ *
+ * 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.swingset3.demos.table;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import javax.swing.Action;
+import javax.swing.JTable;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.border.Border;
+import javax.swing.border.EmptyBorder;
+import javax.swing.table.TableCellRenderer;
+
+import com.sun.swingset3.demos.JHyperlink;
+
+/**
+ * Table renderer which renders cell value as hyperlink with optional rollover underline.
+ *
+ * @author aim
+ */
+public class HyperlinkCellRenderer extends JHyperlink implements TableCellRenderer {
+ private JTable table;
+ private final ArrayList<Integer> columnModelIndeces = new ArrayList<Integer>();
+
+ private Color rowColors[];
+ private Color foreground;
+ private Color visitedForeground;
+ private Border focusBorder;
+ private Border noFocusBorder;
+
+ private boolean underlineOnRollover = true;
+
+ private transient int hitColumnIndex = -1;
+ private transient int hitRowIndex = -1;
+
+ private HashMap<Object, int[]> visitedCache;
+
+ public HyperlinkCellRenderer(Action action, boolean underlineOnRollover) {
+ setAction(action);
+ setHorizontalAlignment(JHyperlink.LEFT);
+ rowColors = new Color[1];
+ rowColors[0] = UIManager.getColor("Table.background");
+ this.underlineOnRollover = underlineOnRollover;
+ applyDefaults();
+ }
+
+ public void setRowColors(Color[] colors) {
+ this.rowColors = colors;
+ }
+
+ public void updateUI() {
+ super.updateUI();
+ applyDefaults();
+ }
+
+ protected void applyDefaults() {
+ setOpaque(true);
+ setBorderPainted(false);
+ foreground = UIManager.getColor("Hyperlink.foreground");
+ visitedForeground = UIManager.getColor("Hyperlink.visitedForeground");
+
+ // Make sure border used on non-focussed cells is same size as focussed border
+ focusBorder = UIManager.getBorder("Table.focusCellHighlightBorder");
+ if (focusBorder != null) {
+ Insets insets = focusBorder.getBorderInsets(this);
+ noFocusBorder = new EmptyBorder(insets.top, insets.left, insets.bottom, insets.right);
+ } else {
+ focusBorder = noFocusBorder = new EmptyBorder(1, 1, 1, 1);
+ }
+ }
+
+ public Component getTableCellRendererComponent(JTable table, Object value,
+ boolean isSelected, boolean hasFocus, int row, int column) {
+ if (this.table == null) {
+ this.table = table;
+ HyperlinkMouseListener hyperlinkListener = new HyperlinkMouseListener();
+ table.addMouseMotionListener(hyperlinkListener);
+ table.addMouseListener(hyperlinkListener);
+ }
+ int columnModelIndex = table.getColumnModel().getColumn(column).getModelIndex();
+ if (!columnModelIndeces.contains(columnModelIndex)) {
+ columnModelIndeces.add(columnModelIndex);
+ }
+
+ if (value instanceof Link) {
+ Link link = (Link) value;
+ setText(link.getDisplayText());
+ setToolTipText(link.getDescription());
+ } else {
+ setText(value != null ? value.toString() : "");
+ }
+ setVisited(isCellLinkVisited(value, row, column));
+ setDrawUnderline(!underlineOnRollover ||
+ (row == hitRowIndex && column == hitColumnIndex));
+
+ if (!isSelected) {
+ setBackground(rowColors[row % rowColors.length]);
+ //setForeground(isCellLinkVisited(value, row, column)?
+ // visitedForeground : foreground);
+ setForeground(foreground);
+ setVisitedForeground(visitedForeground);
+ } else {
+ setBackground(table.getSelectionBackground());
+ setForeground(table.getSelectionForeground());
+ setVisitedForeground(table.getSelectionForeground());
+ }
+ //setBorder(hasFocus? focusBorder : noFocusBorder);
+ //System.out.println("border insets="+getBorder().getBorderInsets(this));
+
+ return this;
+ }
+
+ protected void setCellLinkVisited(Object value, int row, int column) {
+ if (!isCellLinkVisited(value, row, column)) {
+ if (value instanceof Link) {
+ ((Link) value).setVisited(true);
+ } else {
+ if (visitedCache == null) {
+ visitedCache = new HashMap<Object, int[]>();
+ }
+ int position[] = new int[2];
+ position[0] = table.convertRowIndexToModel(row);
+ position[1] = table.convertColumnIndexToModel(column);
+ visitedCache.put(value, position);
+ }
+ }
+ }
+
+ protected boolean isCellLinkVisited(Object value, int row, int column) {
+ if (value instanceof Link) {
+ return ((Link) value).isVisited();
+ }
+ if (visitedCache != null) {
+ int position[] = visitedCache.get(value);
+ if (position != null) {
+ return position[0] == table.convertRowIndexToModel(row) &&
+ position[1] == table.convertColumnIndexToModel(column);
+ }
+ }
+ return false;
+ }
+
+ public int getActiveHyperlinkRow() {
+ return hitRowIndex;
+ }
+
+ public int getActiveHyperlinkColumn() {
+ return hitColumnIndex;
+ }
+
+ // overridden because the AbstractButton's version forces the source of the event
+ // to be the AbstractButton and we want a little more freedom to configure the
+ // event
+ @Override
+ protected void fireActionPerformed(ActionEvent event) {
+ // Guaranteed to return a non-null array
+ Object[] listeners = listenerList.getListenerList();
+
+ // Process the listeners last to first, notifying
+ // those that are interested in this event
+ for (int i = listeners.length - 2; i >= 0; i -= 2) {
+ if (listeners[i] == ActionListener.class) {
+ ((ActionListener) listeners[i + 1]).actionPerformed(event);
+ }
+ }
+ }
+
+ public void invalidate() {
+ }
+
+ public void validate() {
+ }
+
+ public void revalidate() {
+ }
+
+ public void repaint(long tm, int x, int y, int width, int height) {
+ }
+
+ public void repaint(Rectangle r) {
+ }
+
+ public void repaint() {
+ }
+
+ private class HyperlinkMouseListener extends MouseAdapter {
+ private transient Rectangle cellRect;
+ private final transient Rectangle iconRect = new Rectangle();
+ private final transient Rectangle textRect = new Rectangle();
+ private transient Cursor tableCursor;
+
+ @Override
+ public void mouseMoved(MouseEvent event) {
+ // This should only be called if underlineOnRollover is true
+ JTable table = (JTable) event.getSource();
+
+ // Locate the table cell under the event location
+ int oldHitColumnIndex = hitColumnIndex;
+ int oldHitRowIndex = hitRowIndex;
+
+ checkIfPointInsideHyperlink(event.getPoint());
+
+ if (hitRowIndex != oldHitRowIndex ||
+ hitColumnIndex != oldHitColumnIndex) {
+ if (hitRowIndex != -1) {
+ if (tableCursor == null) {
+ tableCursor = table.getCursor();
+ }
+ table.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+ } else {
+ table.setCursor(tableCursor);
+ }
+
+ // repaint the cells affected by rollover
+ Rectangle repaintRect;
+ if (hitRowIndex != -1 && hitColumnIndex != -1) {
+ // we need to repaint new cell with rollover underline
+ // cellRect already contains rect of hit cell
+ if (oldHitRowIndex != -1 && oldHitColumnIndex != -1) {
+ // we also need to repaint previously underlined hyperlink cell
+ // to remove the underline
+ repaintRect = cellRect.union(
+ table.getCellRect(oldHitRowIndex, oldHitColumnIndex, false));
+ } else {
+ // we don't have a previously underlined hyperlink, so just repaint new one'
+ repaintRect = table.getCellRect(hitRowIndex, hitColumnIndex, false);
+ }
+ } else {
+ // we just need to repaint previously underlined hyperlink cell
+ //to remove the underline
+ repaintRect = table.getCellRect(oldHitRowIndex, oldHitColumnIndex, false);
+ }
+ table.repaint(repaintRect);
+ }
+
+ }
+
+ @Override
+ public void mouseClicked(MouseEvent event) {
+ if (checkIfPointInsideHyperlink(event.getPoint())) {
+
+ ActionEvent actionEvent = new ActionEvent(new Integer(hitRowIndex),
+ ActionEvent.ACTION_PERFORMED,
+ "hyperlink");
+
+ HyperlinkCellRenderer.this.fireActionPerformed(actionEvent);
+
+ setCellLinkVisited(table.getValueAt(hitRowIndex, hitColumnIndex),
+ hitRowIndex, hitColumnIndex);
+
+ }
+ }
+
+ protected boolean checkIfPointInsideHyperlink(Point p) {
+ hitColumnIndex = table.columnAtPoint(p);
+ hitRowIndex = table.rowAtPoint(p);
+
+ if (hitColumnIndex != -1 && hitRowIndex != -1 &&
+ columnModelIndeces.contains(table.getColumnModel().
+ getColumn(hitColumnIndex).getModelIndex())) {
+ // We know point is within a hyperlink column, however we do further hit testing
+ // to see if point is within the text bounds on the hyperlink
+ TableCellRenderer renderer = table.getCellRenderer(hitRowIndex, hitColumnIndex);
+ JHyperlink hyperlink = (JHyperlink) table.prepareRenderer(renderer, hitRowIndex, hitColumnIndex);
+
+ // Convert the event to the renderer's coordinate system
+ cellRect = table.getCellRect(hitRowIndex, hitColumnIndex, false);
+ hyperlink.setSize(cellRect.width, cellRect.height);
+ p.translate(-cellRect.x, -cellRect.y);
+ cellRect.x = cellRect.y = 0;
+ iconRect.x = iconRect.y = iconRect.width = iconRect.height = 0;
+ textRect.x = textRect.y = textRect.width = textRect.height = 0;
+ SwingUtilities.layoutCompoundLabel(
+ hyperlink.getFontMetrics(hyperlink.getFont()),
+ hyperlink.getText(), hyperlink.getIcon(),
+ hyperlink.getVerticalAlignment(),
+ hyperlink.getHorizontalAlignment(),
+ hyperlink.getVerticalTextPosition(),
+ hyperlink.getHorizontalTextPosition(),
+ cellRect, iconRect, textRect, hyperlink.getIconTextGap());
+
+ if (textRect.contains(p)) {
+ // point is within hyperlink text bounds
+ return true;
+ }
+ }
+ // point is not within a hyperlink's text bounds
+ hitRowIndex = -1;
+ hitColumnIndex = -1;
+ return false;
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/IMDBLink.java Mon Mar 19 10:46:31 2018 -0700
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2018, 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.
+ *
+ * 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.swingset3.demos.table;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+
+/**
+ * Class used to support converting a movie title string into an IMDB URI
+ * corresponding to that movie's IMDB entry. Since IMDB encodes entries with
+ * an alpha-numeric key (rather than title), we have to use Yahoo search on the
+ * title and then screenscrape the search results to find the IMDB key.
+ *
+ * @author aim
+ */
+public class IMDBLink {
+
+ private IMDBLink() {
+ }
+
+ /**
+ * @param movieTitle the title of the movie
+ * @param year the year the movie was nominated for the oscar
+ * @return String containing URI for movie's IMDB entry or null if URI could not be found
+ */
+ public static String getMovieURIString(String movieTitle, int year) throws IOException {
+ ArrayList<String> matches = new ArrayList<String>();
+ URL url;
+ BufferedReader reader;
+
+ // btw, google rejects the request with a 403 return code!
+ // URL url = new URL("http://www.google.com/search?q=Dazed+and+confused");
+ // Thank you, yahoo, for granting our search request :-)
+ try {
+ String urlKey = URLEncoder.encode(movieTitle, "UTF-8");
+ url = new URL("http://search.yahoo.com/search?ei=utf-8&fr=sfp&p=imdb+" +
+ urlKey + "&iscqry=");
+ } catch (Exception ex) {
+ System.err.println(ex);
+
+ return null;
+ }
+
+ URLConnection conn = url.openConnection();
+ conn.connect();
+
+ // Get the response from Yahoo search query
+ reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+
+ // Parse response a find each imdb/titleString result
+ String line;
+ String imdbString = ".imdb.com";
+ String titleStrings[] = {"/title", "/Title"};
+
+ while ((line = reader.readLine()) != null) {
+ for (String titleString : titleStrings) {
+ String scrapeKey = imdbString + titleString;
+ int index = line.indexOf(scrapeKey);
+ if (index != -1) {
+ // The IMDB key looks something like "tt0032138"
+ // so we look for the 9 characters after the scrape key
+ // to construct the full IMDB URI.
+ // e.g. http://www.imdb.com/title/tt0032138
+ int len = scrapeKey.length();
+ String imdbURL = "http://www" +
+ line.substring(index, index + len) +
+ line.substring(index + len, index + len + 10);
+
+ if (!matches.contains(imdbURL)) {
+ matches.add(imdbURL);
+ }
+ }
+ }
+ }
+ reader.close();
+
+ // Since imdb contains entries for multiple movies of the same titleString,
+ // use the year to find the right entry
+ if (matches.size() > 1) {
+ for (String matchURL : matches) {
+ if (verifyYear(matchURL, year)) {
+ return matchURL;
+ }
+ }
+ }
+ return matches.isEmpty()? null : matches.get(0);
+ }
+
+
+ private static boolean verifyYear(String imdbURL, int movieYear) throws IOException {
+ boolean yearMatches = false;
+
+ URLConnection conn = new URL(imdbURL).openConnection();
+ conn.connect();
+
+ // Get the response
+ BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+
+ String line;
+ while ((line = reader.readLine()) != null) {
+ int index = line.indexOf("</title>");
+ if (index != -1) {
+ // looking for "<title>movie title (YEAR)</title>"
+ try {
+ int year = Integer.parseInt(line.substring(index - 5, index - 1));
+ // Movie may have been made the year prior to oscar award
+ yearMatches = year == movieYear || year == movieYear - 1;
+
+ } catch (NumberFormatException ex) {
+ // ignore title lines that have other formatting
+ }
+ break; // only interested in analyzing the one line
+ }
+ }
+ reader.close();
+
+ return yearMatches;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/Link.java Mon Mar 19 10:46:31 2018 -0700
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2018, 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.
+ *
+ * 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.swingset3.demos.table;
+
+import java.net.URI;
+
+/**
+ * Class representing the state of a hyperlink
+ * This class may be used in conjunction with HyperlinkCellRenderer,
+ * but it is not required.
+ *
+ * @author aim
+ */
+public class Link {
+ protected String displayText;
+ private URI uri;
+ private String description;
+ private boolean visited;
+
+ /**
+ * Creates a new instance of Link
+ */
+ public Link(String text) {
+ setDisplayText(text);
+ }
+
+ public Link(String text, URI uri) {
+ this(text);
+ setUri(uri);
+ }
+
+ public String getDisplayText() {
+ return displayText;
+ }
+
+ public void setDisplayText(String text) {
+ this.displayText = text;
+ }
+
+ public URI getUri() {
+ return uri;
+ }
+
+ public void setUri(URI uri) {
+ this.uri = uri;
+ }
+
+ public String getDescription() {
+ return description != null ? description :
+ uri != null ? uri.getPath() : null;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public boolean isVisited() {
+ return visited;
+ }
+
+ public void setVisited(boolean visited) {
+ this.visited = visited;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/OscarCandidate.java Mon Mar 19 10:46:31 2018 -0700
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2018, 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.
+ *
+ * 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.swingset3.demos.table;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *
+ * @author aim
+ */
+public class OscarCandidate {
+
+ private String category;
+ private Integer year;
+ private boolean winner = false;
+ private String movie;
+ private URI imdbURI;
+ private final ArrayList<String> persons = new ArrayList<String>();
+
+ /**
+ * Creates a new instance of OscarCandidate
+ */
+ public OscarCandidate(String category) {
+ this.category = category;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public Integer getYear() {
+ return year;
+ }
+
+ public void setYear(Integer year) {
+ this.year = year;
+ }
+
+ public boolean isWinner() {
+ return winner;
+ }
+
+ public void setWinner(boolean winner) {
+ this.winner = winner;
+ }
+
+ public String getMovieTitle() {
+ return movie;
+ }
+
+ public void setMovieTitle(String movie) {
+ this.movie = movie;
+ }
+
+ public URI getIMDBMovieURI() {
+ return imdbURI;
+ }
+
+ public void setIMDBMovieURI(URI uri) {
+ this.imdbURI = uri;
+ }
+
+ public List<String> getPersons() {
+ return persons;
+ }
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/OscarCellRenderers.java Mon Mar 19 10:46:31 2018 -0700
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2018, 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.
+ *
+ * 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.swingset3.demos.table;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Font;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.swing.Action;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JTable;
+import javax.swing.UIManager;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableModel;
+
+/**
+ *
+ * @author aim
+ */
+public class OscarCellRenderers {
+
+ //<snip>Render table rows with alternating colors
+ public static class RowRenderer extends DefaultTableCellRenderer {
+ private Color rowColors[];
+
+ public RowRenderer() {
+ // initialize default colors from look-and-feel
+ rowColors = new Color[1];
+ rowColors[0] = UIManager.getColor("Table.background");
+ }
+
+ public RowRenderer(Color colors[]) {
+ super();
+ setRowColors(colors);
+ }
+
+ public void setRowColors(Color colors[]) {
+ rowColors = colors;
+ }
+
+ public Component getTableCellRendererComponent(JTable table, Object value,
+ boolean isSelected, boolean hasFocus, int row, int column) {
+ super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+ setText(value != null ? value.toString() : "unknown");
+ if (!isSelected) {
+ setBackground(rowColors[row % rowColors.length]);
+ }
+ return this;
+ }
+
+ public boolean isOpaque() {
+ return true;
+ }
+ }
+ //<snip>
+
+ //<snip>Render "year" table column with font representing style of decade
+ // currently only used on OS X because fonts are Mac centric.
+
+ public static class YearRenderer extends RowRenderer {
+ private HashMap<String, Font> eraFonts;
+
+ public YearRenderer() {
+ setHorizontalAlignment(JLabel.CENTER);
+
+ if (System.getProperty("os.name").equals("Mac OS X")) {
+ eraFonts = new HashMap<String, Font>();
+ eraFonts.put("192"/*1920's*/, new Font("Jazz LET", Font.PLAIN, 12));
+ eraFonts.put("193"/*1930's*/, new Font("Mona Lisa Solid ITC TT", Font.BOLD, 18));
+ eraFonts.put("194"/*1940's*/, new Font("American Typewriter", Font.BOLD, 12));
+ eraFonts.put("195"/*1950's*/, new Font("Britannic Bold", Font.PLAIN, 12));
+ eraFonts.put("196"/*1960's*/, new Font("Cooper Black", Font.PLAIN, 14));
+ eraFonts.put("197"/*1970's*/, new Font("Syncro LET", Font.PLAIN, 14));
+ eraFonts.put("198"/*1980's*/, new Font("Mistral", Font.PLAIN, 18));
+ eraFonts.put("199"/*1990's*/, new Font("Papyrus", Font.BOLD, 14));
+ eraFonts.put("200"/*2000's*/, new Font("Calisto MT", Font.PLAIN, 14));
+ }
+ }
+
+ public YearRenderer(Color colors[]) {
+ this();
+ setRowColors(colors);
+ }
+
+ public Component getTableCellRendererComponent(JTable table, Object value,
+ boolean isSelected, boolean hasFocus, int row, int column) {
+
+ super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+
+ String year = table.getValueAt(row,
+ table.convertColumnIndexToView(OscarTableModel.YEAR_COLUMN)).toString();
+ if (eraFonts != null && year != null && year.length() == 4) {
+ String era = year.substring(0, 3);
+ Font eraFont = eraFonts.get(era);
+ setFont(eraFont);
+ }
+ return this;
+ }
+ }
+ //</snip>
+
+ //<snip>Render "nominee" table column with special icon for winners
+
+ public static class NomineeRenderer extends RowRenderer {
+ private final ImageIcon winnerIcon;
+ private final ImageIcon nomineeIcon; // nice way of saying "loser" :)
+
+ public NomineeRenderer() {
+ winnerIcon = new ImageIcon(
+ getClass().getResource("resources/images/goldstar.png"));
+ nomineeIcon = new ImageIcon(
+ getClass().getResource("resources/images/nominee.png"));
+ setHorizontalTextPosition(JLabel.TRAILING);
+ }
+
+ public NomineeRenderer(Color colors[]) {
+ this();
+ setRowColors(colors);
+ }
+
+ public Component getTableCellRendererComponent(JTable table, Object value,
+ boolean isSelected, boolean hasFocus, int row, int column) {
+
+ super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+
+ TableModel model = table.getModel();
+ boolean winner = ((Boolean) model.getValueAt(table.convertRowIndexToModel(row),
+ OscarTableModel.WINNER_COLUMN)).booleanValue();
+
+ List<String> persons = (List<String>) value;
+ String text = persons != null && !persons.isEmpty() ? persons.get(0) : "name unknown";
+ if (persons != null && persons.size() > 1) {
+ int personCount = persons.size();
+ setText(text + " + more...");
+ StringBuffer winners = new StringBuffer("");
+ for (int i = 0; i < personCount; i++) {
+ String person = persons.get(i);
+ winners.append(" " + person + (i < personCount - 1 ? ", " : ""));
+ }
+ setToolTipText((winner ? "Winners:" : "Nominees:") + winners);
+ } else {
+ setText(text);
+ setToolTipText(winner ? "Winner!" : "Nominee");
+ }
+
+ setIcon(winner ? winnerIcon : nomineeIcon);
+
+ return this;
+ }
+ }
+ //</snip>
+
+ public static class MovieRenderer extends HyperlinkCellRenderer {
+ public MovieRenderer(Action action, boolean underlineOnRollover, Color rowColors[]) {
+ super(action, underlineOnRollover);
+ setRowColors(rowColors);
+ }
+
+ public Component getTableCellRendererComponent(JTable table, Object value,
+ boolean isSelected, boolean hasFocus, int row, int column) {
+ super.getTableCellRendererComponent(table, value, isSelected,
+ hasFocus, row, column);
+ if (value != null) {
+ setToolTipText("http://www.imdb.com/" + "\"" + value + "\"");
+ }
+ return this;
+ }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/OscarDataParser.java Mon Mar 19 10:46:31 2018 -0700
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 2018, 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.
+ *
+ * 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.swingset3.demos.table;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.logging.Level;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public abstract class OscarDataParser extends DefaultHandler {
+ private static final String[] CATEGORIES_IN = {
+ "actor", "actress", "bestPicture",
+ "actorSupporting", "actressSupporting", "artDirection",
+ "assistantDirector", "director", "cinematography",
+ "costumeDesign", "danceDirection", "docFeature",
+ "docShort", "filmEditing", "foreignFilm",
+ "makeup", "musicScore", "musicSong",
+ "screenplayAdapted", "screenplayOriginal", "shortAnimation",
+ "shortLiveAction", "sound", "soundEditing",
+ "specialEffects", "visualEffects", "writing",
+ "engEffects", "uniqueArtisticPicture"
+ };
+
+ private static final String[] CATEGORIES_OUT = {
+ "Best Actor", "Best Actress", "Best Picture",
+ "Best Supporting Actor", "Best Supporting Actress", "Best Art Direction",
+ "Best Assistant Director", "Best Director", "Best Cinematography",
+ "Best Costume Design", "Best Dance Direction", "Best Feature Documentary",
+ "Best Short Documentary", "Best Film Editing", "Best Foreign Film",
+ "Best Makeup", "Best Musical Score", "Best Song",
+ "Best Adapted Screenplay", "Best Original Screenplay", "Best Animation Short",
+ "Best Live Action Short", "Best Sound", "Best Sound Editing",
+ "Best Special Effects", "Best Visual Effects", "Best Engineering Effects",
+ "Best Writing", "Most Unique Artistic Picture"
+ };
+
+
+ private String tempVal;
+
+ //to maintain context
+ private OscarCandidate tempOscarCandidate;
+
+ private int count = 0;
+
+ public int getCount() {
+ return count;
+ }
+
+ public void parseDocument(URL oscarURL) {
+ //get a factory
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+
+ try {
+ //get a new instance of parser
+ SAXParser sp = spf.newSAXParser();
+
+ //parse the file and also register this class for call backs
+ InputStream is = new BufferedInputStream(oscarURL.openStream());
+ sp.parse(is, this);
+ System.out.println("done parsing count="+count);
+ is.close();
+
+ } catch (SAXException se) {
+ se.printStackTrace();
+ } catch (ParserConfigurationException pce) {
+ pce.printStackTrace();
+ } catch (IOException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ //Event Handlers
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ //reset
+ tempVal = "";
+ for (int i = 0; i < CATEGORIES_IN.length; i++) {
+ if (qName.equalsIgnoreCase(CATEGORIES_IN[i])) {
+ tempOscarCandidate = new OscarCandidate(CATEGORIES_OUT[i]);
+ tempOscarCandidate.setYear(Integer.parseInt(attributes.getValue("year")));
+ if (CATEGORIES_IN[i].equals("screenplayOriginal") &&
+ tempOscarCandidate.getYear() == 2007) {
+ }
+ return;
+ }
+ }
+ }
+
+ public void characters(char[] ch, int start, int length) throws SAXException {
+ tempVal = new String(ch, start, length);
+ }
+
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+ if (qName.equalsIgnoreCase("won")) {
+ tempOscarCandidate.setWinner(true);
+ } else if (qName.equalsIgnoreCase("lost")) {
+ tempOscarCandidate.setWinner(false);
+ } else if (qName.equalsIgnoreCase("movie")) {
+ tempOscarCandidate.setMovieTitle(tempVal);
+ } else if (qName.equalsIgnoreCase("person")) {
+ tempOscarCandidate.getPersons().add(tempVal);
+ } else {
+ // find category
+ for (String category : CATEGORIES_IN) {
+ if (qName.equalsIgnoreCase(category)) {
+ //add it to the list
+ count++;
+ addCandidate(tempOscarCandidate);
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void error(SAXParseException ex) throws SAXException {
+ TableDemo.logger.log(Level.SEVERE, "error parsing oscar data ", ex);
+ }
+
+ @Override
+ public void fatalError(SAXParseException ex) throws SAXException {
+ TableDemo.logger.log(Level.SEVERE, "fatal error parsing oscar data ", ex);
+ }
+
+ @Override
+ public void warning(SAXParseException ex) {
+ TableDemo.logger.log(Level.WARNING, "warning occurred while parsing oscar data ", ex);
+ }
+
+ @Override
+ public void endDocument() throws SAXException {
+ TableDemo.logger.log(Level.FINER, "parsed to end of oscar data.");
+ }
+
+ protected abstract void addCandidate(OscarCandidate candidate);
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/OscarTableModel.java Mon Mar 19 10:46:31 2018 -0700
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2018, 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.
+ *
+ * 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.swingset3.demos.table;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.table.AbstractTableModel;
+
+/**
+ * Data model for oscar candidate data: a list of OscarCandidate beans.
+ *
+ * @author aim
+ */
+
+public class OscarTableModel extends AbstractTableModel {
+ public static final int CATEGORY_COLUMN = 0;
+ public static final int YEAR_COLUMN = 1;
+ public static final int WINNER_COLUMN = 2;
+ public static final int MOVIE_COLUMN = 3;
+ public static final int PERSONS_COLUMN = 4;
+ public static final int COLUMN_COUNT = 5;
+
+ private final List<OscarCandidate> candidates = new ArrayList<OscarCandidate>();
+
+ public void add(List<OscarCandidate> newCandidates) {
+ int first = candidates.size();
+ int last = first + newCandidates.size() - 1;
+ candidates.addAll(newCandidates);
+ fireTableRowsInserted(first, last);
+ }
+
+ public void add(OscarCandidate candidate) {
+ int index = candidates.size();
+ candidates.add(candidate);
+ fireTableRowsInserted(index, index);
+ }
+
+ public int getRowCount() {
+ return candidates.size();
+ }
+
+ public int getColumnCount() {
+ return COLUMN_COUNT;
+ }
+
+ @Override
+ public Class getColumnClass(int column) {
+ return getValueAt(0, column).getClass();
+ }
+
+ public OscarCandidate getCandidate(int row) {
+ return candidates.get(row);
+ }
+
+ public Object getValueAt(int row, int column) {
+ OscarCandidate oscarCandidate = candidates.get(row);
+ switch (column) {
+ case CATEGORY_COLUMN:
+ return oscarCandidate.getCategory();
+ case YEAR_COLUMN:
+ return oscarCandidate.getYear();
+ case MOVIE_COLUMN:
+ return oscarCandidate.getMovieTitle();
+ case WINNER_COLUMN:
+ return oscarCandidate.isWinner() ? Boolean.TRUE : Boolean.FALSE;
+ case PERSONS_COLUMN:
+ return oscarCandidate.getPersons();
+ }
+ return null;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/TableDemo.java Mon Mar 19 10:46:31 2018 -0700
@@ -0,0 +1,623 @@
+/*
+ * Copyright (c) 2018, 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.
+ *
+ * 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.swingset3.demos.table;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.regex.Pattern;
+
+import javax.swing.AbstractAction;
+import javax.swing.Box;
+import javax.swing.JCheckBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JProgressBar;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.ListSelectionModel;
+import javax.swing.RowFilter;
+import javax.swing.UIManager;
+import javax.swing.border.CompoundBorder;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.DefaultTableColumnModel;
+import javax.swing.table.JTableHeader;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumn;
+import javax.swing.table.TableColumnModel;
+import javax.swing.table.TableRowSorter;
+import javax.swing.text.Document;
+
+import com.sun.swingset3.DemoProperties;
+import com.sun.swingset3.demos.DemoUtilities;
+
+/**
+ *
+ * @author aim
+ */
+@DemoProperties(
+ value = "JTable Demo",
+ category = "Data",
+ description = "Demonstrates use of Swing's data grid component, JTable, including asynchronous loading and sorting/filtering.",
+ sourceFiles = {
+ "com/sun/swingset3/demos/table/TableDemo.java",
+ "com/sun/swingset3/demos/table/HyperlinkCellRenderer.java",
+ "com/sun/swingset3/demos/table/IMDBLink.java",
+ "com/sun/swingset3/demos/table/Link.java",
+ "com/sun/swingset3/demos/table/OscarCandidate.java",
+ "com/sun/swingset3/demos/table/OscarCellRenderers.java",
+ "com/sun/swingset3/demos/table/OscarDataParser.java",
+ "com/sun/swingset3/demos/table/OscarTableModel.java",
+ "com/sun/swingset3/demos/DemoUtilities.java",
+ "com/sun/swingset3/demos/JHyperlink.java",
+ "com/sun/swingset3/demos/table/resources/bestpicture",
+ //"com/sun/swingset3/demos/table/resources/oscars.xml", file too large!!
+ "com/sun/swingset3/demos/table/resources/TableDemo.properties",
+ "com/sun/swingset3/demos/table/resources/images/goldstar.png",
+ "com/sun/swingset3/demos/table/resources/images/nominee.png",
+ "com/sun/swingset3/demos/table/resources/images/TableDemo.gif"
+ }
+)
+public class TableDemo extends JPanel {
+ static final Logger logger = Logger.getLogger(TableDemo.class.getName());
+ public static final String DEMO_TITLE = TableDemo.class.getAnnotation(DemoProperties.class).value();
+ public static final int ROW_HEIGHT = 26;
+ public static final String COLUMN1_NAME = "Year";
+ public static final String COLUMN2_NAME = "Award Category";
+ public static final String COLUMN3_NAME = "Movie Title";
+ public static final String COLUMN4_NAME = "Nominees";
+
+ private OscarTableModel oscarModel;
+
+ private JPanel controlPanel;
+ private JTable oscarTable;
+ private JCheckBox winnersCheckbox;
+ private JTextField filterField;
+ private Box statusBarLeft;
+ private JLabel actionStatus;
+ private JLabel tableStatus;
+
+ private Color[] rowColors;
+ private String statusLabelString;
+ private String searchLabelString;
+
+ private boolean showOnlyWinners = false;
+ private String filterString = null;
+
+ private TableRowSorter sorter;
+ private RowFilter<OscarTableModel, Integer> winnerFilter;
+ private RowFilter<OscarTableModel, Integer> searchFilter;
+
+ // Resource bundle for internationalized and accessible text
+ private ResourceBundle bundle = null;
+
+ public TableDemo() {
+ initModel();
+ initComponents();
+ initSortingFiltering();
+ }
+
+ protected void initModel() {
+ oscarModel = new OscarTableModel();
+ }
+
+ protected void initComponents() {
+ setLayout(new BorderLayout());
+
+ controlPanel = createControlPanel();
+ add(controlPanel, BorderLayout.NORTH);
+
+ //<snip>Create JTable
+ oscarTable = new JTable(oscarModel);
+ //</snip>
+
+ //</snip>Set JTable display properties
+ oscarTable.setColumnModel(createColumnModel());
+ oscarTable.setAutoCreateRowSorter(true);
+ oscarTable.setRowHeight(ROW_HEIGHT);
+ oscarTable.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
+ oscarTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ oscarTable.setIntercellSpacing(new Dimension(0, 0));
+ //</snip>
+
+ //<snip>Initialize preferred size for table's viewable area
+ Dimension viewSize = new Dimension();
+ viewSize.width = oscarTable.getColumnModel().getTotalColumnWidth();
+ viewSize.height = 10 * oscarTable.getRowHeight();
+ oscarTable.setPreferredScrollableViewportSize(viewSize);
+ //</snip>
+
+ //<snip>Customize height and alignment of table header
+ JTableHeader header = oscarTable.getTableHeader();
+ header.setPreferredSize(new Dimension(30, 26));
+ TableCellRenderer headerRenderer = header.getDefaultRenderer();
+ if (headerRenderer instanceof JLabel) {
+ ((JLabel) headerRenderer).setHorizontalAlignment(JLabel.CENTER);
+ }
+ //</snip>
+
+ JScrollPane scrollpane = new JScrollPane(oscarTable);
+ add(scrollpane, BorderLayout.CENTER);
+
+ add(createStatusBar(), BorderLayout.SOUTH);
+
+ }
+
+ protected JPanel createControlPanel() {
+ JPanel controlPanel = new JPanel();
+ GridBagLayout gridbag = new GridBagLayout();
+ GridBagConstraints c = new GridBagConstraints();
+ controlPanel.setLayout(gridbag);
+
+ c.gridx = 0;
+ c.gridy = 1;
+ c.gridheight = 1;
+ c.insets = new Insets(20, 10, 0, 10);
+ c.anchor = GridBagConstraints.SOUTHWEST;
+ JLabel searchLabel = new JLabel(getString("TableDemo.searchLabel",
+ "Search Titles and Recipients"));
+ controlPanel.add(searchLabel, c);
+
+ c.gridx = 0;
+ c.gridy = 2;
+ c.weightx = 1.0;
+ c.insets.top = 0;
+ c.insets.bottom = 12;
+ c.anchor = GridBagConstraints.SOUTHWEST;
+ //c.fill = GridBagConstraints.HORIZONTAL;
+ filterField = new JTextField(24);
+ filterField.getDocument().addDocumentListener(new SearchFilterListener());
+ controlPanel.add(filterField, c);
+
+ c.gridx = 1;
+ c.gridy = 2;
+ c.gridwidth = GridBagConstraints.REMAINDER;
+ //c.insets.right = 24;
+ //c.insets.left = 12;
+ c.weightx = 0.0;
+ c.anchor = GridBagConstraints.EAST;
+ c.fill = GridBagConstraints.NONE;
+ winnersCheckbox = new JCheckBox(getString("TableDemo.winnersLabel",
+ "Show Only Winners"));
+ winnersCheckbox.addChangeListener(new ShowWinnersListener());
+ controlPanel.add(winnersCheckbox, c);
+
+ return controlPanel;
+ }
+
+ protected Container createStatusBar() {
+ statusLabelString = getString("TableDemo.rowCountLabel",
+ "Showing ");
+ searchLabelString = getString("TableDemo.searchCountLabel",
+ "Search found ");
+
+ Box statusBar = Box.createHorizontalBox();
+
+ // Left status area
+ statusBar.add(Box.createRigidArea(new Dimension(10, 22)));
+ statusBarLeft = Box.createHorizontalBox();
+ statusBar.add(statusBarLeft);
+ actionStatus = new JLabel(getString("TableDemo.noDataStatusLabel",
+ "No data loaded"));
+ actionStatus.setHorizontalAlignment(JLabel.LEADING);
+ statusBarLeft.add(actionStatus);
+
+ // Middle (should stretch)
+ statusBar.add(Box.createHorizontalGlue());
+ statusBar.add(Box.createHorizontalGlue());
+ statusBar.add(Box.createVerticalGlue());
+
+ // Right status area
+ tableStatus = new JLabel(statusLabelString + "0");
+ statusBar.add(tableStatus);
+ statusBar.add(Box.createHorizontalStrut(12));
+
+ //<snip>Track number of rows currently displayed
+ oscarModel.addTableModelListener(new TableModelListener() {
+ public void tableChanged(TableModelEvent e) {
+ // Get rowCount from *table*, not model, as the view row count
+ // may be different from the model row count due to filtering
+ tableStatus.setText((hasFilterString() ? searchLabelString : statusLabelString) +
+ oscarTable.getRowCount());
+ }
+ });
+ //</snip>
+
+ return statusBar;
+ }
+
+ private Color[] getTableRowColors() {
+ if (rowColors == null) {
+ rowColors = new Color[2];
+ rowColors[0] = UIManager.getColor("Table.background");
+ rowColors[1] = new Color((int) (rowColors[0].getRed() * .9),
+ (int) (rowColors[0].getGreen() * .9),
+ (int) (rowColors[0].getBlue() * .9));
+ }
+ return rowColors;
+ }
+
+ // returns appropriate string from resource bundle
+ protected String getString(String key, String fallback) {
+ String value = fallback;
+ if (bundle == null) {
+ String bundleName = getClass().getPackage().getName() + ".resources." + getClass().getSimpleName();
+ bundle = ResourceBundle.getBundle(bundleName);
+ }
+ try {
+ value = bundle != null ? bundle.getString(key) : key;
+
+ } catch (MissingResourceException ex) {
+ logger.log(Level.WARNING, "couldn't find resource value for: " + key, ex);
+ }
+ return value;
+ }
+
+ public void start() {
+ if (oscarModel.getRowCount() == 0) {
+ loadData("resources/oscars.xml");
+ }
+ }
+
+ //<snip>Initialize table columns
+ protected TableColumnModel createColumnModel() {
+ DefaultTableColumnModel columnModel = new DefaultTableColumnModel();
+
+ TableCellRenderer cellRenderer = new OscarCellRenderers.RowRenderer(getTableRowColors());
+
+ TableColumn column = new TableColumn();
+ column.setModelIndex(OscarTableModel.YEAR_COLUMN);
+ column.setHeaderValue(COLUMN1_NAME);
+ column.setPreferredWidth(26);
+ column.setCellRenderer(new OscarCellRenderers.YearRenderer(getTableRowColors()));
+ columnModel.addColumn(column);
+
+ column = new TableColumn();
+ column.setModelIndex(OscarTableModel.CATEGORY_COLUMN);
+ column.setHeaderValue(COLUMN2_NAME);
+ column.setPreferredWidth(100);
+ column.setCellRenderer(cellRenderer);
+ columnModel.addColumn(column);
+
+ column = new TableColumn();
+ column.setModelIndex(OscarTableModel.MOVIE_COLUMN);
+ column.setHeaderValue(COLUMN3_NAME);
+ column.setPreferredWidth(180);
+ column.setCellRenderer(cellRenderer);
+ columnModel.addColumn(column);
+
+ column = new TableColumn();
+ column.setModelIndex(OscarTableModel.PERSONS_COLUMN);
+ column.setHeaderValue(COLUMN4_NAME);
+ column.setPreferredWidth(120);
+ column.setCellRenderer(new OscarCellRenderers.NomineeRenderer(getTableRowColors()));
+ columnModel.addColumn(column);
+
+ return columnModel;
+ }
+ //</snip>
+
+ protected void initSortingFiltering() {
+ //<snip>Setup filtering for winners
+ sorter = new TableRowSorter(oscarModel);
+ oscarTable.setRowSorter(sorter);
+ winnerFilter = new RowFilter<OscarTableModel, Integer>() {
+ public boolean include(Entry<? extends OscarTableModel, ? extends Integer> entry) {
+ OscarTableModel oscarModel = entry.getModel();
+ OscarCandidate candidate = oscarModel.getCandidate(entry.getIdentifier().intValue());
+ if (candidate.isWinner()) {
+ // Returning true indicates this row should be shown.
+ return true;
+ }
+ // loser
+ return false;
+ }
+ };
+ //</snip>
+
+ //<snip>Setup search filter
+ searchFilter = new RowFilter<OscarTableModel, Integer>() {
+ public boolean include(Entry<? extends OscarTableModel, ? extends Integer> entry) {
+ OscarTableModel oscarModel = entry.getModel();
+ OscarCandidate candidate = oscarModel.getCandidate(entry.getIdentifier().intValue());
+ boolean matches = false;
+ Pattern p = Pattern.compile(filterString + ".*", Pattern.CASE_INSENSITIVE);
+
+ String movie = candidate.getMovieTitle();
+ if (movie != null) {
+ if (movie.startsWith("The ")) {
+ movie = movie.replace("The ", "");
+ } else if (movie.startsWith("A ")) {
+ movie = movie.replace("A ", "");
+ }
+ // Returning true indicates this row should be shown.
+ matches = p.matcher(movie).matches();
+ }
+ List<String> persons = candidate.getPersons();
+ for (String person : persons) {
+ if (p.matcher(person).matches()) {
+ matches = true;
+ }
+ }
+ return matches;
+ }
+ };
+ //</snip>
+ }
+
+ public void setShowOnlyWinners(boolean showOnlyWinners) {
+ boolean oldShowOnlyWinners = this.showOnlyWinners;
+ this.showOnlyWinners = showOnlyWinners;
+ configureFilters();
+ tableStatus.setText(statusLabelString + oscarTable.getRowCount());
+ firePropertyChange("showOnlyWinners", oldShowOnlyWinners, showOnlyWinners);
+ }
+
+ public boolean getShowOnlyWinners() {
+ return showOnlyWinners;
+ }
+
+ public void setFilterString(String filterString) {
+ String oldFilterString = this.filterString;
+ this.filterString = filterString;
+ configureFilters();
+ firePropertyChange("filterString", oldFilterString, filterString);
+ }
+
+ protected boolean hasFilterString() {
+ return filterString != null && !filterString.equals("");
+ }
+
+ protected void configureFilters() {
+ if (showOnlyWinners && hasFilterString()) {
+ List<RowFilter<OscarTableModel, Integer>> filters =
+ new ArrayList<RowFilter<OscarTableModel, Integer>>(2);
+ filters.add(winnerFilter);
+ filters.add(searchFilter);
+ RowFilter<OscarTableModel, Integer> comboFilter = RowFilter.andFilter(filters);
+ sorter.setRowFilter(comboFilter);
+ } else if (showOnlyWinners) {
+ sorter.setRowFilter(winnerFilter);
+ } else if (hasFilterString()) {
+ sorter.setRowFilter(searchFilter);
+ } else {
+ sorter.setRowFilter(null);
+ }
+ tableStatus.setText((hasFilterString() ? searchLabelString : statusLabelString)
+ + oscarTable.getRowCount());
+
+ }
+
+ private class ShowWinnersListener implements ChangeListener {
+ public void stateChanged(ChangeEvent event) {
+ setShowOnlyWinners(winnersCheckbox.isSelected());
+ }
+ }
+
+ //<snip>Setup search filter
+ protected class SearchFilterListener implements DocumentListener {
+ protected void changeFilter(DocumentEvent event) {
+ Document document = event.getDocument();
+ try {
+ setFilterString(document.getText(0, document.getLength()));
+
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ System.err.println(ex);
+ }
+ }
+
+ public void changedUpdate(DocumentEvent e) {
+ changeFilter(e);
+ }
+
+ public void insertUpdate(DocumentEvent e) {
+ changeFilter(e);
+ }
+
+ public void removeUpdate(DocumentEvent e) {
+ changeFilter(e);
+ }
+ }
+ //</snip>
+
+ //<snip>Use SwingWorker to asynchronously load the data
+
+ public void loadData(String dataPath) {
+ // create SwingWorker which will load the data on a separate thread
+ OscarDataLoader loader = new OscarDataLoader(
+ TableDemo.class.getResource(dataPath), oscarModel);
+
+ actionStatus.setText(getString("TableDemo.loadingStatusLabel",
+ "Loading data: "));
+
+ // display progress bar while data loads
+ final JProgressBar progressBar = new JProgressBar();
+ statusBarLeft.add(progressBar);
+ loader.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ if (event.getPropertyName().equals("progress")) {
+ int progress = ((Integer) event.getNewValue()).intValue();
+ progressBar.setValue(progress);
+
+ if (progress == 100) {
+ statusBarLeft.remove(progressBar);
+ actionStatus.setText("");
+ revalidate();
+ }
+ }
+ }
+ });
+ loader.execute();
+
+ }
+ //</snip>
+
+ protected void showMessage(String title, String message) {
+ JOptionPane.showMessageDialog(this, message, title, JOptionPane.INFORMATION_MESSAGE);
+ }
+
+ //<snip>Use SwingWorker to asynchronously load the data
+ private class OscarDataLoader extends javax.swing.SwingWorker<List<OscarCandidate>, OscarCandidate> {
+ private final URL oscarData;
+ private final OscarTableModel oscarModel;
+ private final List<OscarCandidate> candidates = new ArrayList<OscarCandidate>();
+ private JLabel credits;
+
+ private OscarDataLoader(URL oscarURL, OscarTableModel oscarTableModel) {
+ this.oscarData = oscarURL;
+ this.oscarModel = oscarTableModel;
+ }
+
+ @Override
+ public List<OscarCandidate> doInBackground() {
+ OscarDataParser parser = new OscarDataParser() {
+ @Override
+ protected void addCandidate(OscarCandidate candidate) {
+ candidates.add(candidate);
+ if (candidates.size() % 3 == 0) {
+ try { // slow it down so we can see progress :-)
+ Thread.sleep(1);
+ } catch (Exception ex) {
+ }
+ }
+ publish(candidate);
+ setProgress(100 * candidates.size() / 524);
+ }
+ };
+ parser.parseDocument(oscarData);
+ return candidates;
+ }
+
+ // for OS X older Java 6
+ /*
+ protected void process(List<OscarCandidate>... moreCandidates) {
+ for(List<OscarCandidate> newCandidates: moreCandidates) {
+ oscarModel.add(newCandidates);
+ }
+ }*/
+
+ //@Override
+
+ protected void process(List<OscarCandidate> moreCandidates) {
+ if (credits == null) {
+ showCredits();
+ }
+ oscarModel.add(moreCandidates);
+ }
+
+ // For older Java 6 on OS X
+ protected void process(OscarCandidate... moreCandidates) {
+ for (OscarCandidate candidate : moreCandidates) {
+ oscarModel.add(candidate);
+ }
+ }
+
+ private void showCredits() {
+ credits = new JLabel(getString("TableDemo.credits",
+ "<html><p align=\"center\">Academy Award data<br>courtesy of Howard Katz</p></html>"));
+ credits.setFont(UIManager.getFont("Table.font").deriveFont(24f));
+ credits.setHorizontalAlignment(JLabel.CENTER);
+ credits.setBorder(new CompoundBorder(new TitledBorder(""),
+ new EmptyBorder(20,20,20,20)));
+ }
+ @Override
+ protected void done() {
+ setProgress(100);
+ }
+
+ }
+ //</snip>
+
+ private class IMDBLinkAction extends AbstractAction {
+
+ public void actionPerformed(ActionEvent event) {
+ int row = ((Integer) event.getSource()).intValue();
+ OscarCandidate candidate = oscarModel.getCandidate(oscarTable.convertRowIndexToModel(row));
+
+ try {
+ URI imdbURI = candidate.getIMDBMovieURI();
+ if (imdbURI == null) {
+ String imdbString = IMDBLink.getMovieURIString(candidate.getMovieTitle(),
+ candidate.getYear());
+ if (imdbString != null) {
+ imdbURI = new URI(imdbString);
+ candidate.setIMDBMovieURI(imdbURI);
+ }
+ }
+ if (imdbURI != null) {
+ DemoUtilities.browse(imdbURI);
+ } else {
+ showMessage("IMDB Link",
+ getString("TableDemo.imdbLinkNotFound",
+ "Unable to locate IMDB URL for") + "\n" +
+ candidate.getMovieTitle());
+ }
+
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+ }
+
+ public static void main(String args[]) {
+
+ javax.swing.SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ JFrame frame = new JFrame("JTable Demo");
+ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ TableDemo demo = new TableDemo();
+ frame.add(demo);
+ frame.setSize(700, 400);
+ frame.setVisible(true);
+ demo.start();
+ }
+ });
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/resources/TableDemo.properties Mon Mar 19 10:46:31 2018 -0700
@@ -0,0 +1,22 @@
+# Table Demo Properties
+
+TableDemo.accessible_description=Advanced Table Demo
+TableDemo.name=Advanced Table Demo
+TableDemo.title=Academy Awards Results
+TableDemo.credits=<html><p align="center">Academy Award data<br>courtesy of Howard Katz</p></html>
+
+TableDemo.searchLabel=Search Titles and Recipients
+TableDemo.winnersLabel=Show Only Winners
+
+TableDemo.noDataStatusLabel=No data loaded
+TableDemo.loadingStatusLabel=Loading data:
+TableDemo.rowCountLabel=Showing
+TableDemo.searchCountLabel=Search found
+
+TableDemo.yearColumnTitle=Year
+TableDemo.categoryColumnTitle=Award Category
+TableDemo.movieTitleColumnTitle=Movie Title
+TableDemo.nomineesColumnTitle=Nominee(s)
+
+TableDemo.imdbLinkNotFound=Unable to locate IMDB URL for
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/resources/bestpicture Mon Mar 19 10:46:31 2018 -0700
@@ -0,0 +1,397 @@
+
+1927/28 (1st)
+OUTSTANDING PICTURE
+*
+Paramount Famous Lasky -- Wings
+
+1928/29 (2nd)
+OUTSTANDING PICTURE
+*
+Metro-Goldwyn-Mayer -- The Broadway Melody
+[NOTE: THIS IS NOT AN OFFICIAL NOMINATION. There were no announcements of nominations, no certificates of nomination or honorable mention, and only the winners (*) were revealed during the awards banquet on April 3, 1930.]
+
+1929/30 (3rd)
+OUTSTANDING PRODUCTION
+*
+All Quiet on the Western Front -- Universal
+
+1930/31 (4th)
+OUTSTANDING PRODUCTION
+*
+Cimarron -- RKO Radio
+
+1931/32 (5th)
+OUTSTANDING PRODUCTION
+*
+Grand Hotel -- Metro-Goldwyn-Mayer
+
+1932/33 (6th)
+OUTSTANDING PRODUCTION
+*
+Cavalcade -- Fox
+
+1934 (7th)
+OUTSTANDING PRODUCTION
+*
+It Happened One Night -- Columbia
+
+1935 (8th)
+OUTSTANDING PRODUCTION
+*
+Mutiny on the Bounty -- Metro-Goldwyn-Mayer
+
+1936 (9th)
+OUTSTANDING PRODUCTION
+*
+The Great Ziegfeld -- Metro-Goldwyn-Mayer
+
+1937 (10th)
+OUTSTANDING PRODUCTION
+*
+The Life of Emile Zola -- Warner Bros.
+
+1938 (11th)
+OUTSTANDING PRODUCTION
+*
+You Can't Take It with You -- Columbia
+
+1939 (12th)
+OUTSTANDING PRODUCTION
+*
+Gone with the Wind -- Selznick International Pictures
+
+1940 (13th)
+OUTSTANDING PRODUCTION
+*
+Rebecca -- Selznick International Pictures
+
+1941 (14th)
+OUTSTANDING MOTION PICTURE
+*
+How Green Was My Valley -- 20th Century-Fox
+
+1942 (15th)
+OUTSTANDING MOTION PICTURE
+*
+Mrs. Miniver -- Metro-Goldwyn-Mayer
+
+1943 (16th)
+OUTSTANDING MOTION PICTURE
+*
+Casablanca -- Warner Bros.
+
+1944 (17th)
+BEST MOTION PICTURE
+*
+Going My Way -- Paramount
+
+1945 (18th)
+BEST MOTION PICTURE
+*
+The Lost Weekend -- Paramount
+
+1946 (19th)
+BEST MOTION PICTURE
+*
+The Best Years of Our Lives -- Samuel Goldwyn Productions
+
+1947 (20th)
+BEST MOTION PICTURE
+*
+Gentleman's Agreement -- 20th Century-Fox
+
+1948 (21st)
+BEST MOTION PICTURE
+*
+Hamlet -- J. Arthur Rank-Two Cities Films
+
+1949 (22nd)
+BEST MOTION PICTURE
+*
+All the King's Men -- Robert Rossen Productions
+
+1950 (23rd)
+BEST MOTION PICTURE
+*
+All about Eve -- 20th Century-Fox
+
+1951 (24th)
+BEST MOTION PICTURE
+*
+An American in Paris -- Arthur Freed, Producer
+
+1952 (25th)
+BEST MOTION PICTURE
+*
+The Greatest Show on Earth -- Cecil B. DeMille, Producer
+
+1953 (26th)
+BEST MOTION PICTURE
+*
+From Here to Eternity -- Buddy Adler, Producer
+
+1954 (27th)
+BEST MOTION PICTURE
+*
+On the Waterfront -- Sam Spiegel, Producer
+
+1955 (28th)
+BEST MOTION PICTURE
+*
+Marty -- Harold Hecht, Producer
+
+1956 (29th)
+BEST MOTION PICTURE
+*
+Around the World in 80 Days -- Michael Todd, Producer
+
+1957 (30th)
+BEST MOTION PICTURE
+*
+The Bridge on the River Kwai -- Sam Spiegel, Producer
+
+1958 (31st)
+BEST MOTION PICTURE
+*
+Gigi -- Arthur Freed, Producer
+
+1959 (32nd)
+BEST MOTION PICTURE
+*
+Ben-Hur -- Sam Zimbalist, Producer
+
+1960 (33rd)
+BEST MOTION PICTURE
+*
+The Apartment -- Billy Wilder, Producer
+
+1961 (34th)
+BEST MOTION PICTURE
+*
+West Side Story -- Robert Wise, Producer
+
+1962 (35th)
+BEST PICTURE
+*
+Lawrence of Arabia -- Sam Spiegel, Producer
+
+1963 (36th)
+BEST PICTURE
+*
+Tom Jones -- Tony Richardson, Producer
+
+1964 (37th)
+BEST PICTURE
+*
+My Fair Lady -- Jack L. Warner, Producer
+
+1965 (38th)
+BEST PICTURE
+*
+The Sound of Music -- Robert Wise, Producer
+
+1966 (39th)
+BEST PICTURE
+*
+A Man for All Seasons -- Fred Zinnemann, Producer
+
+1967 (40th)
+BEST PICTURE
+*
+In the Heat of the Night -- Walter Mirisch, Producer
+
+1968 (41st)
+BEST PICTURE
+*
+Oliver! -- John Woolf, Producer
+
+1969 (42nd)
+BEST PICTURE
+*
+Midnight Cowboy -- Jerome Hellman, Producer
+
+1970 (43rd)
+BEST PICTURE
+*
+Patton -- Frank McCarthy, Producer
+
+1971 (44th)
+BEST PICTURE
+*
+The French Connection -- Philip D'Antoni, Producer
+
+1972 (45th)
+BEST PICTURE
+*
+The Godfather -- Albert S. Ruddy, Producer
+
+1973 (46th)
+BEST PICTURE
+*
+The Sting -- Tony Bill, Michael Phillips and Julia Phillips, Producers
+
+1974 (47th)
+BEST PICTURE
+*
+The Godfather Part II -- Francis Ford Coppola, Producer; Gray Frederickson and Fred Roos, Co-Producers
+
+1975 (48th)
+BEST PICTURE
+*
+One Flew over the Cuckoo's Nest -- Saul Zaentz and Michael Douglas, Producers
+
+1976 (49th)
+BEST PICTURE
+*
+Rocky -- Irwin Winkler and Robert Chartoff, Producers
+
+1977 (50th)
+BEST PICTURE
+*
+Annie Hall -- Charles H. Joffe, Producer
+
+1978 (51st)
+BEST PICTURE
+*
+The Deer Hunter -- Barry Spikings, Michael Deeley, Michael Cimino and John Peverall, Producers
+
+1979 (52nd)
+BEST PICTURE
+*
+Kramer vs. Kramer -- Stanley R. Jaffe, Producer
+
+1980 (53rd)
+BEST PICTURE
+*
+Ordinary People -- Ronald L. Schwary, Producer
+
+1981 (54th)
+BEST PICTURE
+*
+Chariots of Fire -- David Puttnam, Producer
+
+1982 (55th)
+BEST PICTURE
+*
+Gandhi -- Richard Attenborough, Producer
+
+1983 (56th)
+BEST PICTURE
+*
+Terms of Endearment -- James L. Brooks, Producer
+
+1984 (57th)
+BEST PICTURE
+*
+Amadeus -- Saul Zaentz, Producer
+
+1985 (58th)
+BEST PICTURE
+*
+Out of Africa -- Sydney Pollack, Producer
+
+1986 (59th)
+BEST PICTURE
+*
+Platoon -- Arnold Kopelson, Producer
+
+1987 (60th)
+BEST PICTURE
+*
+The Last Emperor -- Jeremy Thomas, Producer
+
+1988 (61st)
+BEST PICTURE
+*
+Rain Man -- Mark Johnson, Producer
+
+1989 (62nd)
+BEST PICTURE
+*
+Driving Miss Daisy -- Richard D. Zanuck and Lili Fini Zanuck, Producers
+
+1990 (63rd)
+BEST PICTURE
+*
+Dances With Wolves -- Jim Wilson and Kevin Costner, Producers
+
+1991 (64th)
+BEST PICTURE
+*
+The Silence of the Lambs -- Edward Saxon, Kenneth Utt and Ron Bozman, Producers
+
+1992 (65th)
+BEST PICTURE
+*
+Unforgiven -- Clint Eastwood, Producer
+
+1993 (66th)
+BEST PICTURE
+*
+Schindler's List -- Steven Spielberg, Gerald R. Molen and Branko Lustig, Producers
+
+1994 (67th)
+BEST PICTURE
+*
+Forrest Gump -- Wendy Finerman, Steve Tisch and Steve Starkey, Producers
+
+1995 (68th)
+BEST PICTURE
+*
+Braveheart -- Mel Gibson, Alan Ladd, Jr. and Bruce Davey, Producers
+
+1996 (69th)
+BEST PICTURE
+*
+The English Patient -- Saul Zaentz, Producer
+
+1997 (70th)
+BEST PICTURE
+*
+Titanic -- James Cameron and Jon Landau, Producers
+
+1998 (71st)
+BEST PICTURE
+*
+Shakespeare in Love -- David Parfitt, Donna Gigliotti, Harvey Weinstein, Edward Zwick and Marc Norman, Producers
+
+1999 (72nd)
+BEST PICTURE
+*
+American Beauty -- Bruce Cohen and Dan Jinks, Producers
+
+2000 (73rd)
+BEST PICTURE
+*
+Gladiator -- Douglas Wick, David Franzoni and Branko Lustig, Producers
+
+2001 (74th)
+BEST PICTURE
+*
+A Beautiful Mind -- Brian Grazer and Ron Howard, Producers
+
+2002 (75th)
+BEST PICTURE
+*
+Chicago -- Martin Richards, Producer
+
+2003 (76th)
+BEST PICTURE
+*
+The Lord of the Rings: The Return of the King -- Barrie M. Osborne, Peter Jackson and Fran Walsh, Producers
+
+2004 (77th)
+BEST PICTURE
+*
+Million Dollar Baby -- Clint Eastwood, Albert S. Ruddy and Tom Rosenberg, Producers
+
+2005 (78th)
+BEST PICTURE
+*
+Crash -- Paul Haggis and Cathy Schulman, Producers
+
+2006 (79th)
+BEST PICTURE
+*
+The Departed -- Graham King, Producer
+© Academy of Motion Picture Arts and Sciences
\ No newline at end of file
Binary file test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/resources/images/TableDemo.gif has changed
Binary file test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/resources/images/goldstar.png has changed
Binary file test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/resources/images/nominee.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/resources/oscars.xml Mon Mar 19 10:46:31 2018 -0700
@@ -0,0 +1,1 @@
+<?xml version="1.0" encoding="UTF-8"?>
<oscars xmlns:osc-results="http://www.fatdog.com/oscar-results"
osc-results:warning="LIMIT [125000 item(s)] exceeded, 1103 node(s) removed"
version="3.69">
<fm>
<p>This data has been marked up in XML and placed into the public domain by Howard Katz,</p>
<p>Fatdog Software Inc., 2006. It may be freely copied and distributed worldwide.</p>
</fm>
<actor year="1928">
<won>
<movie>The Last Command</movie>
<movie>The Way of All Flesh</movie>
<person>Emil Jannings</person></won></actor>
<actor year="1928">
<lost>
<movie>The Noose</movie>
<movie>The Patent Leather Kid</movie>
<person>Richard Barthelmess</person></lost></actor>
<actor year="1928">
<lost>
<movie>The Circus</movie>
<person>Charles Chaplin</person></lost></actor>
<actress year="1928">
<won>
<movie>7th Heaven</movie>
<movie>Street Angel</movie>
<movie>Sunrise</movie>
<person>Janet Gaynor</person></won></actress>
<actress year="1928">
<lost>
<movie>A Ship Comes in</movie>
<person>Louise Dresser</person></lost></actress>
<actress year="1928">
<lost>
<movie>Sadie Thompson</movie>
<person>Gloria Swanson</person></lost></actress>
<artDirection year="1928">
<won>
<movie>The Dove</movie>
<movie>The Tempest</movie>
<person>William Cameron Menzies</person></won></artDirection>
<artDirection year="1928">
<lost>
<movie>7th Heaven</movie>
<person>Harry Oliver</person></lost></artDirection>
<artDirection year="1928">
<lost>
<movie>Sunrise</movie>
<person>Rochus Gliese</person></lost></artDirection>
<bestPicture year="1928" officially="Outstanding Picture">
<won>
<movie>Wings</movie>
<org>Paramount Famous Lasky</org></won></bestPicture>
<bestPicture year="1928" officially="Outstanding Picture">
<lost>
<movie>7th Heaven</movie>
<org>Fox</org></lost></bestPicture>
<bestPicture year="1928" officially="Outstanding Picture">
<lost>
<movie>The Racket</movie>
<org>The Caddo Company</org></lost></bestPicture>
<cinematography year="1928">
<won>
<movie>Sunrise</movie>
<person>Charles Rosher</person>
<person>Karl Struss</person></won></cinematography>
<cinematography year="1928">
<lost>
<movie>The Devil Dancer</movie>
<movie>The Magic Flame</movie>
<movie>Sadie Thompson</movie>
<person>George Barnes</person></lost></cinematography>
<director year="1928" subcat="comedy">
<won>
<movie>Two Arabian Knights</movie>
<person>Lewis Milestone</person></won></director>
<director year="1928" subcat="comedy">
<lost>
<movie>Speedy</movie>
<person>Ted Wilde</person></lost></director>
<director year="1928" subcat="drama">
<won>
<movie>7th Heaven</movie>
<person>Frank Borzage</person></won></director>
<director year="1928" subcat="drama">
<lost>
<movie>The Crowd</movie>
<person>King Vidor</person></lost></director>
<director year="1928" subcat="drama">
<lost>
<movie>Sorrell and Son</movie>
<person>Herbert Brenon</person></lost></director>
<engEffects year="1928" note="archaic">
<won>
<movie>Wings</movie>
<person>Roy Pomeroy</person></won></engEffects>
<engEffects year="1928" note="archaic">
<lost>
<person>Ralph Hammeras</person>
<person>Nugent Slaughter</person></lost></engEffects>
<uniqueArtisticPicture year="1928" note="archaic">
<won>
<movie>Sunrise</movie>
<org>Fox</org></won></uniqueArtisticPicture>
<uniqueArtisticPicture year="1928" note="archaic">
<lost>
<movie>Chang</movie>
<org>Paramount Famous Lasky</org></lost></uniqueArtisticPicture>
<uniqueArtisticPicture year="1928" note="archaic">
<lost>
<movie>The Crowd</movie>
<org>Metro-Goldwyn-Mayer</org></lost></uniqueArtisticPicture>
<writing year="1928" subcat="adaptation">
<won>
<movie>7th Heaven</movie>
<person>Benjamin Glazer</person></won></writing>
<writing year="1928" subcat="adaptation">
<lost>
<movie>Glorious Betsy</movie>
<person>Anthony Coldeway</person></lost></writing>
<writing year="1928" subcat="adaptation">
<lost>
<movie>The Jazz Singer</movie>
<person>Alfred Cohn</person></lost></writing>
<writing year="1928" subcat="original story">
<won>
<movie>Underworld</movie>
<person>Ben Hecht</person></won></writing>
<writing year="1928" subcat="original story">
<lost>
<movie>The Last Command</movie>
<person>Lajos Biro</person></lost></writing>
<writing year="1928" subcat="title">
<won>
<person>Joseph Farnham</person></won></writing>
<writing year="1928" subcat="title">
<lost>
<person>George Marion Jr.</person></lost></writing>
<writing year="1928" subcat="title">
<lost>
<movie>The Private Life of Helen of Troy</movie>
<person>Gerald Duffy</person></lost></writing>
<actor year="1929">
<won>
<movie>In Old Arizona</movie>
<person>Warner Baxter</person></won></actor>
<actor year="1929">
<lost>
<movie>Thunderbolt</movie>
<person>George Bancroft</person></lost></actor>
<actor year="1929">
<lost>
<movie>Alibi</movie>
<person>Chester Morris</person></lost></actor>
<actor year="1929">
<lost>
<movie>The Valiant</movie>
<person>Paul Muni</person></lost></actor>
<actor year="1929">
<lost>
<movie>The Patriot</movie>
<person>Lewis Stone</person></lost></actor>
<actress year="1929">
<won>
<movie>Coquette</movie>
<person>Mary Pickford</person></won></actress>
<actress year="1929">
<lost>
<movie>Madame X</movie>
<person>Ruth Chatterton</person></lost></actress>
<actress year="1929">
<lost>
<movie>The Barker</movie>
<person>Betty Compson</person></lost></actress>
<actress year="1929">
<lost>
<movie>The Letter</movie>
<person>Jeanne Eagels</person></lost></actress>
<actress year="1929">
<lost>
<movie>The Divine Lady</movie>
<person>Corinne Griffith</person></lost></actress>
<actress year="1929">
<lost>
<movie>The Broadway Melody</movie>
<person>Bessie Love</person></lost></actress>
<artDirection year="1929">
<won>
<movie>The Bridge of San Luis Rey</movie>
<person>Cedric Gibbons</person></won></artDirection>
<artDirection year="1929">
<lost>
<movie>Alibi</movie>
<movie>The Awakening</movie>
<person>William Cameron Menzies</person></lost></artDirection>
<artDirection year="1929">
<lost>
<movie>Dynamite</movie>
<person>Mitchell Leisen</person></lost></artDirection>
<artDirection year="1929">
<lost>
<movie>The Patriot</movie>
<person>Hans Dreier</person></lost></artDirection>
<artDirection year="1929">
<lost>
<movie>Street Angel</movie>
<person>Harry Oliver</person></lost></artDirection>
<bestPicture year="1929">
<won>
<movie>The Broadway Melody</movie>
<org>Metro-Goldwyn-Mayer</org></won></bestPicture>
<bestPicture year="1929">
<lost>
<movie>Alibi</movie>
<org>Art Cinema</org></lost></bestPicture>
<bestPicture year="1929">
<lost>
<movie>Hollywood Revue</movie>
<org>Metro-Goldwyn-Mayer</org></lost></bestPicture>
<bestPicture year="1929">
<lost>
<movie>In Old Arizona</movie>
<org>Fox</org></lost></bestPicture>
<bestPicture year="1929">
<lost>
<movie>The Patriot</movie>
<org>Paramount Famous Lasky</org></lost></bestPicture>
<cinematography year="1929">
<won>
<movie>White Shadows in the South Seas</movie>
<person>Clyde De Vinna</person></won></cinematography>
<cinematography year="1929">
<lost>
<movie>The Divine Lady</movie>
<person>John Seitz</person></lost></cinematography>
<cinematography year="1929">
<lost>
<movie>Four Devils</movie>
<movie>Street Angel</movie>
<person>Ernest Palmer</person></lost></cinematography>
<cinematography year="1929">
<lost>
<movie>In Old Arizona</movie>
<person>Arthur Edeson</person></lost></cinematography>
<cinematography year="1929">
<lost>
<movie>Our Dancing Daughters</movie>
<person>George Barnes</person></lost></cinematography>
<director year="1929">
<won>
<movie>The Divine Lady</movie>
<person>Frank Lloyd</person></won></director>
<director year="1929">
<lost>
<movie>The Broadway Melody</movie>
<person>Harry Beaumont</person></lost></director>
<director year="1929">
<lost>
<movie>Drag</movie>
<person>Frank Lloyd</person></lost></director>
<director year="1929">
<lost>
<movie>In Old Arizona</movie>
<person>Irving Cummings</person></lost></director>
<director year="1929">
<lost>
<movie>Madame X</movie>
<person>Lionel Barrymore</person></lost></director>
<director year="1929">
<lost>
<movie>The Patriot</movie>
<person>Ernst Lubitsch</person></lost></director>
<director year="1929">
<lost>
<movie>Weary River</movie>
<person>Frank Lloyd</person></lost></director>
<writing year="1929">
<won>
<movie>The Patriot</movie>
<person>Hans Kraly</person></won></writing>
<writing year="1929">
<lost>
<movie>The Cop</movie>
<person>Elliott Clawson</person></lost></writing>
<writing year="1929">
<lost>
<movie>In Old Arizona</movie>
<person>Tom Barry</person></lost></writing>
<writing year="1929">
<lost>
<movie>The Last of Mrs. Cheyney</movie>
<person>Hans Kraly</person></lost></writing>
<writing year="1929">
<lost>
<movie>The Leatherneck</movie>
<person>Elliott Clawson</person></lost></writing>
<writing year="1929">
<lost>
<movie>Our Dancing Daughters</movie>
<person>Josephine Lovett</person></lost></writing>
<writing year="1929">
<lost>
<movie>Sal of Singapore</movie>
<person>Elliott Clawson</person></lost></writing>
<writing year="1929">
<lost>
<movie>Skyscraper</movie>
<person>Elliott Clawson</person></lost></writing>
<writing year="1929">
<lost>
<movie>The Valiant</movie>
<person>Tom Barry</person></lost></writing>
<writing year="1929">
<lost>
<movie>A Woman of Affairs</movie>
<person>Bess Meredyth</person></lost></writing>
<writing year="1929">
<lost>
<movie>Wonder of Women</movie>
<person>Bess Meredyth</person></lost></writing>
<actor year="1930">
<won>
<movie>Disraeli</movie>
<person>George Arliss</person></won></actor>
<actor year="1930">
<lost>
<movie>The Green Goddess</movie>
<person>George Arliss</person></lost></actor>
<actor year="1930">
<lost>
<movie>The Big House</movie>
<person>Wallace Beery</person></lost></actor>
<actor year="1930">
<lost>
<movie>The Big Pond</movie>
<person>Maurice Chevalier</person></lost></actor>
<actor year="1930">
<lost>
<movie>The Love Parade</movie>
<person>Maurice Chevalier</person></lost></actor>
<actor year="1930">
<lost>
<movie>Bulldog Drummond</movie>
<person>Ronald Colman</person></lost></actor>
<actor year="1930">
<lost>
<movie>Condemned</movie>
<person>Ronald Colman</person></lost></actor>
<actor year="1930">
<lost>
<movie>The Rogue Song</movie>
<person>Lawrence Tibbett</person></lost></actor>
<actress year="1930">
<won>
<movie>The Divorcee</movie>
<person>Norma Shearer</person></won></actress>
<actress year="1930">
<lost>
<movie>The Devil's Holiday</movie>
<person>Nancy Carroll</person></lost></actress>
<actress year="1930">
<lost>
<movie>Sarah and Son</movie>
<person>Ruth Chatterton</person></lost></actress>
<actress year="1930">
<lost>
<movie>Anna Christie</movie>
<person>Greta Garbo</person></lost></actress>
<actress year="1930">
<lost>
<movie>Romance</movie>
<person>Greta Garbo</person></lost></actress>
<actress year="1930">
<lost>
<movie>Their Own Desire</movie>
<person>Norma Shearer</person></lost></actress>
<actress year="1930">
<lost>
<movie>The Trespasser</movie>
<person>Gloria Swanson</person></lost></actress>
<artDirection year="1930">
<won>
<movie>King of Jazz</movie>
<person>Herman Rosse</person></won></artDirection>
<artDirection year="1930">
<lost>
<movie>Bulldog Drummond</movie>
<person>William Cameron Menzies</person></lost></artDirection>
<artDirection year="1930">
<lost>
<movie>The Love Parade</movie>
<person>Hans Dreier</person></lost></artDirection>
<artDirection year="1930">
<lost>
<movie>Sally</movie>
<person>Jack Okey</person></lost></artDirection>
<artDirection year="1930">
<lost>
<movie>The Vagabond King</movie>
<person>Hans Dreier</person></lost></artDirection>
<bestPicture year="1930">
<won>
<movie>All Quiet on the Western Front</movie>
<org>Universal</org></won></bestPicture>
<bestPicture year="1930">
<lost>
<movie>The Big House</movie>
<org>Cosmopolitan</org></lost></bestPicture>
<bestPicture year="1930">
<lost>
<movie>Disraeli</movie>
<org>Warner Bros.</org></lost></bestPicture>
<bestPicture year="1930">
<lost>
<movie>The Divorcee</movie>
<org>Metro-Goldwyn-Mayer</org></lost></bestPicture>
<bestPicture year="1930">
<lost>
<movie>The Love Parade</movie>
<org>Paramount Famous Lasky</org></lost></bestPicture>
<cinematography year="1930">
<won>
<movie>With Byrd at the South Pole</movie>
<person>Joseph T. Rucker</person>
<person>Willard Van Der Veer</person></won></cinematography>
<cinematography year="1930">
<lost>
<movie>All Quiet on the Western Front</movie>
<person>Arthur Edeson</person></lost></cinematography>
<cinematography year="1930">
<lost>
<movie>Anna Christie</movie>
<person>William Daniels</person></lost></cinematography>
<cinematography year="1930">
<lost>
<movie>Hell's Angels</movie>
<person>Gaetano Gaudio)</person>
<person>Harry Perry</person></lost></cinematography>
<cinematography year="1930">
<lost>
<movie>The Love Parade</movie>
<person>Victor Milner</person></lost></cinematography>
<director year="1930">
<won>
<movie>All Quiet on the Western Front</movie>
<person>Lewis Milestone</person></won></director>
<director year="1930">
<lost>
<movie>Anna Christie</movie>
<person>Clarence Brown</person></lost></director>
<director year="1930">
<lost>
<movie>The Divorcee</movie>
<person>Robert Leonard</person></lost></director>
<director year="1930">
<lost>
<movie>Hallelujah</movie>
<person>King Vidor</person></lost></director>
<director year="1930">
<lost>
<movie>The Love Parade</movie>
<person>Ernst Lubitsch</person></lost></director>
<director year="1930">
<lost>
<movie>Romance</movie>
<person>Clarence Brown</person></lost></director>
<sound year="1930">
<won>
<movie>The Big House</movie>
<org>Metro-Goldwyn-Mayer Studio Sound Department</org>
<person>Douglas Shearer</person></won></sound>
<sound year="1930">
<lost>
<movie>The Case of Sergeant Grischa</movie>
<org>RKO Radio Studio Sound Department</org>
<person>John Tribby</person></lost></sound>
<sound year="1930">
<lost>
<movie>The Love Parade</movie>
<org>Paramount Famous Lasky Studio Sound Department</org>
<person>Franklin Hansen</person></lost></sound>
<sound year="1930">
<lost>
<movie>Raffles</movie>
<org>United Artists Studio Sound Department</org>
<person>Oscar Lagerstrom</person></lost></sound>
<sound year="1930">
<lost>
<movie>Song of the Flame</movie>
<org>First National Studio Sound Department</org>
<person>George Groves</person></lost></sound>
<writing year="1930">
<won>
<movie>The Big House</movie>
<person>Frances Marion</person></won></writing>
<writing year="1930">
<lost>
<movie>All Quiet on the Western Front</movie>
<person>George Abbott</person>
<person>Maxwell Anderson</person>
<person>Del Andrews</person></lost></writing>
<writing year="1930">
<lost>
<movie>Disraeli</movie>
<person>Julian Josephson</person></lost></writing>
<writing year="1930">
<lost>
<movie>The Divorcee</movie>
<person>John Meehan</person></lost></writing>
<writing year="1930">
<lost>
<movie>Street of Chance</movie>
<person>Howard Estabrook</person></lost></writing>
<actor year="1931">
<won>
<movie>A Free Soul</movie>
<person>Lionel Barrymore</person></won></actor>
<actor year="1931">
<lost>
<movie>Skippy</movie>
<person>Jackie Cooper</person></lost></actor>
<actor year="1931">
<lost>
<movie>Cimarron</movie>
<person>Richard Dix</person></lost></actor>
<actor year="1931">
<lost>
<movie>The Royal Family of Broadway</movie>
<person>Fredric March</person></lost></actor>
<actor year="1931">
<lost>
<movie>The Front Page</movie>
<person>Adolphe Menjou</person></lost></actor>
<actress year="1931">
<won>
<movie>Min and Bill</movie>
<person>Marie Dressler</person></won></actress>
<actress year="1931">
<lost>
<movie>Morocco</movie>
<person>Marlene Dietrich</person></lost></actress>
<actress year="1931">
<lost>
<movie>Cimarron</movie>
<person>Irene Dunne</person></lost></actress>
<actress year="1931">
<lost>
<movie>Holiday</movie>
<person>Ann Harding</person></lost></actress>
<actress year="1931">
<lost>
<movie>A Free Soul</movie>
<person>Norma Shearer</person></lost></actress>
<artDirection year="1931">
<won>
<movie>Cimarron</movie>
<person>Max Ree</person></won></artDirection>
<artDirection year="1931">
<lost>
<movie>Just Imagine</movie>
<person>Stephen Goosson</person>
<person>Ralph Hammeras</person></lost></artDirection>
<artDirection year="1931">
<lost>
<movie>Morocco</movie>
<person>Hans Dreier</person></lost></artDirection>
<artDirection year="1931">
<lost>
<movie>Svengali</movie>
<person>Anton Grot</person></lost></artDirection>
<artDirection year="1931">
<lost>
<movie>Whoopee!</movie>
<person>Richard Day</person></lost></artDirection>
<bestPicture year="1931">
<won>
<movie>Cimarron</movie>
<org>RKO Radio</org></won></bestPicture>
<bestPicture year="1931">
<lost>
<movie>East Lynne</movie>
<org>Fox</org></lost></bestPicture>
<bestPicture year="1931">
<lost>
<movie>The Front Page</movie>
<org>The Caddo Company</org></lost></bestPicture>
<bestPicture year="1931">
<lost>
<movie>Skippy</movie>
<org>Paramount Publix</org></lost></bestPicture>
<bestPicture year="1931">
<lost>
<movie>Trader Horn</movie>
<org>Metro-Goldwyn-Mayer</org></lost></bestPicture>
<cinematography year="1931">
<won>
<movie>Tabu</movie>
<person>Floyd Crosby</person></won></cinematography>
<cinematography year="1931">
<lost>
<movie>Cimarron</movie>
<person>Edward Cronjager</person></lost></cinematography>
<cinematography year="1931">
<lost>
<movie>Morocco</movie>
<person>Lee Garmes</person></lost></cinematography>
<cinematography year="1931">
<lost>
<movie>The Right to Love</movie>
<person>Charles Lang</person></lost></cinematography>
<cinematography year="1931">
<lost>
<movie>Svengali</movie>
<person>Barney "Chick" McGill</person></lost></cinematography>
<director year="1931">
<won>
<movie>Skippy</movie>
<person>Norman Taurog</person></won></director>
<director year="1931">
<lost>
<movie>Cimarron</movie>
<person>Wesley Ruggles</person></lost></director>
<director year="1931">
<lost>
<movie>A Free Soul</movie>
<person>Clarence Brown</person></lost></director>
<director year="1931">
<lost>
<movie>The Front Page</movie>
<person>Lewis Milestone</person></lost></director>
<director year="1931">
<lost>
<movie>Morocco</movie>
<person>Josef Von Sternberg</person></lost></director>
<sound year="1931">
<won>
<org>Samuel Goldwyn - United Artists Studio Sound Department</org></won></sound>
<sound year="1931">
<lost>
<org>Metro-Goldwyn-Mayer Studio Sound Department</org></lost></sound>
<sound year="1931">
<lost>
<org>Paramount Publix Studio Sound Department</org></lost></sound>
<sound year="1931">
<lost>
<org>RKO Radio Studio Sound Department</org></lost></sound>
<writing year="1931" subcat="adaptation">
<won>
<movie>Cimarron</movie>
<person>Howard Estabrook</person></won></writing>
<writing year="1931" subcat="adaptation">
<lost>
<movie>The Criminal Code</movie>
<person>Seton I. Miller</person>
<person>Fred Niblo Jr.</person></lost></writing>
<writing year="1931" subcat="adaptation">
<lost>
<movie>Holiday</movie>
<person>Horace Jackson</person></lost></writing>
<writing year="1931" subcat="adaptation">
<lost>
<movie>Little Caesar</movie>
<person>Francis Faragoh</person>
<person>Robert N. Lee</person></lost></writing>
<writing year="1931" subcat="adaptation">
<lost>
<movie>Skippy</movie>
<person>Joseph L. Mankiewicz</person>
<person>Sam Mintz</person></lost></writing>
<writing year="1931" subcat="original story">
<won>
<movie>The Dawn Patrol</movie>
<person>John Monk Saunders</person></won></writing>
<writing year="1931" subcat="original story">
<lost>
<movie>The Doorway to Hell</movie>
<person>Rowland Brown</person></lost></writing>
<writing year="1931" subcat="original story">
<lost>
<movie>Laughter</movie>
<person>Harry d'Abbadie d'Arrast</person>
<person>Douglas Doty</person>
<person>Donald Ogden Stewart</person></lost></writing>
<writing year="1931" subcat="original story">
<lost>
<movie>The Public Enemy</movie>
<person>John Bright</person>
<person>Kubec Glasmon</person></lost></writing>
<writing year="1931" subcat="original story">
<lost>
<movie>Smart Money</movie>
<person>Lucien Hubbard</person>
<person>Joseph Jackson</person></lost></writing>
<actor year="1932">
<won>
<movie>The Champ</movie>
<person>Wallace Beery</person></won></actor>
<actor year="1932">
<won>
<movie>Dr. Jekyll and Mr. Hyde</movie>
<person>Fredric March</person></won></actor>
<actor year="1932">
<lost>
<movie>The Guardsman</movie>
<person>Alfred Lunt</person></lost></actor>
<actress year="1932">
<won>
<movie>The Sin of Madelon Claudet</movie>
<person>Helen Hayes</person></won></actress>
<actress year="1932">
<lost>
<movie>Emma</movie>
<person>Marie Dressler</person></lost></actress>
<actress year="1932">
<lost>
<movie>The Guardsman</movie>
<person>Lynn Fontanne</person></lost></actress>
<artDirection year="1932">
<won>
<movie>Transatlantic</movie>
<person>Gordon Wiles</person></won></artDirection>
<artDirection year="1932">
<lost>
<movie>Arrowsmith</movie>
<person>Richard Day</person></lost></artDirection>
<artDirection year="1932">
<lost>
<movie>A Nous La Liberte</movie>
<person>Lazare Meerson</person></lost></artDirection>
<bestPicture year="1932">
<won>
<movie>Grand Hotel</movie>
<org>Metro-Goldwyn-Mayer</org></won></bestPicture>
<bestPicture year="1932">
<lost>
<movie>Arrowsmith</movie>
<org>Samuel Goldwyn</org></lost></bestPicture>
<bestPicture year="1932">
<lost>
<movie>Bad Girl</movie>
<org>Fox</org></lost></bestPicture>
<bestPicture year="1932">
<lost>
<movie>The Champ</movie>
<org>Metro-Goldwyn-Mayer</org></lost></bestPicture>
<bestPicture year="1932">
<lost>
<movie>Five Star Final</movie>
<org>First National</org></lost></bestPicture>
<bestPicture year="1932">
<lost>
<movie>One Hour with You</movie>
<org>Paramount Publix</org></lost></bestPicture>
<bestPicture year="1932">
<lost>
<movie>Shanghai Express</movie>
<org>Paramount Publix</org></lost></bestPicture>
<bestPicture year="1932">
<lost>
<movie>The Smiling Lieutenant</movie>
<org>Paramount Publix</org></lost></bestPicture>
<cinematography year="1932">
<won>
<movie>Shanghai Express</movie>
<person>Lee Garmes</person></won></cinematography>
<cinematography year="1932">
<lost>
<movie>Arrowsmith</movie>
<person>Ray June</person></lost></cinematography>
<cinematography year="1932">
<lost>
<movie>Dr. Jekyll and Mr. Hyde</movie>
<person>Karl Struss</person></lost></cinematography>
<director year="1932">
<won>
<movie>Bad Girl</movie>
<person>Frank Borzage</person></won></director>
<director year="1932">
<lost>
<movie>The Champ</movie>
<person>King Vidor</person></lost></director>
<director year="1932">
<lost>
<movie>Shanghai Express</movie>
<person>Josef Von Sternberg</person></lost></director>
<shortAnimation year="1932">
<won>
<movie>Flowers and Trees</movie>
<person>Walt Disney</person></won></shortAnimation>
<shortAnimation year="1932">
<lost>
<movie>It's Got Me Again</movie>
<person>Leon Schlesinger</person></lost></shortAnimation>
<shortAnimation year="1932">
<lost>
<movie>Mickey's Orphans</movie>
<person>Walt Disney</person></lost></shortAnimation>
<shortLiveAction year="1932" subcat="comedy">
<won>
<movie>The Music Box</movie>
<person>Hal Roach</person></won></shortLiveAction>
<shortLiveAction year="1932" subcat="comedy">
<lost>
<movie>The Loud Mouth</movie>
<person>Mack Sennett</person></lost></shortLiveAction>
<shortLiveAction year="1932" subcat="comedy">
<lost>
<movie>Scratch-As-Catch-Can</movie>
<org>RKO Radio</org></lost></shortLiveAction>
<shortLiveAction year="1932" subcat="comedy">
<lost>
<movie>Stout Hearts and Willing Hands</movie>
<org>RKO Radio</org></lost></shortLiveAction>
<shortLiveAction year="1932" subcat="novelty">
<won>
<movie>Wrestling Swordfish</movie>
<person>Mack Sennett</person></won></shortLiveAction>
<shortLiveAction year="1932" subcat="novelty">
<lost>
<movie>Screen Souvenirs</movie>
<org>Paramount Publix</org></lost></shortLiveAction>
<shortLiveAction year="1932" subcat="novelty">
<lost>
<movie>Swing High</movie>
<org>Metro-Goldwyn-Mayer</org></lost></shortLiveAction>
<sound year="1932">
<won>
<org>Metro-Goldwyn-Mayer Studio Sound Department</org></won></sound>
<sound year="1932">
<lost>
<org>Paramount Publix Studio Sound Department</org></lost></sound>
<sound year="1932">
<lost>
<org>RKO Radio Studio Sound Department</org></lost></sound>
<sound year="1932">
<lost>
<org>Warner Bros.-First National Studio Sound Department</org></lost></sound>
<writing year="1932" subcat="adaptation">
<won>
<movie>Bad Girl</movie>
<person>Edwin Burke</person></won></writing>
<writing year="1932" subcat="adaptation">
<lost>
<movie>Arrowsmith</movie>
<person>Sidney Howard</person></lost></writing>
<writing year="1932" subcat="adaptation">
<lost>
<movie>Dr. Jekyll and Mr. Hyde</movie>
<person>Percy Heath</person>
<person>Samuel Hoffenstein</person></lost></writing>
<writing year="1932" subcat="original story">
<won>
<movie>The Champ</movie>
<person>Frances Marion</person></won></writing>
<writing year="1932" subcat="original story">
<lost>
<movie>Lady and Gent</movie>
<person>Grover Jones</person>
<person>William Slavens McNutt</person></lost></writing>
<writing year="1932" subcat="original story">
<lost>
<movie>The Star Witness</movie>
<person>Lucien Hubbard</person></lost></writing>
<writing year="1932" subcat="original story">
<lost>
<movie>What Price Hollywood?</movie>
<person>Jane Murfin</person>
<person>Adela Rogers St. Johns</person></lost></writing>
<actor year="1933">
<won>
<movie>The Private Life of Henry VIII</movie>
<person>Charles Laughton</person></won></actor>
<actor year="1933">
<lost>
<movie>Berkeley Square</movie>
<person>Leslie Howard</person></lost></actor>
<actor year="1933">
<lost>
<movie>I Am a Fugitive from a Chain Gang</movie>
<person>Paul Muni</person></lost></actor>
<actress year="1933">
<won>
<movie>Morning Glory</movie>
<person>Katharine Hepburn</person></won></actress>
<actress year="1933">
<lost>
<movie>Lady for a Day</movie>
<person>May Robson</person></lost></actress>
<actress year="1933">
<lost>
<movie>Cavalcade</movie>
<person>Diana Wynyard</person></lost></actress>
<artDirection year="1933">
<won>
<movie>Cavalcade</movie>
<person>William S. Darling</person></won></artDirection>
<artDirection year="1933">
<lost>
<movie>A Farewell to Arms</movie>
<person>Roland Anderson</person>
<person>Hans Dreier</person></lost></artDirection>
<artDirection year="1933">
<lost>
<movie>When Ladies Meet</movie>
<person>Cedric Gibbons</person></lost></artDirection>
<assistantDirector year="1933" note="archaic">
<won>
<person>Charles Barton</person></won></assistantDirector>
<assistantDirector year="1933" note="archaic">
<won>
<person>Scott Beal</person></won></assistantDirector>
<assistantDirector year="1933" note="archaic">
<won>
<person>Charles Dorian</person></won></assistantDirector>
<assistantDirector year="1933" note="archaic">
<won>
<person>Fred Fox</person></won></assistantDirector>
<assistantDirector year="1933" note="archaic">
<won>
<person>Gordon Hollingshead</person></won></assistantDirector>
<assistantDirector year="1933" note="archaic">
<won>
<person>Dewey Starkey</person></won></assistantDirector>
<assistantDirector year="1933" note="archaic">
<won>
<person>William Tummel</person></won></assistantDirector>
<assistantDirector year="1933" note="archaic">
<lost>
<person>Al Alborn</person></lost></assistantDirector>
<assistantDirector year="1933" note="archaic">
<lost>
<person>Sidney S. Brod</person></lost></assistantDirector>
<assistantDirector year="1933" note="archaic">
<lost>
<person>Bunny Dull</person></lost></assistantDirector>
<assistantDirector year="1933" note="archaic">
<lost>
<person>Percy Ikerd</person></lost></assistantDirector>
<assistantDirector year="1933" note="archaic">
<lost>
<person>Arthur Jacobson</person></lost></assistantDirector>
<assistantDirector year="1933" note="archaic">
<lost>
<person>Eddie Killey</person></lost></assistantDirector>
<assistantDirector year="1933" note="archaic">
<lost>
<person>Joe McDonough</person></lost></assistantDirector>
<assistantDirector year="1933" note="archaic">
<lost>
<person>W. J. Reiter</person></lost></assistantDirector>
<assistantDirector year="1933" note="archaic">
<lost>
<person>Frank X. Shaw</person></lost></assistantDirector>
<assistantDirector year="1933" note="archaic">
<lost>
<person>Benjamin Silvey</person></lost></assistantDirector>
<assistantDirector year="1933" note="archaic">
<lost>
<person>John S. Waters</person></lost></assistantDirector>
<bestPicture year="1933">
<won>
<movie>Cavalcade</movie>
<org>Fox</org></won></bestPicture>
<bestPicture year="1933">
<lost>
<movie>42nd Street</movie>
<org>Warner Bros.</org></lost></bestPicture>
<bestPicture year="1933">
<lost>
<movie>A Farewell to Arms</movie>
<org>Paramount</org></lost></bestPicture>
<bestPicture year="1933">
<lost>
<movie>I Am a Fugitive from a Chain Gang</movie>
<org>Warner Bros.</org></lost></bestPicture>
<bestPicture year="1933">
<lost>
<movie>Lady for a Day</movie>
<org>Columbia</org></lost></bestPicture>
<bestPicture year="1933">
<lost>
<movie>Little Women</movie>
<org>RKO Radio</org></lost></bestPicture>
<bestPicture year="1933">
<lost>
<movie>The Private Life of Henry VIII</movie>
<org>London Films</org></lost></bestPicture>
<bestPicture year="1933">
<lost>
<movie>She Done Him Wrong</movie>
<org>Paramount</org></lost></bestPicture>
<bestPicture year="1933">
<lost>
<movie>Smilin' Through</movie>
<org>Metro-Goldwyn-Mayer</org></lost></bestPicture>
<bestPicture year="1933">
<lost>
<movie>State Fair</movie>
<org>Fox</org></lost></bestPicture>
<cinematography year="1933">
<won>
<movie>A Farewell to Arms</movie>
<person>Charles Bryant Lang Jr.</person></won></cinematography>
<cinematography year="1933">
<lost>
<movie>Reunion in Vienna</movie>
<person>George J. Folsey</person></lost></cinematography>
<cinematography year="1933">
<lost>
<movie>The Sign of the Cross</movie>
<person>Karl Struss</person></lost></cinematography>
<director year="1933">
<won>
<movie>Cavalcade</movie>
<person>Frank Lloyd</person></won></director>
<director year="1933">
<lost>
<movie>Lady for a Day</movie>
<person>Frank Capra</person></lost></director>
<director year="1933">
<lost>
<movie>Little Women</movie>
<person>George Cukor</person></lost></director>
<shortAnimation year="1933">
<won>
<movie>The Three Little Pigs</movie>
<person>Walt Disney</person></won></shortAnimation>
<shortAnimation year="1933">
<lost>
<movie>Building a Building</movie>
<person>Walt Disney</person></lost></shortAnimation>
<shortAnimation year="1933">
<lost>
<movie>The Merry Old Soul</movie>
<person>Walter Lantz</person></lost></shortAnimation>
<shortLiveAction year="1933" subcat="comedy">
<won>
<movie>So This Is Harris</movie>
<person>Louis Brock</person></won></shortLiveAction>
<shortLiveAction year="1933" subcat="comedy">
<lost>
<movie>Mister Mugg</movie>
<person>Warren Doane</person></lost></shortLiveAction>
<shortLiveAction year="1933" subcat="comedy">
<lost>
<movie>A Preferred List</movie>
<person>Louis Brock</person></lost></shortLiveAction>
<shortLiveAction year="1933" subcat="novelty">
<won>
<movie>Krakatoa</movie>
<person>Joe Rock</person></won></shortLiveAction>
<shortLiveAction year="1933" subcat="novelty">
<lost>
<movie>Menu</movie>
<person>Pete Smith</person></lost></shortLiveAction>
<shortLiveAction year="1933" subcat="novelty">
<lost>
<movie>The Sea</movie>
<org>Educational</org></lost></shortLiveAction>
<sound year="1933">
<won>
<movie>A Farewell to Arms</movie>
<org>Paramount Studio Sound Department</org>
<person>Franklin B. Hansen</person></won></sound>
<sound year="1933">
<lost>
<movie>42nd Street</movie>
<org>Warner Bros. Studio Sound Department</org>
<person>Nathan Levinson</person></lost></sound>
<sound year="1933">
<lost>
<movie>Gold Diggers of 1933</movie>
<org>Warner Bros. Studio Sound Department</org>
<person>Nathan Levinson</person></lost></sound>
<sound year="1933">
<lost>
<movie>I Am a Fugitive from a Chain Gang</movie>
<org>Warner Bros. Studio Sound Department</org>
<person>Nathan Levinson</person></lost></sound>
<writing year="1933" subcat="adaptation">
<won>
<movie>Little Women</movie>
<person>Victor Heerman</person>
<person>Sarah Y. Mason</person></won></writing>
<writing year="1933" subcat="adaptation">
<lost>
<movie>Lady for a Day</movie>
<person>Robert Riskin</person></lost></writing>
<writing year="1933" subcat="adaptation">
<lost>
<movie>State Fair</movie>
<person>Paul Green</person>
<person>Sonya Levien</person></lost></writing>
<writing year="1933" subcat="original story">
<won>
<movie>One Way Passage</movie>
<person>Robert Lord</person></won></writing>
<writing year="1933" subcat="original story">
<lost>
<movie>The Prizefighter and the Lady</movie>
<person>Frances Marion</person></lost></writing>
<writing year="1933" subcat="original story">
<lost>
<movie>Rasputin and the Empress</movie>
<person>Charles MacArthur</person></lost></writing>
<actor year="1934">
<won>
<movie>It Happened One Night</movie>
<person>Clark Gable</person></won></actor>
<actor year="1934">
<lost>
<movie>The Affairs of Cellini</movie>
<person>Frank Morgan</person></lost></actor>
<actor year="1934">
<lost>
<movie>The Thin Man</movie>
<person>William Powell</person></lost></actor>
<actress year="1934">
<won>
<movie>It Happened One Night</movie>
<person>Claudette Colbert</person></won></actress>
<actress year="1934">
<lost>
<movie>Of Human Bondage</movie>
<person>Bette Davis</person></lost></actress>
<actress year="1934">
<lost>
<movie>One Night of Love</movie>
<person>Grace Moore</person></lost></actress>
<actress year="1934">
<lost>
<movie>The Barretts of Wimpole Street</movie>
<person>Norma Shearer</person></lost></actress>
<artDirection year="1934">
<won>
<movie>The Merry Widow</movie>
<person>Cedric Gibbons</person>
<person>Frederic Hope</person></won></artDirection>
<artDirection year="1934">
<lost>
<movie>The Affairs of Cellini</movie>
<person>Richard Day</person></lost></artDirection>
<artDirection year="1934">
<lost>
<movie>The Gay Divorcee</movie>
<person>Carroll Clark</person>
<person>Van Nest Polglase</person></lost></artDirection>
<assistantDirector year="1934" note="archaic">
<won>
<movie>Viva Villa!</movie>
<person>John Waters</person></won></assistantDirector>
<assistantDirector year="1934" note="archaic">
<lost>
<movie>Cleopatra</movie>
<person>Cullen Tate</person></lost></assistantDirector>
<assistantDirector year="1934" note="archaic">
<lost>
<movie>Imitation of Life</movie>
<person>Scott Beal</person></lost></assistantDirector>
<bestPicture year="1934">
<won>
<movie>It Happened One Night</movie>
<org>Columbia</org></won></bestPicture>
<bestPicture year="1934">
<lost>
<movie>The Barretts of Wimpole Street</movie>
<org>Metro-Goldwyn-Mayer</org></lost></bestPicture>
<bestPicture year="1934">
<lost>
<movie>Cleopatra</movie>
<org>Paramount</org></lost></bestPicture>
<bestPicture year="1934">
<lost>
<movie>Flirtation Walk</movie>
<org>First National</org></lost></bestPicture>
<bestPicture year="1934">
<lost>
<movie>The Gay Divorcee</movie>
<org>RKO Radio</org></lost></bestPicture>
<bestPicture year="1934">
<lost>
<movie>Here Comes the Navy</movie>
<org>Warner Bros.</org></lost></bestPicture>
<bestPicture year="1934">
<lost>
<movie>The House of Rothschild</movie>
<org>20th Century</org></lost></bestPicture>
<bestPicture year="1934">
<lost>
<movie>Imitation of Life</movie>
<org>Universal</org></lost></bestPicture>
<bestPicture year="1934">
<lost>
<movie>One Night of Love</movie>
<org>Columbia</org></lost></bestPicture>
<bestPicture year="1934">
<lost>
<movie>The Thin Man</movie>
<org>Metro-Goldwyn-Mayer</org></lost></bestPicture>
<bestPicture year="1934">
<lost>
<movie>Viva Villa!</movie>
<org>Metro-Goldwyn-Mayer</org></lost></bestPicture>
<bestPicture year="1934">
<lost>
<movie>The White Parade</movie>
<person>Jesse L. Lasky</person></lost></bestPicture>
<cinematography year="1934">
<won>
<movie>Cleopatra</movie>
<person>Victor Milner</person></won></cinematography>
<cinematography year="1934">
<lost>
<movie>The Affairs of Cellini</movie>
<person>Charles Rosher</person></lost></cinematography>
<cinematography year="1934">
<lost>
<movie>Operator 13</movie>
<person>George Folsey</person></lost></cinematography>
<director year="1934">
<won>
<movie>It Happened One Night</movie>
<person>Frank Capra</person></won></director>
<director year="1934">
<lost>
<movie>One Night of Love</movie>
<person>Victor Schertzinger</person></lost></director>
<director year="1934">
<lost>
<movie>The Thin Man</movie>
<person>W. S. Van Dyke</person></lost></director>
<filmEditing year="1934">
<won>
<movie>Eskimo</movie>
<person>Conrad Nervig</person></won></filmEditing>
<filmEditing year="1934">
<lost>
<movie>Cleopatra</movie>
<person>Anne Bauchens</person></lost></filmEditing>
<filmEditing year="1934">
<lost>
<movie>One Night of Love</movie>
<person>Gene Milford</person></lost></filmEditing>
<musicScore year="1934">
<won>
<movie>One Night of Love</movie>
<org>Columbia Studio Music Department</org>
<person>Louis Silvers</person>
<person>Gus Kahn</person>
<person>Victor Schertzinger</person></won></musicScore>
<musicScore year="1934">
<lost>
<movie>The Gay Divorcee</movie>
<org>RKO Radio Studio Music Department</org>
<person>Samuel Hoffenstein</person>
<person>Max Steiner</person>
<person>Kenneth Webb</person></lost></musicScore>
<musicScore year="1934">
<lost>
<movie>The Lost Patrol</movie>
<org>RKO Radio Studio Music Department</org>
<person>Max Steiner</person></lost></musicScore>
<musicScore year="1934">
<lost>
<movie>Captain Blood</movie>
<org>Warner Bros.-First National Studio Music Department</org>
<person>Erich Wolfgang Korngold</person>
<person>Leo Forbstein</person></lost></musicScore>
<musicScore year="1934">
<lost>
<movie>Mutiny on the Bounty</movie>
<org>Metro-Goldwyn-Mayer Studio Music Department</org>
<person>Nat W. Finston</person>
<person>Herbert Stothart</person></lost></musicScore>
<musicScore year="1934">
<lost>
<movie>Peter Ibbetson</movie>
<org>Paramount Studio Music Department</org>
<person>Irvin Talbot</person>
<person>Ernst Toch</person></lost></musicScore>
<musicSong year="1934">
<won>
<title>The Continental</title>
<movie>The Gay Divorcee</movie>
<person>Con Conrad</person>
<person>Herb Magidson</person></won></musicSong>
<musicSong year="1934">
<lost>
<title>Carioca</title>
<movie>Flying Down to Rio</movie>
<person>Edward Eliscu</person>
<person>Gus Kahn</person>
<person>Vincent Youmans</person></lost></musicSong>
<musicSong year="1934">
<lost>
<title>Love in Bloom</title>
<movie>She Loves Me Not</movie>
<person>Ralph Rainger</person>
<person>Leo Robin</person></lost></musicSong>
<shortAnimation year="1934">
<won>
<movie>The Tortoise and the Hare</movie>
<person>Walt Disney</person></won></shortAnimation>
<shortAnimation year="1934">
<lost>
<movie>Holiday Land</movie>
<person>Charles Mintz</person></lost></shortAnimation>
<shortAnimation year="1934">
<lost>
<movie>Jolly Little Elves</movie>
<person>Walter Lantz</person></lost></shortAnimation>
<shortLiveAction year="1934" subcat="comedy">
<won>
<movie>La Cucaracha</movie>
<person>Kenneth Macgowan</person></won></shortLiveAction>
<shortLiveAction year="1934" subcat="comedy">
<lost>
<movie>Men in Black</movie>
<person>Jules White</person></lost></shortLiveAction>
<shortLiveAction year="1934" subcat="comedy">
<lost>
<movie>What, No Men!</movie>
<org>Warner Bros.</org></lost></shortLiveAction>
<shortLiveAction year="1934" subcat="novelty">
<won>
<movie>City of Wax</movie>
<person>Horace Woodard</person>
<person>Stacy Woodard</person></won></shortLiveAction>
<shortLiveAction year="1934" subcat="novelty">
<lost>
<movie>Bosom Friends</movie>
<org>Skibo Productions</org></lost></shortLiveAction>
<shortLiveAction year="1934" subcat="novelty">
<lost>
<movie>Strikes and Spares</movie>
<person>Pete Smith</person></lost></shortLiveAction>
<sound year="1934">
<won>
<movie>One Night of Love</movie>
<org>Columbia Studio Sound Department</org>
<person>John Livadary</person></won></sound>
<sound year="1934">
<lost>
<movie>The Affairs of Cellini</movie>
<org>United Artists Studio Sound Department</org>
<person>Thomas T. Moulton</person></lost></sound>
<sound year="1934">
<lost>
<movie>Cleopatra</movie>
<org>Paramount Studio Sound Department</org>
<person>Franklin B. Hansen</person></lost></sound>
<sound year="1934">
<lost>
<movie>Flirtation Walk</movie>
<org>Warner Bros.-First National Studio Sound Department</org>
<person>Nathan Levinson</person></lost></sound>
<sound year="1934">
<lost>
<movie>The Gay Divorcee</movie>
<org>RKO Radio Studio Sound Department</org>
<person>Carl Dreher</person></lost></sound>
<sound year="1934">
<lost>
<movie>Imitation of Life</movie>
<org>Universal Studio Sound Department</org>
<person>Theodore Soderberg</person></lost></sound>
<sound year="1934">
<lost>
<movie>Viva Villa!</movie>
<org>Metro-Goldwyn-Mayer Studio Sound Department</org>
<person>Douglas Shearer</person></lost></sound>
<sound year="1934">
<lost>
<movie>The White Parade</movie>
<org>Fox Studio Sound Department</org>
<person>E. H. Hansen</person></lost></sound>
<writing year="1934" subcat="adaptation">
<won>
<movie>It Happened One Night</movie>
<person>Robert Riskin</person></won></writing>
<writing year="1934" subcat="adaptation">
<lost>
<movie>The Thin Man</movie>
<person>Frances Goodrich</person>
<person>Albert Hackett</person></lost></writing>
<writing year="1934" subcat="adaptation">
<lost>
<movie>Viva Villa!</movie>
<person>Ben Hecht</person></lost></writing>
<writing year="1934" subcat="original story">
<won>
<movie>Manhattan Melodrama</movie>
<person>Arthur Caesar</person></won></writing>
<writing year="1934" subcat="original story">
<lost>
<movie>Hide-Out</movie>
<person>Mauri Grashin</person></lost></writing>
<writing year="1934" subcat="original story">
<lost>
<movie>The Richest Girl in the World</movie>
<person>Norman Krasna</person></lost></writing>
<actor year="1935">
<won>
<movie>The Informer</movie>
<person>Victor McLaglen</person></won></actor>
<actor year="1935">
<lost>
<movie>Mutiny on the Bounty</movie>
<person>Clark Gable</person></lost></actor>
<actor year="1935">
<lost>
<movie>Mutiny on the Bounty</movie>
<person>Charles Laughton</person></lost></actor>
<actor year="1935">
<lost>
<movie>Black Fury</movie>
<person>Paul Muni</person></lost></actor>
<actor year="1935">
<lost>
<movie>Mutiny on the Bounty</movie>
<person>Franchot Tone</person></lost></actor>
<actress year="1935">
<won>
<movie>Dangerous</movie>
<person>Bette Davis</person></won></actress>
<actress year="1935">
<lost>
<movie>Escape Me Never</movie>
<person>Elisabeth Bergner</person></lost></actress>
<actress year="1935">
<lost>
<movie>Private Worlds</movie>
<person>Claudette Colbert</person></lost></actress>
<actress year="1935">
<lost>
<movie>Alice Adams</movie>
<person>Katharine Hepburn</person></lost></actress>
<actress year="1935">
<lost>
<movie>Becky Sharp</movie>
<person>Miriam Hopkins</person></lost></actress>
<actress year="1935">
<lost>
<movie>The Dark Angel</movie>
<person>Merle Oberon</person></lost></actress>
<artDirection year="1935">
<won>
<movie>The Dark Angel</movie>
<person>Richard Day</person></won></artDirection>
<artDirection year="1935">
<lost>
<movie>The Lives of a Bengal Lancer</movie>
<person>Roland Anderson</person>
<person>Hans Dreier</person></lost></artDirection>
<artDirection year="1935">
<lost>
<movie>Top Hat</movie>
<person>Carroll Clark</person>
<person>Van Nest Polglase</person></lost></artDirection>
<assistantDirector year="1935" note="archaic">
<won>
<movie>The Lives of a Bengal Lancer</movie>
<person>Clem Beauchamp</person>
<person>Paul Wing</person></won></assistantDirector>
<assistantDirector year="1935" note="archaic">
<lost>
<movie>David Copperfield</movie>
<person>Joseph Newman</person></lost></assistantDirector>
<assistantDirector year="1935" note="archaic">
<lost>
<movie>Les Miserables</movie>
<person>Eric Stacey</person></lost></assistantDirector>
<assistantDirector year="1935" note="archaic">
<lost>
<movie>A Midsummer Night's Dream</movie>
<person>Sherry Shourds</person></lost></assistantDirector>
<bestPicture year="1935">
<won>
<movie>Mutiny on the Bounty</movie>
<org>Metro-Goldwyn-Mayer</org></won></bestPicture>
<bestPicture year="1935">
<lost>
<movie>Alice Adams</movie>
<org>RKO Radio</org></lost></bestPicture>
<bestPicture year="1935">
<lost>
<movie>Broadway Melody of 1936</movie>
<org>Metro-Goldwyn-Mayer</org></lost></bestPicture>
<bestPicture year="1935">
<lost>
<movie>Captain Blood</movie>
<org>Cosmopolitan</org></lost></bestPicture>
<bestPicture year="1935">
<lost>
<movie>David Copperfield</movie>
<org>Metro-Goldwyn-Mayer</org></lost></bestPicture>
<bestPicture year="1935">
<lost>
<movie>The Informer</movie>
<org>RKO Radio</org></lost></bestPicture>
<bestPicture year="1935">
<lost>
<movie>Les Miserables</movie>
<org>20th Century</org></lost></bestPicture>
<bestPicture year="1935">
<lost>
<movie>The Lives of a Bengal Lancer</movie>
<org>Paramount</org></lost></bestPicture>
<bestPicture year="1935">
<lost>
<movie>A Midsummer Night's Dream</movie>
<org>Warner Bros.</org></lost></bestPicture>
<bestPicture year="1935">
<lost>
<movie>Naughty Marietta</movie>
<org>Metro-Goldwyn-Mayer</org></lost></bestPicture>
<bestPicture year="1935">
<lost>
<movie>Ruggles of Red Gap</movie>
<org>Paramount</org></lost></bestPicture>
<bestPicture year="1935">
<lost>
<movie>Top Hat</movie>
<org>RKO Radio</org></lost></bestPicture>
<cinematography year="1935">
<won>
<movie>A Midsummer Night's Dream</movie>
<person>Hal Mohr</person></won></cinematography>
<cinematography year="1935">
<lost>
<movie>Barbary Coast</movie>
<person>Ray June</person></lost></cinematography>
<cinematography year="1935">
<lost>
<movie>The Crusades</movie>
<person>Victor Milner</person></lost></cinematography>
<cinematography year="1935">
<lost>
<movie>Les Miserables</movie>
<person>Gregg Toland</person></lost></cinematography>
<danceDirection year="1935" note="archaic">
<won>
<movie>Broadway Melody of 1936</movie>
<movie>Folies Bergere</movie>
<person>Dave Gould</person></won></danceDirection>
<danceDirection year="1935" note="archaic">
<lost>
<movie>All the King's Horses</movie>
<movie>Big Broadcast of 1936</movie>
<person>LeRoy Prinz</person></lost></danceDirection>
<danceDirection year="1935" note="archaic">
<lost>
<movie>Broadway Hostess</movie>
<movie>Go Into Your Dance</movie>
<person>Bobby Connolly</person></lost></danceDirection>
<danceDirection year="1935" note="archaic">
<lost>
<movie>Gold Diggers of 1935</movie>
<person>Busby Berkeley</person></lost></danceDirection>
<danceDirection year="1935" note="archaic">
<lost>
<movie>King of Burlesque</movie>
<person>Sammy Lee</person></lost></danceDirection>
<danceDirection year="1935" note="archaic">
<lost>
<movie>Top Hat</movie>
<person>Hermes Pan</person></lost></danceDirection>
<danceDirection year="1935" note="archaic">
<lost>
<movie>She</movie>
<person>Benjamin Zemach</person></lost></danceDirection>
<director year="1935">
<won>
<movie>The Informer</movie>
<person>John Ford</person></won></director>
<director year="1935">
<lost>
<movie>Captain Blood</movie>
<person>Michael Curtiz</person></lost></director>
<director year="1935">
<lost>
<movie>The Lives of a Bengal Lancer</movie>
<person>Henry Hathaway</person></lost></director>
<director year="1935">
<lost>
<movie>Mutiny on the Bounty</movie>
<person>Frank Lloyd</person></lost></director>
<filmEditing year="1935">
<won>
<movie>A Midsummer Night's Dream</movie>
<person>Ralph Dawson</person></won></filmEditing>
<filmEditing year="1935">
<lost>
<movie>David Copperfield</movie>
<person>Robert J. Kern</person></lost></filmEditing>
<filmEditing year="1935">
<lost>
<movie>The Informer</movie>
<person>George Hively</person></lost></filmEditing>
<filmEditing year="1935">
<lost>
<movie>Les Miserables</movie>
<person>Barbara McLean</person></lost></filmEditing>
<filmEditing year="1935">
<lost>
<movie>The Lives of a Bengal Lancer</movie>
<person>Ellsworth Hoagland</person></lost></filmEditing>
<filmEditing year="1935">
<lost>
<movie>Mutiny on the Bounty</movie>
<person>Margaret Booth</person></lost></filmEditing>
<musicScore year="1935">
<won>
<movie>The Informer</movie>
<org>RKO Radio Studio Music Department</org>
<person>Max Steiner</person></won></musicScore>
<musicSong year="1935">
<won>
<title>Lullaby of Broadway</title>
<movie>Gold Diggers of 1935</movie>
<person>Al Dubin</person>
<person>Harry Warren</person></won></musicSong>
<musicSong year="1935">
<lost>
<title>Cheek to Cheek</title>
<movie>Top Hat</movie>
<person>Irving Berlin</person></lost></musicSong>
<musicSong year="1935">
<lost>
<title>Lovely to Look at</title>
<movie>Roberta</movie>
<person>Dorothy Fields</person>
<person>Jerome Kern</person>
<person>Jimmy McHugh</person></lost></musicSong>
<shortAnimation year="1935">
<won>
<movie>Three Orphan Kittens</movie>
<person>Walt Disney</person></won></shortAnimation>
<shortAnimation year="1935">
<lost>
<movie>The Calico Dragon</movie>
<person>Harman-Ising</person></lost></shortAnimation>
<shortAnimation year="1935">
<lost>
<movie>Who Killed Cock Robin?</movie>
<person>Walt Disney</person></lost></shortAnimation>
<shortLiveAction year="1935" subcat="comedy">
<won>
<movie>How To Sleep</movie>
<person>Jack Chertok</person></won></shortLiveAction>
<shortLiveAction year="1935" subcat="comedy">
<lost>
<movie>Oh, My Nerves</movie>
<person>Jules White</person></lost></shortLiveAction>
<shortLiveAction year="1935" subcat="comedy">
<lost>
<movie>Tit for Tat</movie>
<person>Hal Roach</person></lost></shortLiveAction>
<shortLiveAction year="1935" subcat="novelty">
<won>
<movie>Wings Over Mt. Everest</movie>
<org>Gaumont British and Skibo Productions</org></won></shortLiveAction>
<shortLiveAction year="1935" subcat="novelty">
<lost>
<movie>Audioscopiks</movie>
<person>Pete Smith</person></lost></shortLiveAction>
<shortLiveAction year="1935" subcat="novelty">
<lost>
<movie>Camera Thrills</movie>
<org>Universal</org></lost></shortLiveAction>
<sound year="1935">
<won>
<movie>Naughty Marietta</movie>
<org>Metro-Goldwyn-Mayer Studio Sound Department</org>
<person>Douglas Shearer</person></won></sound>
<sound year="1935">
<lost>
<movie>$1,000 a Minute</movie>
<org>Republic Studio Sound Department</org></lost></sound>
<sound year="1935">
<lost>
<movie>The Bride of Frankenstein</movie>
<org>Universal Studio Sound Department</org>
<person>Gilbert Kurland</person></lost></sound>
<sound year="1935">
<lost>
<movie>Captain Blood</movie>
<org>Warner Bros.-First National Studio Sound Department</org>
<person>Nathan Levinson</person></lost></sound>
<sound year="1935">
<lost>
<movie>The Dark Angel</movie>
<org>United Artists Studio Sound Department</org>
<person>Thomas T. Moulton</person></lost></sound>
<sound year="1935">
<lost>
<movie>I Dream Too Much</movie>
<org>RKO Radio Studio Sound Department</org>
<person>Carl Dreher</person></lost></sound>
<sound year="1935">
<lost>
<movie>The Lives of a Bengal Lancer</movie>
<org>Paramount Studio Sound Department</org>
<person>Franklin B. Hansen</person></lost></sound>
<sound year="1935">
<lost>
<movie>Love Me Forever</movie>
<org>Columbia Studio Sound Department</org>
<person>John Livadary</person></lost></sound>
<sound year="1935">
<lost>
<movie>Thanks a Million</movie>
<org>20th Century-Fox Studio Sound Department</org>
<person>E. H. Hansen</person></lost></sound>
<writing year="1935" subcat="original story">
<won>
<movie>The Scoundrel</movie>
<person>Ben Hecht</person>
<person>Charles MacArthur</person></won></writing>
<writing year="1935" subcat="original story">
<lost>
<movie>Broadway Melody of 1936</movie>
<person>Moss Hart</person></lost></writing>
<writing year="1935" subcat="original story">
<lost>
<movie>G-Men</movie>
<person>Gregory Rogers</person></lost></writing>
<writing year="1935" subcat="original story">
<lost>
<movie>The Gay Deception</movie>
<person>Stephen Avery</person>
<person>Don Hartman</person></lost></writing>
<writing year="1935" subcat="screenplay">
<won>
<movie>The Informer</movie>
<person>Dudley Nichols</person></won></writing>
<writing year="1935" subcat="screenplay">
<lost>
<movie>Captain Blood</movie>
<person>Casey Robinson</person></lost></writing>
<writing year="1935" subcat="screenplay">
<lost>
<movie>The Lives of a Bengal Lancer</movie>
<person>Achmed Abdullah</person>
<person>John L. Balderston</person>
<person>Grover Jones</person>
<person>William Slavens McNutt</person>
<person>Waldemar Young</person></lost></writing>
<writing year="1935" subcat="screenplay">
<lost>
<movie>Mutiny on the Bounty</movie>
<person>Jules Furthman</person>
<person>Talbot Jennings</person>
<person>Carey Wilson</person></lost></writing>
<actor year="1936">
<won>
<movie>The Story of Louis Pasteur</movie>
<person>Paul Muni</person></won></actor>
<actor year="1936">
<lost>
<movie>Mr. Deeds Goes to Town</movie>
<person>Gary Cooper</person></lost></actor>
<actor year="1936">
<lost>
<movie>Dodsworth</movie>
<person>Walter Huston</person></lost></actor>
<actor year="1936">
<lost>
<movie>My Man Godfrey</movie>
<person>William Powell</person></lost></actor>
<actor year="1936">
<lost>
<movie>San Francisco</movie>
<person>Spencer Tracy</person></lost></actor>
<actorSupporting year="1936">
<won>
<movie>Come and Get It</movie>
<person>Walter Brennan</person></won></actorSupporting>
<actorSupporting year="1936">
<lost>
<movie>My Man Godfrey</movie>
<person>Mischa Auer</person></lost></actorSupporting>
<actorSupporting year="1936">
<lost>
<movie>Pigskin Parade</movie>
<person>Stuart Erwin</person></lost></actorSupporting>
<actorSupporting year="1936">
<lost>
<movie>Romeo and Juliet</movie>
<person>Basil Rathbone</person></lost></actorSupporting>
<actorSupporting year="1936">
<lost>
<movie>The General Died at Dawn</movie>
<person>Akim Tamiroff</person></lost></actorSupporting>
<actress year="1936">
<won>
<movie>The Great Ziegfeld</movie>
<person>Luise Rainer</person></won></actress>
<actress year="1936">
<lost>
<movie>Theodora Goes Wild</movie>
<person>Irene Dunne</person></lost></actress>
<actress year="1936">
<lost>
<movie>Valiant Is the Word for Carrie</movie>
<person>Gladys George</person></lost></actress>
<actress year="1936">
<lost>
<movie>My Man Godfrey</movie>
<person>Carole Lombard</person></lost></actress>
<actress year="1936">
<lost>
<movie>Romeo and Juliet</movie>
<person>Norma Shearer</person></lost></actress>
<actressSupporting year="1936">
<won>
<movie>Anthony Adverse</movie>
<person>Gale Sondergaard</person></won></actressSupporting>
<actressSupporting year="1936">
<lost>
<movie>The Gorgeous Hussy</movie>
<person>Beulah Bondi</person></lost></actressSupporting>
<actressSupporting year="1936">
<lost>
<movie>My Man Godfrey</movie>
<person>Alice Brady</person></lost></actressSupporting>
<actressSupporting year="1936">
<lost>
<movie>These Three</movie>
<person>Bonita Granville</person></lost></actressSupporting>
<actressSupporting year="1936">
<lost>
<movie>Dodsworth</movie>
<person>Maria Ouspenskaya</person></lost></actressSupporting>
<artDirection year="1936">
<won>
<movie>Dodsworth</movie>
<person>Richard Day</person></won></artDirection>
<artDirection year="1936">
<lost>
<movie>Anthony Adverse</movie>
<person>Anton Grot</person></lost></artDirection>
<artDirection year="1936">
<lost>
<movie>The Great Ziegfeld</movie>
<person>Cedric Gibbons</person>
<person>Eddie Imazu</person>
<person>Edwin B. Willis</person></lost></artDirection>
<artDirection year="1936">
<lost>
<movie>Lloyds of London</movie>
<person>William S. Darling</person></lost></artDirection>
<artDirection year="1936">
<lost>
<movie>The Magnificent Brute</movie>
<person>Albert S. D'Agostino</person>
<person>Jack Otterson</person></lost></artDirection>
<artDirection year="1936">
<lost>
<movie>Romeo and Juliet</movie>
<person>Cedric Gibbons</person>
<person>Frederic Hope</person>
<person>Edwin B. Willis</person></lost></artDirection>
<artDirection year="1936">
<lost>
<movie>Winterset</movie>
<person>Perry Ferguson</person></lost></artDirection>
<assistantDirector year="1936" note="archaic">
<won>
<movie>The Charge of the Light Brigade</movie>
<person>Jack Sullivan</person></won></assistantDirector>
<assistantDirector year="1936" note="archaic">
<lost>
<movie>Anthony Adverse</movie>
<person>William Cannon</person></lost></assistantDirector>
<assistantDirector year="1936" note="archaic">
<lost>
<movie>The Garden of Allah</movie>
<person>Eric G. Stacey</person></lost></assistantDirector>
<assistantDirector year="1936" note="archaic">
<lost>
<movie>The Last of the Mohicans</movie>
<person>Clem Beauchamp</person></lost></assistantDirector>
<assistantDirector year="1936" note="archaic">
<lost>
<movie>San Francisco</movie>
<person>Joseph Newman</person></lost></assistantDirector>
<bestPicture year="1936">
<won>
<movie>The Great Ziegfeld</movie>
<org>Metro-Goldwyn-Mayer</org></won></bestPicture>
<bestPicture year="1936">
<lost>
<movie>Anthony Adverse</movie>
<org>Warner Bros.</org></lost></bestPicture>
<bestPicture year="1936">
<lost>
<movie>Dodsworth</movie>
<org>Samuel Goldwyn</org></lost></bestPicture>
<bestPicture year="1936">
<lost>
<movie>Libeled Lady</movie>
<org>Metro-Goldwyn-Mayer</org></lost></bestPicture>
<bestPicture year="1936">
<lost>
<movie>Mr. Deeds Goes to Town</movie>
<org>Columbia</org></lost></bestPicture>
<bestPicture year="1936">
<lost>
<movie>Romeo and Juliet</movie>
<org>Metro-Goldwyn-Mayer</org></lost></bestPicture>
<bestPicture year="1936">
<lost>
<movie>San Francisco</movie>
<org>Metro-Goldwyn-Mayer</org></lost></bestPicture>
<bestPicture year="1936">
<lost>
<movie>The Story of Louis Pasteur</movie>
<org>Cosmopolitan</org></lost></bestPicture>
<bestPicture year="1936">
<lost>
<movie>A Tale of Two Cities</movie>
<org>Metro-Goldwyn-Mayer</org></lost></bestPicture>
<bestPicture year="1936">
<lost>
<movie>Three Smart Girls</movie>
<org>Universal</org></lost></bestPicture>
<cinematography year="1936">
<won>
<movie>Anthony Adverse</movie>
<person>Gaetano Gaudio</person></won></cinematography>
<cinematography year="1936">
<lost>
<movie>The General Died at Dawn</movie>
<person>Victor Milner</person></lost></cinematography>
<cinematography year="1936">
<lost>
<movie>The Gorgeous Hussy</movie>
<person>George Folsey</person></lost></cinematography>
<danceDirection year="1936" note="archaic">
<won>
<movie>The Great Ziegfeld</movie>
<person>Seymour Felix</person></won></danceDirection>
<danceDirection year="1936" note="archaic">
<lost>
<movie>Born to Dance</movie>
<person>Dave Gould</person></lost></danceDirection>
<danceDirection year="1936" note="archaic">
<lost>
<movie>Cain and Mabel</movie>
<person>Bobby Connolly</person></lost></danceDirection>
<danceDirection year="1936" note="archaic">
<lost>
<movie>Dancing Pirate</movie>
<person>Russell Lewis</person></lost></danceDirection>
<danceDirection year="1936" note="archaic">
<lost>
<movie>Gold Diggers of 1937</movie>
<person>Busby Berkeley</person></lost></danceDirection>
<danceDirection year="1936" note="archaic">
<lost>
<movie>One in a Million</movie>
<person>Jack Haskell</person></lost></danceDirection>
<danceDirection year="1936" note="archaic">
<lost>
<movie>Swing Time</movie>
<person>Hermes Pan</person></lost></danceDirection>
<director year="1936">
<won>
<movie>Mr. Deeds Goes to Town</movie>
<person>Frank Capra</person></won></director>
<director year="1936">
<lost>
<movie>Dodsworth</movie>
<person>William Wyler</person></lost></director>
<director year="1936">
<lost>
<movie>The Great Ziegfeld</movie>
<person>Robert Z. Leonard</person></lost></director>
<director year="1936">
<lost>
<movie>My Man Godfrey</movie>
<person>Gregory La Cava</person></lost></director>
<director year="1936">
<lost>
<movie>San Francisco</movie>
<person>W. S. Van Dyke</person></lost></director>
<filmEditing year="1936">
<won>
<movie>Anthony Adverse</movie>
<person>Ralph Dawson</person></won></filmEditing>
<filmEditing year="1936">
<lost>
<movie>Come and Get It</movie>
<person>Edward Curtiss</person></lost></filmEditing>
<filmEditing year="1936">
<lost>
<movie>The Great Ziegfeld</movie>
<person>William S. Gray</person></lost></filmEditing>
<filmEditing year="1936">
<lost>
<movie>Lloyds of London</movie>
<person>Barbara McLean</person></lost></filmEditing>
<filmEditing year="1936">
<lost>
<movie>A Tale of Two Cities</movie>
<person>Conrad A. Nervig</person></lost></filmEditing>
<filmEditing year="1936">
<lost>
<movie>Theodora Goes Wild</movie>
<person>Otto Meyer</person></lost></filmEditing>
<musicScore year="1936">
<won>
<movie>Anthony Adverse</movie>
<org>Warner Bros. Studio Music Department</org>
<person>Erich Wolfgang Korngold</person>
<person>Leo Forbstein</person></won></musicScore>
<musicScore year="1936">
<lost>
<movie>The Charge of the Light Brigade</movie>
<org>Max Steiner, Warner Bros. Studio Music Department</org>
<person>Max Steiner</person>
<person>Leo Forbstein</person></lost></musicScore>
<musicScore year="1936">
<lost>
<movie>The Garden of Allah</movie>
<org>Selznick International Pictures Music Department</org>
<person>Max Steiner</person></lost></musicScore>
<musicScore year="1936">
<lost>
<movie>The General Died at Dawn</movie>
<org>Paramount Studio Music Department</org>
<person>Werner Janssen</person>
<person>Boris Morros</person></lost></musicScore>
<musicScore year="1936">
<lost>
<movie>Winterset</movie>
<org>RKO Radio Studio Music Department</org>
<person>Nathaniel Shilkret</person></lost></musicScore>
<musicSong year="1936">
<won>
<title>The Way You Look Tonight</title>
<movie>Swing Time</movie>
<person>Dorothy Fields</person>
<person>Jerome Kern</person></won></musicSong>
<musicSong year="1936">
<lost>
<title>A Melody from the Sky</title>
<movie>Trail of the Lonesome Pine</movie>
<person>Louis Alter</person>
<person>Sidney Mitchell</person></lost></musicSong>
<musicSong year="1936">
<lost>
<title>Did I Remember</title>
<movie>Suzy</movie>
<person>Harold Adamson</person>
<person>Walter Donaldson</person></lost></musicSong>
<musicSong year="1936">
<lost>
<title>I've Got You Under My Skin</title>
<movie>Born To Dance</movie>
<person>Cole Porter</person></lost></musicSong>
<musicSong year="1936">
<lost>
<title>Pennies from Heaven</title>
<movie>Pennies from Heaven</movie>
<person>Johnny Burke</person>
<person>Arthur Johnston</person></lost></musicSong>
<musicSong year="1936">
<lost>
<title>When Did You Leave Heaven</title>
<movie>Sing, Baby, Sing</movie>
<person>Walter Bullock</person>
<person>Richard A. Whiting</person></lost></musicSong>
<shortAnimation year="1936">
<won>
<movie>The Country Cousin</movie>
<person>Walt Disney</person></won></shortAnimation>
<shortAnimation year="1936">
<lost>
<movie>Old Mill Pond</movie>
<person>Harman-Ising</person></lost></shortAnimation>
<shortAnimation year="1936">
<lost>
<movie>Sinbad the Sailor</movie>
<org>Paramount</org></lost></shortAnimation>
<shortLiveAction year="1936" subcat="one reel">
<won>
<movie>Bored of Education</movie>
<person>Hal Roach</person></won></shortLiveAction>
<shortLiveAction year="1936" subcat="one reel">
<lost>
<movie>Moscow Moods</movie>
<org>Paramount</org></lost></shortLiveAction>
<shortLiveAction year="1936" subcat="one reel">
<lost>
<movie>Wanted, a Master</movie>
<person>Pete Smith</person></lost></shortLiveAction>
<shortLiveAction year="1936" subcat="two reel">
<won>
<movie>The Public Pays</movie>
<org>Metro-Goldwyn-Mayer</org></won></shortLiveAction>
<shortLiveAction year="1936" subcat="two reel">
<lost>
<movie>Double Or Nothing</movie>
<org>Warner Bros.</org></lost></shortLiveAction>
<shortLiveAction year="1936" subcat="two reel">
<lost>
<movie>Dummy Ache</movie>
<org>RKO Radio</org></lost></shortLiveAction>
<shortLiveAction year="1936" subcat="color">
<won>
<movie>Give Me Liberty</movie>
<org>Warner Bros.</org></won></shortLiveAction>
<shortLiveAction year="1936" subcat="color">
<lost>
<movie>La Fiesta De Santa Barbara</movie>
<person>Lewis Lewyn</person></lost></shortLiveAction>
<shortLiveAction year="1936" subcat="color">
<lost>
<movie>Popular Science J-6-2</movie>
<org>Paramount</org></lost></shortLiveAction>
<sound year="1936">
<won>
<movie>San Francisco</movie>
<org>Metro-Goldwyn-Mayer Studio Sound Department</org>
<person>Douglas Shearer</person></won></sound>
<sound year="1936">
<lost>
<movie>Banjo on My Knee</movie>
<org>20th Century-Fox Studio Sound Department</org>
<person>E. H. Hansen</person></lost></sound>
<sound year="1936">
<lost>
<movie>The Charge of the Light Brigade</movie>
<org>Warner Bros. Studio Sound Department</org>
<person>Nathan Levinson</person></lost></sound>
<sound year="1936">
<lost>
<movie>Dodsworth</movie>
<org>United Artists Studio Sound Department</org>
<person>Thomas T. Moulton</person></lost></sound>
<sound year="1936">
<lost>
<movie>General Spanky</movie>
<org>Hal Roach Studio Sound Department</org>
<person>Elmer A. Raguse</person></lost></sound>
<sound year="1936">
<lost>
<movie>Mr. Deeds Goes to Town</movie>
<org>Columbia Studio Sound Department</org>
<person>John Livadary</person></lost></sound>
<sound year="1936">
<lost>
<movie>The Texas Rangers</movie>
<org>Paramount Studio Sound Department</org>
<person>Franklin B. Hansen</person></lost></sound>
<sound year="1936">
<lost>
<movie>That Girl from Paris</movie>
<org>Paramount Studio Sound Department</org>
<person>J. O. Aalberg</person></lost></sound>
<sound year="1936">
<lost>
<movie>Three Smart Girls</movie>
<org>Universal Studio Sound Department</org>
<person>Homer G. Tasker</person></lost></sound>
<writing year="1936" subcat="original story">
<won>
<movie>The Story of Louis Pasteur</movie>
<person>Pierre Collings</person>
<person>Sheridan Gibney</person></won></writing>
<writing year="1936" subcat="original story">
<lost>
<movie>Fury</movie>
<person>Norman Krasna</person></lost></writing>
<writing year="1936" subcat="original story">
<lost>
<movie>The Great Ziegfeld</movie>
<person>William Anthony McGuire</person></lost></writing>
<writing year="1936" subcat="original story">
<lost>
<movie>San Francisco</movie>
<person>Robert Hopkins</person></lost></writing>
<writing year="1936" subcat="original story">
<lost>
<movie>Three Smart Girls</movie>
<person>Adele Comandini</person></lost></writing>
<writing year="1936" subcat="screenplay">
<won>
<movie>The Story of Louis Pasteur</movie>
<person>Pierre Collings</person>
<person>Sheridan Gibney</person></won></writing>
<writing year="1936" subcat="screenplay">
<lost>
<movie>After the Thin Man</movie>
<person>Frances Goodrich</person>
<person>Albert Hackett</person></lost></writing>
<writing year="1936" subcat="screenplay">
<lost>
<movie>Dodsworth</movie>
<person>Sidney Howard</person></lost></writing>
<writing year="1936" subcat="screenplay">
<lost>
<movie>Mr. Deeds Goes to Town</movie>
<person>Robert Riskin</person></lost></writing>
<writing year="1936" subcat="screenplay">
<lost>
<movie>My Man Godfrey</movie>
<person>Eric Hatch</person>
<person>Morris Ryskind</person></lost></writing>
</oscars>
\ No newline at end of file