예제 #1
0
 public void actionPerformed(ActionEvent e) {
   ViperViewMediator med = getMediator();
   TextlineModel tlm = (TextlineModel) med.getAttributeValueAtCurrentFrame(attr);
   if (tlm != null) {
     occWindow.setVisible(true);
     occWindow.setModelAndRefresh(tlm, med, attr);
   }
 }
예제 #2
0
 public void actionPerformed(ActionEvent e) {
   boolean propagate = p.isSelected();
   ViperViewMediator m = getMediator();
   PropagateInterpolateModule proper = m.getPropagator();
   if (propagate) {
     proper.startPropagating(desc);
   } else {
     proper.stopPropagating(desc);
   }
   p.setSelected(proper.getPropagatingDescriptors().contains(desc));
 }
예제 #3
0
 public void actionPerformed(ActionEvent e) {
   if (attr == null) {
     return;
   }
   ViperViewMediator m = getMediator();
   Attribute oldWRT = m.getDisplayWRTManager().getAttribute();
   if (attr.equals(oldWRT)) {
     m.getDisplayWRTManager().setAttribute(null, null);
   } else {
     m.getDisplayWRTManager().setAttribute(attr, m.getCurrentFrame());
   }
 }
예제 #4
0
    public void show(Component invoker, int x, int y) {
      ViperViewMediator mediator = getMediator();
      Point pnt = new Point(x, y);
      EnhancedTable tab = getTable();
      int row = tab.rowAtPoint(pnt);
      desc = getCurrentModel().getDescriptorAtRow(row);
      int col = tab.columnAtPoint(pnt);
      Object cellValue = tab.getValueAt(row, col);
      if (cellValue instanceof Attribute) {
        attr = (Attribute) cellValue;

        // hide the "Occlusions..." option when we're not dealing with a Textline object
        boolean isTextline = attr.getAttrConfig().getAttrType().endsWith("textline");
        occlusions.setVisible(isTextline);
        occSeparator.setVisible(isTextline);

        Instant now = mediator.getCurrentFrame();
        if (now == null) {
          mediator.getDisplayWRTManager().setAttribute(null, null);
          wrt.setEnabled(false);
          wrt.setSelected(false);
        } else {
          boolean isDwrt = attr == mediator.getDisplayWRTManager().getAttribute();
          boolean dwrtable =
              (attr.getAttrValueAtInstant(now) instanceof HasCentroid
                  && attr.getDescriptor().getValidRange().contains(now));
          wrt.setEnabled(dwrtable);
          wrt.setSelected(isDwrt);
        }
      } else {
        attr = null;
        wrt.setEnabled(false);
        wrt.setSelected(false);
      }
      if (null != desc) {
        PropagateInterpolateModule proper = getMediator().getPropagator();
        p.setSelected(proper.isPropagatingThis(desc));
        v.setSelected(mediator.isThisValidNow(desc));
        resetMarks();
        super.show(invoker, x, y);
      }
    }