diff --git a/src/MoF/FinderWindow.java b/src/MoF/FinderWindow.java index db5796b7..b02628fe 100644 --- a/src/MoF/FinderWindow.java +++ b/src/MoF/FinderWindow.java @@ -51,7 +51,7 @@ public class FinderWindow extends JFrame { //UI Manager: pane.setLayout(new BorderLayout()); loadMinecraft(); - (new UpdateManager(this, true)).start(); + new UpdateManager(this, true).start(); setJMenuBar(menuBar = new AmidstMenu(this)); setVisible(true); Image icon = ResourceLoader.getImage("icon.png"); diff --git a/src/amidst/Amidst.java b/src/amidst/Amidst.java index 4b543724..3235a292 100644 --- a/src/amidst/Amidst.java +++ b/src/amidst/Amidst.java @@ -8,21 +8,16 @@ import java.io.IOException; public class Amidst { public final static int version_major = 3; public final static int version_minor = 0; - private static FinderWindow mainWindow; public static void main(String args[]) throws IOException { Util.setLookAndFeel(); Google.startTracking(); Google.track("Run"); //TODO: load options - mainWindow = new FinderWindow(); + new FinderWindow(); //as long as we design it well, we won’t need a reference to it ;) } public static String version() { return version_major + "." + version_minor; } - - public static FinderWindow getActiveWindow() { - return mainWindow; - } } diff --git a/src/amidst/Log.java b/src/amidst/Log.java index 4660e1bc..2a745447 100644 --- a/src/amidst/Log.java +++ b/src/amidst/Log.java @@ -4,28 +4,28 @@ public class Log { private static LogListener listener; private static boolean isUsingListener; - public static void i(Object s) { - System.out.println("[info] " + s); + public static void i(Object... s) { + printwithTag("info", s); if (isUsingListener) listener.info(s); } - public static void debug(Object s) { - System.out.println("[debug] " + s); + public static void debug(Object... s) { + printwithTag("debug", s); if (isUsingListener) listener.debug(s); } - public static void w(Object s) { - System.err.println("[warning] " + s); + public static void w(Object... s) { + printwithTag("warning", s); if (isUsingListener) listener.warning(s); } - public static void e(Object s) { - System.err.println("[error] " + s); + public static void e(Object... s) { + printwithTag("error", s); if (isUsingListener) listener.error(s); } - public static void kill(Object s) { - System.err.println("[kill] " + s); + public static void kill(Object... s) { + printwithTag("kill", s); if (isUsingListener) listener.kill(s); System.exit(0); @@ -35,4 +35,12 @@ public class Log { listener = l; isUsingListener = (l != null); } + + private static void printwithTag(String tag, Object... msgs) { + System.out.print("[" + tag + "] "); + for (int i=0; i w) removeColumn(END); @@ -63,12 +60,12 @@ public class Map { //g.fillRect(5, 5, width - 10, height - 10); Fragment frag = startNode; - size = (double)Fragment.SIZE; + size = Fragment.SIZE; if (frag.hasNext) { Fragment corner = frag.nextFragment; double drawX = startX; double drawY = startY; - + mat.setToIdentity(); mat.translate(drawX, drawY); mat.scale(scale, scale); @@ -187,7 +184,6 @@ public class Map { frag.setNext(newFrag); } } - } public void removeColumn(boolean start) { synchronized (resizeLock) { @@ -234,11 +230,11 @@ public class Map { public void load() { fManager.load(); fManager.start(); - + addStart(0, 0); isLoaded = true; - } + public void setZoom(double scale) { this.scale = scale; } @@ -247,13 +243,11 @@ public class Map { } public double getScaledX(double oldScale, double newScale, double x) { double baseX = x - startX; - double dif = baseX - (baseX/oldScale) * newScale; - return dif; + return baseX - (baseX/oldScale) * newScale; } public double getScaledY(double oldScale, double newScale, double y) { double baseY = y - startY; - double dif = baseY - (baseY/oldScale) * newScale; - return dif; + return baseY - (baseY/oldScale) * newScale; } public void close() { isLoaded = false;