|
|
|
@ -14,7 +14,9 @@ import javax.swing.BorderFactory;
|
|
|
|
|
import javax.swing.Icon; |
|
|
|
|
import javax.swing.JDialog; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.JTextPane; |
|
|
|
|
import javax.swing.SwingConstants; |
|
|
|
|
import javax.swing.text.MutableAttributeSet; |
|
|
|
|
import javax.swing.text.SimpleAttributeSet; |
|
|
|
|
import javax.swing.text.StyleConstants; |
|
|
|
|
import javax.swing.text.StyledDocument; |
|
|
|
@ -22,6 +24,7 @@ import java.awt.BorderLayout;
|
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.Container; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.awt.Font; |
|
|
|
|
import java.awt.Graphics2D; |
|
|
|
|
import java.awt.Window; |
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
@ -34,12 +37,16 @@ public class GuideCompleteDialog extends JDialog {
|
|
|
|
|
private static final int ICON_HEIGHT = 182; |
|
|
|
|
private static final Color FONT_COLOR = new Color(51, 51, 52); |
|
|
|
|
private static final Color BUTTON_BG_COLOR = new Color(65, 155,249); |
|
|
|
|
private static final Font TITLE_FONT = new Font(Font.SANS_SERIF, Font.BOLD, 22); |
|
|
|
|
private static final Font CONTENT_FONT = new Font(Font.SANS_SERIF, Font.PLAIN, 18); |
|
|
|
|
private static final Font BUTTON_FONT = new Font(Font.SANS_SERIF, Font.BOLD, 14); |
|
|
|
|
private static GuideCompleteDialog dialog; |
|
|
|
|
|
|
|
|
|
public static GuideCompleteDialog getInstance() { |
|
|
|
|
if (dialog == null) { |
|
|
|
|
dialog = new GuideCompleteDialog(DesignerContext.getDesignerFrame()); |
|
|
|
|
} |
|
|
|
|
dialog = new GuideCompleteDialog(DesignerContext.getDesignerFrame()); |
|
|
|
|
return dialog; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -65,15 +72,16 @@ public class GuideCompleteDialog extends JDialog {
|
|
|
|
|
container.setBorder(BorderFactory.createEmptyBorder(15, 52, 25, 52)); |
|
|
|
|
|
|
|
|
|
UILabel title = new UILabel(Toolkit.i18nText("Fine-Design_Guide_Complete_Confirm")); |
|
|
|
|
title.setFont(title.getFont().deriveFont(22.0f)); |
|
|
|
|
title.setFont(TITLE_FONT); |
|
|
|
|
title.setPreferredSize(new Dimension(190, 30)); |
|
|
|
|
title.setHorizontalAlignment(SwingConstants.CENTER); |
|
|
|
|
title.setForeground(FONT_COLOR); |
|
|
|
|
|
|
|
|
|
textArea = new UITextPane(); |
|
|
|
|
changeLineSpacing(textArea, 0.19f,false); |
|
|
|
|
textArea.setEnabled(false); |
|
|
|
|
textArea.setOpaque(false); |
|
|
|
|
textArea.setFont(textArea.getFont().deriveFont(18.0f)); |
|
|
|
|
textArea.setFont(CONTENT_FONT); |
|
|
|
|
textArea.setPreferredSize(new Dimension(236, 52)); |
|
|
|
|
textArea.setBorder(null); |
|
|
|
|
textArea.setDisabledTextColor(FONT_COLOR); |
|
|
|
@ -83,7 +91,8 @@ public class GuideCompleteDialog extends JDialog {
|
|
|
|
|
doc.setParagraphAttributes(0, doc.getLength(), center, false); |
|
|
|
|
|
|
|
|
|
JPanel buttonContainer= FRGUIPaneFactory.createCenterFlowZeroGapBorderPane(); |
|
|
|
|
buttonContainer.setPreferredSize(new Dimension(190,38)); |
|
|
|
|
buttonContainer.setPreferredSize(new Dimension(190,43)); |
|
|
|
|
buttonContainer.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); |
|
|
|
|
buttonContainer.setOpaque(false); |
|
|
|
|
|
|
|
|
|
UIButton button = new UIButton(Toolkit.i18nText("Fine-Design_Guide_Complete_End")){ |
|
|
|
@ -92,6 +101,7 @@ public class GuideCompleteDialog extends JDialog {
|
|
|
|
|
return new Dimension(122, 38); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
button.setFont(BUTTON_FONT); |
|
|
|
|
button.setUI(confirmButtonUI); |
|
|
|
|
button.setRoundBorder(true); |
|
|
|
|
button.setForeground(Color.WHITE); |
|
|
|
@ -131,4 +141,11 @@ public class GuideCompleteDialog extends JDialog {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
private void changeLineSpacing(JTextPane pane, float factor, boolean replace) { |
|
|
|
|
pane.selectAll(); |
|
|
|
|
MutableAttributeSet set = new SimpleAttributeSet(pane.getParagraphAttributes()); |
|
|
|
|
StyleConstants.setLineSpacing(set, factor); |
|
|
|
|
pane.setParagraphAttributes(set, replace); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|