MCPcopy Create free account
hub / github.com/bobbylight/RText / AboutDialog

Method AboutDialog

src/main/java/org/fife/rtext/AboutDialog.java:42–136  ·  view source on GitHub ↗
(RText parent)

Source from the content-addressed store, hash-verified

40
41
42 AboutDialog(RText parent) {
43
44 super(parent);
45 this.parent = parent;
46 listener = new Listener();
47 //ResourceBundle msg = parent.getResourceBundle();
48 ComponentOrientation o = parent.getComponentOrientation();
49
50 ResourceBundle msg = ResourceBundle.getBundle(MSG);
51
52 JPanel cp = new ResizableFrameContentPane(new BorderLayout());
53
54 Box box = Box.createVerticalBox();
55
56 JPanel top = new JPanel(new BorderLayout(15, 0));
57 top.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
58 Color topBG = UIManager.getColor("TextField.background");
59 top.setOpaque(true);
60 top.setBackground(topBG);
61 top.setBorder(new TopBorder());
62
63 String imageName = "/org/fife/rtext/graphics/app_icons/seagull-" +
64 (UIUtil.isLightForeground(new JLabel().getForeground()) ? "dark.svg" : "light.svg");
65
66 try (InputStream in = getClass().getResourceAsStream(imageName)) {
67 Image image = ImageTranscodingUtil.rasterize(imageName, in, 64, 64);
68 JLabel linkLabel = new JLabel(new ImageIcon(image));
69 top.add(linkLabel, BorderLayout.LINE_START);
70 } catch (IOException ioe) {
71 parent.displayException(ioe);
72 }
73
74 JPanel topText = new JPanel(new BorderLayout());
75 topText.setOpaque(false);
76 top.add(topText);
77
78 // Don't use a Box, as some JVM's won't have the resulting component
79 // honor its opaque property.
80 JPanel box2 = new JPanel();
81 box2.setOpaque(false);
82 box2.setLayout(new BoxLayout(box2, BoxLayout.Y_AXIS));
83 topText.add(box2, BorderLayout.NORTH);
84
85 JLabel label = new JLabel(msg.getString("About.Header"));
86 label.setOpaque(true);
87 label.setBackground(topBG);
88 Font labelFont = label.getFont();
89 label.setFont(labelFont.deriveFont(Font.BOLD, 20));
90 addLeftAligned(label, box2);
91 box2.add(Box.createVerticalStrut(5));
92
93 Date buildDate = parent.getBuildDate();
94 String dateStr = buildDate == null ? "unknown" :
95 DateFormat.getDateTimeInstance().format(buildDate);
96 String desc = getString(msg, "About.MainDesc", parent.getVersionString(), dateStr);
97 SelectableLabel textArea = new SelectableLabel(desc);
98 textArea.addHyperlinkListener(listener);
99 box2.add(textArea);

Callers

nothing calls this directly

Calls 12

getStringMethod · 0.95
addLeftAlignedMethod · 0.95
setVisibleMethod · 0.95
addMethod · 0.80
displayExceptionMethod · 0.80
getFontMethod · 0.80
setFontMethod · 0.80
getVersionStringMethod · 0.80
setTitleMethod · 0.80
getBundleMethod · 0.45
getColorMethod · 0.45
getForegroundMethod · 0.45

Tested by

no test coverage detected