| 1 |
/* Copyright (C) 2022-2025 Free Software Foundation |
| 2 |
|
| 3 |
This program is free software; you can redistribute it and/or modify |
| 4 |
it under the terms of the GNU General Public License as published by |
| 5 |
the Free Software Foundation, either version 3 of the License, or |
| 6 |
(at your option) any later version. |
| 7 |
|
| 8 |
This program is distributed in the hope that it will be useful, |
| 9 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 |
GNU General Public License for more details. |
| 12 |
|
| 13 |
You should have received a copy of the GNU General Public License |
| 14 |
along with this program. If not, see <http://www.gnu.org/licenses>. */ |
| 15 |
|
| 16 |
// @(#)EventDetail.java 1.21 11/06/09 |
| 17 |
|
| 18 |
package org.gprofng.mpmt.timeline.events; |
| 19 |
|
| 20 |
import org.gprofng.mpmt.statecolors.StackState; |
| 21 |
import java.util.List; |
| 22 |
import javax.swing.ImageIcon; |
| 23 |
|
| 24 |
public abstract class EventDetail { |
| 25 |
public static final int NO_CPU_INFO = -1; |
| 26 |
private static final String[] DUMMY_STRINGS = {}; |
| 27 |
// private final static char[] DUMMY_MNEMONICS = { }; |
| 28 |
private static final ImageIcon[] DUMMY_ICONS = {}; |
| 29 |
|
| 30 |
// TODO: adjust should be moved to DBE so filters work as expected for time-adjust experiments |
| 31 |
protected final long timestamp; // adjusted timestamp, e.g. as viewed in timeline |
| 32 |
private final long org_time; // original timestamp |
| 33 |
|
| 34 |
public EventDetail(final long original_time, final long time_adjust) { |
| 35 |
timestamp = original_time - time_adjust; |
| 36 |
org_time = original_time; |
| 37 |
} |
| 38 |
|
| 39 |
public final long getTimestamp() { |
| 40 |
return timestamp; |
| 41 |
} |
| 42 |
|
| 43 |
public abstract long getStack(); // for none, DetailsIPC.INVALID_STACK_ID |
| 44 |
|
| 45 |
public abstract List<StackState> getStackStates(); // for none, returns NULL |
| 46 |
|
| 47 |
public String[] getEventSpecificLabels() { |
| 48 |
return DUMMY_STRINGS; |
| 49 |
} |
| 50 |
|
| 51 |
public String[] getEventSpecificInfo() { |
| 52 |
return DUMMY_STRINGS; |
| 53 |
} |
| 54 |
|
| 55 |
// public char[] getEventSpecificMnemonics() { |
| 56 |
// return DUMMY_MNEMONICS; |
| 57 |
// } |
| 58 |
|
| 59 |
public ImageIcon[] getEventSpecificIcons() { |
| 60 |
return DUMMY_ICONS; |
| 61 |
} |
| 62 |
} |