
gnu.x11.Resource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of escher Show documentation
Show all versions of escher Show documentation
Escher is a collection of libraries for X Window System written purely in Java.
The newest version!
package gnu.x11;
/** X ID resource. */
public abstract class Resource {
public Display display;
public int id;
/** Predefined. */
public Resource (int id) { this.id = id; }
/** Create. */
public Resource (Display display) {
this.display = display;
id = display.allocate_id (this);
}
/** Intern. */
public Resource (Display display, int id) {
this.display = display;
this.id = id;
display.resources.put (new Integer (id), this);
}
/* Java cannot enforce the presence of static method in subclasses. But
* subclasses of this class should implement the following.
*
* public static Object intern (Display display, int id);
*/
public void unintern () {
display.resources.remove (new Integer (id));
}
/**
* Returns the resource ID of this resource.
*
* @return the resource ID of this resource
*/
public int id () {
return id;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy