adds configurable label to separator

This commit is contained in:
2023-02-28 23:05:39 +01:00
parent c39ca8884a
commit 9be9671d3a
14 changed files with 394 additions and 90 deletions

View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015-2021 MINRES Technologies GmbH and others.
* Copyright (c) 2015-2023 MINRES Technologies GmbH and others.
* 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
@ -12,8 +12,8 @@ package com.minres.scviewer.database.ui;
public interface ICursor {
public long getTime();
long getTime();
public void setTime(long time);
void setTime(long time);
}

View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015-2021 MINRES Technologies GmbH and others.
* Copyright (c) 2015-2023 MINRES Technologies GmbH and others.
* 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
@ -35,82 +35,86 @@ public interface IWaveformView extends PropertyChangeListener, ISelectionProvide
static final int MARKER_POS = 1;
public static final RelationType NEXT_PREV_IN_STREAM = RelationTypeFactory.create("Prev/Next in stream");
static final RelationType NEXT_PREV_IN_STREAM = RelationTypeFactory.create("Prev/Next in stream");
public void addSelectionChangedListener(ISelectionChangedListener listener);
void addSelectionChangedListener(ISelectionChangedListener listener);
public void removeSelectionChangedListener(ISelectionChangedListener listener);
void removeSelectionChangedListener(ISelectionChangedListener listener);
public void setStyleProvider(IWaveformStyleProvider styleProvider);
void setStyleProvider(IWaveformStyleProvider styleProvider);
public void update();
void update();
public Control getControl();
Control getControl();
public Control getNameControl();
Control getNameControl();
public Control getValueControl();
Control getValueControl();
public Control getWaveformControl();
Control getWaveformControl();
public ISelection getSelection();
ISelection getSelection();
public void setSelection(ISelection selection);
void setSelection(ISelection selection);
public void setSelection(ISelection selection, boolean showIfNeeded);
void setSelection(ISelection selection, boolean showIfNeeded);
public void addToSelection(ISelection selection, boolean showIfNeeded);
void addToSelection(ISelection selection, boolean showIfNeeded);
public void moveSelection(GotoDirection direction);
void moveSelection(GotoDirection direction);
public void moveSelection(GotoDirection direction, RelationType relationType);
void moveSelection(GotoDirection direction, RelationType relationType);
public void moveCursor(GotoDirection direction);
void moveCursor(GotoDirection direction);
public List<TrackEntry> getStreamList();
List<TrackEntry> getStreamList();
public TrackEntry getEntryFor(ITx source);
TrackEntry getEntryFor(ITx source);
public TrackEntry getEntryFor(IWaveform source);
TrackEntry getEntryFor(IWaveform source);
public List<Object> getElementsAt(Point pt);
List<Object> getElementsAt(Point pt);
public void moveSelectedTrack(int i);
void moveSelectedTrack(int i);
public void setHighliteRelation(RelationType relationType);
void setHighliteRelation(RelationType relationType);
public void setMaxTime(long maxTime);
void setMaxTime(long maxTime);
public void setCursorTime(long time);
void setCursorTime(long time);
public void setMarkerTime(int marker, long time);
void setMarkerTime(int marker, long time);
public long getCursorTime();
long getCursorTime();
public int getSelectedMarker();
int getSelectedMarker();
public long getMarkerTime(int marker);
long getMarkerTime(int marker);
public void addPropertyChangeListener(PropertyChangeListener listener);
void addPropertyChangeListener(PropertyChangeListener listener);
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener);
void addPropertyChangeListener(String propertyName, PropertyChangeListener listener);
public void removePropertyChangeListener(PropertyChangeListener listener);
void removePropertyChangeListener(PropertyChangeListener listener);
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener);
void removePropertyChangeListener(String propertyName, PropertyChangeListener listener);
public List<ICursor> getCursorList();
List<ICursor> getCursorList();
public void scrollHorizontal(int percent);
void scrollHorizontal(int percent);
public void scrollTo(int pos);
void scrollTo(int pos);
public void addDisposeListener( DisposeListener listener );
void addDisposeListener( DisposeListener listener );
public void deleteSelectedTracks();
void addEventListner(IWaveformviewEventListener listener);
void removeEventListner(IWaveformviewEventListener listener);
void deleteSelectedTracks();
public TrackEntry addWaveform(IWaveform waveform, int pos);
TrackEntry addWaveform(IWaveform waveform, int pos);
public IWaveformZoom getWaveformZoom();
IWaveformZoom getWaveformZoom();
}

View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015-2021 MINRES Technologies GmbH and others.
* Copyright (c) 2015-2023 MINRES Technologies GmbH and others.
* 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
@ -13,7 +13,7 @@ package com.minres.scviewer.database.ui;
import org.eclipse.swt.widgets.Composite;
public interface IWaveformViewFactory {
public IWaveformView createPanel(Composite parent);
IWaveformView createPanel(Composite parent);
public IWaveformView createPanel(Composite parent, IWaveformStyleProvider styleProvider);
IWaveformView createPanel(Composite parent, IWaveformStyleProvider styleProvider);
}

View File

@ -0,0 +1,16 @@
/*******************************************************************************
* Copyright (c) 2015-2023 MINRES Technologies GmbH and others.
* 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:
* MINRES Technologies GmbH - initial API and implementation
*******************************************************************************/
package com.minres.scviewer.database.ui;
public interface IWaveformviewEventListener {
void onTrackEntryDoubleClickEvent (TrackEntry trackEntry);
}

View File

@ -1,9 +1,20 @@
/*******************************************************************************
* Copyright (c) 2015-2023 MINRES Technologies GmbH and others.
* 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:
* MINRES Technologies GmbH - initial API and implementation
*******************************************************************************/
package com.minres.scviewer.database.ui;
import java.util.ArrayList;
import java.util.List;
import com.minres.scviewer.database.BlankWaveform;
import com.minres.scviewer.database.EmptyWaveform;
public class TrackEntryGroup extends TrackEntry {
@ -12,7 +23,7 @@ public class TrackEntryGroup extends TrackEntry {
public Boolean is_open = true;
public TrackEntryGroup(TrackEntry[] waveform, IWaveformStyleProvider styleProvider) {
super(new BlankWaveform(), styleProvider);
super(new EmptyWaveform(), styleProvider);
for (TrackEntry iWaveform : waveform) {
waveforms.add(iWaveform);
}

View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015-2021 MINRES Technologies GmbH and others.
* Copyright (c) 2015-2023 MINRES Technologies GmbH and others.
* 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
@ -89,6 +89,7 @@ import com.minres.scviewer.database.ui.ICursor;
import com.minres.scviewer.database.ui.IWaveformStyleProvider;
import com.minres.scviewer.database.ui.IWaveformView;
import com.minres.scviewer.database.ui.IWaveformZoom;
import com.minres.scviewer.database.ui.IWaveformviewEventListener;
import com.minres.scviewer.database.ui.TrackEntry;
import com.minres.scviewer.database.ui.TrackEntryGroup;
import com.minres.scviewer.database.ui.swt.internal.slider.ZoomBar;
@ -98,6 +99,8 @@ public class WaveformView implements IWaveformView {
private ListenerList<ISelectionChangedListener> selectionChangedListeners = new ListenerList<>();
private PropertyChangeSupport pcs;
private List<IWaveformviewEventListener> eventListener = new ArrayList<>();
private ITx currentTxSelection;
@ -176,6 +179,12 @@ public class WaveformView implements IWaveformView {
@Override
public void mouseDoubleClick(MouseEvent e) {
Entry<Integer, TrackEntry> entry = trackVerticalOffset.floorEntry(e.y);
if(entry != null)
setSelection(new StructuredSelection(entry.getValue()), false, false);
for (IWaveformviewEventListener listner : eventListener) {
listner.onTrackEntryDoubleClickEvent(entry.getValue());
}
}
};
@ -1537,6 +1546,20 @@ public class WaveformView implements IWaveformView {
waveformCanvas.addDisposeListener(listener);
}
@Override
public void addEventListner(IWaveformviewEventListener listener) {
if(!eventListener.contains(listener)) {
eventListener.add(listener);
}
}
@Override
public void removeEventListner(IWaveformviewEventListener listener) {
if(eventListener.contains(listener)) {
eventListener.remove(listener);
}
}
@Override
public void setStyleProvider(IWaveformStyleProvider styleProvider) {
this.styleProvider = styleProvider;