Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public class Messages extends NLS
public static String EditAnnotation_Text;
public static String EditAnnotation_Trace;
public static String EditAnnotation_Info;
public static String Legend_Hide;
public static String Legend_Show;
public static String NameUnitsFmt;
public static String Pan;
Expand All @@ -48,7 +47,6 @@ public class Messages extends NLS
public static String Scroll_OnOff;
public static String Snapshot;
public static String Toolbar_Close;
public static String Toolbar_Hide;
public static String Toolbar_Show;
public static String TraceType_Area;
public static String TraceType_AreaDirect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ protected RTPlot(final Composite parent, final Class<XTYPE> type)

plot = new Plot<XTYPE>(this, type);
toolbar = new ToolbarHandler<XTYPE>(this);
toggle_toolbar = new ToggleToolbarAction(this, true);
toggle_legend = new ToggleLegendAction(this, true);
toggle_toolbar = new ToggleToolbarAction(this);
toggle_legend = new ToggleLegendAction(this);
snapshot = new SnapshotAction(this);

toolbar.addContextMenu(toggle_toolbar);
Expand Down Expand Up @@ -174,7 +174,7 @@ public void showLegend(final boolean show)
if (isLegendVisible() == show)
return;
plot.showLegend(show);
toggle_legend.updateText();
toggle_legend.update();
}

/** @return <code>true</code> if toolbar is visible */
Expand All @@ -198,7 +198,7 @@ public void showToolbar(final boolean show)
fd.right = new FormAttachment(100);
fd.bottom = new FormAttachment(100);
plot.setLayoutData(fd);
toggle_toolbar.updateText();
toggle_toolbar.update();
layout();
plot.fireToolbarChange(show);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ public class ToggleLegendAction extends Action
{
final private RTPlot<?> plot;

public ToggleLegendAction(final RTPlot<?> plot, final boolean is_visible)
public ToggleLegendAction(final RTPlot<?> plot)
{
super(is_visible ? Messages.Legend_Hide : Messages.Legend_Show,
Activator.getIcon("legend"));
super(Messages.Legend_Show, Action.AS_CHECK_BOX);
this.setImageDescriptor(Activator.getIcon("legend"));
this.setChecked(plot.isLegendVisible());
this.plot = plot;
}

public void updateText()
public void update()
{
setText(plot.isLegendVisible() ? Messages.Legend_Hide : Messages.Legend_Show);
setChecked(plot.isLegendVisible());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,23 @@ public class ToggleToolbarAction extends Action
{
final private RTPlot<?> plot;

public ToggleToolbarAction(final RTPlot<?> plot, final boolean is_visible)
public ToggleToolbarAction(final RTPlot<?> plot)
{
super(is_visible ? Messages.Toolbar_Hide : Messages.Toolbar_Show,
Activator.getIcon("toolbar"));
super(Messages.Toolbar_Show, Action.AS_CHECK_BOX);
this.setImageDescriptor(Activator.getIcon("toolbar"));
this.setChecked(plot.isToolbarVisible());
this.plot = plot;
}

public void updateText()
public void update()
{
setText(plot.isToolbarVisible() ? Messages.Toolbar_Hide : Messages.Toolbar_Show);
setChecked(plot.isToolbarVisible());
}

@Override
public void run()
{
plot.showToolbar(! plot.isToolbarVisible());
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ EditAnnotation=Edit Annotation
EditAnnotation_Text=Content
EditAnnotation_Trace=Trace
EditAnnotation_Info=Double-click annotation to edit its text. Un-check one or more annotations to remove.
Legend_Hide=Hide Legend
Legend_Show=Show Legend
NameUnitsFmt={0} [{1}]
Pan=Pan
Expand All @@ -31,7 +30,6 @@ Scroll_On_TT=Enable scrolling
Scroll_OnOff=Enable/Disable scrolling
Snapshot=Save Snapshot to File...
Toolbar_Close=Close Toolbar
Toolbar_Hide=Hide Toolbar
Toolbar_Show=Show Toolbar
TraceType_Area=Area
TraceType_AreaDirect=Area (direct)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ public class Messages extends NLS
public static String ValueAxes;
public static String ValueAxisName;
public static String ValueColumn;
public static String WaveformAmplitude;
public static String WaveformIndex;
public static String WaveformIndexCol;
public static String WaveformIndexColTT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ UseTraceNames=Trace Names?
ValueAxes=Value Axes
ValueAxisName=Axis Name
ValueColumn=Value
WaveformAmplitude=Amplitude
WaveformIndex=Waveform Index
WaveformIndexCol=Index
WaveformIndexColTT=Waveform Index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,10 @@ public void widgetSelected(final SelectionEvent e)
// =====================
plot = new RTValuePlot(parent);
plot.getXAxis().setName(Messages.WaveformIndex);
plot.getYAxes().get(0).setName(Messages.WaveformAmplitude);
plot.getYAxes().get(0).setAutoscale(true);
plot.getYAxes().get(0).useAxisName(false);
plot.showLegend(false);
plot.requestUpdate();
plot.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, layout.numColumns, 1));

// <<<<<< Slider >>>>>>
Expand Down Expand Up @@ -271,6 +274,8 @@ public void menuAboutToShow(IMenuManager manager) {
mm.add(plot.getLegendAction());
mm.add(new Separator());
mm.add(new ToggleYAxisAction<Double>(plot, true));
mm.add(new Separator());
mm.add(plot.getSnapshotAction());
}
});

Expand Down