fix: improved panel layouts

This commit is contained in:
Georgy Litvinov 2021-08-11 14:12:29 +02:00
parent 86bbdab7c5
commit d3c1ecbed7
3 changed files with 104 additions and 105 deletions

View file

@ -89,17 +89,6 @@ public class EpubPanel extends JPanel {
.addGroup(groupLayout.createSequentialGroup()
.addGap(6)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addComponent(lb_TargetFormat_description)
.addGap(30)
.addComponent(lb_TargetFormat_1))
.addGroup(groupLayout.createSequentialGroup()
.addGap(1)
.addComponent(lb_FilePath, GroupLayout.PREFERRED_SIZE, 201, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(ComponentPlacement.UNRELATED)
.addComponent(tf_inputFile_1, GroupLayout.DEFAULT_SIZE, 413, Short.MAX_VALUE)
.addGap(12)
.addComponent(btn_chooseFile_1, GroupLayout.PREFERRED_SIZE, 107, GroupLayout.PREFERRED_SIZE))
.addGroup(groupLayout.createSequentialGroup()
.addComponent(lb_OutFilePath, GroupLayout.PREFERRED_SIZE, 201, GroupLayout.PREFERRED_SIZE)
.addGap(19)
@ -130,14 +119,27 @@ public class EpubPanel extends JPanel {
.addGroup(groupLayout.createSequentialGroup()
.addComponent(lb_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, 218, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(tf_FilterLetterSpacing_1, GroupLayout.PREFERRED_SIZE, 50, GroupLayout.PREFERRED_SIZE)))
.addComponent(tf_FilterLetterSpacing_1, GroupLayout.PREFERRED_SIZE, 50, GroupLayout.PREFERRED_SIZE))
.addGroup(groupLayout.createSequentialGroup()
.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING, false)
.addComponent(lb_TargetFormat_description, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(Alignment.LEADING, groupLayout.createSequentialGroup()
.addGap(1)
.addComponent(lb_FilePath, GroupLayout.PREFERRED_SIZE, 201, GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(ComponentPlacement.UNRELATED)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addComponent(tf_inputFile_1, GroupLayout.DEFAULT_SIZE, 413, Short.MAX_VALUE)
.addGap(12)
.addComponent(btn_chooseFile_1, GroupLayout.PREFERRED_SIZE, 107, GroupLayout.PREFERRED_SIZE))
.addComponent(lb_TargetFormat_1))))
.addGap(6))
);
groupLayout.setVerticalGroup(
groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGap(6)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
.addComponent(lb_TargetFormat_description)
.addComponent(lb_TargetFormat_1))
.addGap(6)

View file

@ -101,63 +101,55 @@ public class HTMLPanel extends JPanel{
.addGap(6)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addComponent(lb_OutFilePath, GroupLayout.PREFERRED_SIZE, 201, GroupLayout.PREFERRED_SIZE)
.addGap(21)
.addComponent(tf_OutputFile_1, GroupLayout.DEFAULT_SIZE, 463, Short.MAX_VALUE)
.addGap(17)
.addComponent(btn_ChooseOutputFile_1, GroupLayout.PREFERRED_SIZE, 112, GroupLayout.PREFERRED_SIZE))
.addComponent(lb_TargetFormat_description, GroupLayout.PREFERRED_SIZE, 218, GroupLayout.PREFERRED_SIZE)
.addGap(12)
.addComponent(lb_TargetFormat_1))
.addGroup(groupLayout.createSequentialGroup()
.addComponent(lb_pageBreakInlineStyle, GroupLayout.PREFERRED_SIZE, 201, GroupLayout.PREFERRED_SIZE)
.addGap(21)
.addComponent(tf_pageBreakInlineStyle_1, GroupLayout.DEFAULT_SIZE, 592, Short.MAX_VALUE))
.addComponent(lb_FilePath, GroupLayout.PREFERRED_SIZE, 193, GroupLayout.PREFERRED_SIZE)
.addGap(37)
.addComponent(tf_inputFile_1, GroupLayout.DEFAULT_SIZE, 468, Short.MAX_VALUE)
.addGap(12)
.addComponent(btn_chooseFile_1, GroupLayout.PREFERRED_SIZE, 104, GroupLayout.PREFERRED_SIZE))
.addGroup(groupLayout.createSequentialGroup()
.addComponent(lb_Scale, GroupLayout.PREFERRED_SIZE, 177, GroupLayout.PREFERRED_SIZE)
.addGap(45)
.addComponent(tf_Scale_1, GroupLayout.PREFERRED_SIZE, 53, GroupLayout.PREFERRED_SIZE))
.addComponent(cb_InlineStyles_1, GroupLayout.PREFERRED_SIZE, 370, GroupLayout.PREFERRED_SIZE)
.addComponent(cb_EmbedVectorImages_1, GroupLayout.PREFERRED_SIZE, 370, GroupLayout.PREFERRED_SIZE)
.addComponent(cb_EmbedRaster_1)
.addComponent(cb_convertToPx_1, GroupLayout.PREFERRED_SIZE, 685, GroupLayout.PREFERRED_SIZE)
.addComponent(cb_IgnoreHardLineBreaks_1, GroupLayout.PREFERRED_SIZE, 370, GroupLayout.PREFERRED_SIZE)
.addComponent(cb_IgnoreEmptyParagraphs_1, GroupLayout.PREFERRED_SIZE, 501, GroupLayout.PREFERRED_SIZE)
.addComponent(cb_Greenstone_1)
.addComponent(lb_OutFilePath, GroupLayout.PREFERRED_SIZE, 193, GroupLayout.PREFERRED_SIZE)
.addGap(37)
.addComponent(tf_OutputFile_1, GroupLayout.DEFAULT_SIZE, 468, Short.MAX_VALUE)
.addGap(12)
.addComponent(btn_ChooseOutputFile_1, GroupLayout.PREFERRED_SIZE, 104, GroupLayout.PREFERRED_SIZE))
.addGroup(groupLayout.createSequentialGroup()
.addComponent(lb_SplitByLevel, GroupLayout.PREFERRED_SIZE, 199, GroupLayout.PREFERRED_SIZE)
.addGap(3)
.addComponent(cbox_SplitByLevel_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addComponent(cb_SplitWholePagesOnly_1, GroupLayout.PREFERRED_SIZE, 370, GroupLayout.PREFERRED_SIZE)
.addComponent(cb_UseMathJax_1, GroupLayout.PREFERRED_SIZE, 370, GroupLayout.PREFERRED_SIZE)
.addComponent(cb_Pagination_1, GroupLayout.PREFERRED_SIZE, 370, GroupLayout.PREFERRED_SIZE)
.addComponent(lb_pageBreakInlineStyle, GroupLayout.PREFERRED_SIZE, 193, GroupLayout.PREFERRED_SIZE)
.addGap(37)
.addComponent(tf_pageBreakInlineStyle_1, GroupLayout.DEFAULT_SIZE, 584, Short.MAX_VALUE))
.addGroup(groupLayout.createSequentialGroup()
.addComponent(lb_ImageResolution, GroupLayout.PREFERRED_SIZE, 244, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(cbox_image_resolution_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addComponent(lb_Scale, GroupLayout.PREFERRED_SIZE, 193, GroupLayout.PREFERRED_SIZE)
.addGap(37)
.addComponent(tf_Scale_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGroup(groupLayout.createSequentialGroup()
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addComponent(lb_MaxWidth, GroupLayout.PREFERRED_SIZE, 177, GroupLayout.PREFERRED_SIZE)
.addComponent(lb_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, 220, GroupLayout.PREFERRED_SIZE))
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGap(2)
.addComponent(lb_MaxWidth, GroupLayout.PREFERRED_SIZE, 193, GroupLayout.PREFERRED_SIZE)
.addGap(37)
.addComponent(tf_MaxWidth_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGroup(groupLayout.createSequentialGroup()
.addGap(26)
.addComponent(tf_FilterLetterSpacing_1, GroupLayout.PREFERRED_SIZE, 50, GroupLayout.PREFERRED_SIZE))))
.addComponent(lb_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, 218, GroupLayout.PREFERRED_SIZE)
.addGap(37)
.addComponent(tf_FilterLetterSpacing_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addComponent(cb_InlineStyles_1)
.addComponent(cb_EmbedVectorImages_1)
.addComponent(cb_EmbedRaster_1)
.addComponent(cb_convertToPx_1, GroupLayout.PREFERRED_SIZE, 698, GroupLayout.PREFERRED_SIZE)
.addComponent(cb_IgnoreHardLineBreaks_1)
.addComponent(cb_IgnoreEmptyParagraphs_1, GroupLayout.PREFERRED_SIZE, 698, GroupLayout.PREFERRED_SIZE)
.addComponent(cb_Greenstone_1)
.addGroup(groupLayout.createSequentialGroup()
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
.addComponent(lb_TargetFormat_description, GroupLayout.PREFERRED_SIZE, 177, GroupLayout.PREFERRED_SIZE)
.addComponent(lb_SplitByLevel, GroupLayout.PREFERRED_SIZE, 193, GroupLayout.PREFERRED_SIZE)
.addGap(12)
.addComponent(cbox_SplitByLevel_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addComponent(cb_SplitWholePagesOnly_1)
.addComponent(cb_UseMathJax_1)
.addComponent(cb_Pagination_1)
.addGroup(groupLayout.createSequentialGroup()
.addComponent(lb_FilePath, GroupLayout.PREFERRED_SIZE, 177, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGap(17)
.addComponent(lb_TargetFormat_1, GroupLayout.PREFERRED_SIZE, 145, GroupLayout.PREFERRED_SIZE))
.addGroup(groupLayout.createSequentialGroup()
.addGap(45)
.addComponent(tf_inputFile_1, GroupLayout.DEFAULT_SIZE, 463, Short.MAX_VALUE)
.addGap(17)
.addComponent(btn_chooseFile_1, GroupLayout.PREFERRED_SIZE, 112, GroupLayout.PREFERRED_SIZE)))))
.addComponent(lb_ImageResolution, GroupLayout.PREFERRED_SIZE, 249, GroupLayout.PREFERRED_SIZE)
.addGap(6)
.addComponent(cbox_image_resolution_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
.addGap(6))
);
groupLayout.setVerticalGroup(
@ -166,25 +158,25 @@ public class HTMLPanel extends JPanel{
.addGap(6)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addComponent(lb_TargetFormat_description)
.addComponent(lb_TargetFormat_1))
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGap(6)
.addComponent(lb_TargetFormat_1)))
.addGap(6)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGap(3)
.addComponent(tf_inputFile_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addComponent(btn_chooseFile_1)))
.addGap(10)
.addComponent(lb_FilePath))
.addGroup(groupLayout.createSequentialGroup()
.addPreferredGap(ComponentPlacement.UNRELATED)
.addComponent(lb_FilePath)))
.addGap(6)
.addComponent(tf_inputFile_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addComponent(btn_chooseFile_1))
.addGap(6)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGap(5)
.addComponent(lb_OutFilePath))
.addGroup(groupLayout.createSequentialGroup()
.addGap(3)
.addGap(6)
.addComponent(tf_OutputFile_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addComponent(btn_ChooseOutputFile_1))
.addGap(6)
@ -193,24 +185,25 @@ public class HTMLPanel extends JPanel{
.addGap(2)
.addComponent(lb_pageBreakInlineStyle))
.addComponent(tf_pageBreakInlineStyle_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGap(6)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGap(8)
.addGap(2)
.addComponent(lb_Scale))
.addGroup(groupLayout.createSequentialGroup()
.addComponent(tf_Scale_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGap(6)
.addComponent(tf_Scale_1, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGap(2)
.addComponent(lb_MaxWidth))
.addComponent(tf_MaxWidth_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGap(8)
.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
.addComponent(lb_FilterLetterSpacing, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)
.addGap(6)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGap(2)
.addComponent(lb_FilterLetterSpacing))
.addComponent(tf_FilterLetterSpacing_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGap(10)
.addGap(6)
.addComponent(cb_InlineStyles_1)
.addGap(6)
.addComponent(cb_EmbedVectorImages_1)
@ -224,21 +217,24 @@ public class HTMLPanel extends JPanel{
.addComponent(cb_IgnoreEmptyParagraphs_1)
.addGap(6)
.addComponent(cb_Greenstone_1)
.addGap(11)
.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
.addComponent(lb_SplitByLevel)
.addGap(6)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGap(5)
.addComponent(lb_SplitByLevel))
.addComponent(cbox_SplitByLevel_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGap(10)
.addGap(6)
.addComponent(cb_SplitWholePagesOnly_1)
.addGap(6)
.addComponent(cb_UseMathJax_1)
.addGap(6)
.addComponent(cb_Pagination_1)
.addGap(11)
.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
.addComponent(lb_ImageResolution)
.addComponent(cbox_image_resolution_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGap(4))
.addGap(6)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGap(5)
.addComponent(lb_ImageResolution))
.addComponent(cbox_image_resolution_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
);
setLayout(groupLayout);
}

View file

@ -102,16 +102,6 @@ public class RDFPanel extends JPanel {
.addGroup(groupLayout.createSequentialGroup()
.addGap(6)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGap(210)
.addComponent(lb_TargetFormat_1))
.addComponent(lb_TargetFormat_description, GroupLayout.PREFERRED_SIZE, 382, GroupLayout.PREFERRED_SIZE)
.addGroup(groupLayout.createSequentialGroup()
.addComponent(lb_FilePath, GroupLayout.PREFERRED_SIZE, 198, GroupLayout.PREFERRED_SIZE)
.addGap(12)
.addComponent(tf_inputFile_1, GroupLayout.DEFAULT_SIZE, 448, Short.MAX_VALUE)
.addGap(19)
.addComponent(btnChooseFile, GroupLayout.PREFERRED_SIZE, 115, GroupLayout.PREFERRED_SIZE))
.addGroup(groupLayout.createSequentialGroup()
.addComponent(lb_metadataFilePath, GroupLayout.PREFERRED_SIZE, 198, GroupLayout.PREFERRED_SIZE)
.addGap(12)
@ -152,7 +142,18 @@ public class RDFPanel extends JPanel {
.addGroup(groupLayout.createSequentialGroup()
.addComponent(lb_FilterLetterSpacing)
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(tf_FilterLetterSpacing_1, GroupLayout.PREFERRED_SIZE, 52, GroupLayout.PREFERRED_SIZE)))
.addComponent(tf_FilterLetterSpacing_1, GroupLayout.PREFERRED_SIZE, 52, GroupLayout.PREFERRED_SIZE))
.addGroup(groupLayout.createSequentialGroup()
.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING, false)
.addComponent(lb_TargetFormat_description, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lb_FilePath, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE))
.addGap(12)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addComponent(lb_TargetFormat_1, GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE)
.addGroup(groupLayout.createSequentialGroup()
.addComponent(tf_inputFile_1, GroupLayout.DEFAULT_SIZE, 448, Short.MAX_VALUE)
.addGap(19)
.addComponent(btnChooseFile, GroupLayout.PREFERRED_SIZE, 115, GroupLayout.PREFERRED_SIZE)))))
.addGap(6))
);
groupLayout.setVerticalGroup(
@ -160,9 +161,9 @@ public class RDFPanel extends JPanel {
.addGroup(groupLayout.createSequentialGroup()
.addGap(6)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addComponent(lb_TargetFormat_1)
.addComponent(lb_TargetFormat_description))
.addGap(6)
.addComponent(lb_TargetFormat_description)
.addComponent(lb_TargetFormat_1))
.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGap(5)