aboutsummaryrefslogtreecommitdiffstats
path: root/hierarchyviewer2/app
diff options
context:
space:
mode:
authorKonstantin Lopyrev <klopyrev@google.com>2010-08-05 18:00:36 -0700
committerKonstantin Lopyrev <klopyrev@google.com>2010-08-17 18:02:55 -0700
commitc1db1ab270b953da579e657de11d4486a49e1c1e (patch)
tree5d2aaae1c176f9d7c7a41821f0c5ba356a42aca8 /hierarchyviewer2/app
parentbc494ce06410728bef8a6fa25f3da361cb66df79 (diff)
downloadsdk-c1db1ab270b953da579e657de11d4486a49e1c1e.zip
sdk-c1db1ab270b953da579e657de11d4486a49e1c1e.tar.gz
sdk-c1db1ab270b953da579e657de11d4486a49e1c1e.tar.bz2
Adding the new tree view.
Change-Id: I490f475fadaec5625352a49524ec8cb3a6e9b7d4
Diffstat (limited to 'hierarchyviewer2/app')
-rw-r--r--hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java2
-rw-r--r--hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplicationDirector.java5
-rw-r--r--hierarchyviewer2/app/src/com/android/hierarchyviewer/UIThread.java56
3 files changed, 36 insertions, 27 deletions
diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java
index 6acbdff..c3538dc 100644
--- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java
+++ b/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java
@@ -20,6 +20,7 @@ import com.android.hierarchyviewerlib.ComponentRegistry;
import com.android.hierarchyviewerlib.HierarchyViewerDirector;
import com.android.hierarchyviewerlib.models.DeviceSelectionModel;
import com.android.hierarchyviewerlib.models.PixelPerfectModel;
+import com.android.hierarchyviewerlib.models.TreeViewModel;
public class HierarchyViewerApplication {
public static void main(String[] args) {
@@ -27,6 +28,7 @@ public class HierarchyViewerApplication {
ComponentRegistry.setDirector(director);
ComponentRegistry.setDeviceSelectionModel(new DeviceSelectionModel());
ComponentRegistry.setPixelPerfectModel(new PixelPerfectModel());
+ ComponentRegistry.setTreeViewModel(new TreeViewModel());
director.initDebugBridge();
director.startListenForDevices();
director.populateDeviceSelectionModel();
diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplicationDirector.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplicationDirector.java
index 5321ce7..8d77410 100644
--- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplicationDirector.java
+++ b/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplicationDirector.java
@@ -43,6 +43,9 @@ public class HierarchyViewerApplicationDirector extends HierarchyViewerDirector
@Override
public String getAdbLocation() {
String hvParentLocation = System.getProperty("com.android.hierarchyviewer.bindir");
+ // TODO REMOVE THIS.
+ hvParentLocation = "/usr/local/google/android-ext/out/host/linux-x86/bin";
+ System.out.println(hvParentLocation);
if (hvParentLocation != null && hvParentLocation.length() != 0) {
return hvParentLocation + File.separator + SdkConstants.FN_ADB;
}
@@ -58,7 +61,9 @@ public class HierarchyViewerApplicationDirector extends HierarchyViewerDirector
public void executeInBackground(final Runnable task) {
executor.execute(new Runnable() {
public void run() {
+ System.out.println("STARTING TASK");
task.run();
+ System.out.println("ENDING TASK");
}
});
}
diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/UIThread.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/UIThread.java
index 485fbb5..f1965b2 100644
--- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/UIThread.java
+++ b/hierarchyviewer2/app/src/com/android/hierarchyviewer/UIThread.java
@@ -17,15 +17,21 @@
package com.android.hierarchyviewer;
import com.android.ddmuilib.ImageLoader;
+import com.android.hierarchyviewerlib.ComponentRegistry;
import com.android.hierarchyvieweruilib.DeviceSelector;
import com.android.hierarchyvieweruilib.PixelPerfect;
import com.android.hierarchyvieweruilib.PixelPerfectLoupe;
import com.android.hierarchyvieweruilib.PixelPerfectTree;
+import com.android.hierarchyvieweruilib.TreeView;
+import com.android.hierarchyvieweruilib.TreeViewOverview;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Slider;
@@ -41,23 +47,22 @@ public class UIThread {
shell.open();
Shell shell2 = new Shell(display);
shell2.setLayout(new FillLayout());
- PixelPerfect pixelPerfect = new PixelPerfect(shell2);
- shell2.open();
- Shell shell3 = new Shell(display);
- shell3.setLayout(new FillLayout());
- final PixelPerfectLoupe pixelPerfectLoupe = new PixelPerfectLoupe(shell3);
- shell3.open();
- Shell shell4 = new Shell(display);
- shell4.setLayout(new FillLayout());
- PixelPerfectTree pixelPerfectTree = new PixelPerfectTree(shell4);
- shell4.open();
- Shell shell5 = new Shell(display);
- shell5.setLayout(new FillLayout());
- final Slider slider = new Slider(shell5, SWT.HORIZONTAL);
+ /*
+
+
+
+ PixelPerfectTree pixelPerfectTree = new PixelPerfectTree(shell2);
+ Composite overview = new Composite(shell2, SWT.NONE);
+ overview.setLayout(new GridLayout());
+ PixelPerfect pixelPerfect = new PixelPerfect(overview);
+ pixelPerfect.setLayoutData(new GridData(GridData.FILL_BOTH));
+ final Slider slider = new Slider(overview, SWT.HORIZONTAL);
+ slider.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
slider.setMinimum(2);
slider.setMaximum(25);
slider.setSelection(8);
slider.setThumb(1);
+ final PixelPerfectLoupe pixelPerfectLoupe = new PixelPerfectLoupe(shell2);
slider.addSelectionListener(new SelectionListener() {
private int oldZoom = 8;
@@ -68,15 +73,22 @@ public class UIThread {
public void widgetSelected(SelectionEvent arg0) {
int newZoom = slider.getSelection();
if (newZoom != oldZoom) {
- pixelPerfectLoupe.setZoom(newZoom);
+ ComponentRegistry.getPixelPerfectModel().setZoom(newZoom);
oldZoom = newZoom;
}
}
});
- shell5.open();
- while (!shell.isDisposed() && !shell2.isDisposed() && !shell3.isDisposed()
- && !shell4.isDisposed()) {
+ shell2.open();
+ */
+ TreeView treeView = new TreeView(shell2);
+ shell2.open();
+ Shell shell3 = new Shell(display);
+ shell3.setLayout(new FillLayout());
+ TreeViewOverview treeViewOverview = new TreeViewOverview(shell3);
+ shell3.open();
+ // ComponentRegistry.getDirector().loadViewTreeData(null);
+ while (!shell.isDisposed() && !shell2.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
@@ -87,19 +99,9 @@ public class UIThread {
if (!shell2.isDisposed()) {
shell2.dispose();
}
- if (!shell3.isDisposed()) {
- shell3.dispose();
- }
- if (!shell4.isDisposed()) {
- shell4.dispose();
- }
// NO LONGER TESTING STUFF.
- deviceSelector.terminate();
- pixelPerfect.terminate();
- pixelPerfectLoupe.terminate();
- pixelPerfectTree.terminate();
ImageLoader.dispose();
display.dispose();
}