23 * questions.
24 */
25
26 package sun.print;
27
28 import javax.print.attribute.EnumSyntax;
29 import javax.print.attribute.standard.MediaTray;
30 import javax.print.attribute.standard.Media;
31 import java.util.ArrayList;
32
33 class CustomMediaTray extends MediaTray {
34 private static ArrayList<String> customStringTable = new ArrayList<>();
35 private static ArrayList<MediaTray> customEnumTable = new ArrayList<>();
36 private String choiceName;
37
38 private CustomMediaTray(int x) {
39 super(x);
40
41 }
42
43 private synchronized static int nextValue(String name) {
44 customStringTable.add(name);
45 return (customStringTable.size()-1);
46 }
47
48
49 public CustomMediaTray(String name, String choice) {
50 super(nextValue(name));
51 choiceName = choice;
52 customEnumTable.add(this);
53 }
54
55 /**
56 * Version ID for serialized form.
57 */
58 private static final long serialVersionUID = 1019451298193987013L;
59
60
61 /**
62 * Returns the command string for this media tray.
63 */
|
23 * questions.
24 */
25
26 package sun.print;
27
28 import javax.print.attribute.EnumSyntax;
29 import javax.print.attribute.standard.MediaTray;
30 import javax.print.attribute.standard.Media;
31 import java.util.ArrayList;
32
33 class CustomMediaTray extends MediaTray {
34 private static ArrayList<String> customStringTable = new ArrayList<>();
35 private static ArrayList<MediaTray> customEnumTable = new ArrayList<>();
36 private String choiceName;
37
38 private CustomMediaTray(int x) {
39 super(x);
40
41 }
42
43 private static synchronized int nextValue(String name) {
44 customStringTable.add(name);
45 return (customStringTable.size()-1);
46 }
47
48
49 public CustomMediaTray(String name, String choice) {
50 super(nextValue(name));
51 choiceName = choice;
52 customEnumTable.add(this);
53 }
54
55 /**
56 * Version ID for serialized form.
57 */
58 private static final long serialVersionUID = 1019451298193987013L;
59
60
61 /**
62 * Returns the command string for this media tray.
63 */
|