UI enhancements
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Dmitry Isaenko 2023-09-12 16:07:13 +03:00
parent ab47f1c960
commit 3c391cf1d3
5 changed files with 99 additions and 82 deletions

View file

@ -34,7 +34,7 @@ public class Main {
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Image img = new ImageIcon(Objects.requireNonNull(MainAppUi.class.getClassLoader().getResource("tray_icon.gif"))).getImage(); Image img = new ImageIcon(Objects.requireNonNull(MainAppUi.class.getClassLoader().getResource("tray_icon.gif"))).getImage();
frame.setIconImage(img); frame.setIconImage(img);
frame.setMinimumSize(new Dimension(700, 300)); frame.setMinimumSize(new Dimension(700, 350));
//frame.setResizable(false); //frame.setResizable(false);
frame.setVisible(true); frame.setVisible(true);
} }

View file

@ -2,6 +2,7 @@
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="tihwin.MainAppUi"> <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="tihwin.MainAppUi">
<grid id="27dc6" binding="mainPanel" layout-manager="FormLayout"> <grid id="27dc6" binding="mainPanel" layout-manager="FormLayout">
<rowspec value="center:max(d;4px):noGrow"/> <rowspec value="center:max(d;4px):noGrow"/>
<rowspec value="top:m:grow"/>
<rowspec value="top:4dlu:noGrow"/> <rowspec value="top:4dlu:noGrow"/>
<rowspec value="center:max(d;4px):noGrow"/> <rowspec value="center:max(d;4px):noGrow"/>
<rowspec value="top:4dlu:noGrow"/> <rowspec value="top:4dlu:noGrow"/>
@ -10,9 +11,10 @@
<rowspec value="center:max(d;4px):noGrow"/> <rowspec value="center:max(d;4px):noGrow"/>
<rowspec value="top:4dlu:noGrow"/> <rowspec value="top:4dlu:noGrow"/>
<rowspec value="center:max(d;4px):noGrow"/> <rowspec value="center:max(d;4px):noGrow"/>
<rowspec value="top:p:grow"/>
<rowspec value="top:4dlu:noGrow"/> <rowspec value="top:4dlu:noGrow"/>
<rowspec value="center:max(d;4px):noGrow"/> <rowspec value="center:max(d;4px):noGrow"/>
<rowspec value="top:4dlu:noGrow"/>
<rowspec value="center:max(d;1dlu):noGrow"/>
<colspec value="fill:p:noGrow"/> <colspec value="fill:p:noGrow"/>
<colspec value="left:4dlu:noGrow"/> <colspec value="left:4dlu:noGrow"/>
<colspec value="fill:p:noGrow"/> <colspec value="fill:p:noGrow"/>
@ -23,14 +25,14 @@
<colspec value="left:4dlu:noGrow"/> <colspec value="left:4dlu:noGrow"/>
<colspec value="fill:p:noGrow"/> <colspec value="fill:p:noGrow"/>
<constraints> <constraints>
<xy x="0" y="0" width="729" height="288"/> <xy x="0" y="0" width="763" height="488"/>
</constraints> </constraints>
<properties/> <properties/>
<border type="none"/> <border type="none"/>
<children> <children>
<component id="3f7d8" class="javax.swing.JButton" binding="diskImageSelectBtn"> <component id="3f7d8" class="javax.swing.JButton" binding="diskImageSelectBtn">
<constraints> <constraints>
<grid row="2" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/> <grid row="3" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
<forms top="0" left="5" bottom="0" right="0" defaultalign-vert="false"/> <forms top="0" left="5" bottom="0" right="0" defaultalign-vert="false"/>
</constraints> </constraints>
<properties> <properties>
@ -40,7 +42,7 @@
</component> </component>
<component id="8e185" class="javax.swing.JTextField" binding="titleField"> <component id="8e185" class="javax.swing.JTextField" binding="titleField">
<constraints> <constraints>
<grid row="4" column="6" row-span="1" col-span="3" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="1" use-parent-layout="false"> <grid row="5" column="6" row-span="1" col-span="3" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="1" use-parent-layout="false">
<preferred-size width="150" height="-1"/> <preferred-size width="150" height="-1"/>
</grid> </grid>
<forms top="0" left="0" bottom="0" right="5"/> <forms top="0" left="0" bottom="0" right="5"/>
@ -49,7 +51,7 @@
</component> </component>
<component id="b32ec" class="javax.swing.JLabel" binding="destinationDirectoryLbl"> <component id="b32ec" class="javax.swing.JLabel" binding="destinationDirectoryLbl">
<constraints> <constraints>
<grid row="6" column="6" row-span="1" col-span="3" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> <grid row="7" column="6" row-span="1" col-span="3" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<forms/> <forms/>
</constraints> </constraints>
<properties> <properties>
@ -58,7 +60,7 @@
</component> </component>
<component id="43fa" class="javax.swing.JLabel" binding="diskImageNameLbl"> <component id="43fa" class="javax.swing.JLabel" binding="diskImageNameLbl">
<constraints> <constraints>
<grid row="2" column="6" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/> <grid row="3" column="6" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<forms/> <forms/>
</constraints> </constraints>
<properties> <properties>
@ -67,7 +69,7 @@
</component> </component>
<component id="fbb6" class="javax.swing.JButton" binding="destinationSelectBtn"> <component id="fbb6" class="javax.swing.JButton" binding="destinationSelectBtn">
<constraints> <constraints>
<grid row="6" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/> <grid row="7" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
<forms top="0" left="5" bottom="0" right="0"/> <forms top="0" left="5" bottom="0" right="0"/>
</constraints> </constraints>
<properties> <properties>
@ -77,7 +79,7 @@
</component> </component>
<component id="ed01c" class="javax.swing.JLabel" binding="ulDestinationRoLbl"> <component id="ed01c" class="javax.swing.JLabel" binding="ulDestinationRoLbl">
<constraints> <constraints>
<grid row="6" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> <grid row="7" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<forms/> <forms/>
</constraints> </constraints>
<properties> <properties>
@ -86,7 +88,7 @@
</component> </component>
<component id="778d6" class="javax.swing.JLabel" binding="diskImageRoLbl"> <component id="778d6" class="javax.swing.JLabel" binding="diskImageRoLbl">
<constraints> <constraints>
<grid row="2" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> <grid row="3" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<forms/> <forms/>
</constraints> </constraints>
<properties> <properties>
@ -95,7 +97,7 @@
</component> </component>
<component id="cbd88" class="javax.swing.JLabel" binding="titleRoLbl"> <component id="cbd88" class="javax.swing.JLabel" binding="titleRoLbl">
<constraints> <constraints>
<grid row="4" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> <grid row="5" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<forms/> <forms/>
</constraints> </constraints>
<properties> <properties>
@ -104,7 +106,7 @@
</component> </component>
<component id="a214f" class="javax.swing.JRadioButton" binding="CDRadioButton" default-binding="true"> <component id="a214f" class="javax.swing.JRadioButton" binding="CDRadioButton" default-binding="true">
<constraints> <constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/> <grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<forms/> <forms/>
</constraints> </constraints>
<properties> <properties>
@ -113,7 +115,7 @@
</component> </component>
<component id="1dd66" class="javax.swing.JRadioButton" binding="DVDRadioButton" default-binding="true"> <component id="1dd66" class="javax.swing.JRadioButton" binding="DVDRadioButton" default-binding="true">
<constraints> <constraints>
<grid row="4" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/> <grid row="5" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<forms/> <forms/>
</constraints> </constraints>
<properties> <properties>
@ -123,7 +125,7 @@
</component> </component>
<component id="308a4" class="javax.swing.JButton" binding="convertBtn"> <component id="308a4" class="javax.swing.JButton" binding="convertBtn">
<constraints> <constraints>
<grid row="8" column="0" row-span="1" col-span="9" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"> <grid row="9" column="0" row-span="1" col-span="9" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
<minimum-size width="-1" height="50"/> <minimum-size width="-1" height="50"/>
</grid> </grid>
<forms top="0" left="5" bottom="0" right="5"/> <forms top="0" left="5" bottom="0" right="5"/>
@ -133,37 +135,14 @@
<text resource-bundle="locale" key="ConvertBtn"/> <text resource-bundle="locale" key="ConvertBtn"/>
</properties> </properties>
</component> </component>
<grid id="8b0eb" binding="statusJPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="5" bottom="5" right="5"/>
<constraints>
<grid row="11" column="0" row-span="1" col-span="9" vsize-policy="0" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<forms/>
</constraints>
<properties>
<background color="-1"/>
</properties>
<border type="none">
<color color="-4473925"/>
</border>
<children>
<component id="2cf16" class="javax.swing.JLabel" binding="statusLbl">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="locale" key="WelcomeText"/>
</properties>
</component>
</children>
</grid>
<component id="be17f" class="javax.swing.JProgressBar" binding="progressBar" default-binding="true"> <component id="be17f" class="javax.swing.JProgressBar" binding="progressBar" default-binding="true">
<constraints> <constraints>
<grid row="10" column="0" row-span="1" col-span="7" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/> <grid row="11" column="0" row-span="1" col-span="9" vsize-policy="0" hsize-policy="6" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
<forms defaultalign-horz="false"/> <forms defaultalign-horz="false" defaultalign-vert="false"/>
</constraints> </constraints>
<properties> <properties>
<borderPainted value="false"/> <borderPainted value="false"/>
<foreground color="-9251843"/> <foreground color="-26368"/>
<indeterminate value="false"/> <indeterminate value="false"/>
</properties> </properties>
</component> </component>
@ -189,9 +168,12 @@
</component> </component>
<component id="92f10" class="javax.swing.JComboBox" binding="ulLangComboBox" custom-create="true"> <component id="92f10" class="javax.swing.JComboBox" binding="ulLangComboBox" custom-create="true">
<constraints> <constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="9" fill="1" indent="0" use-parent-layout="false"/> <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="9" fill="1" indent="1" use-parent-layout="false"/>
</constraints> </constraints>
<properties/> <properties>
<background color="-9251843"/>
<foreground color="-1"/>
</properties>
<clientProperties> <clientProperties>
<html.disable class="java.lang.Boolean" value="false"/> <html.disable class="java.lang.Boolean" value="false"/>
</clientProperties> </clientProperties>
@ -200,7 +182,7 @@
</grid> </grid>
<component id="824ea" class="javax.swing.JButton" binding="ulCfgBtn"> <component id="824ea" class="javax.swing.JButton" binding="ulCfgBtn">
<constraints> <constraints>
<grid row="2" column="8" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/> <grid row="3" column="8" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
<forms top="0" left="0" bottom="0" right="5"/> <forms top="0" left="0" bottom="0" right="5"/>
</constraints> </constraints>
<properties> <properties>
@ -211,6 +193,29 @@
<text resource-bundle="locale" key="editUlCfgBtn"/> <text resource-bundle="locale" key="editUlCfgBtn"/>
</properties> </properties>
</component> </component>
<grid id="8b0eb" binding="statusJPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="5" bottom="5" right="5"/>
<constraints>
<grid row="13" column="0" row-span="1" col-span="9" vsize-policy="0" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<forms/>
</constraints>
<properties>
<background color="-1"/>
</properties>
<border type="none">
<color color="-4473925"/>
</border>
<children>
<component id="2cf16" class="javax.swing.JLabel" binding="statusLbl">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="locale" key="WelcomeText"/>
</properties>
</component>
</children>
</grid>
</children> </children>
</grid> </grid>
<buttonGroups> <buttonGroups>

View file

@ -88,7 +88,7 @@ public class MainAppUi extends JFrame {
CDRadioButton.setSelected(true); CDRadioButton.setSelected(true);
recentRomLocation = Settings.INSTANCE.getRomLocation(); recentRomLocation = Settings.INSTANCE.getRomLocation();
destinationDirectoryLbl.setText(FilesHelper.getRealFolder(Settings.INSTANCE.getDestination())); destinationDirectoryLbl.setText(FilesHelper.getRealFolder(Settings.INSTANCE.getDestination()));
addWindowListener(new WindowAdapter(){ addWindowListener(new WindowAdapter() {
@Override @Override
public void windowClosing(WindowEvent windowEvent) { public void windowClosing(WindowEvent windowEvent) {
Settings.INSTANCE.setRomLocation(recentRomLocation); Settings.INSTANCE.setRomLocation(recentRomLocation);
@ -110,14 +110,14 @@ public class MainAppUi extends JFrame {
} }
private void diskImageSelectEventHandler() { private void diskImageSelectEventHandler() {
JFileChooser fileChooser = new JFileChooser(FilesHelper.getRealFolder(recentRomLocation)); JFileChooser fileChooser = new JFileChooser(FilesHelper.getRealFolder(recentRomLocation));
fileChooser.setDialogTitle(resourceBundle.getString("SelectDiskImageText")); fileChooser.setDialogTitle(resourceBundle.getString("SelectDiskImageText"));
fileChooser.setFileFilter(new IsoFileFilter()); fileChooser.setFileFilter(new IsoFileFilter());
if (fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) if (fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION)
setDiskImageFile(fileChooser.getSelectedFile()); setDiskImageFile(fileChooser.getSelectedFile());
} }
public void setDiskImageFile(File imageFile){ public void setDiskImageFile(File imageFile) {
try { try {
recentRomLocation = imageFile.getParent(); recentRomLocation = imageFile.getParent();
ISO9660 iso9660 = new ISO9660(imageFile); ISO9660 iso9660 = new ISO9660(imageFile);
@ -227,6 +227,11 @@ public class MainAppUi extends JFrame {
ulCfgBtn.setText(resourceBundle.getString("editUlCfgBtn")); ulCfgBtn.setText(resourceBundle.getString("editUlCfgBtn"));
} }
private void createUIComponents() {
this.ulLangComboBox = new LanguageComboBox();
ulLangComboBox.addActionListener(e -> onLanguageChanged());
}
/** /**
* Method generated by IntelliJ IDEA GUI Designer * Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<< * >>> IMPORTANT!! <<<
@ -237,56 +242,49 @@ public class MainAppUi extends JFrame {
private void $$$setupUI$$$() { private void $$$setupUI$$$() {
createUIComponents(); createUIComponents();
mainPanel = new JPanel(); mainPanel = new JPanel();
mainPanel.setLayout(new FormLayout("fill:p:noGrow,left:4dlu:noGrow,fill:p:noGrow,left:4dlu:noGrow,fill:p:noGrow,fill:max(d;4px):noGrow,fill:d:grow,left:4dlu:noGrow,fill:p:noGrow", "center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:p:grow,top:4dlu:noGrow,center:max(d;4px):noGrow")); mainPanel.setLayout(new FormLayout("fill:p:noGrow,left:4dlu:noGrow,fill:p:noGrow,left:4dlu:noGrow,fill:p:noGrow,fill:max(d;4px):noGrow,fill:d:grow,left:4dlu:noGrow,fill:p:noGrow", "center:max(d;4px):noGrow,top:m:grow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;1dlu):noGrow"));
diskImageSelectBtn = new JButton(); diskImageSelectBtn = new JButton();
diskImageSelectBtn.setBackground(new Color(-2034433)); diskImageSelectBtn.setBackground(new Color(-2034433));
this.$$$loadButtonText$$$(diskImageSelectBtn, this.$$$getMessageFromBundle$$$("locale", "SelectBtn")); this.$$$loadButtonText$$$(diskImageSelectBtn, this.$$$getMessageFromBundle$$$("locale", "SelectBtn"));
CellConstraints cc = new CellConstraints(); CellConstraints cc = new CellConstraints();
mainPanel.add(diskImageSelectBtn, new CellConstraints(1, 3, 3, 1, CellConstraints.DEFAULT, CellConstraints.CENTER, new Insets(0, 5, 0, 0))); mainPanel.add(diskImageSelectBtn, new CellConstraints(1, 4, 3, 1, CellConstraints.DEFAULT, CellConstraints.CENTER, new Insets(0, 5, 0, 0)));
titleField = new JTextField(); titleField = new JTextField();
mainPanel.add(titleField, new CellConstraints(7, 5, 3, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(0, 0, 0, 5))); mainPanel.add(titleField, new CellConstraints(7, 6, 3, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(0, 0, 0, 5)));
destinationDirectoryLbl = new JLabel(); destinationDirectoryLbl = new JLabel();
destinationDirectoryLbl.setText(""); destinationDirectoryLbl.setText("");
mainPanel.add(destinationDirectoryLbl, cc.xyw(7, 7, 3)); mainPanel.add(destinationDirectoryLbl, cc.xyw(7, 8, 3));
diskImageNameLbl = new JLabel(); diskImageNameLbl = new JLabel();
diskImageNameLbl.setText(""); diskImageNameLbl.setText("");
mainPanel.add(diskImageNameLbl, cc.xy(7, 3)); mainPanel.add(diskImageNameLbl, cc.xy(7, 4));
destinationSelectBtn = new JButton(); destinationSelectBtn = new JButton();
destinationSelectBtn.setBackground(new Color(-2034433)); destinationSelectBtn.setBackground(new Color(-2034433));
this.$$$loadButtonText$$$(destinationSelectBtn, this.$$$getMessageFromBundle$$$("locale", "SelectBtn")); this.$$$loadButtonText$$$(destinationSelectBtn, this.$$$getMessageFromBundle$$$("locale", "SelectBtn"));
mainPanel.add(destinationSelectBtn, new CellConstraints(1, 7, 3, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(0, 5, 0, 0))); mainPanel.add(destinationSelectBtn, new CellConstraints(1, 8, 3, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(0, 5, 0, 0)));
ulDestinationRoLbl = new JLabel(); ulDestinationRoLbl = new JLabel();
this.$$$loadLabelText$$$(ulDestinationRoLbl, this.$$$getMessageFromBundle$$$("locale", "ulDestinationLbl")); this.$$$loadLabelText$$$(ulDestinationRoLbl, this.$$$getMessageFromBundle$$$("locale", "ulDestinationLbl"));
mainPanel.add(ulDestinationRoLbl, cc.xy(5, 7)); mainPanel.add(ulDestinationRoLbl, cc.xy(5, 8));
diskImageRoLbl = new JLabel(); diskImageRoLbl = new JLabel();
this.$$$loadLabelText$$$(diskImageRoLbl, this.$$$getMessageFromBundle$$$("locale", "DiskImageLbl")); this.$$$loadLabelText$$$(diskImageRoLbl, this.$$$getMessageFromBundle$$$("locale", "DiskImageLbl"));
mainPanel.add(diskImageRoLbl, cc.xy(5, 3)); mainPanel.add(diskImageRoLbl, cc.xy(5, 4));
titleRoLbl = new JLabel(); titleRoLbl = new JLabel();
this.$$$loadLabelText$$$(titleRoLbl, this.$$$getMessageFromBundle$$$("locale", "TitleLbl")); this.$$$loadLabelText$$$(titleRoLbl, this.$$$getMessageFromBundle$$$("locale", "TitleLbl"));
mainPanel.add(titleRoLbl, cc.xy(5, 5)); mainPanel.add(titleRoLbl, cc.xy(5, 6));
CDRadioButton = new JRadioButton(); CDRadioButton = new JRadioButton();
this.$$$loadButtonText$$$(CDRadioButton, this.$$$getMessageFromBundle$$$("locale", "CD")); this.$$$loadButtonText$$$(CDRadioButton, this.$$$getMessageFromBundle$$$("locale", "CD"));
mainPanel.add(CDRadioButton, cc.xy(1, 5)); mainPanel.add(CDRadioButton, cc.xy(1, 6));
DVDRadioButton = new JRadioButton(); DVDRadioButton = new JRadioButton();
DVDRadioButton.setSelected(true); DVDRadioButton.setSelected(true);
this.$$$loadButtonText$$$(DVDRadioButton, this.$$$getMessageFromBundle$$$("locale", "DVD")); this.$$$loadButtonText$$$(DVDRadioButton, this.$$$getMessageFromBundle$$$("locale", "DVD"));
mainPanel.add(DVDRadioButton, cc.xy(3, 5)); mainPanel.add(DVDRadioButton, cc.xy(3, 6));
convertBtn = new JButton(); convertBtn = new JButton();
convertBtn.setBackground(new Color(-2034433)); convertBtn.setBackground(new Color(-2034433));
this.$$$loadButtonText$$$(convertBtn, this.$$$getMessageFromBundle$$$("locale", "ConvertBtn")); this.$$$loadButtonText$$$(convertBtn, this.$$$getMessageFromBundle$$$("locale", "ConvertBtn"));
mainPanel.add(convertBtn, new CellConstraints(1, 9, 9, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(0, 5, 0, 5))); mainPanel.add(convertBtn, new CellConstraints(1, 10, 9, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(0, 5, 0, 5)));
statusJPanel = new JPanel();
statusJPanel.setLayout(new GridLayoutManager(1, 1, new Insets(5, 5, 5, 5), -1, -1));
statusJPanel.setBackground(new Color(-1));
mainPanel.add(statusJPanel, cc.xyw(1, 12, 9));
statusLbl = new JLabel();
this.$$$loadLabelText$$$(statusLbl, this.$$$getMessageFromBundle$$$("locale", "WelcomeText"));
statusJPanel.add(statusLbl, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
progressBar = new JProgressBar(); progressBar = new JProgressBar();
progressBar.setBorderPainted(false); progressBar.setBorderPainted(false);
progressBar.setForeground(new Color(-9251843)); progressBar.setForeground(new Color(-26368));
progressBar.setIndeterminate(false); progressBar.setIndeterminate(false);
mainPanel.add(progressBar, cc.xyw(1, 11, 7, CellConstraints.FILL, CellConstraints.DEFAULT)); mainPanel.add(progressBar, cc.xyw(1, 12, 9, CellConstraints.FILL, CellConstraints.TOP));
final JPanel panel1 = new JPanel(); final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
panel1.setBackground(new Color(-9251843)); panel1.setBackground(new Color(-9251843));
@ -295,15 +293,24 @@ public class MainAppUi extends JFrame {
label1.setIcon(new ImageIcon(getClass().getResource("/banner.png"))); label1.setIcon(new ImageIcon(getClass().getResource("/banner.png")));
label1.setText(""); label1.setText("");
panel1.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); panel1.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
ulLangComboBox.setBackground(new Color(-9251843));
ulLangComboBox.setForeground(new Color(-1));
ulLangComboBox.putClientProperty("html.disable", Boolean.FALSE); ulLangComboBox.putClientProperty("html.disable", Boolean.FALSE);
panel1.add(ulLangComboBox, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_NORTHWEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); panel1.add(ulLangComboBox, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_NORTHWEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 1, false));
ulCfgBtn = new JButton(); ulCfgBtn = new JButton();
ulCfgBtn.setBackground(new Color(-2031648)); ulCfgBtn.setBackground(new Color(-2031648));
ulCfgBtn.setMargin(new Insets(1, 1, 1, 1)); ulCfgBtn.setMargin(new Insets(1, 1, 1, 1));
ulCfgBtn.setMinimumSize(new Dimension(130, 30)); ulCfgBtn.setMinimumSize(new Dimension(130, 30));
ulCfgBtn.setPreferredSize(new Dimension(140, 30)); ulCfgBtn.setPreferredSize(new Dimension(140, 30));
this.$$$loadButtonText$$$(ulCfgBtn, this.$$$getMessageFromBundle$$$("locale", "editUlCfgBtn")); this.$$$loadButtonText$$$(ulCfgBtn, this.$$$getMessageFromBundle$$$("locale", "editUlCfgBtn"));
mainPanel.add(ulCfgBtn, new CellConstraints(9, 3, 1, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(0, 0, 0, 5))); mainPanel.add(ulCfgBtn, new CellConstraints(9, 4, 1, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(0, 0, 0, 5)));
statusJPanel = new JPanel();
statusJPanel.setLayout(new GridLayoutManager(1, 1, new Insets(5, 5, 5, 5), -1, -1));
statusJPanel.setBackground(new Color(-1));
mainPanel.add(statusJPanel, cc.xyw(1, 14, 9));
statusLbl = new JLabel();
this.$$$loadLabelText$$$(statusLbl, this.$$$getMessageFromBundle$$$("locale", "WelcomeText"));
statusJPanel.add(statusLbl, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
ButtonGroup buttonGroup; ButtonGroup buttonGroup;
buttonGroup = new ButtonGroup(); buttonGroup = new ButtonGroup();
buttonGroup.add(DVDRadioButton); buttonGroup.add(DVDRadioButton);
@ -388,8 +395,4 @@ public class MainAppUi extends JFrame {
return mainPanel; return mainPanel;
} }
private void createUIComponents() {
this.ulLangComboBox = new LanguageComboBox();
ulLangComboBox.addActionListener(e -> onLanguageChanged());
}
} }

View file

@ -24,17 +24,21 @@ import tihwin.ui.model.LocaleHolder;
import tihwin.ui.model.SettingsLanguagesSetup; import tihwin.ui.model.SettingsLanguagesSetup;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.basic.BasicComboBoxUI; import javax.swing.plaf.basic.BasicComboBoxUI;
import java.awt.*; import java.awt.*;
import java.util.List; import java.util.List;
public class LanguageComboBox extends JComboBox<LocaleHolder> { public class LanguageComboBox extends JComboBox<LocaleHolder> {
private static final Color COLOR_SKY_BLUE = new Color(114, 211, 253); private static final Color COLOR_SKY_BLUE = new Color(114, 211, 253);
private final Color COLOR_DARK = new Color(71, 81, 93);
private final Border myBorder = new EmptyBorder(5, 10, 5, 10);
public LanguageComboBox(){ public LanguageComboBox(){
super(); super();
UIManager.put("ComboBox.selectionForeground", COLOR_SKY_BLUE); UIManager.put("ComboBox.selectionForeground", COLOR_DARK);
UIManager.put("ComboBox.selectionBackground", Color.white); UIManager.put("ComboBox.selectionBackground", COLOR_SKY_BLUE);
UIManager.put("ComboBox.squareButton", Boolean.FALSE); UIManager.put("ComboBox.squareButton", Boolean.FALSE);
setUI(new BasicComboBoxUI(){ setUI(new BasicComboBoxUI(){
@ -51,14 +55,17 @@ public class LanguageComboBox extends JComboBox<LocaleHolder> {
ListCellRenderer<LocaleHolder> current = (ListCellRenderer<LocaleHolder>) getRenderer(); ListCellRenderer<LocaleHolder> current = (ListCellRenderer<LocaleHolder>) getRenderer();
setRenderer((list, localeHolder, index, isSelected, hasFocus) -> { setRenderer((list, localeHolder, index, isSelected, hasFocus) -> {
Component component = current.getListCellRendererComponent(list, localeHolder, index, isSelected, hasFocus); JLabel component = (JLabel) current.getListCellRendererComponent(list, localeHolder, index, isSelected, hasFocus);
component.setHorizontalAlignment(SwingConstants.RIGHT);
component.setBorder(myBorder);
if (isSelected) { if (isSelected) {
component.setForeground(Color.black); component.setForeground(COLOR_DARK);
component.setBackground(Color.ORANGE); component.setBackground(Color.ORANGE);
} else { } else {
component.setForeground(Color.white); component.setForeground(Color.white);
component.setBackground(COLOR_SKY_BLUE); component.setBackground(COLOR_DARK);
} }
return component; return component;
}); });

View file

@ -32,6 +32,7 @@ public class UiUpdater {
this.progressBar = progressBar; this.progressBar = progressBar;
this.statusLine = statusLine; this.statusLine = statusLine;
progressBar.setMaximum(100); progressBar.setMaximum(100);
progressBar.setStringPainted(true);
} }
public synchronized void updateProgressBySize(int value){ public synchronized void updateProgressBySize(int value){
@ -49,6 +50,7 @@ public class UiUpdater {
public void close(){ public void close(){
progressBar.setValue(0); progressBar.setValue(0);
progressBar.setStringPainted(false);
AwesomeMediator.notifyAllConvertsEnded(); AwesomeMediator.notifyAllConvertsEnded();
} }
} }