1
2 package org.freehep.graphicsio.exportchooser;
3
4 import java.awt.Component;
5 import java.util.Properties;
6
7 import org.freehep.graphicsio.FontConstants;
8 import org.freehep.swing.layout.TableLayout;
9
10
11
12
13
14
15 public class FontPanel extends OptionPanel {
16
17
18
19
20
21
22
23
24 public FontPanel(Properties options, String embeddingRootKey, String shapeRootKey) {
25 super("Fonts");
26
27
28 Component enable = null;
29
30
31 if (embeddingRootKey != null) {
32 final OptionCheckBox checkBox = new OptionCheckBox(
33 options,
34 embeddingRootKey + "." + FontConstants.EMBED_FONTS,
35 "Embed Fonts as");
36 add(TableLayout.LEFT, checkBox);
37
38 final OptionComboBox comboBox = new OptionComboBox(
39 options,
40 embeddingRootKey + "." + FontConstants.EMBED_FONTS_AS,
41 FontConstants .getEmbedFontsAsList());
42 add(TableLayout.RIGHT, comboBox);
43 checkBox.enables(comboBox);
44
45 enable = checkBox;
46 }
47
48
49 if (shapeRootKey != null) {
50 final OptionCheckBox shapeCheckBox = new OptionCheckBox(
51 options,
52 shapeRootKey + "." + FontConstants.TEXT_AS_SHAPES,
53 "Draw text as shapes");
54 add(TableLayout.FULL, shapeCheckBox);
55
56 if (enable != null) {
57 shapeCheckBox.disables(enable);
58 }
59 }
60 }
61 }