Mercurial > hg > truffle
comparison visualizer/Util/src/com/sun/hotspot/igv/util/CompilationViewModel.java @ 4512:015fb895586b
Moved visualizer to new directory.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Tue, 07 Feb 2012 22:41:09 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
4511:6cb549627941 | 4512:015fb895586b |
---|---|
1 /* | |
2 * To change this template, choose Tools | Templates | |
3 * and open the template in the editor. | |
4 */ | |
5 | |
6 package com.sun.hotspot.igv.util; | |
7 | |
8 import com.sun.hotspot.igv.data.*; | |
9 import java.awt.Color; | |
10 import java.util.List; | |
11 | |
12 public class CompilationViewModel implements ChangedEventProvider<CompilationViewModel> { | |
13 | |
14 private final ChangedEvent<CompilationViewModel> changedEvent = new ChangedEvent<>(this); | |
15 private final RangeSliderModel model; | |
16 private final Group group; | |
17 | |
18 @Override | |
19 public ChangedEvent<CompilationViewModel> getChangedEvent() { | |
20 return changedEvent; | |
21 } | |
22 | |
23 public CompilationViewModel(RangeSliderModel model, Group group) { | |
24 this.model = model; | |
25 this.group = group; | |
26 model.getChangedEvent().addListener(rangeSliderChangedListener); | |
27 } | |
28 | |
29 private final ChangedListener<RangeSliderModel> rangeSliderChangedListener = new ChangedListener<RangeSliderModel>() { | |
30 @Override | |
31 public void changed(RangeSliderModel source) { | |
32 changedEvent.fire(); | |
33 } | |
34 }; | |
35 | |
36 public InputGraph getFirstSnapshot() { | |
37 return group.getGraphs().get(model.getFirstPosition()); | |
38 } | |
39 | |
40 public InputGraph getSecondSnapshot() { | |
41 return group.getGraphs().get(model.getSecondPosition()); | |
42 } | |
43 | |
44 public void setColors(List<Color> colors) { | |
45 model.setColors(colors); | |
46 } | |
47 } |