Skip to content

Commit 603c657

Browse files
committed
Move default_zoom_factor to display runtime preferences
1 parent 716cbb4 commit 603c657

File tree

4 files changed

+7
-17
lines changed

4 files changed

+7
-17
lines changed

app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/Preferences.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public class Preferences
3333
@Preference public static String probe_display;
3434
/** Preference setting */
3535
public static final List<TextPatch> pv_name_patches = new ArrayList<>();
36+
/** Preference setting */
37+
@Preference public static int default_zoom_factor;
3638

3739
static
3840
{

app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/ZoomAction.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
package org.csstudio.display.builder.runtime.app;
99

1010
import org.csstudio.display.builder.representation.javafx.JFXRepresentation;
11-
import org.phoebus.framework.preferences.AnnotatedPreferences;
12-
import org.phoebus.framework.preferences.PreferencesReader;
13-
import org.phoebus.framework.preferences.Preference;
11+
import org.csstudio.display.builder.runtime.Preferences;
1412

1513
import javafx.application.Platform;
1614
import javafx.scene.control.ComboBox;
@@ -22,13 +20,6 @@ public class ZoomAction extends ComboBox<String>
2220
{
2321
private boolean updating = false;
2422

25-
@Preference public static int default_zoom_factor;
26-
27-
static
28-
{
29-
AnnotatedPreferences.initialize(ZoomAction.class, "/zoom_preferences.properties");
30-
}
31-
3223
/** @param instance {@link DisplayRuntimeInstance} */
3324
public ZoomAction(final DisplayRuntimeInstance instance)
3425
{
@@ -47,7 +38,7 @@ public ZoomAction(final DisplayRuntimeInstance instance)
4738
// Apply default zoom factor from settings.ini
4839
Platform.runLater(() ->
4940
{
50-
String zoom = String.format("%d %%", default_zoom_factor);
41+
String zoom = String.format("%d %%", Preferences.default_zoom_factor);
5142
setValue(zoom);
5243
// Invoke zoom changed handler
5344
getOnAction().handle(null);

app/display/runtime/src/main/resources/display_runtime_preferences.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@ update_throttle=250
4646
# When left empty, the "Probe Display"
4747
# context menu entry is disabled.
4848
probe_display=examples:/probe.bob
49+
50+
# Default zoom factor (percentage) of display runtime window
51+
default_zoom_factor=100

app/display/runtime/src/main/resources/zoom_preferences.properties

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)