-/*******************************************************************************\r
- * Copyright (c) 2009, 2010, 2012 Ericsson\r
- * \r
- * All rights reserved. This program and the accompanying materials are\r
- * made available under the terms of the Eclipse Public License v1.0 which\r
- * accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- * \r
- * Contributors:\r
- * Alvaro Sanchez-Leon - Initial API and implementation\r
- * Patrick Tasse - Refactoring\r
- *******************************************************************************/\r
-\r
-package org.eclipse.linuxtools.tmf.ui.widgets.timegraph;\r
-\r
-import java.util.Map;\r
-\r
-import org.eclipse.linuxtools.internal.tmf.ui.Messages;\r
-import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;\r
-import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;\r
-import org.eclipse.swt.graphics.GC;\r
-import org.eclipse.swt.graphics.Image;\r
-import org.eclipse.swt.graphics.Rectangle;\r
-\r
-public abstract class TimeGraphPresentationProvider implements ITimeGraphPresentationProvider {\r
-\r
- // ------------------------------------------------------------------------\r
- // Constants\r
- // ------------------------------------------------------------------------\r
- private static final int DEFAULT_ITEM_HEIGHT = 19;\r
-\r
- // ------------------------------------------------------------------------\r
- // Operations\r
- // ------------------------------------------------------------------------\r
- /*\r
- * (non-Javadoc)\r
- * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getStateTypeName()\r
- */\r
- @Override\r
- public String getStateTypeName() {\r
- return Messages.TmfTimeLegend_TRACE_STATES;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphProvider#postDrawItems(org.eclipse.swt.graphics.Rectangle, org.eclipse.swt.graphics.GC)\r
- */\r
- @Override\r
- public void postDrawControl(Rectangle bounds, GC gc) {\r
- // Override to add own drawing code\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphProvider#postDrawItem(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry, org.eclipse.swt.graphics.Rectangle, org.eclipse.swt.graphics.GC)\r
- */\r
- @Override\r
- public void postDrawEntry(ITimeGraphEntry entry, Rectangle bounds, GC gc) {\r
- // Override to add own drawing code\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphProvider#drawState(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent, org.eclipse.swt.graphics.Rectangle, org.eclipse.swt.graphics.GC)\r
- */\r
- @Override\r
- public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc) {\r
- // Override to add own drawing code\r
- }\r
-\r
-// /* (non-Javadoc)\r
-// * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphProvider#getEventColorTable()\r
-// */\r
-// @Override\r
-// public RGB[] getEventColorTable() {\r
-// return null;\r
-// }\r
-//\r
-// /*\r
-// * (non-Javadoc)\r
-// * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getEventNameTable()\r
-// */\r
-// @Override\r
-// public String[] getEventNameTable() {\r
-// return null;\r
-// }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getStateItems()\r
- */\r
- @Override\r
- public StateItem[] getStateTable() {\r
- return null;\r
- }\r
- \r
- /*\r
- * (non-Javadoc)\r
- * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getEventTableIndex(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent)\r
- */\r
- @Override\r
- public int getEventTableIndex(ITimeEvent event) {\r
- return 0;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getItemHeight(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry)\r
- */\r
- @Override\r
- public int getItemHeight(ITimeGraphEntry entry) {\r
- return DEFAULT_ITEM_HEIGHT;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphProvider#getTraceClassName(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry)\r
- */\r
- @Override\r
- public String getTraceClassName(ITimeGraphEntry trace) {\r
- return null;\r
- }\r
-\r
- /* (non-Javadoc)\r
- * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphProvider#getEventName(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent)\r
- */\r
- @Override\r
- public abstract String getEventName(ITimeEvent event);\r
-\r
- /*\r
- * (non-Javadoc)\r
- * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphProvider#composeTraceName(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry, boolean)\r
- */\r
- @Override\r
- public String composeTraceName(ITimeGraphEntry trace, boolean inclState) {\r
- String name = trace.getName();\r
- String threadClass = getTraceClassName(trace);\r
- if (threadClass != null && threadClass.length() > 0) {\r
- name += " [" + threadClass + "]"; //$NON-NLS-1$ //$NON-NLS-2$\r
- }\r
- return name;\r
- }\r
-\r
- /* (non-Javadoc)\r
- * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphProvider#composeEventName(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent)\r
- */\r
- @Override\r
- public String composeEventName(ITimeEvent event) {\r
- String name = event.getEntry().getName();\r
- String threadClass = getTraceClassName(event.getEntry());\r
- if (threadClass != null && threadClass.length() > 0) {\r
- name += " [" + threadClass + "]"; //$NON-NLS-1$ //$NON-NLS-2$\r
- }\r
- name += " (" + getEventName(event) + ")"; //$NON-NLS-1$ //$NON-NLS-2$\r
- return name;\r
- }\r
-\r
- /* (non-Javadoc)\r
- * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphProvider#getEventHoverToolTipInfo(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent)\r
- */\r
- @Override\r
- public abstract Map<String, String> getEventHoverToolTipInfo(ITimeEvent event);\r
-\r
- /* (non-Javadoc)\r
- * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphProvider#getItemImage(java.lang.Object)\r
- */\r
- @Override\r
- public Image getItemImage(Object obj) {\r
- return null;\r
- }\r
-\r
+/*******************************************************************************
+ * Copyright (c) 2009, 2012 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alvaro Sanchez-Leon - Initial API and implementation
+ * Patrick Tasse - Refactoring
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.ui.widgets.timegraph;
+
+import java.util.Map;
+
+import org.eclipse.linuxtools.internal.tmf.ui.Messages;
+import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;
+import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+
+/**
+ * Provider class for the time graph provider
+ *
+ * @version 1.0
+ * @author Patrick Tasse
+ *
+ */
+public class TimeGraphPresentationProvider implements ITimeGraphPresentationProvider {
+
+ // ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+ private static final int DEFAULT_ITEM_HEIGHT = 19;
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getStateTypeName()
+ */
+ @Override
+ public String getStateTypeName() {
+ return Messages.TmfTimeLegend_TRACE_STATES;
+ }
+
+ /**
+ * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getStateTypeName(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry)
+ * @since 2.0
+ */
+ @Override
+ public String getStateTypeName(ITimeGraphEntry entry) {
+ return null;
+ }
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getStateTable()
+ */
+ @Override
+ public StateItem[] getStateTable() {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getEventTableIndex(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent)
+ */
+ @Override
+ public int getStateTableIndex(ITimeEvent event) {
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#postDrawControl(org.eclipse.swt.graphics.Rectangle, org.eclipse.swt.graphics.GC)
+ */
+ @Override
+ public void postDrawControl(Rectangle bounds, GC gc) {
+ // Override to add own drawing code
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#postDrawEntry(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry, org.eclipse.swt.graphics.Rectangle, org.eclipse.swt.graphics.GC)
+ */
+ @Override
+ public void postDrawEntry(ITimeGraphEntry entry, Rectangle bounds, GC gc) {
+ // Override to add own drawing code
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#postDrawEvent(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent, org.eclipse.swt.graphics.Rectangle, org.eclipse.swt.graphics.GC)
+ */
+ @Override
+ public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc) {
+ // Override to add own drawing code
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getItemHeight(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry)
+ */
+ @Override
+ public int getItemHeight(ITimeGraphEntry entry) {
+ return DEFAULT_ITEM_HEIGHT;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getItemImage(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry)
+ */
+ @Override
+ public Image getItemImage(ITimeGraphEntry entry) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getEventName(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent)
+ */
+ @Override
+ public String getEventName(ITimeEvent event) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getEventHoverToolTipInfo(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent)
+ */
+ @Override
+ public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getEventHoverToolTipInfo(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent, long)
+ */
+ /**
+ * @since 2.0
+ */
+ @Override
+ public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event, long hoverTime) {
+ return getEventHoverToolTipInfo(event);
+ }
+
}
\ No newline at end of file