站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.5.1

AssociationEvent (NetBeans MDR API) - NetBeans API Javadoc 5.5.1

org.netbeans.api.mdr/1 1.4.31

org.netbeans.api.mdr.events
Class AssociationEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.netbeans.api.mdr.events.MDRChangeEvent
          extended by org.netbeans.api.mdr.events.AssociationEvent
All Implemented Interfaces:
Serializable

public class AssociationEvent
extends MDRChangeEvent

MDR Event used for representing association-related events. Any association event is described the way that there is one association end taken as "fixed". This means that the change will be described from the perspective of this association end. For changes to the association caused by modifying a reference or live collection returned from a getter for an association end this behavior is very intuitive - the fixed association end will be the exposed end of the reference (or the fixed element will be the element provided to getter for association end). For direct association proxy operations (i.e. remove or add), the event object looks as follows:

See Also:
Serialized Form

Field Summary
static int EVENT_ASSOCIATION_ADD
          Identifier of the event type indicating that a new link is to be/was added.
static int EVENT_ASSOCIATION_REMOVE
          Identifier of the event type indicating that an existing link is to be/was removed.
static int EVENT_ASSOCIATION_SET
          Identifier of the event type indicating that one end of an existing association link is to be/was modified.
static int EVENTMASK_ASSOCIATION
          Bitmask for event types related to operations with associations.
static int POSITION_NONE
          Value indicating unspecified position
 
Fields inherited from class org.netbeans.api.mdr.events.MDRChangeEvent
EVENTMASK_ALL, EVENTMASK_ON_ASSOCIATION, EVENTMASK_ON_CLASS, EVENTMASK_ON_INSTANCE, EVENTMASK_ON_PACKAGE, EVENTMASK_ON_REPOSITORY
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
AssociationEvent(javax.jmi.reflect.RefAssociation source, int type, javax.jmi.reflect.RefObject fixedElement, String endName, javax.jmi.reflect.RefObject oldElement, javax.jmi.reflect.RefObject newElement, int position)
          Creates new AssociationEvent object.
 
Method Summary
 String getEndName()
          Returns name of the fixed association end.
 javax.jmi.reflect.RefObject getFixedElement()
          Returns the element on the fixed side of the affected link.
 javax.jmi.reflect.RefObject getNewElement()
          Returns the new element on the non-fixed side of the affected link.
 javax.jmi.reflect.RefObject getOldElement()
          Returns the original element on the non-fixed side of the affected link.
 int getPosition()
          Returns position of the non-fixed element of the affected link.
 
Methods inherited from class org.netbeans.api.mdr.events.MDRChangeEvent
getType, isOfType
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

POSITION_NONE

public static final int POSITION_NONE
Value indicating unspecified position

See Also:
Constant Field Values

EVENTMASK_ASSOCIATION

public static final int EVENTMASK_ASSOCIATION
Bitmask for event types related to operations with associations. Can be used for registering a listener for listening to all association-related events.

See Also:
Constant Field Values

EVENT_ASSOCIATION_SET

public static final int EVENT_ASSOCIATION_SET
Identifier of the event type indicating that one end of an existing association link is to be/was modified.

See Also:
Constant Field Values

EVENT_ASSOCIATION_ADD

public static final int EVENT_ASSOCIATION_ADD
Identifier of the event type indicating that a new link is to be/was added.

See Also:
Constant Field Values

EVENT_ASSOCIATION_REMOVE

public static final int EVENT_ASSOCIATION_REMOVE
Identifier of the event type indicating that an existing link is to be/was removed.

See Also:
Constant Field Values
Constructor Detail

AssociationEvent

public AssociationEvent(javax.jmi.reflect.RefAssociation source,
                        int type,
                        javax.jmi.reflect.RefObject fixedElement,
                        String endName,
                        javax.jmi.reflect.RefObject oldElement,
                        javax.jmi.reflect.RefObject newElement,
                        int position)
Creates new AssociationEvent object.

Parameters:
source - Event source (association proxy object).
type - Event type.
fixedElement - Element of the affected link on the side of fixed association end.
endName - Name of association end on the fixed side of the link.
oldElement - Original element of the affected link on the non-fixed side of the link or null.
newElement - New element of the affected link on the non-fixed side of the link or null.
position - Position of the element on the non-fixed side of the affected link or POSITION_NONE if not applicable.
Method Detail

getFixedElement

public javax.jmi.reflect.RefObject getFixedElement()
Returns the element on the fixed side of the affected link.

Returns:
Link element.

getEndName

public String getEndName()
Returns name of the fixed association end.

Returns:
Association end name.

getOldElement

public javax.jmi.reflect.RefObject getOldElement()
Returns the original element on the non-fixed side of the affected link.

Returns:
Link element or null.

getNewElement

public javax.jmi.reflect.RefObject getNewElement()
Returns the new element on the non-fixed side of the affected link.

Returns:
Link element or null.

getPosition

public int getPosition()
Returns position of the non-fixed element of the affected link.

Returns:
Position of element or POSITION_NONE.

org.netbeans.api.mdr/1 1.4.31

Built on March 26 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.