net.officefloor.woof.model.resources.WoofResourcesModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of officeweb_configuration Show documentation
Show all versions of officeweb_configuration Show documentation
Configuration for WoOF (Web on OfficeFloor)
The newest version!
/*
*
*/
package net.officefloor.woof.model.resources;
import java.util.List;
import java.util.LinkedList;
import javax.annotation.processing.Generated;
import net.officefloor.model.AbstractModel;
import net.officefloor.model.ConnectionModel;
import net.officefloor.model.ItemModel;
import net.officefloor.model.RemoveConnectionsAction;
@Generated("net.officefloor.model.generate.ModelGenerator")
public class WoofResourcesModel extends AbstractModel implements ItemModel {
public static enum WoofResourcesEvent {
ADD_WOOF_RESOURCE, REMOVE_WOOF_RESOURCE
}
/**
* Default constructor.
*/
public WoofResourcesModel() {
}
/**
* Convenience constructor.
*
* @param woofResource Woof resource.
*/
public WoofResourcesModel(
WoofResourceModel[] woofResource
) {
if (woofResource != null) {
for (WoofResourceModel model : woofResource) {
this.woofResource.add(model);
}
}
}
/**
* Convenience constructor allowing XY initialising.
*
* @param woofResource Woof resource.
* @param x Horizontal location.
* @param y Vertical location.
*/
public WoofResourcesModel(
WoofResourceModel[] woofResource
, int x
, int y
) {
if (woofResource != null) {
for (WoofResourceModel model : woofResource) {
this.woofResource.add(model);
}
}
this.setX(x);
this.setY(y);
}
/**
* Woof resource.
*/
private List woofResource = new LinkedList();
/**
* @return Woof resource.
*/
public List getWoofResources() {
return this.woofResource;
}
/**
* @param woofResource Woof resource.
*/
public void addWoofResource(WoofResourceModel woofResource) {
this.addItemToList(woofResource, this.woofResource, WoofResourcesEvent.ADD_WOOF_RESOURCE);
}
/**
* @param woofResource Woof resource.
*/
public void removeWoofResource(WoofResourceModel woofResource) {
this.removeItemFromList(woofResource, this.woofResource, WoofResourcesEvent.REMOVE_WOOF_RESOURCE);
}
/**
* Remove Connections.
*
* @return {@link RemoveConnectionsAction} to remove the {@link ConnectionModel} instances.
*/
public RemoveConnectionsAction removeConnections() {
RemoveConnectionsAction _action = new RemoveConnectionsAction(this);
return _action;
}
}