Class AbstractSwapObject

    • Field Detail

      • m_NoCopy

        protected boolean m_NoCopy
        whether to create no copy of the object.
      • m_Traversal

        protected transient PropertyTraversal m_Traversal
        the property traversal.
    • Constructor Detail

      • AbstractSwapObject

        public AbstractSwapObject()
    • Method Detail

      • setNoCopy

        public void setNoCopy​(boolean value)
        Sets whether to skip creating a copy of the object before swapping.
        Specified by:
        setNoCopy in interface InPlaceProcessing
        Parameters:
        value - true if to skip creating copy
      • getNoCopy

        public boolean getNoCopy()
        Returns whether to skip creating a copy of the object before swapping.
        Specified by:
        getNoCopy in interface InPlaceProcessing
        Returns:
        true if copying is skipped
      • noCopyTipText

        public String noCopyTipText()
        Returns the tip text for this property.
        Specified by:
        noCopyTipText in interface InPlaceProcessing
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • canSwap

        protected abstract boolean canSwap​(PropertyPath.Path path,
                                           PropertyDescriptor desc,
                                           Object parent,
                                           Object child)
        Checks whether a swap can be made.
        Parameters:
        path - the current path
        desc - the property descriptor
        parent - the parent object to swap
        child - the child object to swap
        Returns:
        true if swap can be done
      • performSwap

        protected abstract boolean performSwap​(PropertyPath.Path path,
                                               PropertyDescriptor desc,
                                               Object parent,
                                               Object child)
        Performs the swap.
        Parameters:
        path - the current path
        desc - the property descriptor
        parent - the parent object to swap
        child - the child object to swap
        Returns:
        true if swap was successful
      • doConvert

        protected Object doConvert​(Object input)
        Performs the swap.
        Parameters:
        input - the object to update
        Returns:
        the updated object