diff options
author | Siva Velusamy <vsiva@google.com> | 2013-02-16 01:10:18 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-02-16 01:10:18 +0000 |
commit | a5aac752d0daa84209f739122f6c189b1380c02d (patch) | |
tree | bc416633f9f05f31c24694f485a25d0a376dfe43 /hierarchyviewer/src | |
parent | 8a14389ebf3f55efd9bfe69abc285041110e6fa3 (diff) | |
parent | 25adb796ca0623f79a8c4aeb7de118cfd72ff8f9 (diff) | |
download | sdk-a5aac752d0daa84209f739122f6c189b1380c02d.zip sdk-a5aac752d0daa84209f739122f6c189b1380c02d.tar.gz sdk-a5aac752d0daa84209f739122f6c189b1380c02d.tar.bz2 |
Merge "Use swing worker that is part of Java6"
Diffstat (limited to 'hierarchyviewer/src')
4 files changed, 86 insertions, 87 deletions
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) { |