Class PropertyAction

  • All Implemented Interfaces:
    com.nomagic.magicdraw.actions.ShortcutSchemaAction, java.awt.event.ActionListener, java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, java.util.EventListener, javax.swing.Action

    @OpenApiAll
    public class PropertyAction
    extends MDAction
    implements java.beans.PropertyChangeListener
    Action for changing assigned property value.
    See Also:
    Serialized Form
    • Field Detail

    • Constructor Detail

      • PropertyAction

        public PropertyAction​(PropertyManager manager,
                              java.lang.String propertyID)
        The constructor for action with given property.
        Parameters:
        manager - property manager
        propertyID - id of the property
      • PropertyAction

        public PropertyAction​(java.lang.String actionID,
                              PropertyManager manager,
                              java.lang.String propertyID)
        The constructor for action with given property.
        Parameters:
        actionID - id of the action
        manager - property manager
        propertyID - id of the property
      • PropertyAction

        public PropertyAction​(java.lang.String actionID,
                              PropertyManager manager,
                              java.lang.String propertyID,
                              boolean useShortcutSchema)
        The constructor for action with given property.
        Parameters:
        actionID - id of the action
        manager - property manager
        propertyID - id of the property
        useShortcutSchema - use shortcuts schema for this action
    • Method Detail

      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent evt)
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener
        See Also:
        PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)
      • setNewValue

        public void setNewValue​(java.lang.Object newValue)
        Sets the new property value.
        Parameters:
        newValue - the new property value.
      • getNewValue

        public java.lang.Object getNewValue()
        Gets the new property value.
        Returns:
        the new property value
      • getProperty

        public Property getProperty()
        Returns the property.
        Returns:
        returns an assigned property
      • changePropertyValue

        protected void changePropertyValue​(java.lang.Object newValue)
        Change value of a property
        Parameters:
        newValue - new value
      • accept

        public void accept​(ActionsVisitor visitor)
        Description copied from class: NMAction
        Accepts ActionsVisitor using Visitor pattern.
        Overrides:
        accept in class NMAction
        Parameters:
        visitor - visitor to accept.
      • getManager

        public PropertyManager getManager()
        Get the manager.
        Returns:
        returns the manager
      • setManager

        public void setManager​(PropertyManager manager)
        Set the manager.
        Parameters:
        manager - the new manager
      • fireManagerChanged

        protected void fireManagerChanged​(PropertyManager oldManager,
                                          PropertyManager newManager)
        Fires the notification about the property manager change
        Parameters:
        oldManager - old manager
        newManager - new manager
      • getPropertyID

        public java.lang.String getPropertyID()
        Get the property id.
        Returns:
        Returns the id
      • setPropertyId

        protected void setPropertyId​(java.lang.String id)
        Sets property id
        Parameters:
        id - property id
      • addChangeListener

        public void addChangeListener​(java.beans.PropertyChangeListener listener)
        Add the listener which will be notified about the change of underlying property manager of this action
        Parameters:
        listener - for property change notifications
      • addChangeListener

        public void addChangeListener​(java.lang.String property,
                                      java.beans.PropertyChangeListener listener)
        Add the listener which will be notified about the change of underlying property manager of this action
        Parameters:
        property - the listener will be notified only about this property changes
        listener - for property change notifications
        See Also:
        MANAGER_CHANGED
      • removeChangeListener

        public void removeChangeListener​(java.beans.PropertyChangeListener listener)
        Remove the listener from this action
        Parameters:
        listener - to be removed
      • removeChangeListener

        public void removeChangeListener​(java.lang.String property,
                                         java.beans.PropertyChangeListener listener)
        Remove the listener from this action
        Parameters:
        property - the name of the property
        listener - to be removed