All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jeometry.geom3D.textured.TexturePath Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
package org.jeometry.geom3D.textured;

import org.jeometry.Jeometry;

/**
 * A {@link Texture texture} is an identified resource that can provide display information attached to a coordinate. 
 * This texture is linked with a resource described by its path (file, URL, ...) 
 * @author Julien Seinturier - COMEX S.A. - [email protected] - https://github.com/jorigin/jeometry
 * @version {@value Jeometry#version} build {@value Jeometry#BUILD}
 * @since 1.0.0
 */
public class TexturePath implements Texture {
  
  String ressourcePath = null;
  
  @Override
  public Object getResource() {
    return ressourcePath;
  }

  @Override
  public void setResource(Object resource) {
    if (resource instanceof String){
      ressourcePath = (String) resource;
    }
  }
  
  /**
   * Get the path that describe the attached resource.
   * @return the path that describe the attached resource.
   */
  public String getResourcePath(){
    return ressourcePath;
  }
  
  /**
   * Default constructor should not be used as texture identifier and resources are needed by various processes.
   */
  public TexturePath(){
    super();
  }
  
  /**
   * Construct a new texture identified by the name and the numerical identifier idn given in parameters 
   * and linked to the given resource. A texture resource can be an image file path, a raster image, ...
   * @param name the name of the texture.
   * @param idn the numerical identifier of the resource.
   * @param resource the resource attached to the texture.
   */
  public TexturePath(String name, int idn, String resource){
    super();
    setResource(resource);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy