Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4756696

java.awt.event.WindowEvent: unclear doc

XMLWordPrintable

    • b28
    • sparc
    • solaris_7

      Name: sdR10048 Date: 10/02/2002


      JDK1.4 doc for 4 constructors:
      java.awt.event.WindowEvent(Window source, int id)
      java.awt.event.WindowEvent(Window source, int id, int oldState, int newState)
      java.awt.event.WindowEvent(Window source, int id, Window opposite)
      java.awt.event.WindowEvent(Window source, int id, Window opposite, int oldState, int newState)

      has some specification holes:

      1) WindowEvent(Window source, int id)
      > public WindowEvent(Window source,
      > int id)
      >
      > Constructs a WindowEvent object.
      >
      > Note that passing in an invalid id results in unspecified behavior.

      What ids are invalid?

      > Parameters:
      > source - the Window object that originated the event
      > id - an integer indicating the type of event

      2) WindowEvent(Window source, int id, int oldState, int newState)
      > public WindowEvent(Window source,
      > int id,
      > int oldState,
      > int newState)
      >
      > Constructs a WindowEvent object with the specified previous and new
      > window states.

      No notes about invalid ids..

      > Parameters:
      > source - the Window object that originated the event
      > id - WINDOW_STATE_CHANGED event type. It is expected that this
      > constructor will not be used for other WindowEvent types, because
      > the previous and new window states are meaningless for other event
      > types.

      Is it ok to specify different ids: WINDOW_ACTIVATED for example. What
      is expected behaviour here?

      > oldState - an integer representing the previous window state
      > newState - an integer representing the new window state

      If it is ok to pass different ids, what will be with these 2
      parameters? What getOldState() and getNewState() will return?

      3) WindowEvent(Window source, int id, Window opposite)
      The same to (2).

      4) WindowEvent(Window source, int id, Window opposite, int oldState, int newState)
      The same to (2) but more complicated case.

      See: http://java.sun.com/j2se/javadoc/writingapispecs/index.html#method
      Need for jck test development.
      ======================================================================

            dav Andrei Dmitriev (Inactive)
            dsvsunw Dsv Dsv (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: