RDF export tab added
This commit is contained in:
parent
d398b8a138
commit
14be21dbce
1 changed files with 359 additions and 189 deletions
|
@ -97,14 +97,14 @@ public class ConfigurationWindow extends JFrame {
|
|||
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.LEFT);
|
||||
getContentPane().add(tabbedPane);
|
||||
|
||||
//JPanel panel_rdf = createRDFPanel();
|
||||
//JPanel panel_epub = createEpubPanel();
|
||||
JPanel panel_rdf = createRDFPanel();
|
||||
JPanel panel_epub = createEpubPanel();
|
||||
JPanel panel_html = createHTMLPanel();
|
||||
|
||||
|
||||
tabbedPane.addTab("HTML", null, panel_html, null);
|
||||
//tabbedPane.addTab("RDF", null, panel_rdf, null);
|
||||
//tabbedPane.addTab("ePub", null, panel_epub, null);
|
||||
tabbedPane.addTab("RDF", null, panel_rdf, null);
|
||||
tabbedPane.addTab("ePub", null, panel_epub, null);
|
||||
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ public class ConfigurationWindow extends JFrame {
|
|||
JPanel panel_epub = new JPanel();
|
||||
HashMap<String, Component> configuration = new HashMap<String, Component>();
|
||||
JPanel panel_control = createControlPanel(configuration);
|
||||
JPanel panel_configEpub = createConfigEpubPanel();
|
||||
JPanel panel_configEpub = createConfigEpubPanel(configuration);
|
||||
applyDefaultLayout(panel_epub, panel_configEpub, panel_control);
|
||||
return panel_epub;
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ public class ConfigurationWindow extends JFrame {
|
|||
JPanel panel_rdf = new JPanel();
|
||||
HashMap<String, Component> configuration = new HashMap<String, Component>();
|
||||
JPanel panel_control = createControlPanel(configuration);
|
||||
JPanel panel_configRDF = createConfigRDFPanel();
|
||||
JPanel panel_configRDF = createConfigRDFPanel(configuration);
|
||||
applyDefaultLayout2(panel_rdf, panel_configRDF, panel_control);
|
||||
return panel_rdf;
|
||||
}
|
||||
|
@ -175,178 +175,12 @@ public class ConfigurationWindow extends JFrame {
|
|||
tabbedPanel.setLayout(gl_panel_html);
|
||||
}
|
||||
|
||||
private JPanel createConfigRDFPanel() {
|
||||
JPanel panel_configHTML = new JPanel();
|
||||
|
||||
JCheckBox cb_UseMathJax = new JCheckBox("Use MathJax");
|
||||
|
||||
JCheckBox cb_IgnoreEmptyParagraphs = new JCheckBox("Filter empty paragraphs");
|
||||
|
||||
JCheckBox cb_IgnoreHardLineBreaks = new JCheckBox("Filter hard line breaks");
|
||||
|
||||
JLabel lb_FilterLetterSpacing = new JLabel("Filter letter spacing less than");
|
||||
|
||||
JTextField tf_FilterLetterSpacing = new JTextField();
|
||||
tf_FilterLetterSpacing.setColumns(10);
|
||||
|
||||
JCheckBox cb_InlineStyles = new JCheckBox("Inline styles1");
|
||||
|
||||
JCheckBox cb_EmbedVectorImages = new JCheckBox("Embed vector images");
|
||||
|
||||
JCheckBox cb_EmbedRaster = new JCheckBox("Embed raster images");
|
||||
|
||||
JLabel lb_MaxWidth_1 = new JLabel("Scale");
|
||||
|
||||
JTextField tf_Scale = new JTextField();
|
||||
tf_Scale.setColumns(10);
|
||||
|
||||
JCheckBox cb_ConversionToRem = new JCheckBox("Convert dimensions to REM");
|
||||
GroupLayout gl_panel_configHTML = new GroupLayout(panel_configHTML);
|
||||
gl_panel_configHTML.setHorizontalGroup(
|
||||
gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(40)
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addComponent(cb_UseMathJax, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addComponent(lb_MaxWidth_1, GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18)
|
||||
.addComponent(tf_Scale, GroupLayout.PREFERRED_SIZE, 175, GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addComponent(lb_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, 253, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18)
|
||||
.addComponent(tf_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, 175, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(cb_InlineStyles, GroupLayout.PREFERRED_SIZE, 592, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_EmbedVectorImages, GroupLayout.PREFERRED_SIZE, 592, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_EmbedRaster, GroupLayout.PREFERRED_SIZE, 592, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_ConversionToRem, GroupLayout.PREFERRED_SIZE, 592, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_IgnoreHardLineBreaks, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_IgnoreEmptyParagraphs, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(332, Short.MAX_VALUE))
|
||||
);
|
||||
gl_panel_configHTML.setVerticalGroup(
|
||||
gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(38)
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(lb_MaxWidth_1))
|
||||
.addComponent(tf_Scale, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(31)
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(lb_FilterLetterSpacing))
|
||||
.addComponent(tf_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(2)
|
||||
.addComponent(cb_InlineStyles)
|
||||
.addGap(7)
|
||||
.addComponent(cb_EmbedVectorImages)
|
||||
.addGap(7)
|
||||
.addComponent(cb_EmbedRaster)
|
||||
.addGap(7)
|
||||
.addComponent(cb_ConversionToRem)
|
||||
.addPreferredGap(ComponentPlacement.RELATED)
|
||||
.addComponent(cb_IgnoreHardLineBreaks)
|
||||
.addGap(7)
|
||||
.addComponent(cb_IgnoreEmptyParagraphs)
|
||||
.addGap(83)
|
||||
.addComponent(cb_UseMathJax)
|
||||
.addContainerGap(310, Short.MAX_VALUE))
|
||||
);
|
||||
panel_configHTML.setLayout(gl_panel_configHTML);
|
||||
return panel_configHTML;
|
||||
}
|
||||
|
||||
private JPanel createConfigEpubPanel() {
|
||||
JPanel panel_configHTML = new JPanel();
|
||||
|
||||
JCheckBox cb_UseMathJax = new JCheckBox("Use MathJax");
|
||||
|
||||
JCheckBox cb_IgnoreEmptyParagraphs = new JCheckBox("Filter empty paragraphs");
|
||||
|
||||
JCheckBox cb_IgnoreHardLineBreaks = new JCheckBox("Filter hard line breaks");
|
||||
|
||||
JLabel lb_FilterLetterSpacing = new JLabel("Filter letter spacing less than");
|
||||
|
||||
JTextField tf_FilterLetterSpacing = new JTextField();
|
||||
tf_FilterLetterSpacing.setColumns(10);
|
||||
|
||||
JCheckBox cb_InlineStyles = new JCheckBox("Inline styles");
|
||||
|
||||
JCheckBox cb_EmbedVectorImages = new JCheckBox("Embed vector images");
|
||||
|
||||
JCheckBox cb_EmbedRaster = new JCheckBox("Embed raster images");
|
||||
|
||||
JLabel lb_MaxWidth_1 = new JLabel("Scale");
|
||||
|
||||
JTextField tf_Scale = new JTextField();
|
||||
tf_Scale.setColumns(10);
|
||||
|
||||
JCheckBox cb_ConversionToRem = new JCheckBox("Convert dimensions to REM");
|
||||
GroupLayout gl_panel_configHTML = new GroupLayout(panel_configHTML);
|
||||
gl_panel_configHTML.setHorizontalGroup(
|
||||
gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(40)
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addComponent(cb_UseMathJax, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addComponent(lb_MaxWidth_1, GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18)
|
||||
.addComponent(tf_Scale, GroupLayout.PREFERRED_SIZE, 175, GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addComponent(lb_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, 253, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18)
|
||||
.addComponent(tf_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, 175, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(cb_InlineStyles, GroupLayout.PREFERRED_SIZE, 592, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_EmbedVectorImages, GroupLayout.PREFERRED_SIZE, 592, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_EmbedRaster, GroupLayout.PREFERRED_SIZE, 592, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_ConversionToRem, GroupLayout.PREFERRED_SIZE, 592, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_IgnoreHardLineBreaks, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_IgnoreEmptyParagraphs, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(332, Short.MAX_VALUE))
|
||||
);
|
||||
gl_panel_configHTML.setVerticalGroup(
|
||||
gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(38)
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(lb_MaxWidth_1))
|
||||
.addComponent(tf_Scale, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(31)
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(lb_FilterLetterSpacing))
|
||||
.addComponent(tf_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(2)
|
||||
.addComponent(cb_InlineStyles)
|
||||
.addGap(7)
|
||||
.addComponent(cb_EmbedVectorImages)
|
||||
.addGap(7)
|
||||
.addComponent(cb_EmbedRaster)
|
||||
.addGap(7)
|
||||
.addComponent(cb_ConversionToRem)
|
||||
.addPreferredGap(ComponentPlacement.RELATED)
|
||||
.addComponent(cb_IgnoreHardLineBreaks)
|
||||
.addGap(7)
|
||||
.addComponent(cb_IgnoreEmptyParagraphs)
|
||||
.addGap(83)
|
||||
.addComponent(cb_UseMathJax)
|
||||
.addContainerGap(310, Short.MAX_VALUE))
|
||||
);
|
||||
panel_configHTML.setLayout(gl_panel_configHTML);
|
||||
return panel_configHTML;
|
||||
}
|
||||
|
||||
private JPanel createConfigHTMLPanel(HashMap<String, Component> configuration) {
|
||||
private JPanel createConfigEpubPanel(HashMap<String, Component> configuration) {
|
||||
JPanel panel_configHTML = new JPanel();
|
||||
|
||||
JCheckBox cb_UseMathJax = new JCheckBox("Use MathJax");
|
||||
cb_UseMathJax.setSelected(true);
|
||||
configuration.put("use_mathjax", cb_UseMathJax);
|
||||
|
||||
JCheckBox cb_SplitWholePagesOnly = new JCheckBox("Split on whole pages only");
|
||||
|
@ -362,29 +196,36 @@ public class ConfigurationWindow extends JFrame {
|
|||
configuration.put("greenstone", cb_Greenstone);
|
||||
|
||||
JCheckBox cb_IgnoreEmptyParagraphs = new JCheckBox("Filter empty paragraphs");
|
||||
cb_IgnoreEmptyParagraphs.setSelected(true);
|
||||
configuration.put("ignore_empty_paragraphs", cb_IgnoreEmptyParagraphs);
|
||||
|
||||
JCheckBox cb_IgnoreHardLineBreaks = new JCheckBox("Filter hard line breaks");
|
||||
cb_IgnoreHardLineBreaks.setSelected(true);
|
||||
configuration.put("ignore_hard_line_breaks", cb_IgnoreHardLineBreaks);
|
||||
|
||||
JLabel lb_FilterLetterSpacing = new JLabel("Filter letter spacing less than");
|
||||
|
||||
JTextField tf_FilterLetterSpacing = new JTextField();
|
||||
tf_FilterLetterSpacing.setText("0.15");
|
||||
configuration.put("min_letter_spacing", tf_FilterLetterSpacing);
|
||||
|
||||
tf_FilterLetterSpacing.setColumns(10);
|
||||
|
||||
JCheckBox cb_InlineStyles = new JCheckBox("Inline styles");
|
||||
cb_InlineStyles.setSelected(true);
|
||||
configuration.put("css_inline", cb_InlineStyles);
|
||||
|
||||
JCheckBox cb_EmbedVectorImages = new JCheckBox("Embed vector images");
|
||||
cb_EmbedVectorImages.setSelected(true);
|
||||
configuration.put("embed_svg", cb_EmbedVectorImages);
|
||||
|
||||
JCheckBox cb_EmbedRaster = new JCheckBox("Embed raster images");
|
||||
cb_EmbedRaster.setSelected(true);
|
||||
configuration.put("embed_img", cb_EmbedRaster);
|
||||
|
||||
JLabel lb_Scale = new JLabel("Scale");
|
||||
JTextField tf_Scale = new JTextField();
|
||||
tf_Scale.setText("100%");
|
||||
configuration.put("scaling", tf_Scale);
|
||||
|
||||
tf_Scale.setColumns(10);
|
||||
|
@ -440,10 +281,7 @@ public class ConfigurationWindow extends JFrame {
|
|||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addComponent(lb_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, 253, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18)
|
||||
.addComponent(tf_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, 175, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(cb_InlineStyles, GroupLayout.PREFERRED_SIZE, 592, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_EmbedVectorImages, GroupLayout.PREFERRED_SIZE, 592, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_EmbedRaster, GroupLayout.PREFERRED_SIZE, 592, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(tf_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, 58, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(cb_convertToPx, GroupLayout.PREFERRED_SIZE, 592, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_IgnoreHardLineBreaks, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_IgnoreEmptyParagraphs, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE)
|
||||
|
@ -452,7 +290,10 @@ public class ConfigurationWindow extends JFrame {
|
|||
.addComponent(lb_SplitByLevel, GroupLayout.PREFERRED_SIZE, 295, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(42)
|
||||
.addComponent(tf_SplitByLevel, GroupLayout.PREFERRED_SIZE, 175, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(cb_SplitWholePagesOnly, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(cb_SplitWholePagesOnly, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_EmbedRaster, GroupLayout.PREFERRED_SIZE, 194, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_EmbedVectorImages, GroupLayout.PREFERRED_SIZE, 214, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_InlineStyles, GroupLayout.PREFERRED_SIZE, 156, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(48))))
|
||||
);
|
||||
gl_panel_configHTML.setVerticalGroup(
|
||||
|
@ -480,18 +321,19 @@ public class ConfigurationWindow extends JFrame {
|
|||
.addGap(2)
|
||||
.addComponent(lb_MaxWidth))
|
||||
.addComponent(tf_MaxWidth, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(6)
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(lb_FilterLetterSpacing))
|
||||
.addComponent(tf_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(2)
|
||||
.addComponent(cb_InlineStyles)
|
||||
.addGap(7)
|
||||
.addComponent(cb_EmbedVectorImages)
|
||||
.addGap(7)
|
||||
.addComponent(cb_EmbedRaster)
|
||||
.addGap(8)
|
||||
.addComponent(lb_FilterLetterSpacing)
|
||||
.addGap(4)
|
||||
.addComponent(cb_InlineStyles)
|
||||
.addGap(7)
|
||||
.addComponent(cb_EmbedVectorImages)
|
||||
.addGap(7)
|
||||
.addComponent(cb_EmbedRaster))
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(6)
|
||||
.addComponent(tf_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
|
||||
.addGap(7)
|
||||
.addComponent(cb_convertToPx)
|
||||
.addPreferredGap(ComponentPlacement.RELATED)
|
||||
|
@ -515,6 +357,334 @@ public class ConfigurationWindow extends JFrame {
|
|||
panel_configHTML.setLayout(gl_panel_configHTML);
|
||||
return panel_configHTML;
|
||||
}
|
||||
|
||||
|
||||
private JPanel createConfigHTMLPanel(HashMap<String, Component> configuration) {
|
||||
JPanel panel_configHTML = new JPanel();
|
||||
|
||||
JCheckBox cb_UseMathJax = new JCheckBox("Use MathJax");
|
||||
cb_UseMathJax.setSelected(true);
|
||||
configuration.put("use_mathjax", cb_UseMathJax);
|
||||
|
||||
JCheckBox cb_SplitWholePagesOnly = new JCheckBox("Split on whole pages only");
|
||||
configuration.put("align_splits_to_pages", cb_SplitWholePagesOnly);
|
||||
|
||||
JLabel lb_SplitByLevel = new JLabel("Split into multiple files by heading level");
|
||||
JTextField tf_SplitByLevel = new JTextField();
|
||||
configuration.put("split_level", tf_SplitByLevel);
|
||||
|
||||
tf_SplitByLevel.setColumns(10);
|
||||
|
||||
JCheckBox cb_Greenstone = new JCheckBox("Split document into subsections for Greenstone digital library");
|
||||
configuration.put("greenstone", cb_Greenstone);
|
||||
|
||||
JCheckBox cb_IgnoreEmptyParagraphs = new JCheckBox("Filter empty paragraphs");
|
||||
cb_IgnoreEmptyParagraphs.setSelected(true);
|
||||
configuration.put("ignore_empty_paragraphs", cb_IgnoreEmptyParagraphs);
|
||||
|
||||
JCheckBox cb_IgnoreHardLineBreaks = new JCheckBox("Filter hard line breaks");
|
||||
cb_IgnoreHardLineBreaks.setSelected(true);
|
||||
configuration.put("ignore_hard_line_breaks", cb_IgnoreHardLineBreaks);
|
||||
|
||||
JLabel lb_FilterLetterSpacing = new JLabel("Filter letter spacing less than");
|
||||
|
||||
JTextField tf_FilterLetterSpacing = new JTextField();
|
||||
tf_FilterLetterSpacing.setText("0.15");
|
||||
configuration.put("min_letter_spacing", tf_FilterLetterSpacing);
|
||||
|
||||
tf_FilterLetterSpacing.setColumns(10);
|
||||
|
||||
JCheckBox cb_InlineStyles = new JCheckBox("Inline styles");
|
||||
cb_InlineStyles.setSelected(true);
|
||||
configuration.put("css_inline", cb_InlineStyles);
|
||||
|
||||
JCheckBox cb_EmbedVectorImages = new JCheckBox("Embed vector images");
|
||||
cb_EmbedVectorImages.setSelected(true);
|
||||
configuration.put("embed_svg", cb_EmbedVectorImages);
|
||||
|
||||
JCheckBox cb_EmbedRaster = new JCheckBox("Embed raster images");
|
||||
cb_EmbedRaster.setSelected(true);
|
||||
configuration.put("embed_img", cb_EmbedRaster);
|
||||
|
||||
JLabel lb_Scale = new JLabel("Scale");
|
||||
JTextField tf_Scale = new JTextField();
|
||||
tf_Scale.setText("100%");
|
||||
configuration.put("scaling", tf_Scale);
|
||||
|
||||
tf_Scale.setColumns(10);
|
||||
|
||||
JLabel lb_MaxWidth = new JLabel("Max body width");
|
||||
|
||||
JTextField tf_MaxWidth = new JTextField();
|
||||
configuration.put("max_width", tf_MaxWidth);
|
||||
|
||||
tf_MaxWidth.setColumns(10);
|
||||
|
||||
JCheckBox cb_convertToPx = new JCheckBox("Convert dimensions to pixels instead of REM (root em)");
|
||||
configuration.put("convert_to_px", cb_convertToPx);
|
||||
|
||||
JLabel lb_FilePath = new JLabel("File path");
|
||||
|
||||
JTextField tf_inputFile = new JTextField(fileName);
|
||||
tf_inputFile.setColumns(10);
|
||||
configuration.put("inputFile", tf_inputFile);
|
||||
|
||||
|
||||
JLabel lb_TargetFormat = new JLabel("html5");
|
||||
configuration.put("targetFormat", lb_TargetFormat);
|
||||
|
||||
|
||||
JLabel lb_TargetFormat_description = new JLabel("Target format");
|
||||
GroupLayout gl_panel_configHTML = new GroupLayout(panel_configHTML);
|
||||
gl_panel_configHTML.setHorizontalGroup(
|
||||
gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(32)
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addComponent(lb_TargetFormat_description, GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(ComponentPlacement.UNRELATED)
|
||||
.addComponent(lb_TargetFormat, GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap())
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addComponent(lb_FilePath, GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18)
|
||||
.addComponent(tf_inputFile, GroupLayout.DEFAULT_SIZE, 755, Short.MAX_VALUE))
|
||||
.addComponent(cb_UseMathJax, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addComponent(lb_Scale, GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18)
|
||||
.addComponent(tf_Scale, GroupLayout.PREFERRED_SIZE, 175, GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addComponent(lb_MaxWidth)
|
||||
.addGap(18)
|
||||
.addComponent(tf_MaxWidth, GroupLayout.PREFERRED_SIZE, 175, GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addComponent(lb_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, 253, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18)
|
||||
.addComponent(tf_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, 58, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(cb_convertToPx, GroupLayout.PREFERRED_SIZE, 592, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_IgnoreHardLineBreaks, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_IgnoreEmptyParagraphs, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_Greenstone, GroupLayout.PREFERRED_SIZE, 482, GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addComponent(lb_SplitByLevel, GroupLayout.PREFERRED_SIZE, 295, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(42)
|
||||
.addComponent(tf_SplitByLevel, GroupLayout.PREFERRED_SIZE, 175, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(cb_SplitWholePagesOnly, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_EmbedRaster, GroupLayout.PREFERRED_SIZE, 194, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_EmbedVectorImages, GroupLayout.PREFERRED_SIZE, 214, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_InlineStyles, GroupLayout.PREFERRED_SIZE, 156, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(48))))
|
||||
);
|
||||
gl_panel_configHTML.setVerticalGroup(
|
||||
gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.BASELINE)
|
||||
.addComponent(lb_TargetFormat_description)
|
||||
.addComponent(lb_TargetFormat))
|
||||
.addGap(22)
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(lb_FilePath))
|
||||
.addComponent(tf_inputFile, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(ComponentPlacement.RELATED)
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(lb_Scale))
|
||||
.addComponent(tf_Scale, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(6)
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(lb_MaxWidth))
|
||||
.addComponent(tf_MaxWidth, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(8)
|
||||
.addComponent(lb_FilterLetterSpacing)
|
||||
.addGap(4)
|
||||
.addComponent(cb_InlineStyles)
|
||||
.addGap(7)
|
||||
.addComponent(cb_EmbedVectorImages)
|
||||
.addGap(7)
|
||||
.addComponent(cb_EmbedRaster))
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(6)
|
||||
.addComponent(tf_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
|
||||
.addGap(7)
|
||||
.addComponent(cb_convertToPx)
|
||||
.addPreferredGap(ComponentPlacement.RELATED)
|
||||
.addComponent(cb_IgnoreHardLineBreaks)
|
||||
.addGap(7)
|
||||
.addComponent(cb_IgnoreEmptyParagraphs)
|
||||
.addGap(4)
|
||||
.addComponent(cb_Greenstone)
|
||||
.addGap(8)
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addComponent(tf_SplitByLevel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(lb_SplitByLevel)))
|
||||
.addPreferredGap(ComponentPlacement.RELATED)
|
||||
.addComponent(cb_SplitWholePagesOnly)
|
||||
.addPreferredGap(ComponentPlacement.UNRELATED)
|
||||
.addComponent(cb_UseMathJax)
|
||||
.addContainerGap(274, Short.MAX_VALUE))
|
||||
);
|
||||
panel_configHTML.setLayout(gl_panel_configHTML);
|
||||
return panel_configHTML;
|
||||
}
|
||||
|
||||
private JPanel createConfigRDFPanel(HashMap<String, Component> configuration) {
|
||||
JPanel panel_configHTML = new JPanel();
|
||||
|
||||
JCheckBox cb_UseMathJax = new JCheckBox("Use MathJax");
|
||||
cb_UseMathJax.setSelected(true);
|
||||
configuration.put("use_mathjax", cb_UseMathJax);
|
||||
|
||||
JCheckBox cb_IgnoreEmptyParagraphs = new JCheckBox("Filter empty paragraphs");
|
||||
cb_IgnoreEmptyParagraphs.setSelected(true);
|
||||
configuration.put("ignore_empty_paragraphs", cb_IgnoreEmptyParagraphs);
|
||||
|
||||
JCheckBox cb_IgnoreHardLineBreaks = new JCheckBox("Filter hard line breaks");
|
||||
cb_IgnoreHardLineBreaks.setSelected(true);
|
||||
configuration.put("ignore_hard_line_breaks", cb_IgnoreHardLineBreaks);
|
||||
|
||||
JLabel lb_FilterLetterSpacing = new JLabel("Filter letter spacing less than");
|
||||
|
||||
JTextField tf_FilterLetterSpacing = new JTextField();
|
||||
tf_FilterLetterSpacing.setText("0.15");
|
||||
configuration.put("min_letter_spacing", tf_FilterLetterSpacing);
|
||||
|
||||
tf_FilterLetterSpacing.setColumns(10);
|
||||
|
||||
JCheckBox cb_InlineStyles = new JCheckBox("Inline styles");
|
||||
cb_InlineStyles.setEnabled(false);
|
||||
cb_InlineStyles.setSelected(true);
|
||||
configuration.put("css_inline", cb_InlineStyles);
|
||||
|
||||
JCheckBox cb_EmbedVectorImages = new JCheckBox("Embed vector images");
|
||||
cb_EmbedVectorImages.setEnabled(false);
|
||||
cb_EmbedVectorImages.setSelected(true);
|
||||
configuration.put("embed_svg", cb_EmbedVectorImages);
|
||||
|
||||
JCheckBox cb_EmbedRaster = new JCheckBox("Embed raster images");
|
||||
cb_EmbedRaster.setEnabled(false);
|
||||
cb_EmbedRaster.setSelected(true);
|
||||
configuration.put("embed_img", cb_EmbedRaster);
|
||||
|
||||
JLabel lb_Scale = new JLabel("Scale");
|
||||
JTextField tf_Scale = new JTextField();
|
||||
tf_Scale.setText("100%");
|
||||
configuration.put("scaling", tf_Scale);
|
||||
|
||||
tf_Scale.setColumns(10);
|
||||
|
||||
JCheckBox cb_convertToPx = new JCheckBox("Convert dimensions to pixels instead of REM (root em)");
|
||||
configuration.put("convert_to_px", cb_convertToPx);
|
||||
|
||||
JLabel lb_FilePath = new JLabel("File path");
|
||||
|
||||
JTextField tf_inputFile = new JTextField(fileName);
|
||||
tf_inputFile.setColumns(10);
|
||||
configuration.put("inputFile", tf_inputFile);
|
||||
|
||||
|
||||
JLabel lb_TargetFormat = new JLabel("rdf");
|
||||
configuration.put("targetFormat", lb_TargetFormat);
|
||||
|
||||
|
||||
JLabel lb_TargetFormat_description = new JLabel("Target format");
|
||||
GroupLayout gl_panel_configHTML = new GroupLayout(panel_configHTML);
|
||||
gl_panel_configHTML.setHorizontalGroup(
|
||||
gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(32)
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addComponent(cb_UseMathJax, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap())
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addComponent(lb_TargetFormat_description, GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(ComponentPlacement.UNRELATED)
|
||||
.addComponent(lb_TargetFormat, GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap())
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addComponent(lb_FilePath, GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18)
|
||||
.addComponent(tf_inputFile, GroupLayout.DEFAULT_SIZE, 755, Short.MAX_VALUE))
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addComponent(lb_Scale, GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18)
|
||||
.addComponent(tf_Scale, GroupLayout.PREFERRED_SIZE, 98, GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addComponent(lb_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, 253, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18)
|
||||
.addComponent(tf_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, 58, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(cb_convertToPx, GroupLayout.PREFERRED_SIZE, 592, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_IgnoreHardLineBreaks, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_IgnoreEmptyParagraphs, GroupLayout.PREFERRED_SIZE, 303, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_EmbedRaster, GroupLayout.PREFERRED_SIZE, 194, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_EmbedVectorImages, GroupLayout.PREFERRED_SIZE, 214, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cb_InlineStyles, GroupLayout.PREFERRED_SIZE, 156, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(48)))))
|
||||
);
|
||||
gl_panel_configHTML.setVerticalGroup(
|
||||
gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.BASELINE)
|
||||
.addComponent(lb_TargetFormat_description)
|
||||
.addComponent(lb_TargetFormat))
|
||||
.addGap(22)
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(lb_FilePath))
|
||||
.addComponent(tf_inputFile, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(8)
|
||||
.addComponent(lb_Scale))
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addPreferredGap(ComponentPlacement.RELATED)
|
||||
.addComponent(tf_Scale, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
|
||||
.addGap(25)
|
||||
.addGroup(gl_panel_configHTML.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(8)
|
||||
.addComponent(lb_FilterLetterSpacing)
|
||||
.addGap(4)
|
||||
.addComponent(cb_InlineStyles)
|
||||
.addGap(7)
|
||||
.addComponent(cb_EmbedVectorImages)
|
||||
.addGap(7)
|
||||
.addComponent(cb_EmbedRaster))
|
||||
.addGroup(gl_panel_configHTML.createSequentialGroup()
|
||||
.addGap(6)
|
||||
.addComponent(tf_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
|
||||
.addGap(7)
|
||||
.addComponent(cb_convertToPx)
|
||||
.addPreferredGap(ComponentPlacement.RELATED)
|
||||
.addComponent(cb_IgnoreHardLineBreaks)
|
||||
.addGap(7)
|
||||
.addComponent(cb_IgnoreEmptyParagraphs)
|
||||
.addPreferredGap(ComponentPlacement.UNRELATED)
|
||||
.addComponent(cb_UseMathJax)
|
||||
.addContainerGap(407, Short.MAX_VALUE))
|
||||
);
|
||||
panel_configHTML.setLayout(gl_panel_configHTML);
|
||||
return panel_configHTML;
|
||||
}
|
||||
|
||||
private JPanel createControlPanel(HashMap<String,Component> configuration) {
|
||||
JPanel controlPanel = new JPanel();
|
||||
|
|
Loading…
Add table
Reference in a new issue