Skip to content

Commit

Permalink
Rename and add app icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
Guo Yunhe committed Sep 6, 2015
1 parent 6c051b4 commit 6ba2ac1
Show file tree
Hide file tree
Showing 8 changed files with 197 additions and 7 deletions.
10 changes: 8 additions & 2 deletions src/me/guoyunhe/fontweak/MainWindow.form
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
<Properties>
<Property name="defaultCloseOperation" type="int" value="3"/>
<Property name="title" type="java.lang.String" value="Fontweak" noResource="true"/>
<Property name="iconImages" type="java.util.List" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="appIconImages" type="code"/>
</Property>
<Property name="locationByPlatform" type="boolean" value="true"/>
</Properties>
<SyntheticProperties>
Expand Down Expand Up @@ -2736,6 +2739,9 @@
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Serif" size="18" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/me/guoyunhe/fontweak/img/icon-32.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Fontweak" noResource="true"/>
</Properties>
</Component>
Expand All @@ -2744,7 +2750,7 @@
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Serif" size="18" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="0.3.0" noResource="true"/>
<Property name="text" type="java.lang.String" value="0.4.0" noResource="true"/>
</Properties>
</Component>
</SubComponents>
Expand Down Expand Up @@ -2789,7 +2795,7 @@
<Component class="javax.swing.JLabel" name="homepageLabel">
<Properties>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="&lt;html&gt;&lt;a href=&quot;#&quot;&gt;https://github.com/guoyunhe/font-config-master&lt;/a&gt;&lt;/html&gt;" noResource="true"/>
<Property name="text" type="java.lang.String" value="&lt;html&gt;&lt;a href=&quot;#&quot;&gt;https://github.com/guoyunhe/fontweak&lt;/a&gt;&lt;/html&gt;" noResource="true"/>
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
<Color id="&#x624b;&#x578b;&#x5149;&#x6807;"/>
</Property>
Expand Down
27 changes: 24 additions & 3 deletions src/me/guoyunhe/fontweak/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@
package me.guoyunhe.fontweak;

import java.awt.Desktop;
import java.awt.Image;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

Expand All @@ -36,6 +39,7 @@
*/
public class MainWindow extends javax.swing.JFrame {

private ArrayList<Image> appIconImages;
private FontConfigXML fontconfig;
private DefaultTableModel aliasTableModel;
private SchemeManager schemeManager;
Expand All @@ -46,10 +50,25 @@ public class MainWindow extends javax.swing.JFrame {
* Creates new form MainWindow
*/
public MainWindow() {
initResources();

initComponents();

initApplication();
}

private void initResources() {
appIconImages = new ArrayList<>();
URL appIcon16URL = getClass().getResource("/me/guoyunhe/fontweak/img/icon-16.png");
ImageIcon appIcon16 = new ImageIcon(appIcon16URL);
appIconImages.add(appIcon16.getImage());
URL appIcon32URL = getClass().getResource("/me/guoyunhe/fontweak/img/icon-32.png");
ImageIcon appIcon32 = new ImageIcon(appIcon32URL);
appIconImages.add(appIcon32.getImage());
URL appIcon64URL = getClass().getResource("/me/guoyunhe/fontweak/img/icon-64.png");
ImageIcon appIcon64 = new ImageIcon(appIcon64URL);
appIconImages.add(appIcon64.getImage());
}

/**
* This method is called from within the constructor to initialize the form.
Expand Down Expand Up @@ -151,6 +170,7 @@ private void initComponents() {

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Fontweak"); // NOI18N
setIconImages(appIconImages);
setLocationByPlatform(true);
getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.Y_AXIS));

Expand Down Expand Up @@ -495,11 +515,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
appTitlePanel.setMaximumSize(new java.awt.Dimension(32767, 50));

appNameLabel.setFont(new java.awt.Font("Serif", 1, 18)); // NOI18N
appNameLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/me/guoyunhe/fontweak/img/icon-32.png"))); // NOI18N
appNameLabel.setText("Fontweak"); // NOI18N
appTitlePanel.add(appNameLabel);

appVersionLabel.setFont(new java.awt.Font("Serif", 0, 18)); // NOI18N
appVersionLabel.setText("0.3.0"); // NOI18N
appVersionLabel.setText("0.4.0"); // NOI18N
appTitlePanel.add(appVersionLabel);

aboutContentPanel.add(appTitlePanel);
Expand All @@ -520,7 +541,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
appInfoPanel.add(authorLabel);

homepageLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
homepageLabel.setText("<html><a href=\"#\">https://github.com/guoyunhe/font-config-master</a></html>"); // NOI18N
homepageLabel.setText("<html><a href=\"#\">https://github.com/guoyunhe/fontweak</a></html>"); // NOI18N
homepageLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
homepageLabel.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
Expand Down Expand Up @@ -597,7 +618,7 @@ private void subpixelTestButtonMouseClicked(java.awt.event.MouseEvent evt) {//GE
}//GEN-LAST:event_subpixelTestButtonMouseClicked

private void homepageLabelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_homepageLabelMouseClicked
String link = "https://github.com/guoyunhe/font-config-master";
String link = "https://github.com/guoyunhe/fontweak";
try {
Desktop.getDesktop().browse(new URI(link));
} catch (IOException | URISyntaxException ex) {
Expand Down
3 changes: 2 additions & 1 deletion src/me/guoyunhe/fontweak/i18n/translation.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ RENAME=Rename
NEW\ SCHEME=New scheme
SCHEME=Scheme
PLEASE\ TAKE\ OFF\ YOUR\ GLASSES!=Please take off your glasses!
MainWindow.authorLabel.text=Created by Guo "IceRabbit" Yunhe
MainWindow.authorLabel.text=Created by Guo Yunhe
MainWindow.aboutPanel.TabConstraints.tabTitle=About
MainWindow.fontAliasPanel.TabConstraints.tabTitle=Font alias
MainWindow.fontFamilyPanel.TabConstraints.tabTitle=Font family
Expand All @@ -62,3 +62,4 @@ MainWindow.oneClickButton.text=1-click setup
MainWindow.resetButton.text=Reset default
MainWindow.aliasTable.columnModel.title1=Font alias
MainWindow.aliasTable.columnModel.title0=Original font
MainWindow.jTextPane1.text=<html>\n<p style="color:red">Hello</p>\n</html>
3 changes: 2 additions & 1 deletion src/me/guoyunhe/fontweak/i18n/translation_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RENAME=\u91cd\u547d\u540d
NEW\ SCHEME=\u65b0\u5efa\u65b9\u6848
SCHEME=\u914d\u7f6e\u65b9\u6848
PLEASE\ TAKE\ OFF\ YOUR\ GLASSES!=\u8bf7\u6458\u6389\u773c\u955c\uff01
MainWindow.authorLabel.text=\u7531"\u51b0\u5154"(\u90ed\u4e91\u9e64)\u521b\u4f5c
MainWindow.authorLabel.text=\u7531\u90ed\u4e91\u9e64\u521b\u4f5c
MainWindow.aboutPanel.TabConstraints.tabTitle=\u5173\u4e8e
MainWindow.fontAliasPanel.TabConstraints.tabTitle=\u5b57\u4f53\u522b\u540d
MainWindow.fontFamilyPanel.TabConstraints.tabTitle=\u5b57\u4f53\u65cf
Expand All @@ -49,3 +49,4 @@ MainWindow.oneClickButton.text=\u4e00\u952e\u8bbe\u7f6e
MainWindow.resetButton.text=\u91cd\u7f6e\u7cfb\u7edf\u9ed8\u8ba4
MainWindow.aliasTable.columnModel.title1=\u5b57\u4f53\u522b\u540d
MainWindow.aliasTable.columnModel.title0=\u539f\u59cb\u5b57\u4f53
MainWindow.jTextPane1.text=<html>\n<p style="color:red">Hello</p>\n</html>
Binary file added src/me/guoyunhe/fontweak/img/icon-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/me/guoyunhe/fontweak/img/icon-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/me/guoyunhe/fontweak/img/icon-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
161 changes: 161 additions & 0 deletions src/me/guoyunhe/fontweak/img/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6ba2ac1

Please sign in to comment.