// Path: src/ch/jbead/Settings.java
// public class Settings {
// 
// 	private static final String BASE = "brunoldsoft/jbead";
// 
// 	private Preferences preferences = Preferences.userRoot().node(BASE);
// 	private String category = "general";
// 
// 	public Settings() {
// 		category = "general";
// 	}
// 
// 	public void setCategory(String category) {
// 		this.category = category;
// 	}
// 
// 	public String category() {
// 		return category;
// 	}
// 
// 	public boolean hasSetting(String name) {
// 	    return preferences.node(category).get(name, null) != null;
// 	}
// 
// 	public int loadInt(String name) {
// 		return loadInt(name, 0);
// 	}
// 
// 	public int loadInt(String name, int defaultvalue) {
// 		return preferences.node(category).getInt(name, defaultvalue);
// 	}
// 
//     public long loadLong(String name) {
//         return loadLong(name, 0);
//     }
// 
//     public long loadLong(String name, long defaultvalue) {
//         return preferences.node(category).getLong(name, defaultvalue);
//     }
// 
//     public boolean loadBoolean(String name) {
//         return loadBoolean(name, false);
//     }
// 
//     public boolean loadBoolean(String name, boolean defaultvalue) {
//         return preferences.node(category).getBoolean(name, defaultvalue);
//     }
// 
// 	public String loadString(String name) {
// 		return loadString(name, "");
// 	}
// 
// 	public String loadString(String name, String defaultvalue) {
// 		return preferences.node(category).get(name, defaultvalue);
// 	}
// 
// 	public void saveInt(String name, int value) {
// 		preferences.node(category).putInt(name, value);
// 	}
// 
//     public void saveLong(String name, long value) {
//         preferences.node(category).putLong(name, value);
//     }
// 
//     public void saveBoolean(String name, boolean value) {
//         preferences.node(category).putBoolean(name, value);
//     }
// 
// 	public void saveString(String name, String value) {
// 		preferences.node(category).put(name, value);
// 	}
// 
//     public void remove(String name) {
//         preferences.node(category).remove(name);
//     }
// 
// 	public void flush() throws BackingStoreException {
// 		preferences.flush();
// 	}
// 
// }


import java.awt.print.Paper;
import java.awt.print.PrinterJob;
import java.util.HashMap;
import java.util.Map;
import javax.print.PrintService;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.Copies;
import javax.print.attribute.standard.MediaSizeName;
import javax.print.attribute.standard.OrientationRequested;
import ch.jbead.Settings;
/** jbead - http://www.jbead.ch
    Copyright (C) 2001-2012  Damian Brunold

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

package ch.jbead.print;




public class PrintSettings {

    private static Map<String, MediaSizeName> mediamap = new HashMap<String, MediaSizeName>();

    static {
        mediamap.put("a0", MediaSizeName.ISO_A0);
        mediamap.put("a1", MediaSizeName.ISO_A1);
        mediamap.put("a2", MediaSizeName.ISO_A2);
        mediamap.put("a3", MediaSizeName.ISO_A3);
        mediamap.put("a4", MediaSizeName.ISO_A4);
        mediamap.put("a5", MediaSizeName.ISO_A5);
        mediamap.put("a6", MediaSizeName.ISO_A6);
        mediamap.put("a7", MediaSizeName.ISO_A7);
        mediamap.put("a8", MediaSizeName.ISO_A8);
        mediamap.put("a9", MediaSizeName.ISO_A9);
        mediamap.put("a10", MediaSizeName.ISO_A10);
        mediamap.put("letter", MediaSizeName.NA_LETTER);
        mediamap.put("legal", MediaSizeName.NA_LEGAL);
        mediamap.put("executive", MediaSizeName.EXECUTIVE);
        mediamap.put("ledger", MediaSizeName.LEDGER);
        mediamap.put("tabloid", MediaSizeName.TABLOID);
        mediamap.put("invoice", MediaSizeName.INVOICE);
        mediamap.put("folio", MediaSizeName.FOLIO);
        mediamap.put("quarto", MediaSizeName.QUARTO);
    }

    private PrintService service;
    private PrintRequestAttributeSet attributes;

// Path: src/ch/jbead/Settings.java
// public class Settings {
// 
// 	private static final String BASE = "brunoldsoft/jbead";
// 
// 	private Preferences preferences = Preferences.userRoot().node(BASE);
// 	private String category = "general";
// 
// 	public Settings() {
// 		category = "general";
// 	}
// 
// 	public void setCategory(String category) {
// 		this.category = category;
// 	}
// 
// 	public String category() {
// 		return category;
// 	}
// 
// 	public boolean hasSetting(String name) {
// 	    return preferences.node(category).get(name, null) != null;
// 	}
// 
// 	public int loadInt(String name) {
// 		return loadInt(name, 0);
// 	}
// 
// 	public int loadInt(String name, int defaultvalue) {
// 		return preferences.node(category).getInt(name, defaultvalue);
// 	}
// 
//     public long loadLong(String name) {
//         return loadLong(name, 0);
//     }
// 
//     public long loadLong(String name, long defaultvalue) {
//         return preferences.node(category).getLong(name, defaultvalue);
//     }
// 
//     public boolean loadBoolean(String name) {
//         return loadBoolean(name, false);
//     }
// 
//     public boolean loadBoolean(String name, boolean defaultvalue) {
//         return preferences.node(category).getBoolean(name, defaultvalue);
//     }
// 
// 	public String loadString(String name) {
// 		return loadString(name, "");
// 	}
// 
// 	public String loadString(String name, String defaultvalue) {
// 		return preferences.node(category).get(name, defaultvalue);
// 	}
// 
// 	public void saveInt(String name, int value) {
// 		preferences.node(category).putInt(name, value);
// 	}
// 
//     public void saveLong(String name, long value) {
//         preferences.node(category).putLong(name, value);
//     }
// 
//     public void saveBoolean(String name, boolean value) {
//         preferences.node(category).putBoolean(name, value);
//     }
// 
// 	public void saveString(String name, String value) {
// 		preferences.node(category).put(name, value);
// 	}
// 
//     public void remove(String name) {
//         preferences.node(category).remove(name);
//     }
// 
// 	public void flush() throws BackingStoreException {
// 		preferences.flush();
// 	}
// 
// }


// Path: src/ch/jbead/print/PrintSettings.java
import java.awt.print.Paper;
import java.awt.print.PrinterJob;
import java.util.HashMap;
import java.util.Map;
import javax.print.PrintService;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.Copies;
import javax.print.attribute.standard.MediaSizeName;
import javax.print.attribute.standard.OrientationRequested;
import ch.jbead.Settings;

/** jbead - http://www.jbead.ch
    Copyright (C) 2001-2012  Damian Brunold

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

package ch.jbead.print;




public class PrintSettings {

    private static Map<String, MediaSizeName> mediamap = new HashMap<String, MediaSizeName>();

    static {
        mediamap.put("a0", MediaSizeName.ISO_A0);
        mediamap.put("a1", MediaSizeName.ISO_A1);
        mediamap.put("a2", MediaSizeName.ISO_A2);
        mediamap.put("a3", MediaSizeName.ISO_A3);
        mediamap.put("a4", MediaSizeName.ISO_A4);
        mediamap.put("a5", MediaSizeName.ISO_A5);
        mediamap.put("a6", MediaSizeName.ISO_A6);
        mediamap.put("a7", MediaSizeName.ISO_A7);
        mediamap.put("a8", MediaSizeName.ISO_A8);
        mediamap.put("a9", MediaSizeName.ISO_A9);
        mediamap.put("a10", MediaSizeName.ISO_A10);
        mediamap.put("letter", MediaSizeName.NA_LETTER);
        mediamap.put("legal", MediaSizeName.NA_LEGAL);
        mediamap.put("executive", MediaSizeName.EXECUTIVE);
        mediamap.put("ledger", MediaSizeName.LEDGER);
        mediamap.put("tabloid", MediaSizeName.TABLOID);
        mediamap.put("invoice", MediaSizeName.INVOICE);
        mediamap.put("folio", MediaSizeName.FOLIO);
        mediamap.put("quarto", MediaSizeName.QUARTO);
    }

    private PrintService service;
    private PrintRequestAttributeSet attributes;

    public PrintSettings(Settings settings) {