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
 /**
  * Find a new name that isn't among the used names.
  *
  * @param prefix
  * @param usedNames
  * @return
  */
 public static String unusedName(String prefix, Iterator usedNames) {
   SortedSet u = new TreeSet();
   while (usedNames.hasNext()) {
     String curr = (String) usedNames.next();
     if (curr.startsWith(prefix)) {
       String postfix = curr.substring(prefix.length());
       u.add(postfix);
     }
   }
   int count = 0;
   while (u.contains(String.valueOf(count))) {
     count++;
   }
   return prefix + count;
 }
Exemplo n.º 4
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);
 }
Exemplo n.º 5
0
 public Object next() {
   return ((AttrConfig) attrs.next()).getAttrName();
 }
Exemplo n.º 6
0
 public Object next() {
   return ((Config) descs.next()).getDescName();
 }