use of org.pepsoft.worldpainter.objects.WPObject in project WorldPainter by Captain-Chaos.
the class Bo2ObjectTube method load.
/**
* Create a new <code>Bo2ObjectTube</code> with a specific name from a list
* of specific custom object files.
*
* @param name The name of the new <code>Bo2ObjectTube</code>.
* @param files The list of files containing the objects to load.
* @return A new <code>Bo2ObjectTube</code> containing the custom objects
* from the specified file(s).
* @throws IOException If there was an I/O error reading one of the files.
*/
public static Bo2ObjectTube load(String name, Collection<File> files) throws IOException {
if (files.isEmpty()) {
throw new IllegalArgumentException("Cannot create an object tube with no objects");
}
List<WPObject> objects = new ArrayList<>(files.size());
CustomObjectManager customObjectManager = CustomObjectManager.getInstance();
for (File file : files) {
objects.add(customObjectManager.loadObject(file));
}
return new Bo2ObjectTube(name, objects);
}
use of org.pepsoft.worldpainter.objects.WPObject in project WorldPainter by Captain-Chaos.
the class EditObjectAttributes method editOffset.
private void editOffset() {
if (objects.size() > 1) {
return;
}
WPObject object = objects.iterator().next();
Point3i offset = offsets.get(object);
OffsetEditor dialog = new OffsetEditor(this, (offset != null) ? offset : new Point3i(), object, colourScheme);
dialog.setVisible(true);
if (!dialog.isCancelled()) {
offset = dialog.getOffset();
offsets.put(object, offset);
String offsetStr = "<html><u>" + offset.x + ", " + offset.y + ", " + offset.z + "</u></html>";
labelOffset.setText(offsetStr);
}
}
Aggregations