com.android.ide.eclipse.hierarchyviewer_22.6.2.v201403212031-1085508

16:34:17.149 INFO  jd.cli.Main - Decompiling com.android.ide.eclipse.hierarchyviewer_22.6.2.v201403212031-1085508.jar
package com.android.ide.eclipse.hierarchyviewer;

import org.eclipse.ui.console.MessageConsoleStream;

class HierarchyViewerPlugin$1
  implements Runnable
{
  HierarchyViewerPlugin$1(HierarchyViewerPlugin paramHierarchyViewerPlugin, MessageConsoleStream paramMessageConsoleStream) {}
  
  public void run()
  {
    val$errorConsoleStream.setColor(HierarchyViewerPlugin.access$0(this$0));
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.HierarchyViewerPlugin.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer;

import com.android.ddmlib.Log.LogLevel;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

class HierarchyViewerPlugin$2$1
  implements Runnable
{
  HierarchyViewerPlugin$2$1(HierarchyViewerPlugin.2 param2, Log.LogLevel paramLogLevel, String paramString1, String paramString2) {}
  
  public void run()
  {
    Shell shell = Display.getDefault().getActiveShell();
    if (val$logLevel == Log.LogLevel.ERROR) {
      MessageDialog.openError(shell, val$tag, val$message);
    } else {
      MessageDialog.openWarning(shell, val$tag, val$message);
    }
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.HierarchyViewerPlugin.2.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer;

import com.android.ddmlib.Log.ILogOutput;
import com.android.ddmlib.Log.LogLevel;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.MessageConsole;
import org.eclipse.ui.console.MessageConsoleStream;

class HierarchyViewerPlugin$2
  implements Log.ILogOutput
{
  HierarchyViewerPlugin$2(HierarchyViewerPlugin paramHierarchyViewerPlugin, MessageConsoleStream paramMessageConsoleStream1, MessageConsole paramMessageConsole, MessageConsoleStream paramMessageConsoleStream2) {}
  
  public void printLog(Log.LogLevel logLevel, String tag, String message)
  {
    if (logLevel.getPriority() >= Log.LogLevel.ERROR.getPriority())
    {
      HierarchyViewerPlugin.access$1(val$errorConsoleStream, tag, message);
      ConsolePlugin.getDefault().getConsoleManager().showConsoleView(val$messageConsole);
    }
    else
    {
      HierarchyViewerPlugin.access$1(val$consoleStream, tag, message);
    }
  }
  
  public void printAndPromptLog(final Log.LogLevel logLevel, final String tag, final String message)
  {
    printLog(logLevel, tag, message);
    
    Display.getDefault().asyncExec(new Runnable()
    {
      public void run()
      {
        Shell shell = Display.getDefault().getActiveShell();
        if (logLevel == Log.LogLevel.ERROR) {
          MessageDialog.openError(shell, tag, message);
        } else {
          MessageDialog.openWarning(shell, tag, message);
        }
      }
    });
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.HierarchyViewerPlugin.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer;

import com.android.ddmlib.AndroidDebugBridge;
import com.android.ddmlib.AndroidDebugBridge.IDebugBridgeChangeListener;
import com.android.hierarchyviewerlib.HierarchyViewerDirector;

class HierarchyViewerPlugin$3
  implements AndroidDebugBridge.IDebugBridgeChangeListener
{
  HierarchyViewerPlugin$3(HierarchyViewerPlugin paramHierarchyViewerPlugin, HierarchyViewerDirector paramHierarchyViewerDirector) {}
  
  public void bridgeChanged(AndroidDebugBridge bridge)
  {
    val$director.acquireBridge(bridge);
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.HierarchyViewerPlugin.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer;

import com.android.hierarchyviewerlib.HierarchyViewerDirector;

class HierarchyViewerPlugin$4
  extends Thread
{
  HierarchyViewerPlugin$4(HierarchyViewerPlugin paramHierarchyViewerPlugin, HierarchyViewerDirector paramHierarchyViewerDirector) {}
  
  public void run()
  {
    val$director.populateDeviceSelectionModel();
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.HierarchyViewerPlugin.4
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer;

import com.android.ddmlib.AndroidDebugBridge;
import com.android.ddmlib.AndroidDebugBridge.IDebugBridgeChangeListener;
import com.android.ddmlib.Log;
import com.android.ddmlib.Log.ILogOutput;
import com.android.ddmlib.Log.LogLevel;
import com.android.hierarchyviewerlib.HierarchyViewerDirector;
import java.util.Calendar;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.MessageConsole;
import org.eclipse.ui.console.MessageConsoleStream;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class HierarchyViewerPlugin
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "com.android.ide.eclipse.hierarchyviewer";
  public static final String ADB_LOCATION = "com.android.ide.eclipse.hierarchyviewer.adb";
  private static HierarchyViewerPlugin sPlugin;
  private Color mRedColor;
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    sPlugin = this;
    
    final MessageConsole messageConsole = new MessageConsole("Hierarchy Viewer", null);
    ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] {
      messageConsole });
    
    final MessageConsoleStream consoleStream = messageConsole.newMessageStream();
    final MessageConsoleStream errorConsoleStream = messageConsole.newMessageStream();
    mRedColor = new Color(Display.getDefault(), 255, 0, 0);
    
    Display.getDefault().asyncExec(new Runnable()
    {
      public void run()
      {
        errorConsoleStream.setColor(mRedColor);
      }
    });
    Log.setLogOutput(new Log.ILogOutput()
    {
      public void printLog(Log.LogLevel logLevel, String tag, String message)
      {
        if (logLevel.getPriority() >= Log.LogLevel.ERROR.getPriority())
        {
          HierarchyViewerPlugin.printToStream(errorConsoleStream, tag, message);
          ConsolePlugin.getDefault().getConsoleManager().showConsoleView(messageConsole);
        }
        else
        {
          HierarchyViewerPlugin.printToStream(consoleStream, tag, message);
        }
      }
      
      public void printAndPromptLog(final Log.LogLevel logLevel, final String tag, final String message)
      {
        printLog(logLevel, tag, message);
        
        Display.getDefault().asyncExec(new Runnable()
        {
          public void run()
          {
            Shell shell = Display.getDefault().getActiveShell();
            if (logLevel == Log.LogLevel.ERROR) {
              MessageDialog.openError(shell, tag, message);
            } else {
              MessageDialog.openWarning(shell, tag, message);
            }
          }
        });
      }
    });
    final HierarchyViewerDirector director = HierarchyViewerPluginDirector.createDirector();
    director.startListenForDevices();
    
    AndroidDebugBridge.addDebugBridgeChangeListener(new AndroidDebugBridge.IDebugBridgeChangeListener()
    {
      public void bridgeChanged(AndroidDebugBridge bridge)
      {
        director.acquireBridge(bridge);
      }
    });
    director.acquireBridge(AndroidDebugBridge.getBridge());
    
    new Thread()
    {
      public void run()
      {
        director.populateDeviceSelectionModel();
      }
    }.start();
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    sPlugin = null;
    super.stop(context);
    
    mRedColor.dispose();
    
    HierarchyViewerDirector director = HierarchyViewerDirector.getDirector();
    director.stopListenForDevices();
    director.stopDebugBridge();
    director.terminate();
  }
  
  public static HierarchyViewerPlugin getPlugin()
  {
    return sPlugin;
  }
  
  private static synchronized void printToStream(MessageConsoleStream stream, String tag, String message)
  {
    String dateTag = getMessageTag(tag);
    
    stream.print(dateTag);
    stream.println(message);
  }
  
  private static String getMessageTag(String tag)
  {
    Calendar c = Calendar.getInstance();
    if (tag == null) {
      return String.format("[%1$tF %1$tT]", new Object[] { c });
    }
    return String.format("[%1$tF %1$tT - %2$s]", new Object[] { c, tag });
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.HierarchyViewerPlugin
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer;

import org.eclipse.core.runtime.jobs.ISchedulingRule;

class HierarchyViewerPluginDirector$1
  implements ISchedulingRule
{
  HierarchyViewerPluginDirector$1(HierarchyViewerPluginDirector paramHierarchyViewerPluginDirector) {}
  
  public boolean contains(ISchedulingRule rule)
  {
    return rule == this;
  }
  
  public boolean isConflicting(ISchedulingRule rule)
  {
    return rule == this;
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.HierarchyViewerPluginDirector.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;

class HierarchyViewerPluginDirector$2
  extends Job
{
  HierarchyViewerPluginDirector$2(HierarchyViewerPluginDirector paramHierarchyViewerPluginDirector, String $anonymous0, Runnable paramRunnable)
  {
    super($anonymous0);
  }
  
  protected IStatus run(IProgressMonitor monitor)
  {
    val$task.run();
    return Status.OK_STATUS;
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.HierarchyViewerPluginDirector.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer;

import com.android.hierarchyviewerlib.HierarchyViewerDirector;
import com.android.hierarchyviewerlib.device.IHvDevice;
import com.android.hierarchyviewerlib.models.Window;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.IPerspectiveDescriptor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;

public class HierarchyViewerPluginDirector
  extends HierarchyViewerDirector
{
  public static HierarchyViewerDirector createDirector()
  {
    return sDirector = new HierarchyViewerPluginDirector();
  }
  
  public void executeInBackground(String taskName, final Runnable task)
  {
    Job job = new Job(taskName)
    {
      protected IStatus run(IProgressMonitor monitor)
      {
        task.run();
        return Status.OK_STATUS;
      }
    };
    job.setPriority(20);
    job.setRule(mSchedulingRule);
    job.schedule();
  }
  
  private ISchedulingRule mSchedulingRule = new ISchedulingRule()
  {
    public boolean contains(ISchedulingRule rule)
    {
      return rule == this;
    }
    
    public boolean isConflicting(ISchedulingRule rule)
    {
      return rule == this;
    }
  };
  
  public String getAdbLocation()
  {
    return HierarchyViewerPlugin.getPlugin().getPreferenceStore().getString(
      "com.android.ide.eclipse.hierarchyviewer.adb");
  }
  
  public void loadViewTreeData(Window window)
  {
    super.loadViewTreeData(window);
    
    IWorkbenchWindow[] windows = 
      HierarchyViewerPlugin.getPlugin().getWorkbench().getWorkbenchWindows();
    IWorkbenchWindow[] arrayOfIWorkbenchWindow1;
    int j = (arrayOfIWorkbenchWindow1 = windows).length;
    for (int i = 0; i < j; i++)
    {
      IWorkbenchWindow currentWindow = arrayOfIWorkbenchWindow1[i];
      IWorkbenchPage page = currentWindow.getActivePage();
      if (page.getPerspective().getId().equals("com.android.ide.eclipse.hierarchyviewer.TreeViewPerspective")) {
        try
        {
          IWorkbenchPart part = page.findView("com.android.ide.eclipse.hierarchyviewer.views.PropertyView");
          if (part != null) {
            page.showView("com.android.ide.eclipse.hierarchyviewer.views.PropertyView");
          }
        }
        catch (PartInitException localPartInitException) {}
      }
    }
  }
  
  public void loadPixelPerfectData(IHvDevice device)
  {
    super.loadPixelPerfectData(device);
    
    IWorkbenchWindow[] windows = 
      HierarchyViewerPlugin.getPlugin().getWorkbench().getWorkbenchWindows();
    IWorkbenchWindow[] arrayOfIWorkbenchWindow1;
    int j = (arrayOfIWorkbenchWindow1 = windows).length;
    for (int i = 0; i < j; i++)
    {
      IWorkbenchWindow window = arrayOfIWorkbenchWindow1[i];
      IWorkbenchPage page = window.getActivePage();
      if (page.getPerspective().getId().equals("com.android.ide.eclipse.hierarchyviewer.PixelPerfectPespective")) {
        try
        {
          IWorkbenchPart part = page.findView("com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectTreeView");
          if (part != null) {
            page.showView("com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectTreeView");
          }
        }
        catch (PartInitException localPartInitException) {}
      }
    }
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.HierarchyViewerPluginDirector
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer;

import com.android.ide.eclipse.ddms.Perspective;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

public class PixelPerfectPespective
  implements IPerspectiveFactory
{
  public static final String ID = "com.android.ide.eclipse.hierarchyviewer.PixelPerfectPespective";
  
  public void createInitialLayout(IPageLayout layout)
  {
    layout.setEditorAreaVisible(false);
    
    String editorArea = layout.getEditorArea();
    
    IFolderLayout folder = layout.createFolder("tree", 1, 0.25F, editorArea);
    folder.addView("com.android.ide.eclipse.hierarchyviewer.views.DeviceSelectorView");
    folder.addView("com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectTreeView");
    
    folder = layout.createFolder("overview", 2, 0.4F, editorArea);
    folder.addView("com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectView");
    
    folder = layout.createFolder("main", 2, 0.35F, editorArea);
    folder.addView("com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectLoupeView");
    
    layout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.DeviceSelectorView");
    layout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectTreeView");
    layout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectLoupeView");
    layout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectView");
    
    layout.addPerspectiveShortcut("org.eclipse.jdt.ui.JavaPerspective");
    layout.addPerspectiveShortcut("com.android.ide.eclipse.hierarchyviewer.TreeViewPerspective");
    layout.addPerspectiveShortcut(Perspective.ID);
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.PixelPerfectPespective
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer;

import com.android.ide.eclipse.ddms.Perspective;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

public class TreeViewPerspective
  implements IPerspectiveFactory
{
  public static final String ID = "com.android.ide.eclipse.hierarchyviewer.TreeViewPerspective";
  
  public void createInitialLayout(IPageLayout layout)
  {
    layout.setEditorAreaVisible(false);
    
    String editorArea = layout.getEditorArea();
    
    IFolderLayout folder = layout.createFolder("properties", 1, 0.1F, editorArea);
    folder.addView("com.android.ide.eclipse.hierarchyviewer.views.DeviceSelectorView");
    folder.addView("com.android.ide.eclipse.hierarchyviewer.views.PropertyView");
    
    folder = layout.createFolder("main", 2, 0.24F, "properties");
    folder.addView("com.android.ide.eclipse.hierarchyviewer.views.TreeViewView");
    
    folder = layout.createFolder("panel-top", 2, 0.7F, "main");
    folder.addView("com.android.ide.eclipse.hierarchyviewer.views.TreeOverviewView");
    
    folder = layout.createFolder("panel-bottom", 4, 0.5F, "panel-top");
    folder.addView("com.android.ide.eclipse.hierarchyviewer.views.LayoutView");
    
    layout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.DeviceSelectorView");
    layout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.PropertyView");
    layout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.TreeOverviewView");
    layout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.LayoutView");
    layout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.TreeViewView");
    
    layout.addPerspectiveShortcut("org.eclipse.jdt.ui.JavaPerspective");
    layout.addPerspectiveShortcut("com.android.ide.eclipse.hierarchyviewer.PixelPerfectPespective");
    layout.addPerspectiveShortcut(Perspective.ID);
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.TreeViewPerspective
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer.views;

import com.android.hierarchyviewerlib.actions.InspectScreenshotAction;
import com.android.hierarchyviewerlib.actions.LoadViewHierarchyAction;
import com.android.hierarchyviewerlib.actions.RefreshWindowsAction;
import com.android.hierarchyviewerlib.ui.DeviceSelector;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IPerspectiveDescriptor;
import org.eclipse.ui.IPerspectiveListener;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.part.ViewPart;

public class DeviceSelectorView
  extends ViewPart
  implements IPerspectiveListener
{
  public static final String ID = "com.android.ide.eclipse.hierarchyviewer.views.DeviceSelectorView";
  private DeviceSelector mDeviceSelector;
  
  public void createPartControl(Composite parent)
  {
    parent.setLayout(new FillLayout());
    
    IPerspectiveDescriptor perspective = getViewSite().getPage().getPerspective();
    boolean doTreeViewStuff = true;
    boolean doPixelPerfectStuff = true;
    if (perspective.getId().equals("com.android.ide.eclipse.hierarchyviewer.PixelPerfectPespective")) {
      doTreeViewStuff = false;
    } else if (perspective.getId().equals("com.android.ide.eclipse.hierarchyviewer.TreeViewPerspective")) {
      doPixelPerfectStuff = false;
    }
    mDeviceSelector = new DeviceSelector(parent, doTreeViewStuff, doPixelPerfectStuff);
    
    placeActions(doTreeViewStuff, doPixelPerfectStuff);
    
    getViewSite().getWorkbenchWindow().addPerspectiveListener(this);
  }
  
  public void dispose()
  {
    super.dispose();
    getViewSite().getWorkbenchWindow().removePerspectiveListener(this);
  }
  
  private void placeActions(boolean doTreeViewStuff, boolean doPixelPerfectStuff)
  {
    IActionBars actionBars = getViewSite().getActionBars();
    
    IMenuManager mm = actionBars.getMenuManager();
    mm.removeAll();
    mm.add(RefreshWindowsAction.getAction());
    
    IToolBarManager tm = actionBars.getToolBarManager();
    tm.removeAll();
    tm.add(RefreshWindowsAction.getAction());
    if (doTreeViewStuff)
    {
      mm.add(LoadViewHierarchyAction.getAction());
      tm.add(LoadViewHierarchyAction.getAction());
    }
    if (doPixelPerfectStuff)
    {
      mm.add(InspectScreenshotAction.getAction());
      tm.add(InspectScreenshotAction.getAction());
    }
    mm.updateAll(true);
    tm.update(true);
    actionBars.updateActionBars();
  }
  
  public void setFocus()
  {
    mDeviceSelector.setFocus();
  }
  
  public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective)
  {
    if (perspective.getId().equals("com.android.ide.eclipse.hierarchyviewer.PixelPerfectPespective"))
    {
      mDeviceSelector.setMode(false, true);
      placeActions(false, true);
    }
    else if (perspective.getId().equals("com.android.ide.eclipse.hierarchyviewer.TreeViewPerspective"))
    {
      mDeviceSelector.setMode(true, false);
      placeActions(true, false);
    }
    else
    {
      mDeviceSelector.setMode(true, true);
      placeActions(true, true);
    }
  }
  
  public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) {}
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.views.DeviceSelectorView
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer.views;

import com.android.hierarchyviewerlib.ui.LayoutViewer;
import org.eclipse.jface.action.Action;

class LayoutView$1
  extends Action
{
  LayoutView$1(LayoutView paramLayoutView, String $anonymous0, int $anonymous1)
  {
    super($anonymous0, $anonymous1);
  }
  
  public void run()
  {
    LayoutView.access$0(this$0).setShowExtras(isChecked());
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.views.LayoutView.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer.views;

import com.android.hierarchyviewerlib.HierarchyViewerDirector;
import com.android.hierarchyviewerlib.ui.LayoutViewer;
import org.eclipse.jface.action.Action;

class LayoutView$2
  extends Action
{
  LayoutView$2(LayoutView paramLayoutView, String $anonymous0)
  {
    super($anonymous0);
  }
  
  public void run()
  {
    HierarchyViewerDirector.getDirector().loadAllViews();
    LayoutView.access$1(this$0).setChecked(true);
    LayoutView.access$0(this$0).setShowExtras(true);
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.views.LayoutView.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer.views;

import com.android.hierarchyviewerlib.ui.LayoutViewer;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;

class LayoutView$3
  extends Action
{
  LayoutView$3(LayoutView paramLayoutView, String $anonymous0)
  {
    super($anonymous0);
  }
  
  public void run()
  {
    boolean newValue = !LayoutView.access$0(this$0).getOnBlack();
    LayoutView.access$0(this$0).setOnBlack(newValue);
    if (newValue) {
      setImageDescriptor(ImageDescriptor.createFromImage(LayoutView.access$2(this$0)));
    } else {
      setImageDescriptor(ImageDescriptor.createFromImage(LayoutView.access$3(this$0)));
    }
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.views.LayoutView.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer.views;

import com.android.hierarchyviewerlib.models.TreeViewModel;
import org.eclipse.jface.action.Action;

class LayoutView$4
  implements Runnable
{
  LayoutView$4(LayoutView paramLayoutView) {}
  
  public void run()
  {
    LayoutView.access$4(this$0).setEnabled(TreeViewModel.getModel().getTree() != null);
    LayoutView.access$1(this$0).setEnabled(TreeViewModel.getModel().getTree() != null);
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.views.LayoutView.4
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer.views;

import com.android.ddmuilib.ImageLoader;
import com.android.hierarchyviewerlib.HierarchyViewerDirector;
import com.android.hierarchyviewerlib.models.TreeViewModel;
import com.android.hierarchyviewerlib.models.TreeViewModel.ITreeChangeListener;
import com.android.hierarchyviewerlib.ui.LayoutViewer;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.part.ViewPart;

public class LayoutView
  extends ViewPart
  implements TreeViewModel.ITreeChangeListener
{
  public static final String ID = "com.android.ide.eclipse.hierarchyviewer.views.LayoutView";
  private LayoutViewer mLayoutViewer;
  private Image mOnBlack;
  private Image mOnWhite;
  private Action mShowExtrasAction = new Action("Show &Extras", 2)
  {
    public void run()
    {
      mLayoutViewer.setShowExtras(isChecked());
    }
  };
  private Action mLoadAllViewsAction = new Action("Load All &Views")
  {
    public void run()
    {
      HierarchyViewerDirector.getDirector().loadAllViews();
      mShowExtrasAction.setChecked(true);
      mLayoutViewer.setShowExtras(true);
    }
  };
  private Action mOnBlackWhiteAction = new Action("Change Background &Color")
  {
    public void run()
    {
      boolean newValue = !mLayoutViewer.getOnBlack();
      mLayoutViewer.setOnBlack(newValue);
      if (newValue) {
        setImageDescriptor(ImageDescriptor.createFromImage(mOnWhite));
      } else {
        setImageDescriptor(ImageDescriptor.createFromImage(mOnBlack));
      }
    }
  };
  
  public void createPartControl(Composite parent)
  {
    mShowExtrasAction.setAccelerator(SWT.MOD1 + 69);
    ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
    Image image = imageLoader.loadImage("show-extras.png", Display.getDefault());
    mShowExtrasAction.setImageDescriptor(ImageDescriptor.createFromImage(image));
    mShowExtrasAction.setToolTipText("Show images");
    mShowExtrasAction.setEnabled(TreeViewModel.getModel().getTree() != null);
    
    mOnWhite = imageLoader.loadImage("on-white.png", Display.getDefault());
    mOnBlack = imageLoader.loadImage("on-black.png", Display.getDefault());
    
    mOnBlackWhiteAction.setAccelerator(SWT.MOD1 + 67);
    mOnBlackWhiteAction.setImageDescriptor(ImageDescriptor.createFromImage(mOnWhite));
    mOnBlackWhiteAction.setToolTipText("Change layout viewer background color");
    
    mLoadAllViewsAction.setAccelerator(SWT.MOD1 + 86);
    image = imageLoader.loadImage("load-all-views.png", Display.getDefault());
    mLoadAllViewsAction.setImageDescriptor(ImageDescriptor.createFromImage(image));
    mLoadAllViewsAction.setToolTipText("Load all view images");
    mLoadAllViewsAction.setEnabled(TreeViewModel.getModel().getTree() != null);
    
    parent.setLayout(new FillLayout());
    
    mLayoutViewer = new LayoutViewer(parent);
    
    placeActions();
    
    TreeViewModel.getModel().addTreeChangeListener(this);
  }
  
  public void placeActions()
  {
    IActionBars actionBars = getViewSite().getActionBars();
    
    IMenuManager mm = actionBars.getMenuManager();
    mm.removeAll();
    mm.add(mOnBlackWhiteAction);
    mm.add(mShowExtrasAction);
    mm.add(mLoadAllViewsAction);
    
    IToolBarManager tm = actionBars.getToolBarManager();
    tm.removeAll();
    tm.add(mOnBlackWhiteAction);
    tm.add(mShowExtrasAction);
    tm.add(mLoadAllViewsAction);
  }
  
  public void dispose()
  {
    super.dispose();
    TreeViewModel.getModel().removeTreeChangeListener(this);
  }
  
  public void setFocus()
  {
    mLayoutViewer.setFocus();
  }
  
  public void selectionChanged() {}
  
  public void treeChanged()
  {
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        mLoadAllViewsAction.setEnabled(TreeViewModel.getModel().getTree() != null);
        mShowExtrasAction.setEnabled(TreeViewModel.getModel().getTree() != null);
      }
    });
  }
  
  public void viewportChanged() {}
  
  public void zoomChanged() {}
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.views.LayoutView
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer.views;

import com.android.hierarchyviewerlib.ui.PixelPerfectLoupe;
import org.eclipse.jface.action.Action;

class PixelPerfectLoupeView$1
  extends Action
{
  PixelPerfectLoupeView$1(PixelPerfectLoupeView paramPixelPerfectLoupeView, String $anonymous0, int $anonymous1)
  {
    super($anonymous0, $anonymous1);
  }
  
  public void run()
  {
    PixelPerfectLoupeView.access$0(this$0).setShowOverlay(isChecked());
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectLoupeView.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer.views;

import com.android.hierarchyviewerlib.models.PixelPerfectModel;
import org.eclipse.jface.action.Action;
import org.eclipse.swt.graphics.Image;

class PixelPerfectLoupeView$2
  implements Runnable
{
  PixelPerfectLoupeView$2(PixelPerfectLoupeView paramPixelPerfectLoupeView) {}
  
  public void run()
  {
    Image overlayImage = PixelPerfectModel.getModel().getOverlayImage();
    PixelPerfectLoupeView.access$1(this$0).setEnabled(overlayImage != null);
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectLoupeView.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer.views;

import com.android.hierarchyviewerlib.models.PixelPerfectModel;
import org.eclipse.jface.action.Action;

class PixelPerfectLoupeView$3
  implements Runnable
{
  PixelPerfectLoupeView$3(PixelPerfectLoupeView paramPixelPerfectLoupeView) {}
  
  public void run()
  {
    PixelPerfectLoupeView.access$1(this$0).setEnabled(PixelPerfectModel.getModel().getOverlayImage() != null);
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectLoupeView.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer.views;

import com.android.ddmuilib.ImageLoader;
import com.android.hierarchyviewerlib.HierarchyViewerDirector;
import com.android.hierarchyviewerlib.actions.PixelPerfectAutoRefreshAction;
import com.android.hierarchyviewerlib.models.PixelPerfectModel;
import com.android.hierarchyviewerlib.models.PixelPerfectModel.IImageChangeListener;
import com.android.hierarchyviewerlib.ui.PixelPerfectControls;
import com.android.hierarchyviewerlib.ui.PixelPerfectLoupe;
import com.android.hierarchyviewerlib.ui.PixelPerfectPixelPanel;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
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.ui.IActionBars;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.part.ViewPart;

public class PixelPerfectLoupeView
  extends ViewPart
  implements PixelPerfectModel.IImageChangeListener
{
  public static final String ID = "com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectLoupeView";
  private PixelPerfectLoupe mPixelPerfectLoupe;
  private Action mShowInLoupeAction = new Action("&Show Overlay", 2)
  {
    public void run()
    {
      mPixelPerfectLoupe.setShowOverlay(isChecked());
    }
  };
  
  public void createPartControl(Composite parent)
  {
    mShowInLoupeAction.setAccelerator(SWT.MOD1 + 83);
    ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
    Image image = imageLoader.loadImage("show-overlay.png", Display.getDefault());
    mShowInLoupeAction.setImageDescriptor(ImageDescriptor.createFromImage(image));
    mShowInLoupeAction.setToolTipText("Show the overlay in the loupe view");
    mShowInLoupeAction.setEnabled(PixelPerfectModel.getModel().getOverlayImage() != null);
    PixelPerfectModel.getModel().addImageChangeListener(this);
    
    GridLayout loupeLayout = new GridLayout();
    marginWidth = (marginHeight = 0);
    horizontalSpacing = (verticalSpacing = 0);
    parent.setLayout(loupeLayout);
    
    Composite pixelPerfectLoupeBorder = new Composite(parent, 2048);
    pixelPerfectLoupeBorder.setLayoutData(new GridData(1808));
    GridLayout pixelPerfectLoupeBorderGridLayout = new GridLayout();
    marginWidth = 
      (marginHeight = 0);
    horizontalSpacing = 
      (verticalSpacing = 0);
    pixelPerfectLoupeBorder.setLayout(pixelPerfectLoupeBorderGridLayout);
    
    mPixelPerfectLoupe = new PixelPerfectLoupe(pixelPerfectLoupeBorder);
    mPixelPerfectLoupe.setLayoutData(new GridData(1808));
    
    PixelPerfectPixelPanel pixelPerfectPixelPanel = 
      new PixelPerfectPixelPanel(pixelPerfectLoupeBorder);
    pixelPerfectPixelPanel.setLayoutData(new GridData(768));
    
    PixelPerfectControls pixelPerfectControls = 
      new PixelPerfectControls(parent);
    pixelPerfectControls.setLayoutData(new GridData(768));
    
    placeActions();
  }
  
  private void placeActions()
  {
    IActionBars actionBars = getViewSite().getActionBars();
    
    IMenuManager mm = actionBars.getMenuManager();
    mm.removeAll();
    mm.add(PixelPerfectAutoRefreshAction.getAction());
    mm.add(mShowInLoupeAction);
    
    IToolBarManager tm = actionBars.getToolBarManager();
    tm.removeAll();
    tm.add(PixelPerfectAutoRefreshAction.getAction());
    tm.add(mShowInLoupeAction);
  }
  
  public void dispose()
  {
    super.dispose();
    PixelPerfectModel.getModel().removeImageChangeListener(this);
  }
  
  public void setFocus()
  {
    mPixelPerfectLoupe.setFocus();
  }
  
  public void crosshairMoved() {}
  
  public void treeChanged() {}
  
  public void imageChanged() {}
  
  public void imageLoaded()
  {
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        Image overlayImage = PixelPerfectModel.getModel().getOverlayImage();
        mShowInLoupeAction.setEnabled(overlayImage != null);
      }
    });
  }
  
  public void overlayChanged()
  {
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        mShowInLoupeAction.setEnabled(PixelPerfectModel.getModel().getOverlayImage() != null);
      }
    });
  }
  
  public void overlayTransparencyChanged() {}
  
  public void selectionChanged() {}
  
  public void zoomChanged() {}
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectLoupeView
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer.views;

import com.android.hierarchyviewerlib.actions.RefreshPixelPerfectTreeAction;
import com.android.hierarchyviewerlib.ui.PixelPerfectTree;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.part.ViewPart;

public class PixelPerfectTreeView
  extends ViewPart
{
  public static final String ID = "com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectTreeView";
  private PixelPerfectTree mPixelPerfectTree;
  
  public void createPartControl(Composite parent)
  {
    parent.setLayout(new FillLayout());
    mPixelPerfectTree = new PixelPerfectTree(parent);
    
    placeActions();
  }
  
  private void placeActions()
  {
    IActionBars actionBars = getViewSite().getActionBars();
    
    IMenuManager mm = actionBars.getMenuManager();
    mm.removeAll();
    mm.add(RefreshPixelPerfectTreeAction.getAction());
    
    IToolBarManager tm = actionBars.getToolBarManager();
    tm.removeAll();
    tm.add(RefreshPixelPerfectTreeAction.getAction());
  }
  
  public void setFocus()
  {
    mPixelPerfectTree.setFocus();
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectTreeView
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer.views;

import com.android.hierarchyviewerlib.actions.LoadOverlayAction;
import com.android.hierarchyviewerlib.actions.RefreshPixelPerfectAction;
import com.android.hierarchyviewerlib.actions.SavePixelPerfectAction;
import com.android.hierarchyviewerlib.ui.PixelPerfect;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.part.ViewPart;

public class PixelPerfectView
  extends ViewPart
{
  public static final String ID = "com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectView";
  private PixelPerfect mPixelPerfect;
  
  public void createPartControl(Composite parent)
  {
    parent.setLayout(new FillLayout());
    mPixelPerfect = new PixelPerfect(parent);
    
    placeActions();
  }
  
  private void placeActions()
  {
    IActionBars actionBars = getViewSite().getActionBars();
    
    IMenuManager mm = actionBars.getMenuManager();
    mm.removeAll();
    mm.add(SavePixelPerfectAction.getAction(getSite().getShell()));
    mm.add(RefreshPixelPerfectAction.getAction());
    mm.add(LoadOverlayAction.getAction(getSite().getShell()));
    
    IToolBarManager tm = actionBars.getToolBarManager();
    tm.removeAll();
    tm.add(SavePixelPerfectAction.getAction(getSite().getShell()));
    tm.add(RefreshPixelPerfectAction.getAction());
    tm.add(LoadOverlayAction.getAction(getSite().getShell()));
  }
  
  public void setFocus()
  {
    mPixelPerfect.setFocus();
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectView
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer.views;

import com.android.hierarchyviewerlib.ui.PropertyViewer;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;

public class PropertyView
  extends ViewPart
{
  public static final String ID = "com.android.ide.eclipse.hierarchyviewer.views.PropertyView";
  private PropertyViewer mPropertyViewer;
  
  public void createPartControl(Composite parent)
  {
    parent.setLayout(new FillLayout());
    
    mPropertyViewer = new PropertyViewer(parent);
  }
  
  public void setFocus()
  {
    mPr
1 2

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd