[CLEANUP] Formatted adjusted code

This commit is contained in:
Emmastone
2016-04-28 02:11:17 +01:00
parent a1553ef8fb
commit 800727a727
3 changed files with 10 additions and 23 deletions
@@ -7,7 +7,7 @@ import org.parabot.core.forum.AccountManagerAccess;
import org.parabot.core.io.ProgressListener;
import org.parabot.core.ui.ServerSelector;
import org.parabot.core.ui.images.Images;
import org.parabot.core.ui.utils.Fonts;
import org.parabot.core.ui.fonts.Fonts;
import org.parabot.core.ui.utils.UILog;
import javax.swing.*;
@@ -1,14 +1,10 @@
package org.parabot.core.ui.utils;
import org.parabot.core.ui.fonts.ParabotFont;
package org.parabot.core.ui.fonts;
import java.awt.*;
import java.util.*;
import java.util.ArrayList;
/**
* Created by Capslock
* On 28/04/16
* With IntelliJ
* @author Capslock
*/
public class Fonts {
private static final java.util.List<ParabotFont> FONT_CACHE = new ArrayList<>();
@@ -19,7 +15,7 @@ public class Fonts {
* @param resource
* @return
*/
public static Font getResource(final String resource){
public static Font getResource(final String resource) {
return getResource(resource, 12f);
}
@@ -27,12 +23,12 @@ public class Fonts {
ParabotFont parabotFont = null;
for (ParabotFont font : FONT_CACHE) {
if (font.getLocation().equalsIgnoreCase(fileName) && font.getSize() == size){
if (font.getLocation().equalsIgnoreCase(fileName) && font.getSize() == size) {
parabotFont = font;
}
}
if (parabotFont == null){
if (parabotFont == null) {
parabotFont = new ParabotFont(fileName, size);
FONT_CACHE.add(parabotFont);
}
@@ -1,7 +1,5 @@
package org.parabot.core.ui.fonts;
import org.parabot.core.ui.utils.Fonts;
import java.awt.*;
import java.io.IOException;
@@ -10,12 +8,11 @@ import java.io.IOException;
*/
public class ParabotFont {
private String name;
private String location;
private Font font;
public ParabotFont(String location, float size) {
if (!location.toLowerCase().startsWith("/storage/fonts/")){
if (!location.toLowerCase().startsWith("/storage/fonts/")) {
location = "/storage/fonts/" + location;
}
this.location = location;
@@ -39,10 +36,6 @@ public class ParabotFont {
return location;
}
public String getName() {
return name;
}
public Font getFont() {
return font;
}
@@ -52,10 +45,8 @@ public class ParabotFont {
if (obj != null) {
if (obj instanceof ParabotFont) {
ParabotFont otherFont = (ParabotFont) obj;
if (otherFont.getName().equalsIgnoreCase(this.getName())) {
if (otherFont.getSize() == this.getSize()) {
return true;
}
if (otherFont.getSize() == this.getSize()) {
return true;
}
}
}