diff options
Diffstat (limited to 'hierarchyviewer/src/com/android/hierarchyviewer/ui/action')
13 files changed, 0 insertions, 533 deletions
diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/BackgroundAction.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/BackgroundAction.java deleted file mode 100644 index b2046fd81..000000000 --- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/BackgroundAction.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.hierarchyviewer.ui.action; - -import javax.swing.AbstractAction; -import javax.swing.SwingWorker; - -public abstract class BackgroundAction extends AbstractAction { - protected void executeBackgroundTask(SwingWorker<?, ?> worker) { - if (worker != null) { - worker.execute(); - } - } -} diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/CaptureLayersAction.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/CaptureLayersAction.java deleted file mode 100644 index 2fff04179..000000000 --- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/CaptureLayersAction.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.hierarchyviewer.ui.action; - -import com.android.hierarchyviewer.ui.Workspace; - -import javax.swing.KeyStroke; -import java.awt.event.KeyEvent; -import java.awt.event.ActionEvent; -import java.awt.Toolkit; - -public class CaptureLayersAction extends BackgroundAction { - public static final String ACTION_NAME = "captureLayers"; - private Workspace mWorkspace; - - public CaptureLayersAction(Workspace workspace) { - putValue(NAME, "Capture PSD"); - putValue(SHORT_DESCRIPTION, "Capture PSD"); - putValue(LONG_DESCRIPTION, "Capture current window into a Photoshop PSD file"); - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_P, - Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); - this.mWorkspace = workspace; - } - - public void actionPerformed(ActionEvent e) { - executeBackgroundTask(mWorkspace.captureLayers()); - } -} diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/CaptureNodeAction.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/CaptureNodeAction.java deleted file mode 100644 index a8aee3c01..000000000 --- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/CaptureNodeAction.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.hierarchyviewer.ui.action; - -import com.android.hierarchyviewer.ui.Workspace; - -import javax.swing.KeyStroke; -import java.awt.event.KeyEvent; -import java.awt.event.ActionEvent; -import java.awt.Toolkit; - -public class CaptureNodeAction extends BackgroundAction { - public static final String ACTION_NAME = "captureNode"; - private Workspace mWorkspace; - - public CaptureNodeAction(Workspace workspace) { - putValue(NAME, "Display View"); - putValue(SHORT_DESCRIPTION, "Display View"); - putValue(LONG_DESCRIPTION, "Display View"); - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_D, - Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); - this.mWorkspace = workspace; - } - - public void actionPerformed(ActionEvent e) { - executeBackgroundTask(mWorkspace.showNodeCapture()); - } -} diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/DumpDisplayListAction.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/DumpDisplayListAction.java deleted file mode 100644 index 3e667946b..000000000 --- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/DumpDisplayListAction.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.android.hierarchyviewer.ui.action; - -import com.android.hierarchyviewer.ui.Workspace; - -import javax.swing.KeyStroke; -import java.awt.event.KeyEvent; -import java.awt.event.ActionEvent; -import java.awt.Toolkit; - -public class DumpDisplayListAction extends BackgroundAction { - public static final String ACTION_NAME = "dumpDisplayList"; - private Workspace mWorkspace; - - public DumpDisplayListAction(Workspace workspace) { - putValue(NAME, "Dump DisplayList"); - putValue(SHORT_DESCRIPTION, "Dump DisplayList"); - putValue(LONG_DESCRIPTION, "Dump DisplayList"); - this.mWorkspace = workspace; - } - - public void actionPerformed(ActionEvent e) { - executeBackgroundTask(mWorkspace.outputDisplayList()); - } -} diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/ExitAction.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/ExitAction.java deleted file mode 100644 index e5aaed555..000000000 --- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/ExitAction.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.hierarchyviewer.ui.action; - -import com.android.hierarchyviewer.ui.Workspace; -import com.android.hierarchyviewer.device.DeviceBridge; - -import javax.swing.AbstractAction; -import javax.swing.KeyStroke; -import java.awt.event.KeyEvent; -import java.awt.event.ActionEvent; -import java.awt.Toolkit; - -public class ExitAction extends AbstractAction { - public static final String ACTION_NAME = "exit"; - private Workspace mWorkspace; - - public ExitAction(Workspace workspace) { - putValue(NAME, "Quit"); - putValue(SHORT_DESCRIPTION, "Quit"); - putValue(LONG_DESCRIPTION, "Quit"); - putValue(MNEMONIC_KEY, KeyEvent.VK_Q); - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_Q, - Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); - this.mWorkspace = workspace; - } - - public void actionPerformed(ActionEvent e) { - mWorkspace.cleanupDevices(); - mWorkspace.dispose(); - DeviceBridge.terminate(); - System.exit(0); - } -} diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/InvalidateAction.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/InvalidateAction.java deleted file mode 100644 index 7767cda74..000000000 --- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/InvalidateAction.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.hierarchyviewer.ui.action; - -import com.android.hierarchyviewer.ui.Workspace; - -import javax.swing.KeyStroke; -import java.awt.event.KeyEvent; -import java.awt.event.ActionEvent; -import java.awt.Toolkit; - -public class InvalidateAction extends BackgroundAction { - public static final String ACTION_NAME = "invalidate"; - private Workspace mWorkspace; - - public InvalidateAction(Workspace workspace) { - putValue(NAME, "Invalidate"); - putValue(SHORT_DESCRIPTION, "Invalidate"); - putValue(LONG_DESCRIPTION, "Invalidate"); - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_I, - Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); - this.mWorkspace = workspace; - } - - public void actionPerformed(ActionEvent e) { - executeBackgroundTask(mWorkspace.invalidateView()); - } -} diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/LoadGraphAction.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/LoadGraphAction.java deleted file mode 100644 index 42c8b8e60..000000000 --- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/LoadGraphAction.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.hierarchyviewer.ui.action; - -import com.android.hierarchyviewer.ui.Workspace; - -import javax.swing.KeyStroke; -import java.awt.event.KeyEvent; -import java.awt.event.ActionEvent; -import java.awt.Toolkit; - -public class LoadGraphAction extends BackgroundAction { - public static final String ACTION_NAME = "loadGraph"; - private Workspace mWorkspace; - - public LoadGraphAction(Workspace workspace) { - putValue(NAME, "Load View Hierarchy"); - putValue(SHORT_DESCRIPTION, "Load"); - putValue(LONG_DESCRIPTION, "Load View Hierarchy"); - putValue(MNEMONIC_KEY, KeyEvent.VK_L); - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_L, - Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); - this.mWorkspace = workspace; - } - - public void actionPerformed(ActionEvent e) { - executeBackgroundTask(mWorkspace.loadGraph()); - } -} diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/RefreshWindowsAction.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/RefreshWindowsAction.java deleted file mode 100644 index bcb7ea73c..000000000 --- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/RefreshWindowsAction.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.hierarchyviewer.ui.action; - -import com.android.hierarchyviewer.ui.Workspace; - -import javax.swing.KeyStroke; -import java.awt.event.KeyEvent; -import java.awt.event.ActionEvent; - -public class RefreshWindowsAction extends BackgroundAction { - public static final String ACTION_NAME = "refreshWindows"; - private Workspace mWorkspace; - - public RefreshWindowsAction(Workspace workspace) { - putValue(NAME, "Refresh Windows"); - putValue(SHORT_DESCRIPTION, "Refresh"); - putValue(LONG_DESCRIPTION, "Refresh Windows"); - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F7, 0)); - this.mWorkspace = workspace; - } - - public void actionPerformed(ActionEvent e) { - executeBackgroundTask(mWorkspace.loadWindows()); - } -} diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/RequestLayoutAction.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/RequestLayoutAction.java deleted file mode 100644 index 6fc2832df..000000000 --- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/RequestLayoutAction.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.hierarchyviewer.ui.action; - -import com.android.hierarchyviewer.ui.Workspace; - -import javax.swing.KeyStroke; -import java.awt.event.KeyEvent; -import java.awt.event.ActionEvent; -import java.awt.Toolkit; - -public class RequestLayoutAction extends BackgroundAction { - public static final String ACTION_NAME = "requestLayout"; - private Workspace mWorkspace; - - public RequestLayoutAction(Workspace workspace) { - putValue(NAME, "Request Layout"); - putValue(SHORT_DESCRIPTION, "Request Layout"); - putValue(LONG_DESCRIPTION, "Request Layout"); - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_R, - Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); - this.mWorkspace = workspace; - } - - public void actionPerformed(ActionEvent e) { - executeBackgroundTask(mWorkspace.requestLayout()); - } -} diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/SaveSceneAction.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/SaveSceneAction.java deleted file mode 100644 index 7c7a8a9e2..000000000 --- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/SaveSceneAction.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.hierarchyviewer.ui.action; - -import com.android.hierarchyviewer.ui.Workspace; - -import javax.swing.KeyStroke; -import java.awt.event.KeyEvent; -import java.awt.event.ActionEvent; -import java.awt.Toolkit; - -public class SaveSceneAction extends BackgroundAction { - public static final String ACTION_NAME = "saveScene"; - private Workspace mWorkspace; - - public SaveSceneAction(Workspace workspace) { - mWorkspace = workspace; - putValue(NAME, "Save as PNG..."); - putValue(SHORT_DESCRIPTION, "Save"); - putValue(LONG_DESCRIPTION, "Save as PNG..."); - putValue(MNEMONIC_KEY, KeyEvent.VK_S); - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_S, - Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); - } - - public void actionPerformed(ActionEvent e) { - executeBackgroundTask(mWorkspace.saveSceneAsImage()); - } -} diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/ShowDevicesAction.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/ShowDevicesAction.java deleted file mode 100644 index a91ab7a00..000000000 --- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/ShowDevicesAction.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.hierarchyviewer.ui.action; - -import com.android.hierarchyviewer.ui.Workspace; - -import javax.swing.AbstractAction; -import javax.swing.KeyStroke; -import java.awt.event.KeyEvent; -import java.awt.event.ActionEvent; -import java.awt.Toolkit; - -public class ShowDevicesAction extends AbstractAction { - public static final String ACTION_NAME = "showDevices"; - private Workspace mWorkspace; - - public ShowDevicesAction(Workspace workspace) { - putValue(NAME, "Devices"); - putValue(SHORT_DESCRIPTION, "Devices"); - putValue(LONG_DESCRIPTION, "Show Devices"); - putValue(MNEMONIC_KEY, KeyEvent.VK_D); - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_D, - Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); - this.mWorkspace = workspace; - } - - public void actionPerformed(ActionEvent e) { - mWorkspace.showDevicesSelector(); - } -} diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/StartServerAction.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/StartServerAction.java deleted file mode 100644 index ccb6ae02c..000000000 --- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/StartServerAction.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.hierarchyviewer.ui.action; - -import com.android.hierarchyviewer.ui.Workspace; - -import javax.swing.KeyStroke; -import java.awt.event.KeyEvent; -import java.awt.event.ActionEvent; - -public class StartServerAction extends BackgroundAction { - public static final String ACTION_NAME = "startServer"; - private Workspace mWorkspace; - - public StartServerAction(Workspace workspace) { - putValue(NAME, "Start Server"); - putValue(SHORT_DESCRIPTION, "Start"); - putValue(LONG_DESCRIPTION, "Start Server"); - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0)); - this.mWorkspace = workspace; - } - - public void actionPerformed(ActionEvent e) { - executeBackgroundTask(mWorkspace.startServer()); - } -} diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/StopServerAction.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/StopServerAction.java deleted file mode 100644 index ac76e14ff..000000000 --- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/StopServerAction.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.hierarchyviewer.ui.action; - -import com.android.hierarchyviewer.ui.Workspace; - -import javax.swing.KeyStroke; -import java.awt.event.KeyEvent; -import java.awt.event.ActionEvent; - -public class StopServerAction extends BackgroundAction { - public static final String ACTION_NAME = "stopServer"; - private Workspace mWorkspace; - - public StopServerAction(Workspace workspace) { - putValue(NAME, "Stop Server"); - putValue(SHORT_DESCRIPTION, "Stop"); - putValue(LONG_DESCRIPTION, "Stop Server"); - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0)); - this.mWorkspace = workspace; - } - - public void actionPerformed(ActionEvent e) { - executeBackgroundTask(mWorkspace.stopServer()); - } -} |