<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Unlimited Edition &#187; Mac</title>
	<atom:link href="http://michaelodden.com/category/mac/feed/" rel="self" type="application/rss+xml" />
	<link>http://michaelodden.com</link>
	<description>Unlimited views, cleverness and love</description>
	<lastBuildDate>Tue, 08 Mar 2011 20:33:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Acquiring full screen in Java-applications</title>
		<link>http://michaelodden.com/mac/acquiring-full-screen-in-java-applications/</link>
		<comments>http://michaelodden.com/mac/acquiring-full-screen-in-java-applications/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 13:36:51 +0000</pubDate>
		<dc:creator>michaelo</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://blog.michaelodden.com/?p=65</guid>
		<description><![CDATA[Inn a recent project I&#8217;ve been toying around with, the need to acquire the entire screen came up as a need. Being rather new to Java as I am, this took some time figuring out. I use the javax.swing-library to handle my GUI. My first try was to  set the JFrame undecorated, &#8220;always on top&#8221;, [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Inn a recent project I&#8217;ve been toying around with, the need to acquire the entire screen came up as a need. Being rather new to Java as I am, this took some time figuring out. I use the javax.swing-library to handle my <acronym title="Graphical User Interface">GUI</acronym>.</p>
<p>My first try was to  set the JFrame undecorated, &#8220;always on top&#8221;, start at (x,y)=(0,0) and size=screen size, like this:</p>
<pre name="code" class="java">public class Window extends JFrame {
    Window() {
        super();
        // Not too important in this example
        this.setLayout(new GridLayout(1,1));

        // Start at top-left
        this.setLocation(0, 0);

        // Get screensize, set as window-size
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        this.setSize(screenSize);

       // I don't want it to look like a window
        this.setResizable(false);
        this.setUndecorated(true);
        this.setAlwaysOnTop(true);

        // Woop-de-do
        this.setVisible(true);
    }
}</pre>
<p>So when instantiating a new Window(), it will cover the entire screen. Almost. This will behave as expected in Windows (XP at least), but not in <acronym title="Operating System">OS</acronym> X. In <acronym title="Operating System">OS</acronym> X the dock will overlap, and the coordinates (0,0) will mean &#8220;first pixel _underneath_ the menubar&#8221; &#8211; obviously not what I want &#8211; and not ideal for this application.</p>
<p>The solution is to take over the entire screen, the same way as ie <acronym title="Digital Versatile Disc">DVD</acronym> Players, games and other presentation-apps. One way to do this in Java is like this:</p>
<pre name="code" class="java">import java.awt.GraphicsEnvironment;
import java.awt.GraphicsDevice;

public class Main {
    public static void main(String[] args) {
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice[] gs = ge.getScreenDevices(); // There may be more than one screen-device
        // Can also get the default-screen directly with ge.getDefaultScreenDevice()
        window = new Window(); // Instantiating the class from above, to create a dummy-window
        // Setting device to full-screen
        gs[0].setFullScreenWindow(window); // In my case, only interested in the first screen
    }
}</pre>
<p>I suppose this is the correct way to do it always for Windows XP etc as this will actually take over the entire screen, not just overlapping the existing one.</p>
<p>Thanks goes to <a href="http://dispo.se/">Jan-Petter</a> for giving me a push in the correct direction.</p><img src="http://michaelodden.com/?ak_action=api_record_view&id=65&type=feed" alt="" /><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://michaelodden.com/mac/acquiring-full-screen-in-java-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Essential mac-applications</title>
		<link>http://michaelodden.com/mac/essential-mac-applications/</link>
		<comments>http://michaelodden.com/mac/essential-mac-applications/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 19:29:32 +0000</pubDate>
		<dc:creator>michaelo</dc:creator>
				<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://blog.michaelodden.com/?p=52</guid>
		<description><![CDATA[Here follows my must-have os x-applications, and several of them are the very reasons themselves I use a mac as my main workstation: Opera (free) &#8211; my browser of choice, for development as well as everyday browsing. Transmit (!free, but well worth it) -I&#8217;ve yet to find a better FTP-client on any platform. It&#8217;s a [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Here follows my must-have os x-applications, and several of them are the very reasons themselves I use a mac as my main workstation:</p>
<ul>
<li><a href="http://opera.com/">Opera</a> (free) &#8211; my browser of choice, for development as well as everyday browsing.</li>
<li><a href="http://www.panic.com/transmit/">Transmit</a> (!free, but well worth it) -I&#8217;ve yet to find a better <acronym title="File Transfer Protocol">FTP</acronym>-client on any platform. It&#8217;s a reason for switching to mac all by itself.</li>
<li><a href="http://www.blacktree.com/">Quicksilver</a> (free) &#8211; I didn&#8217;t understand what all the fuzz was about until I installed it myself. It doesn&#8217;t save the day, but it makes it all a little more efficient.</li>
<li><a href="http://free.abracode.com/cmworkshop/on_my_command.html">OnMyCommand</a> (free) &#8211; easily customize the context-menues. I.e. &#8220;Create new file here&#8221;. Although it&#8217;s a pity how, in Leopard, everything is grouped under &#8220;More&#8221;.</li>
<li><a href="http://http://tuppis.com/smultron/">Smultron</a> (free) &#8211; a very neat text-editor and basic &#8220;IDE&#8221;. It has those code-features I need, and some more. No bloat whatsoever.</li>
<li><a href="http://www.adiumx.com/">Adium</a> (free) &#8211; the sleakest and most well-featured <acronym title="Instant Message">IM</acronym>-client so far &#8211; only missing webcam-support. It makes all other <acronym title="Instant Message">IM</acronym>-clients look, feel and behave like garbage.Well, Digsby wasn&#8217;t that bad actually.</li>
<li><a href="http://scplugin.tigris.org/">SCPlugin</a> (free) &#8211; os x-equivalent of TortoiseSVN</li>
<li><a href="http://www.omnigroup.com/applications/omnioutliner/">OmniOutliner</a> (!free) &#8211; well, an outliner, great for brainstorming, todo-lists, etc etc. Best of it&#8217;s kind as far as I&#8217;ve had the chance to test.</li>
</ul>
<p>There are of course other apps I use, like Firefox, Skype, etc for my day-to-day business, testing (beeing a webdeveloper), but those up there are the single most important ones.</p>
<h3>Update:</h3>
<p>I&#8217;ve quite recently come across two other applications which have stood out regarding makeing my days a little bit easier:</p>
<ul>
<li><a href="http://bargiel.home.pl/iGTD/">iGTD</a> (free) &#8211; &#8220;Getting things done&#8221;, basicly a todo-list-app, but with great organization features and a quite sleek interface.</li>
<li><a href="http://cocoatech.com/">Path Finder</a> (!free) &#8211; Finder on steroids. It has support for tabs (my main reason for giving it a try at all), a great bread-crumb-system, and quite a bit of other useful features. It&#8217;s well worth a try!</li>
</ul><img src="http://michaelodden.com/?ak_action=api_record_view&id=52&type=feed" alt="" /><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://michaelodden.com/mac/essential-mac-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

