GraphEditorInput.java

Go to the documentation of this file.
00001 package edu.rice.cs.hpc.viewer.graph;
00002 
00003 import org.eclipse.jface.resource.ImageDescriptor;
00004 import org.eclipse.ui.IEditorInput;
00005 import org.eclipse.ui.IPersistableElement;
00006 import org.eclipse.ui.IWorkbenchWindow;
00007 
00008 import edu.rice.cs.hpc.data.experiment.metric.MetricRaw;
00009 import edu.rice.cs.hpc.data.experiment.scope.Scope;
00010 import edu.rice.cs.hpc.viewer.window.Database;
00011 
00012 public class GraphEditorInput implements IEditorInput {
00013     private final Database _database;
00014     private final Scope _scope;
00015     private final MetricRaw _metric;
00016     
00017     private final GraphType.PlotType _type;
00018     /***
00019      * Create a new editor input for a give scope, metric, plot type and database
00020      * @param experiment
00021      * @param scope
00022      * @param metric
00023      * @param type
00024      * @param database
00025      */
00026     public GraphEditorInput(Database database, Scope scope, MetricRaw metric, 
00027             GraphType.PlotType type, IWorkbenchWindow window) {
00028         this._scope = scope;
00029         this._metric = metric;
00030         this._type = type;
00031         this._database = database;
00032     }
00033     
00034     public boolean exists() {
00035         // TODO Auto-generated method stub
00036         return false;
00037     }
00038 
00039     public ImageDescriptor getImageDescriptor() {
00040         // TODO Auto-generated method stub
00041         return null;
00042     }
00043 
00044     public String getName() {
00045         final String sOrignalTitle = "[" + GraphType.toString(_type) + "] " + _scope.getName()+": " + _metric.getDisplayName();
00046         return sOrignalTitle;
00047     }
00048 
00049     public String getID() {
00050         return getID(_scope, _metric, _type, _database);
00051     }
00052     
00053     /****
00054      * return the ID for the editor graph from the combination of scope, metric, graph type and database
00055      * @param scope
00056      * @param metric
00057      * @param type
00058      * @param database
00059      * @return
00060      */
00061     static public String getID(Scope scope, MetricRaw metric, GraphType.PlotType type, Database database) {
00062         return Integer.toString(database.getWindowIndex()) + GraphType.toString(type) + ":" + 
00063         scope.getCCTIndex()+":" + metric.getID();
00064     }
00065 
00066     
00067     public IPersistableElement getPersistable() {
00068         // TODO Auto-generated method stub
00069         return null;
00070     }
00071 
00072     public String getToolTipText() {
00073         return getName();
00074     }
00075 
00076     public Object getAdapter(Class adapter) {
00077         // TODO Auto-generated method stub
00078         return null;
00079     }
00080     
00081         
00082     public GraphType.PlotType getType() {
00083         return this._type;
00084     }
00085 
00086     public Database getDatabase() {
00087         return this._database;
00088     }
00089     
00090     public Scope getScope() {
00091         return this._scope;
00092     }
00093     
00094     public MetricRaw getMetric() {
00095         return this._metric;
00096     }
00097 }

Generated on 5 May 2015 for HPCVIEWER by  doxygen 1.6.1