use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class OffsetDialog method eventSelected.
/**
* Handler for the event selected signal
*
* @param signal
* the event selected signal
*/
@TmfSignalHandler
public void eventSelected(final TmfEventSelectedSignal signal) {
Display.getDefault().asyncExec(() -> {
for (TmfTraceElement traceElement : fOffsetMap.keySet()) {
if (traceElement.getResource().equals(signal.getEvent().getTrace().getResource())) {
fRefTimeMap.put(traceElement, signal.getEvent().getTimestamp());
fViewer.getViewer().update(traceElement, null);
break;
}
}
});
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class OffsetDialog method timeSelected.
/**
* Handler for the time selected signal
*
* @param signal
* the event selected signal
*/
@TmfSignalHandler
public void timeSelected(final TmfSelectionRangeUpdatedSignal signal) {
Display.getDefault().asyncExec(() -> {
for (TmfTraceElement traceElement : fOffsetMap.keySet()) {
fTargetTimeMap.put(traceElement, signal.getBeginTime());
fViewer.getViewer().update(traceElement, null);
}
});
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class TmfUml2SDSyncLoader method windowRangeUpdated.
/**
* Moves to the page that contains the current time provided by signal. No
* message will be selected however the focus will be set to the message if
* the provided time is the time of a message.
*
* @param signal
* The window range signal
* @since 1.0
*/
@TmfSignalHandler
public void windowRangeUpdated(TmfWindowRangeUpdatedSignal signal) {
fLock.lock();
try {
if ((signal.getSource() != this) && (fFrame != null) && !fIsSignalSent && (!fCheckPoints.isEmpty())) {
TmfTimeRange newTimeRange = signal.getCurrentRange();
fIsSelect = false;
fCurrentTime = newTimeRange.getStartTime();
moveToMessage();
}
} finally {
fLock.unlock();
}
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class TmfTimeViewer method selectionRangeUpdated.
/**
* Signal handler for handling of the selected range signal.
*
* @param signal
* The {@link TmfSelectionRangeUpdatedSignal}
* @since 1.0
*/
@TmfSignalHandler
public void selectionRangeUpdated(@Nullable TmfSelectionRangeUpdatedSignal signal) {
final ITmfTrace trace = fTrace;
if (signal != null && (signal.getSource() != this) && (trace != null)) {
TmfTraceContext ctx = TmfTraceManager.getInstance().getTraceContext(trace);
long selectedTime = ctx.getSelectionRange().getStartTime().toNanos();
long selectedEndTime = ctx.getSelectionRange().getEndTime().toNanos();
setSelectionRange(selectedTime, selectedEndTime);
}
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class TmfTimeViewer method windowRangeUpdated.
/**
* Signal handler for handling of the window range signal.
*
* @param signal
* The {@link TmfWindowRangeUpdatedSignal}
* @since 1.0
*/
@TmfSignalHandler
public void windowRangeUpdated(@Nullable TmfWindowRangeUpdatedSignal signal) {
final ITmfTrace trace = fTrace;
if (signal != null && trace != null) {
TmfTraceContext ctx = TmfTraceManager.getInstance().getTraceContext(trace);
// Validate the time range
TmfTimeRange range = ctx.getWindowRange().getIntersection(trace.getTimeRange());
if (range == null) {
return;
}
if (signal.getSource() != this) {
// Update the time range
long windowStartTime = range.getStartTime().toNanos();
long windowEndTime = range.getEndTime().toNanos();
setWindowRange(windowStartTime, windowEndTime);
}
}
}
Aggregations