aboutsummaryrefslogtreecommitdiffstats
path: root/hierarchyviewer2/app
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2011-05-04 18:00:46 -0700
committerAndroid Code Review <code-review@android.com>2011-05-04 18:00:46 -0700
commit38d97f3b67fc379107a423eb507b46665556731b (patch)
treef63eed2e836ee6daf91b9eab009ad92ffd72331b /hierarchyviewer2/app
parent5429213ea1c9621564692d81e585eed2ee26bc6e (diff)
parent3fe16ced4294bdeeab31008e93b5e2d004da7437 (diff)
downloadsdk-38d97f3b67fc379107a423eb507b46665556731b.zip
sdk-38d97f3b67fc379107a423eb507b46665556731b.tar.gz
sdk-38d97f3b67fc379107a423eb507b46665556731b.tar.bz2
Merge "hierarchyviewer can dump displaylists for selected nodes."
Diffstat (limited to 'hierarchyviewer2/app')
-rw-r--r--hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java23
-rw-r--r--hierarchyviewer2/app/src/com/android/hierarchyviewer/util/ActionButton.java4
2 files changed, 24 insertions, 3 deletions
diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java
index 54a5fd6..bf18965 100644
--- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java
+++ b/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java
@@ -26,6 +26,7 @@ import com.android.hierarchyviewer.util.ActionButton;
import com.android.hierarchyviewerlib.HierarchyViewerDirector;
import com.android.hierarchyviewerlib.actions.CapturePSDAction;
import com.android.hierarchyviewerlib.actions.DisplayViewAction;
+import com.android.hierarchyviewerlib.actions.DumpDisplayListAction;
import com.android.hierarchyviewerlib.actions.InspectScreenshotAction;
import com.android.hierarchyviewerlib.actions.InvalidateAction;
import com.android.hierarchyviewerlib.actions.LoadOverlayAction;
@@ -38,6 +39,8 @@ import com.android.hierarchyviewerlib.actions.RefreshWindowsAction;
import com.android.hierarchyviewerlib.actions.RequestLayoutAction;
import com.android.hierarchyviewerlib.actions.SavePixelPerfectAction;
import com.android.hierarchyviewerlib.actions.SaveTreeViewAction;
+import com.android.hierarchyviewerlib.device.DeviceBridge.ViewServerInfo;
+import com.android.hierarchyviewerlib.models.DeviceSelectionModel;
import com.android.hierarchyviewerlib.models.PixelPerfectModel;
import com.android.hierarchyviewerlib.models.TreeViewModel;
import com.android.hierarchyviewerlib.models.PixelPerfectModel.IImageChangeListener;
@@ -86,8 +89,8 @@ import org.eclipse.swt.widgets.Shell;
public class HierarchyViewerApplication extends ApplicationWindow {
private static final String APP_NAME = "Hierarchy Viewer";
- private static final int INITIAL_WIDTH = 1024;
- private static final int INITIAL_HEIGHT = 768;
+ private static final int INITIAL_WIDTH = 1280;
+ private static final int INITIAL_HEIGHT = 800;
private static HierarchyViewerApplication sMainWindow;
@@ -124,6 +127,8 @@ public class HierarchyViewerApplication extends ApplicationWindow {
private PixelPerfectLoupe mPixelPerfectLoupe;
private Composite mTreeViewControls;
+ private ActionButton dumpDisplayList;
+
private HierarchyViewerDirector mDirector;
/*
@@ -366,7 +371,7 @@ public class HierarchyViewerApplication extends ApplicationWindow {
Composite innerButtonPanel = new Composite(buttonPanel, SWT.NONE);
innerButtonPanel.setLayoutData(new GridData(GridData.FILL_VERTICAL));
- GridLayout innerButtonPanelLayout = new GridLayout(6, true);
+ GridLayout innerButtonPanelLayout = new GridLayout(7, true);
innerButtonPanelLayout.marginWidth = innerButtonPanelLayout.marginHeight = 2;
innerButtonPanelLayout.horizontalSpacing = innerButtonPanelLayout.verticalSpacing = 2;
innerButtonPanel.setLayout(innerButtonPanelLayout);
@@ -394,6 +399,10 @@ public class HierarchyViewerApplication extends ApplicationWindow {
new ActionButton(innerButtonPanel, RequestLayoutAction.getAction());
requestLayout.setLayoutData(new GridData(GridData.FILL_BOTH));
+ dumpDisplayList =
+ new ActionButton(innerButtonPanel, DumpDisplayListAction.getAction());
+ dumpDisplayList.setLayoutData(new GridData(GridData.FILL_BOTH));
+
SashForm mainSash = new SashForm(mTreeViewPanel, SWT.HORIZONTAL | SWT.SMOOTH);
mainSash.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite treeViewContainer = new Composite(mainSash, SWT.BORDER);
@@ -657,6 +666,14 @@ public class HierarchyViewerApplication extends ApplicationWindow {
treeViewMenu.add(new Separator());
treeViewMenu.add(RefreshViewAction.getAction());
treeViewMenu.add(DisplayViewAction.getAction(getShell()));
+ // Only make the DumpDisplayList action visible if the protocol supports it.
+ ViewServerInfo info = DeviceSelectionModel.getModel().getSelectedDeviceInfo();
+ if (info != null && info.protocolVersion >= 4) {
+ treeViewMenu.add(DumpDisplayListAction.getAction());
+ dumpDisplayList.setVisible(true);
+ } else {
+ dumpDisplayList.setVisible(false);
+ }
treeViewMenu.add(new Separator());
treeViewMenu.add(InvalidateAction.getAction());
treeViewMenu.add(RequestLayoutAction.getAction());
diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/util/ActionButton.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/util/ActionButton.java
index 4681c40..ca3c689 100644
--- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/util/ActionButton.java
+++ b/hierarchyviewer2/app/src/com/android/hierarchyviewer/util/ActionButton.java
@@ -73,4 +73,8 @@ public class ActionButton implements IPropertyChangeListener, SelectionListener
public void addSelectionListener(SelectionListener listener) {
mButton.addSelectionListener(listener);
}
+
+ public void setVisible(boolean visible) {
+ mButton.setVisible(visible);
+ }
}