示例#1
0
    /**
     * Adds the.
     *
     * @param name the name
     * @param annotations the annotations
     * @param colorHint the color hint
     * @param ancestry the ancestry
     */
    public void add(String name, Annotations annotations, String colorHint, String ancestry) {

      if (!instances.isEmpty() && !StringUtils.same(getAncestry(), ancestry)) return;

      for (TransferableAnnotations a : instances) {
        if (a.getAnnotations() == annotations) return;
      }

      instances.add(new AnnotationSource(name, annotations, getUniqueColor(colorHint), ancestry));

      length = Math.max(length, annotations.size());
      this.bounds.setRect(0, 0, getLength(), 1);

      timeline.setLength(length);
      timeline.repaint();
      timeline.getTrack("tags").addObject(this);

      values.reload(this);
    }