예제 #1
0
 // Note: If decimals > 0 then values must be decimally shifted left
 // that many places, i.e. multiplied by Math.pow(10.0, decimals).
 public synchronized void addValues(long time, long... values) {
   assert (values.length == seqs.size());
   times.add(time);
   for (int i = 0; i < values.length; i++) {
     seqs.get(i).add(values[i]);
   }
   repaint();
 }
예제 #2
0
  // Called on EDT
  public void propertyChange(PropertyChangeEvent ev) {
    String prop = ev.getPropertyName();

    if (prop == JConsoleContext.CONNECTION_STATE_PROPERTY) {
      ConnectionState newState = (ConnectionState) ev.getNewValue();

      switch (newState) {
        case DISCONNECTED:
          synchronized (this) {
            long time = System.currentTimeMillis();
            times.add(time);
            for (Sequence seq : seqs) {
              seq.add(Long.MIN_VALUE);
            }
          }
          break;
      }
    }
  }