Skip to content

Commit

Permalink
Enable buffered selection by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Sep 3, 2024
1 parent 87ce9e6 commit c32b625
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@

public class ChartSettings implements IChartSettings {

/*
* As it turned out, that buffered rendering under macOS fails somehow,
* the bufferSelection option is deactivated by default. Charts shall
* enable buffering via an option, so that it can be tested in several
* environments, e.g. macOS, GTK3, ... .
*/
private boolean bufferSelection = false;
//
private boolean enableRangeSelector = false;
Expand Down Expand Up @@ -230,17 +224,7 @@ public boolean isBufferSelection() {
@Override
public void setBufferSelection(boolean bufferSelection) {

/*
* Limitations
* macOS - https://github.com/eclipse/swtchart/issues/150
* GTK3 - https://github.com/eclipse/swtchart/issues/166
*/
if(isMacOS()) {
System.out.println("Can't set buffer selection on macOS true, see: https://github.com/eclipse/swtchart/issues/150"); //$NON-NLS-1$
this.bufferSelection = false;
} else {
this.bufferSelection = bufferSelection;
}
this.bufferSelection = bufferSelection;
}

@Override
Expand Down Expand Up @@ -738,13 +722,4 @@ public boolean isEnableTooltips() {

return enableTooltips;
}

private boolean isMacOS() {

String os = System.getProperty("os.name"); //$NON-NLS-1$
if(os != null) {
return os.toLowerCase().indexOf("mac") >= 0; //$NON-NLS-1$
}
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,9 @@ public class PreferenceConstants {

public static final int MIN_MOVE_LEGEND = 1;
public static final int MAX_MOVE_LEGEND = 100;
/*
* The buffered selection creates a screenshot and sets it in the background
* while doing the data selection. This prevents to redraw the series while
* doing the selection event. Known limitations:
* ---
* macOS - https://github.com/eclipse/swtchart/issues/150
* GTK3 - https://github.com/eclipse/swtchart/issues/166
*/
//
public static final String P_BUFFER_SELECTION = "bufferSelection";
public static final boolean DEF_BUFFER_SELECTION = false;
public static final boolean DEF_BUFFER_SELECTION = true;
public static final String P_KEEP_SERIES_DESCRIPTION = "keepSeriesDescription";
public static final boolean DEF_KEEP_SERIES_DESCRIPTION = false;
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020, 2023 Lablicate GmbH.
* Copyright (c) 2020, 2024 Lablicate GmbH.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2023 Lablicate GmbH.
* Copyright (c) 2017, 2024 Lablicate GmbH.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -90,14 +90,18 @@ private PreferenceSupport() {

}

/**
* The buffered selection creates a screenshot and sets it in the background
* while doing the data selection. This prevents to redraw the series while
* doing the selection event.
*/
public static boolean isBufferedSelection() {

boolean bufferedSelection = false;
IPreferenceStore preferenceStore = ResourceSupport.getPreferenceStore();
if(preferenceStore != null) {
bufferedSelection = preferenceStore.getBoolean(PreferenceConstants.P_BUFFER_SELECTION);
}
//
return bufferedSelection;
}

Expand Down

0 comments on commit c32b625

Please sign in to comment.