Exemplo n.º 1
0
 public void actionPerformed(ActionEvent e) {
   JMenuItem jmi = (JMenuItem) e.getSource();
   Iterator marks = mediator.getMarkerModel().getMarkersWithLabel(jmi.getText());
   if (marks.hasNext()) {
     ChronicleMarker marker = (ChronicleMarker) marks.next();
     Instant to = marker.getWhen();
     Instant from = mediator.getMajorMoment();
     viper.api.impl.Util.shiftDescriptors(new Descriptor[] {desc}, from, to);
   }
 }
Exemplo n.º 2
0
 public void actionPerformed(ActionEvent e) {
   Iterator toInterp = Collections.singleton(desc).iterator();
   JMenuItem jmi = (JMenuItem) e.getSource();
   Iterator marks = mediator.getMarkerModel().getMarkersWithLabel(jmi.getText());
   if (marks.hasNext()) {
     ChronicleMarker marker = (ChronicleMarker) marks.next();
     Instant to = marker.getWhen();
     Instant from = mediator.getMajorMoment();
     mediator.getPropagator().interpolateDescriptors(toInterp, from, to);
   }
 }
Exemplo n.º 3
0
 private void resetMarks() {
   interpToMark.removeAll();
   shiftToMark.removeAll();
   Iterator marks = mediator.getMarkerModel().getLabels().iterator();
   boolean hasMark = false;
   while (marks.hasNext()) {
     String mark = (String) marks.next();
     if (!ChronicleViewer.CURR_FRAME_LABEL.equals(mark)) {
       JMenuItem mi = new JMenuItem(mark);
       mi.addActionListener(itmAction);
       interpToMark.add(mi);
       mi = new JMenuItem(mark);
       mi.addActionListener(stmAction);
       shiftToMark.add(mi);
       hasMark = true;
     }
   }
   shiftToMark.setEnabled(hasMark);
   interpToMark.setEnabled(hasMark);
 }