Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bar Chart] Customize direction when a bar chart is scrolled with the…
… mouse wheel #1096
- Loading branch information
1 parent
631747c
commit e18e488
Showing
13 changed files
with
322 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?eclipse version="3.4"?> | ||
<plugin> | ||
<extension | ||
point="org.eclipse.core.runtime.preferences"> | ||
<initializer | ||
class="net.tourbook.chart.preferences.ChartPreferenceInitializer"> | ||
</initializer> | ||
</extension> | ||
|
||
</plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
bundles/net.tourbook.chart/src/net/tourbook/chart/MouseWheel2KeyTranslation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/******************************************************************************* | ||
* Copyright (C) 2023 Wolfgang Schramm and Contributors | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free Software | ||
* Foundation version 2 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA | ||
*******************************************************************************/ | ||
package net.tourbook.chart; | ||
|
||
/** | ||
* Translate mouse wheel direction into keyboard arrow direction | ||
*/ | ||
public enum MouseWheel2KeyTranslation { | ||
|
||
/** | ||
* Scrolling the mouse up is moving the bar selection to the left | ||
*/ | ||
Up_Left, | ||
|
||
/** | ||
* Scrolling the mouse up is moving the bar selection to the right | ||
*/ | ||
Up_Right, | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
...les/net.tourbook.chart/src/net/tourbook/chart/preferences/ChartPreferenceInitializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/******************************************************************************* | ||
* Copyright (C) 2023 Wolfgang Schramm and Contributors | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free Software | ||
* Foundation version 2 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA | ||
*******************************************************************************/ | ||
package net.tourbook.chart.preferences; | ||
|
||
import net.tourbook.chart.ChartActivator; | ||
import net.tourbook.chart.MouseWheel2KeyTranslation; | ||
|
||
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; | ||
import org.eclipse.jface.preference.IPreferenceStore; | ||
|
||
public class ChartPreferenceInitializer extends AbstractPreferenceInitializer { | ||
|
||
public ChartPreferenceInitializer() {} | ||
|
||
@Override | ||
public void initializeDefaultPreferences() { | ||
|
||
final IPreferenceStore store = ChartActivator.getPrefStore(); | ||
|
||
// mouse wheel to key translation | ||
store.setDefault(IChartPreferences.GRAPH_MOUSE_KEY_TRANSLATION, MouseWheel2KeyTranslation.Up_Left.name()); | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
bundles/net.tourbook.chart/src/net/tourbook/chart/preferences/IChartPreferences.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/******************************************************************************* | ||
* Copyright (C) 2023 Wolfgang Schramm and Contributors | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free Software | ||
* Foundation version 2 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA | ||
*******************************************************************************/ | ||
package net.tourbook.chart.preferences; | ||
|
||
public interface IChartPreferences { | ||
|
||
public static final String GRAPH_MOUSE_KEY_TRANSLATION = "GRAPH_MOUSE_KEY_TRANSLATION"; //$NON-NLS-1$ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.