Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #34435

Re: How to extend an array

Newsgroups comp.lang.java.programmer
Date 2016-06-01 04:57 -0700
References (1 earlier) <nikc0f$b0v$1@dont-email.me> <f46278e9-a64d-42d4-8c2d-5e0cfd168692@googlegroups.com> <nikk4d$ao3$1@dont-email.me> <d8ea605f-0759-4b10-b293-235cc558d6e9@googlegroups.com> <niku2v$hhp$1@dont-email.me>
Message-ID <e85ae3a6-8c82-4232-8967-559ee31b21bc@googlegroups.com> (permalink)
Subject Re: How to extend an array
From Eric Douglas <e.d.programmer@gmail.com>

Show all headers | View raw


On Tuesday, May 31, 2016 at 5:01:35 PM UTC-4, Eric Sosman wrote:
>      I'm afraid I still can't understand what you're up to.  It seems a
> Class2 instance will have listeners of two kinds, and will maintain two
> references to some of them:
> 
>      - A Listener1 registered with addListener() will appear in one
>        list of listeners,
> 
>      - A Listener2 registered with addExtendedListener() will appear
>        in two lists of listeners, once in its Listener2 aspect and
>        again as its Listener1 superinterface.
> 
correct

>      I'm at a loss to understand why you want the Listener2's double-
> registered, held in two lists.  Since the list in Class1 appears to
> serve no purpose (listeners get added to it and thereafter ignored),
> it seems likely that further detail has been simplified away -- but
> simplified to the extent that I cannot divine what you're about.
> It's over my head, I fear.

Normally an instance of Class1 will only want a Listener1 type listener, and a Class2 will only want a Listener2 type listener.

Class1 is the base class.  In this example it's a custom JFrame.  In the complicated API it's a customized JTable.  It reports those simple events.  In the example it's reporting window opened.  In the complicated API it's reporting everything JTable related - focus gained, row changed, start edit, etc.

Class2 is the extension of Class1.  It doesn't need to repeat what Class1 is doing.  In this example Class1 reports window opened for a Class2 window, and Class2 reports the window minimized.  In the complicated API I'm displaying one JTable column using a JTree.  Mouse clicks on that JTable pass through to the JTree, so you can click a node and expand it, and it inserts rows to the table.  This needs all the standard JTable events, which still report from the base custom class, plus it needs the extended class to report the tree node expanding and all such related events.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to extend an array Eric Douglas <e.d.programmer@gmail.com> - 2016-05-31 07:52 -0700
  Re: How to extend an array Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-31 11:52 -0400
    Re: How to extend an array Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-31 11:56 -0400
      Re: How to extend an array Eric Douglas <e.d.programmer@gmail.com> - 2016-05-31 09:19 -0700
        Re: How to extend an array Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-31 14:01 -0400
    Re: How to extend an array Eric Douglas <e.d.programmer@gmail.com> - 2016-05-31 09:09 -0700
      Re: How to extend an array Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-31 14:11 -0400
        Re: How to extend an array Eric Douglas <e.d.programmer@gmail.com> - 2016-05-31 11:25 -0700
          Re: How to extend an array Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-31 17:01 -0400
            Re: How to extend an array Eric Douglas <e.d.programmer@gmail.com> - 2016-06-01 04:57 -0700
  Re: How to extend an array Roedy Green <inquiry@mindprod.com> - 2016-05-31 21:56 -0700
    Re: How to extend an array Eric Douglas <e.d.programmer@gmail.com> - 2016-06-01 04:49 -0700
  Re: How to extend an array Robert Klemme <shortcutter@googlemail.com> - 2016-06-01 23:07 +0200
    Re: How to extend an array Eric Douglas <e.d.programmer@gmail.com> - 2016-06-03 05:38 -0700
      Re: How to extend an array Robert Klemme <shortcutter@googlemail.com> - 2016-06-04 19:17 +0200
    Re: How to extend an array Eric Douglas <e.d.programmer@gmail.com> - 2016-06-03 08:52 -0700

csiph-web