use of javax.swing.plaf.basic.BasicProgressBarUI in project jsql-injection by ron190.
the class DialogTranslate method initializeLastLine.
private JPanel initializeLastLine() {
var lastLine = new JPanel();
lastLine.setLayout(new BoxLayout(lastLine, BoxLayout.LINE_AXIS));
lastLine.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
this.buttonSend.setContentAreaFilled(false);
this.buttonSend.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));
this.buttonSend.setBackground(new Color(200, 221, 242));
this.buttonSend.setToolTipText(String.join("", "<html>", "<b>Send your translation to the developer</b><br>", "Your translation will be integrated in the next version of jSQL", "</html>"));
this.buttonSend.addMouseListener(new FlatButtonMouseAdapter(this.buttonSend));
this.buttonSend.addActionListener(actionEvent -> {
if (this.textToTranslate.getText().equals(this.textBeforeChange)) {
LOGGER.log(LogLevel.CONSOLE_ERROR, "Nothing changed, translate a piece of text then click on Send");
return;
}
// Escape Markdown character # for h1 in .properties
String clientDescription = this.textToTranslate.getText().replace("\\\\", "\\\\\\\\").replaceAll("(?m)^#", "\\\\#").replace("<", "\\<");
MediatorHelper.model().getMediatorUtils().getGitUtil().sendReport(clientDescription, ShowOnConsole.YES, DialogTranslate.this.language + " translation");
DialogTranslate.this.setVisible(false);
});
this.setLayout(new BorderLayout());
this.progressBarTranslation.setUI(new BasicProgressBarUI());
this.progressBarTranslation.setOpaque(false);
this.progressBarTranslation.setStringPainted(true);
this.progressBarTranslation.setValue(0);
lastLine.add(this.progressBarTranslation);
lastLine.add(Box.createGlue());
lastLine.add(this.buttonSend);
return lastLine;
}
Aggregations