Monthly Archive for February, 2008

Politically Convenient Timing

Is it just me, or are other people getting sick of the opposition political party (in this case the National party in New Zealand) always questioning the current Governments ‘alternative intentions’ when they pass a law that is ‘conveniently timed to be in election year’? I listen to The Rock radio station, so the political discourse is obviously kept to a minimum, but the frequency with which I hear some National party member questioning the intentions of the Government ‘because it is election year’ is shockingly high.

Elections happen every four years. Should the Government stop creating policy and rolling out new initiatives because it’s election year? I can’t imagine what the opposition wants to happen for the 25% of the time where an election is close to happening. Perhaps they advocate abolishing the Government for the year leading up to elections (except of course they wouldn’t do that if they were in power). I honestly don’t know what they’re saying.

I would think the smarter approach would be to attack the policy, if they are against it, rather than simply attacking the timing of the policy. This happens amazingly less often than I would expect, with the timing of the policy being the real issue raised.

Unless the Government is clearly trying to buy votes, who cares about timing. The issue that pushed me over the edge was Simon Power complaining today that the tagging initiatives proposed by Helen Clark were conveniently timed because it was election year. He didn’t say anything else in the sound bite I heard (but I seriously hope he did say more than that!).

To be clear, I did vote Labour last time round as I was a student and interest-free student loans was a Real Good Thing, but this next election I don’t know who I’m voting for yet, so don’t think I’m bagging National as I have a political aversion to them.

Why do Fonts suck in Java?

When it comes to fonts in Java, there seems to be a few holes. Two major ones that I just come across today:

  • No ‘font chooser’ dialog to let users graphically select a font.
  • No easy way to serialise a font to a properties/preferences text stream, despite the fact there is an easy way to read them in using Font.decode().

For the first issue, I simply made use of a component library we have (Jide), but it would be ideal if this component become a normal component in Swing. It isn’t that difficult – I remember writing a font chooser back at university in an HCI paper using Java which was trivial (and actually focused more on the creation of custom UI components by overriding paint methods).

For the second issue, I seem to have some luck with the following method I just flicked together:

	public static String encodeFont(final Font f) {
		String style;
		if (f.isBold() && f.isItalic()) {
			style = "BOLDITALIC";
		} else if (f.isBold()) {
			style = "BOLD";
		} else if (f.isItalic()) {
			style = "ITALIC";
		} else {
			style = "PLAIN";
		}

		return f.getFontName() + "-" + style + "-" + f.getSize();
	}
}

Arrested Development Movie?

This made my day.

Arrested Development is an incredibly funny TV show that was cancelled well before its prime. It only last 3 seasons, but is absolutely hilarious. If you can find it, I recommend you watch it. I try to watch all three seasons over a few weeks every year, and only just finished watching the whole three seasons over Christmas.

About

Jonathan Giles is a 25 year old software engineer living in Thames, New Zealand. He holds a Bachelor of Engineering Honours in Software Engineering, a Masters of Science in Computer Science, and is a Sun certified Java programmer. Jonathan specialises in Java, Swing, JavaFX and Client-Server development.

He is currently a software engineer at Oracle in the JavaFX UI controls team. He also blogs over at the FX Experience blog. Obviously, the opinions expressed here are his own.

Contact

Email:   Here
NZ:   +64 211 089 038
US:   +1 408 372 8057
Twitter:   JonathanGiles
LinkedIn:   My Profile
Skype:   Skype Me