<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Thanks, hope this all helps to get it right.<br>
    <br>
    On 6/30/2011 2:27 PM, Curtis Rueden wrote:
    <blockquote
      cite="mid:BANLkTi=4Wp8rKyx-eumnbqvcx7m7CkwU_A@mail.gmail.com"
      type="cite">Hi Grant et. al,<br>
      <br>
      Grant and I discussed this further, and we agree that it is much
      preferred to avoid depending on or altering the order events are
      delivered to subscribers. It should always be possible to create
      additional event types to discriminate more finely, as Lee
      describes.<br>
      <br>
      So Grant, I propose that we remove the PriorityEventSubscriber
      stuff we added the other day, to avoid complexifying the events
      package. What do you think?<br>
      <br>
      -Curtis<br>
      <br>
      <div class="gmail_quote">On Thu, Jun 23, 2011 at 12:38 PM, Lee
        Kamentsky <span dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:leek@broadinstitute.org">leek@broadinstitute.org</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">IMHO - if you depend on order for events,
          there's a good chance you're not doing something right. If you
          depend on order, I'm guessing that a direct function call is
          the appropriate solution or that you are not properly modeling
          what is really happening.<br>
          <br>
          I'm guessing that this has to do with the overlay manager -
          that you've received an overlay created/deleted event and you
          don't know whether it's in the overlay manager or not. There
          are two different events here:<br>
          * an overlay object was created or deleted<br>
          * the overlay manager added or removed an overlay<br>
          so, the code that is experiencing difficulty should respond to
          the appropriate event. If you have a user interface that shows
          the overlays in the manager, it's the second event that you
          want. If I guessed wrong, perhaps it follows the same pattern?<br>
          <font color="#888888">
            <br>
            --Lee</font>
          <div>
            <div class="h5"><br>
              <br>
              On 6/23/2011 12:58 PM, Grant B. Harris wrote:<br>
              <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
                0.8ex; border-left: 1px solid rgb(204, 204, 204);
                padding-left: 1ex;">
                Ooops... My bad. &nbsp;I thought we were using 1.2... We are
                already using 1.4. &nbsp;But we need to change Events
                framework. &nbsp;I'll take a stab at it today.<br>
                -- Grant<br>
                <br>
                On 6/23/2011 12:55 PM, Grant B. Harris wrote:<br>
                <blockquote class="gmail_quote" style="margin: 0pt 0pt
                  0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204);
                  padding-left: 1ex;">
                  I think EventBus can serve us well, but I have run
                  into a serious issue that demands that we move from
                  EventBus version 1.2 to 1.4.<br>
                  <br>
                  Because "subscribers are called in the order in which
                  they subscribed", we cannot use the EventBus (1.2) in
                  ways that we need. &nbsp;If I have a class which is
                  watching things (say a ROI Manager or the Window menu
                  list of open displays) it's behavior depends on when
                  it was subscribed. &nbsp;I've been working on this for a
                  week and I have not found a way to manage this.
                  &nbsp;Fortunately I discovered that as of version 1.3 there
                  is a PrioritizedEventSubscriber &nbsp;(<a
                    moz-do-not-send="true"
href="http://www.jarvana.com/jarvana/view/org/bushe/eventbus/1.3/eventbus-1.3-javadoc.jar%21/org/bushe/swing/event/Prioritized.html"
                    target="_blank">http://www.jarvana.com/jarvana/view/org/bushe/eventbus/1.3/eventbus-1.3-javadoc.jar!/org/bushe/swing/event/Prioritized.html</a>)
                  &nbsp;I think this is just what we need.<br>
                  <br>
                  (Using this priority mechanism may also eliminate the
                  need for the ObjectsUpdatedEvent that I added last
                  week.)<br>
                  <br>
                  EventBus version 1.4 is here: <a
                    moz-do-not-send="true"
                    href="http://mvnrepository.com/artifact/org.bushe/eventbus/1.4"
                    target="_blank">http://mvnrepository.com/artifact/org.bushe/eventbus/1.4</a><br>
                  <br>
                  We will need to change the Events framework a bit to
                  add Prioritized Event Subscription, but otherwise I
                  don't think it will require any refactoring except for
                  the subscribers that need to set priority.<br>
                  <br>
                  -- Grant<br>
                  <br>
                  <br>
                  _______________________________________________<br>
                  ImageJ-devel mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:ImageJ-devel@imagejdev.org"
                    target="_blank">ImageJ-devel@imagejdev.org</a><br>
                  <a moz-do-not-send="true"
                    href="http://imagejdev.org/mailman/listinfo/imagej-devel"
                    target="_blank">http://imagejdev.org/mailman/listinfo/imagej-devel</a><br>
                </blockquote>
                <br>
                _______________________________________________<br>
                ImageJ-devel mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:ImageJ-devel@imagejdev.org"
                  target="_blank">ImageJ-devel@imagejdev.org</a><br>
                <a moz-do-not-send="true"
                  href="http://imagejdev.org/mailman/listinfo/imagej-devel"
                  target="_blank">http://imagejdev.org/mailman/listinfo/imagej-devel</a><br>
              </blockquote>
              <br>
              <br>
              _______________________________________________<br>
              ImageJ-devel mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:ImageJ-devel@imagejdev.org" target="_blank">ImageJ-devel@imagejdev.org</a><br>
              <a moz-do-not-send="true"
                href="http://imagejdev.org/mailman/listinfo/imagej-devel"
                target="_blank">http://imagejdev.org/mailman/listinfo/imagej-devel</a><br>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
    </blockquote>
    <br>
  </body>
</html>