monniasza.collects.ReadOnlyListModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multimachinebuilder Show documentation
Show all versions of multimachinebuilder Show documentation
Dependency for the MultiMachineBuilder, a voxel game about building an industrial empire in a finite world.
THIS RELEASE IS NOT PLAYABLE. To play the game, donwload from >ITCH.IO LINK HERE< or >GH releases link here<
The newest version!
/**
*
*/
package monniasza.collects;
import javax.swing.ListModel;
import javax.swing.event.ListDataListener;
/**
* A read-only wrapper of a list model
* @author oskar
* @param type of elements
*/
public class ReadOnlyListModel implements ListModel {
private final ListModel extends E> model;
/**
* Wraps a list model
* @param model list model to be wrapped
*/
public ReadOnlyListModel(ListModel extends E> model) {
this.model = model;
}
@Override
public void addListDataListener(@SuppressWarnings("null") ListDataListener arg0) {
model.addListDataListener(arg0);
}
@Override
public E getElementAt(int arg0) {
return model.getElementAt(arg0);
}
@Override
public int getSize() {
return model.getSize();
}
@Override
public void removeListDataListener(@SuppressWarnings("null") ListDataListener arg0) {
model.removeListDataListener(arg0);
}
}