Search in sources :

Example 1 with BasicProgressBarUI

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;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) BoxLayout(javax.swing.BoxLayout) Color(java.awt.Color) FlatButtonMouseAdapter(com.jsql.view.swing.ui.FlatButtonMouseAdapter) BasicProgressBarUI(javax.swing.plaf.basic.BasicProgressBarUI)

Aggregations

FlatButtonMouseAdapter (com.jsql.view.swing.ui.FlatButtonMouseAdapter)1 BorderLayout (java.awt.BorderLayout)1 Color (java.awt.Color)1 BoxLayout (javax.swing.BoxLayout)1 JPanel (javax.swing.JPanel)1 BasicProgressBarUI (javax.swing.plaf.basic.BasicProgressBarUI)1