aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2013-02-16 01:10:18 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-02-16 01:10:18 +0000
commita5aac752d0daa84209f739122f6c189b1380c02d (patch)
treebc416633f9f05f31c24694f485a25d0a376dfe43
parent8a14389ebf3f55efd9bfe69abc285041110e6fa3 (diff)
parent25adb796ca0623f79a8c4aeb7de118cfd72ff8f9 (diff)
downloadsdk-a5aac752d0daa84209f739122f6c189b1380c02d.zip
sdk-a5aac752d0daa84209f739122f6c189b1380c02d.tar.gz
sdk-a5aac752d0daa84209f739122f6c189b1380c02d.tar.bz2
Merge "Use swing worker that is part of Java6"
-rw-r--r--build/tools.atree1
-rw-r--r--draw9patch/Android.mk3
-rw-r--r--draw9patch/etc/manifest.txt1
-rw-r--r--draw9patch/src/com/android/draw9patch/ui/MainFrame.java18
-rw-r--r--draw9patch/src/com/android/draw9patch/ui/action/BackgroundAction.java3
-rw-r--r--hierarchyviewer/etc/manifest.txt2
-rw-r--r--hierarchyviewer/src/Android.mk1
-rw-r--r--hierarchyviewer/src/com/android/hierarchyviewer/ui/ScreenViewer.java63
-rw-r--r--hierarchyviewer/src/com/android/hierarchyviewer/ui/Workspace.java106
-rw-r--r--hierarchyviewer/src/com/android/hierarchyviewer/ui/action/BackgroundAction.java3
10 files changed, 97 insertions, 104 deletions
diff --git a/build/tools.atree b/build/tools.atree
index 046ce3f..b5a7edd 100644
--- a/build/tools.atree
+++ b/build/tools.atree
@@ -143,7 +143,6 @@ prebuilts/tools/common/eclipse/org.eclipse.core.commands_3.6.0.I20100512-1500.ja
prebuilts/tools/common/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar tools/lib/org.eclipse.equinox.common_3.6.0.v20100503.jar
prebuilts/tools/common/eclipse/org.eclipse.jface_3.6.2.M20110210-1200.jar tools/lib/org.eclipse.jface_3.6.2.M20110210-1200.jar
prebuilts/tools/common/osgi/osgi.jar tools/lib/osgi.jar
-prebuilts/tools/common/swing-worker/swing-worker-1.1.jar tools/lib/swing-worker-1.1.jar
prebuilts/tools/common/asm-tools/asm-4.0.jar tools/lib/asm-4.0.jar
prebuilts/tools/common/asm-tools/asm-tree-4.0.jar tools/lib/asm-tree-4.0.jar
prebuilts/tools/common/asm-tools/asm-analysis-4.0.jar tools/lib/asm-analysis-4.0.jar
diff --git a/draw9patch/Android.mk b/draw9patch/Android.mk
index ef2184d..ddb8707 100644
--- a/draw9patch/Android.mk
+++ b/draw9patch/Android.mk
@@ -20,9 +20,6 @@ LOCAL_JAVA_RESOURCE_DIRS := src
LOCAL_JAR_MANIFEST := etc/manifest.txt
-LOCAL_JAVA_LIBRARIES := \
- swing-worker-1.1
-
LOCAL_MODULE := draw9patch
LOCAL_MODULE_TAGS := debug
diff --git a/draw9patch/etc/manifest.txt b/draw9patch/etc/manifest.txt
index b2e3528..2616706 100644
--- a/draw9patch/etc/manifest.txt
+++ b/draw9patch/etc/manifest.txt
@@ -1,2 +1 @@
Main-Class: com.android.draw9patch.Application
-Class-Path: swing-worker-1.1.jar
diff --git a/draw9patch/src/com/android/draw9patch/ui/MainFrame.java b/draw9patch/src/com/android/draw9patch/ui/MainFrame.java
index a272a28..ff749f4 100644
--- a/draw9patch/src/com/android/draw9patch/ui/MainFrame.java
+++ b/draw9patch/src/com/android/draw9patch/ui/MainFrame.java
@@ -16,24 +16,24 @@
package com.android.draw9patch.ui;
+import com.android.draw9patch.graphics.GraphicsUtilities;
import com.android.draw9patch.ui.action.ExitAction;
import com.android.draw9patch.ui.action.OpenAction;
import com.android.draw9patch.ui.action.SaveAction;
-import com.android.draw9patch.graphics.GraphicsUtilities;
-import javax.swing.JFrame;
-import javax.swing.JMenuBar;
-import javax.swing.JMenu;
-import javax.swing.JMenuItem;
-import javax.swing.ActionMap;
-import javax.swing.JFileChooser;
-import javax.imageio.ImageIO;
import java.awt.HeadlessException;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.concurrent.ExecutionException;
-import org.jdesktop.swingworker.SwingWorker;
+import javax.imageio.ImageIO;
+import javax.swing.ActionMap;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.SwingWorker;
public class MainFrame extends JFrame {
private ActionMap actionsMap;
diff --git a/draw9patch/src/com/android/draw9patch/ui/action/BackgroundAction.java b/draw9patch/src/com/android/draw9patch/ui/action/BackgroundAction.java
index 85d9d4f..11bf261 100644
--- a/draw9patch/src/com/android/draw9patch/ui/action/BackgroundAction.java
+++ b/draw9patch/src/com/android/draw9patch/ui/action/BackgroundAction.java
@@ -16,9 +16,8 @@
package com.android.draw9patch.ui.action;
-import org.jdesktop.swingworker.SwingWorker;
-
import javax.swing.AbstractAction;
+import javax.swing.SwingWorker;
public abstract class BackgroundAction extends AbstractAction {
protected void executeBackgroundTask(SwingWorker<?, ?> worker) {
diff --git a/hierarchyviewer/etc/manifest.txt b/hierarchyviewer/etc/manifest.txt
index f7ddfa9..06efd79 100644
--- a/hierarchyviewer/etc/manifest.txt
+++ b/hierarchyviewer/etc/manifest.txt
@@ -1,2 +1,2 @@
Main-Class: com.android.hierarchyviewer.HierarchyViewer
-Class-Path: ddmlib.jar swing-worker-1.1.jar org-openide-util.jar org-netbeans-api-visual.jar
+Class-Path: ddmlib.jar org-openide-util.jar org-netbeans-api-visual.jar
diff --git a/hierarchyviewer/src/Android.mk b/hierarchyviewer/src/Android.mk
index a578218..e84c8f8 100644
--- a/hierarchyviewer/src/Android.mk
+++ b/hierarchyviewer/src/Android.mk
@@ -21,7 +21,6 @@ LOCAL_JAVA_RESOURCE_DIRS := resources
LOCAL_JAR_MANIFEST := ../etc/manifest.txt
LOCAL_JAVA_LIBRARIES := \
ddmlib \
- swing-worker-1.1 \
org-openide-util \
org-netbeans-api-visual
LOCAL_MODULE := hierarchyviewer
diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/ScreenViewer.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/ScreenViewer.java
index 3b0662f..bae1270 100644
--- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/ScreenViewer.java
+++ b/hierarchyviewer/src/com/android/hierarchyviewer/ui/ScreenViewer.java
@@ -2,54 +2,53 @@ package com.android.hierarchyviewer.ui;
import com.android.ddmlib.IDevice;
import com.android.ddmlib.RawImage;
-import com.android.hierarchyviewer.util.WorkerThread;
import com.android.hierarchyviewer.scene.ViewNode;
-import com.android.hierarchyviewer.ui.util.PngFileFilter;
import com.android.hierarchyviewer.ui.util.IconLoader;
+import com.android.hierarchyviewer.ui.util.PngFileFilter;
+import com.android.hierarchyviewer.util.WorkerThread;
-import javax.swing.JComponent;
-import javax.swing.JScrollPane;
-import javax.swing.Timer;
-import javax.swing.JPanel;
-import javax.swing.SwingUtilities;
-import javax.swing.BorderFactory;
-import javax.swing.JLabel;
-import javax.swing.JSlider;
-import javax.swing.Box;
-import javax.swing.JCheckBox;
-import javax.swing.JButton;
-import javax.swing.JFileChooser;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.ChangeEvent;
-import javax.imageio.ImageIO;
-
-import org.jdesktop.swingworker.SwingWorker;
-
-import java.io.IOException;
-import java.io.File;
-import java.awt.image.BufferedImage;
-import java.awt.Graphics;
-import java.awt.Dimension;
+import java.awt.AlphaComposite;
import java.awt.BorderLayout;
-import java.awt.Graphics2D;
import java.awt.Color;
-import java.awt.Rectangle;
-import java.awt.Point;
-import java.awt.GridBagLayout;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
import java.awt.Insets;
-import java.awt.FlowLayout;
-import java.awt.AlphaComposite;
+import java.awt.Point;
+import java.awt.Rectangle;
import java.awt.RenderingHints;
-import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
import java.util.concurrent.ExecutionException;
+import javax.imageio.ImageIO;
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComponent;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSlider;
+import javax.swing.SwingUtilities;
+import javax.swing.SwingWorker;
+import javax.swing.Timer;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
class ScreenViewer extends JPanel implements ActionListener {
private final Workspace workspace;
private final IDevice device;
diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/Workspace.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/Workspace.java
index 82375e0..bfa15b3 100644
--- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/Workspace.java
+++ b/hierarchyviewer/src/com/android/hierarchyviewer/ui/Workspace.java
@@ -22,43 +22,70 @@ import com.android.hierarchyviewer.device.DeviceBridge;
import com.android.hierarchyviewer.device.Window;
import com.android.hierarchyviewer.laf.UnifiedContentBorder;
import com.android.hierarchyviewer.scene.CaptureLoader;
+import com.android.hierarchyviewer.scene.ProfilesLoader;
import com.android.hierarchyviewer.scene.VersionLoader;
import com.android.hierarchyviewer.scene.ViewHierarchyLoader;
import com.android.hierarchyviewer.scene.ViewHierarchyScene;
import com.android.hierarchyviewer.scene.ViewManager;
import com.android.hierarchyviewer.scene.ViewNode;
import com.android.hierarchyviewer.scene.WindowsLoader;
-import com.android.hierarchyviewer.scene.ProfilesLoader;
-import com.android.hierarchyviewer.ui.action.DumpDisplayListAction;
-import com.android.hierarchyviewer.ui.util.PsdFileFilter;
-import com.android.hierarchyviewer.util.OS;
-import com.android.hierarchyviewer.util.WorkerThread;
-import com.android.hierarchyviewer.ui.action.ShowDevicesAction;
-import com.android.hierarchyviewer.ui.action.RequestLayoutAction;
-import com.android.hierarchyviewer.ui.action.InvalidateAction;
-import com.android.hierarchyviewer.ui.action.CaptureNodeAction;
import com.android.hierarchyviewer.ui.action.CaptureLayersAction;
-import com.android.hierarchyviewer.ui.action.RefreshWindowsAction;
-import com.android.hierarchyviewer.ui.action.StopServerAction;
-import com.android.hierarchyviewer.ui.action.StartServerAction;
+import com.android.hierarchyviewer.ui.action.CaptureNodeAction;
+import com.android.hierarchyviewer.ui.action.DumpDisplayListAction;
import com.android.hierarchyviewer.ui.action.ExitAction;
+import com.android.hierarchyviewer.ui.action.InvalidateAction;
import com.android.hierarchyviewer.ui.action.LoadGraphAction;
+import com.android.hierarchyviewer.ui.action.RefreshWindowsAction;
+import com.android.hierarchyviewer.ui.action.RequestLayoutAction;
import com.android.hierarchyviewer.ui.action.SaveSceneAction;
-import com.android.hierarchyviewer.ui.util.PngFileFilter;
-import com.android.hierarchyviewer.ui.util.IconLoader;
+import com.android.hierarchyviewer.ui.action.ShowDevicesAction;
+import com.android.hierarchyviewer.ui.action.StartServerAction;
+import com.android.hierarchyviewer.ui.action.StopServerAction;
+import com.android.hierarchyviewer.ui.model.ProfilesTableModel;
import com.android.hierarchyviewer.ui.model.PropertiesTableModel;
import com.android.hierarchyviewer.ui.model.ViewsTreeModel;
-import com.android.hierarchyviewer.ui.model.ProfilesTableModel;
-import org.jdesktop.swingworker.SwingWorker;
+import com.android.hierarchyviewer.ui.util.IconLoader;
+import com.android.hierarchyviewer.ui.util.PngFileFilter;
+import com.android.hierarchyviewer.ui.util.PsdFileFilter;
+import com.android.hierarchyviewer.util.OS;
+import com.android.hierarchyviewer.util.WorkerThread;
+
import org.netbeans.api.visual.graph.layout.TreeGraphLayout;
import org.netbeans.api.visual.model.ObjectSceneEvent;
import org.netbeans.api.visual.model.ObjectSceneEventType;
import org.netbeans.api.visual.model.ObjectSceneListener;
import org.netbeans.api.visual.model.ObjectState;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Graphics2D;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseWheelEvent;
+import java.awt.event.MouseWheelListener;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.ExecutionException;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
import javax.imageio.ImageIO;
import javax.swing.ActionMap;
import javax.swing.BorderFactory;
+import javax.swing.Box;
import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
import javax.swing.JButton;
@@ -72,56 +99,31 @@ import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
-import javax.swing.JScrollPane;
import javax.swing.JScrollBar;
+import javax.swing.JScrollPane;
import javax.swing.JSlider;
import javax.swing.JSplitPane;
import javax.swing.JTable;
+import javax.swing.JTextField;
import javax.swing.JToggleButton;
import javax.swing.JToolBar;
+import javax.swing.JTree;
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
-import javax.swing.JTree;
-import javax.swing.Box;
-import javax.swing.JTextField;
-import javax.swing.text.Document;
-import javax.swing.text.BadLocationException;
-import javax.swing.tree.TreePath;
-import javax.swing.tree.DefaultTreeCellRenderer;
+import javax.swing.SwingWorker;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TreeSelectionListener;
import javax.swing.event.TreeSelectionEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.event.DocumentEvent;
+import javax.swing.event.TreeSelectionListener;
import javax.swing.table.DefaultTableModel;
-import java.awt.image.BufferedImage;
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.GridBagLayout;
-import java.awt.GridBagConstraints;
-import java.awt.Insets;
-import java.awt.FlowLayout;
-import java.awt.Color;
-import java.awt.Image;
-import java.awt.Graphics2D;
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseWheelEvent;
-import java.awt.event.MouseWheelListener;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-import java.util.concurrent.ExecutionException;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.tree.DefaultTreeCellRenderer;
+import javax.swing.tree.TreePath;
public class Workspace extends JFrame {
private JLabel viewCountLabel;
diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/BackgroundAction.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/BackgroundAction.java
index 051e3f3..b2046fd 100644
--- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/BackgroundAction.java
+++ b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/BackgroundAction.java
@@ -16,9 +16,8 @@
package com.android.hierarchyviewer.ui.action;
-import org.jdesktop.swingworker.SwingWorker;
-
import javax.swing.AbstractAction;
+import javax.swing.SwingWorker;
public abstract class BackgroundAction extends AbstractAction {
protected void executeBackgroundTask(SwingWorker<?, ?> worker) {