Skip to content

Commit

Permalink
retina icons // refs #27
Browse files Browse the repository at this point in the history
  • Loading branch information
tofi86 committed Jan 24, 2016
1 parent d689d5e commit 008c43d
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 34 deletions.
2 changes: 2 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<zipfileset excludes="META-INF/*.SF" src="${src.dir}/lib/commons-compress-1.5.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${src.dir}/lib/epubcheck.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${src.dir}/lib/guava-14.0.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${src.dir}/lib/iconloader.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${src.dir}/lib/imageio-core-3.1.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${src.dir}/lib/imageio-jpeg-3.1.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${src.dir}/lib/imageio-metadata-3.1.2.jar"/>
Expand Down Expand Up @@ -124,6 +125,7 @@
version="${program.version.txtNumber}"
developmentregion="German"
allowMixedLocalizations="true"
highresolutioncapable="true"
signature="PAEC"
build="${program.version.build}"
copyright="© 2010-${YEAR} pagina GmbH, Tübingen, Germany"
Expand Down
Binary file added lib/iconloader.jar
Binary file not shown.
9 changes: 4 additions & 5 deletions src/de/paginagmbh/common/internet/FileDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/**
* @author Tobias Fischer
* @copyright pagina GmbH, Tübingen
* @date 2015-11-07
* @date 2016-01-24
*/
public class FileDownloader {

Expand Down Expand Up @@ -62,8 +62,8 @@ public FileDownloader(String url, String downloadP, String message) {
e.printStackTrace();
}

/* Icon definieren (Windows only) */
f.setIconImage(FileManager.logoImg32);
/* Icon definieren */
f.setIconImages(FileManager.logoIcons);

/* Fenstergröße setzen */
f.setSize(570,340);
Expand All @@ -81,8 +81,7 @@ public FileDownloader(String url, String downloadP, String message) {
f.getContentPane().setLayout(gridBagLayout);

JLabel lbl_Icon = new JLabel();
Icon paginaIcon = new ImageIcon(FileManager.logoImg64);
lbl_Icon.setIcon(paginaIcon);
lbl_Icon.setIcon(FileManager.logoIcon64);
GridBagConstraints gbc_lbl_Icon = new GridBagConstraints();
gbc_lbl_Icon.anchor = GridBagConstraints.NORTH;
gbc_lbl_Icon.ipadx = 20;
Expand Down
41 changes: 28 additions & 13 deletions src/de/paginagmbh/epubchecker/FileManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@
import java.awt.Toolkit;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.swing.Icon;
import javax.swing.ImageIcon;

import com.bulenkov.iconloader.IconLoader;

/**
* A static Manager class to maintain all relevant file paths
* and image icons - including initialising them on different OS'es
*
* @author Tobias Fischer
* @date 2015-12-05
* @date 2016-01-24
*/
public class FileManager {

Expand All @@ -41,21 +45,23 @@ public class FileManager {
private static String cfgFile_FirstRun = "FirstRun_" + paginaEPUBChecker.PROGRAMVERSION + ".cfg";

// logo icons
public static final Image logoImg16 = Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/paginaEPUBChecker_16.png"));
public static final Image logoImg32 = Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/paginaEPUBChecker_32.png"));
public static final Image logoImg64 = Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/paginaEPUBChecker_64.png"));
public static final Image logoImg128 = Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/paginaEPUBChecker_128.png"));
public static final Image logoImg256 = Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/paginaEPUBChecker_256.png"));
public static final Image logoImg512 = Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/paginaEPUBChecker_512.png"));
public static final Image logoImg1024 = Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/paginaEPUBChecker_1024.png"));
private static final Image logoImg16 = Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/paginaEPUBChecker_16.png"));
private static final Image logoImg32 = Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/paginaEPUBChecker_32.png"));
private static final Image logoImg64 = Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/paginaEPUBChecker_64.png"));
private static final Image logoImg128 = Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/paginaEPUBChecker_128.png"));
private static final Image logoImg256 = Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/paginaEPUBChecker_256.png"));
private static final Image logoImg512 = Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/paginaEPUBChecker_512.png"));
private static final Image logoImg1024 = Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/paginaEPUBChecker_1024.png"));
public static final Icon logoIcon64 = IconLoader.getIcon("/resources/icons/paginaEPUBChecker_64.png");
public static List<Image> logoIcons = new ArrayList<Image>();

// icons
public static final Icon iconLoading = new ImageIcon(Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/infinity-loader_small.gif")));
public static final Icon iconError = new ImageIcon(Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/icon_error.png")));
public static final Icon iconWarning = new ImageIcon(Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/icon_warning.png")));
public static final Icon iconInfo = new ImageIcon(Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/icon_info.png")));
public static final Icon iconDebug = new ImageIcon(Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/icon_debug.png")));
public static final Icon iconConfig = new ImageIcon(Toolkit.getDefaultToolkit().getImage(FileManager.class.getResource("/resources/icons/icon_config.png")));
public static final Icon iconError = IconLoader.getIcon("/resources/icons/icon_error.png");
public static final Icon iconWarning = IconLoader.getIcon("/resources/icons/icon_warning.png");
public static final Icon iconInfo = IconLoader.getIcon("/resources/icons/icon_info.png");
public static final Icon iconDebug = IconLoader.getIcon("/resources/icons/icon_debug.png");
public static final Icon iconConfig = IconLoader.getIcon("/resources/icons/icon_config.png");


public static void init() {
Expand Down Expand Up @@ -99,6 +105,15 @@ public static void init() {



// logoIcons for JFrames in different sizes
logoIcons.add(logoImg16);
logoIcons.add(logoImg32);
logoIcons.add(logoImg64);
logoIcons.add(logoImg128);
logoIcons.add(logoImg256);
logoIcons.add(logoImg512);
logoIcons.add(logoImg1024);



// load language string from language config file
Expand Down
10 changes: 3 additions & 7 deletions src/de/paginagmbh/epubchecker/mainGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
*
* @author Tobias Fischer
* @copyright pagina GmbH, Tübingen
* @date 2015-12-05
* @date 2016-01-24
*/
public class mainGUI extends JFrame implements ActionListener {

Expand Down Expand Up @@ -99,12 +99,8 @@ public mainGUI() {

guiManager = GuiManager.getInstance();

// set lowRes Windows Icon and hiRes Linux Icon
if(FileManager.os_name.equals("windows")) {
setIconImage(FileManager.logoImg32);
} else if(FileManager.os_name.equals("linux")) {
setIconImage(FileManager.logoImg1024);
}
// set IconList with different sizes
setIconImages(FileManager.logoIcons);

// set Apple specific system properties
System.setProperty("apple.laf.useScreenMenuBar", "true");
Expand Down
7 changes: 3 additions & 4 deletions src/de/paginagmbh/epubchecker/messageGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* @author Tobias Fischer
* @copyright pagina GmbH, Tübingen
* @date 2015-11-07
* @date 2016-01-24
*/
public class messageGUI extends JDialog {

Expand Down Expand Up @@ -63,9 +63,8 @@ public void newFrame() {
// set window position
f.setLocation(50, 50);

/* Icon definieren (Windows only) */
f.setIconImage(FileManager.logoImg32);

/* Icon definieren */
f.setIconImages(FileManager.logoIcons);
}


Expand Down
10 changes: 5 additions & 5 deletions src/de/paginagmbh/epubchecker/subGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.ImageIcon;

import javax.swing.JFrame;
import javax.swing.JOptionPane;

Expand All @@ -12,7 +12,7 @@
*
* @author Tobias Fischer
* @copyright pagina GmbH, Tübingen
* @date 2015-11-07
* @date 2016-01-24
*/
public class subGUI {

Expand Down Expand Up @@ -50,7 +50,7 @@ public void displayAboutBox() {

__("About"),
JOptionPane.INFORMATION_MESSAGE,
new ImageIcon(FileManager.logoImg64)
FileManager.logoIcon64
);
}

Expand All @@ -76,7 +76,7 @@ public void displayTranslationBox() {

__("Translations"),
JOptionPane.INFORMATION_MESSAGE,
new ImageIcon(FileManager.logoImg64)
FileManager.logoIcon64
);
}

Expand All @@ -98,7 +98,7 @@ public void displayLicenceBox() {

__("Licence information"),
JOptionPane.INFORMATION_MESSAGE,
new ImageIcon(FileManager.logoImg64)
FileManager.logoIcon64
);

}
Expand Down
Binary file added src/resources/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/resources/icons/icon_debug.png
100755 → 100644
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/resources/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/resources/icons/icon_error.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/resources/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/resources/icons/icon_info.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/resources/icons/[email protected]
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/resources/icons/[email protected]
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/resources/icons/[email protected]
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 008c43d

Please sign in to comment.