Class ImplementationFactory

  • Direct Known Subclasses:
    ImplementationFactoryJ2D

    public abstract class ImplementationFactory
    extends java.lang.Object
    Author:
    Fabrizio Giudici
    • Constructor Detail

      • ImplementationFactory

        public ImplementationFactory()
    • Method Detail

      • registerImplementation

        public void registerImplementation​(@Nonnull
                                           java.lang.Class<? extends Operation> operationClass,
                                           @Nonnull
                                           java.lang.Class<? extends OperationImplementation> implementationClass)
      • unregisterImplementation

        public void unregisterImplementation​(@Nonnull
                                             java.lang.Class<? extends Operation> operationClass)
      • findImplementation

        @Nonnull
        public OperationImplementation<Operation,​java.lang.Object> findImplementation​(@Nonnull
                                                                                            Operation operation)
        Finds the concrete implementation for a given operation.
        Parameters:
        operation - operation
        Returns:
        the implementation (null if not supported)
      • createImageModel

        @Nonnull
        public ImageModel createImageModel​(@Nonnull
                                           java.awt.image.BufferedImage image)
      • canConvertFrom

        public abstract boolean canConvertFrom​(@Nonnull
                                               java.lang.Class imageClass)
        Return true if we can convert the given imageClass into our specific image class.
      • convertFrom

        @Nonnull
        public abstract ImageModel convertFrom​(@Nonnull
                                               java.lang.Object image)
        Converts the given image into our specific image representation.
      • canConvertTo

        public abstract boolean canConvertTo​(@Nonnull
                                             java.lang.Class<?> imageClass)
      • convertTo

        @Nonnull
        public abstract java.lang.Object convertTo​(@Nonnull
                                                   java.lang.Object image)