franta-hg@3: /**
franta-hg@3: * copy-image-resizer
franta-hg@3: * Copyright © 2014 František Kučera (frantovo.cz)
franta-hg@3: *
franta-hg@3: * This program is free software: you can redistribute it and/or modify
franta-hg@3: * it under the terms of the GNU General Public License as published by
franta-hg@3: * the Free Software Foundation, either version 3 of the License, or
franta-hg@3: * (at your option) any later version.
franta-hg@3: *
franta-hg@3: * This program is distributed in the hope that it will be useful,
franta-hg@3: * but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@3: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@3: * GNU General Public License for more details.
franta-hg@3: *
franta-hg@3: * You should have received a copy of the GNU General Public License
franta-hg@3: * along with this program. If not, see .
franta-hg@3: */
franta-hg@4: package cz.frantovo.copyImageResizer.cli;
franta-hg@3:
franta-hg@3: import java.io.File;
franta-hg@3: import java.util.ArrayList;
franta-hg@3: import java.util.Collection;
franta-hg@3:
franta-hg@3: /**
franta-hg@3: *
franta-hg@3: * @author Ing. František Kučera (frantovo.cz)
franta-hg@3: */
franta-hg@3: public class CLIOptions {
franta-hg@3:
franta-hg@3: /**
franta-hg@3: * Source directory
franta-hg@3: */
franta-hg@3: private File input;
franta-hg@3: /**
franta-hg@3: * Output directory
franta-hg@3: */
franta-hg@3: private File output;
franta-hg@3: /**
franta-hg@3: * Image resolutions to create
franta-hg@3: */
franta-hg@3: private final Collection sizes = new ArrayList<>();
franta-hg@3:
franta-hg@3: public File getSourceDir() {
franta-hg@3: return input;
franta-hg@3: }
franta-hg@3:
franta-hg@3: public void setInput(File input) {
franta-hg@3: this.input = input;
franta-hg@3: }
franta-hg@3:
franta-hg@3: public File getDestinationDir() {
franta-hg@3: return output;
franta-hg@3: }
franta-hg@3:
franta-hg@3: public void setOutput(File output) {
franta-hg@3: this.output = output;
franta-hg@3: }
franta-hg@3:
franta-hg@3: public Collection getSizes() {
franta-hg@3: return sizes;
franta-hg@3: }
franta-hg@3:
franta-hg@3: public void addSize(SizeSpecification size) {
franta-hg@3: sizes.add(size);
franta-hg@3: }
franta-hg@3:
franta-hg@3: public static class SizeSpecification {
franta-hg@3:
franta-hg@3: private final int width;
franta-hg@3: private final int height;
franta-hg@3: private final String directory;
franta-hg@3:
franta-hg@3: public SizeSpecification(int width, int height, String directory) {
franta-hg@3: this.width = width;
franta-hg@3: this.height = height;
franta-hg@3: this.directory = directory;
franta-hg@3: }
franta-hg@3:
franta-hg@3: public int getWidth() {
franta-hg@3: return width;
franta-hg@3: }
franta-hg@3:
franta-hg@3: public int getHeight() {
franta-hg@3: return height;
franta-hg@3: }
franta-hg@3:
franta-hg@3: public String getDirectory() {
franta-hg@3: return directory;
franta-hg@3: }
franta-hg@3: }
franta-hg@3: }