]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.charts/src/org/simantics/charts/editor/MoveHairlineAction.java
Fixed context menu popup location for HiDPI displays with display zoom
[simantics/platform.git] / bundles / org.simantics.charts / src / org / simantics / charts / editor / MoveHairlineAction.java
1 package org.simantics.charts.editor;
2
3 import org.eclipse.jface.action.Action;
4 import org.simantics.db.Resource;
5 import org.simantics.trend.impl.TrendNode;
6
7 /**
8  * @author Tuukka Lehtonen
9  */
10 public class MoveHairlineAction extends Action {
11
12     private final Resource chart;
13     private final TrendNode trend;
14     private final double time;
15     private final Boolean setTrackExperimentTime;
16
17     public MoveHairlineAction(String name, Resource chart, boolean enabled, TrendNode trend, double time) {
18         this(name, chart, enabled, trend, time, null);
19     }
20
21     public MoveHairlineAction(String name, Resource chart, boolean enabled, TrendNode trend, double time, Boolean setTrackExperimentTime) {
22         super(name);
23         setEnabled(enabled);
24         this.chart = chart;
25         this.trend = trend;
26         this.time = time;
27         this.setTrackExperimentTime = setTrackExperimentTime;
28     }
29
30     @Override
31     public void run() {
32         trend.valueTipTime = time;
33         trend.repaint();
34         if (setTrackExperimentTime != null) {
35             TrackExperimentTimeAction.setTracking(chart, setTrackExperimentTime);
36         }
37     }
38
39 }