Header image

SimpleTimer 2 updated

June 18th, 2009 | Posted by lars in AIR | Flex | Talk - (3 Comments)

st_new_icon

I found some time to give my timer a small graphical rebrush. The application icon and the logo itself has been updated. Now it looks a lot more beautiful in the dock. I also added an alternative bright skin in case you don’t like the dark one. The calender is now zoomable if you didn’t already noticed and timers running less than 60 seconds are not counted anymore. The next thing I’m planning is to write an importer/exporter for the database that let’s you easily migrate all your timer data to a new computer. So long…

Issues with ANT and Out of memory error

May 18th, 2009 | Posted by lars in Flex | Talk - (0 Comments)

Finally my macbook arrived and I got everything set up and started working (Yes, I switched finally ;)). In one of my projects I have to compile a large flex project quite often, so I use ANT directly in the shell.

On Windows it was never a problem, but in OS X I always got: “java.lang.OutOfMemoryError: Java heap space”. After quite a journey through the depths of the web I found the place where to increase the memory size and I thought that’s might be interesting for you:

Just create a file called ant.conf in /etc (Use sudo to create the file) and paste this line: ANT_OPTS=’-Xmx1024m -XX:MaxPermSize=128m’ Done!

Today we upgraded our Flexbuilders to the newest version, the update didn’t come with the built in auto update of Flexbuilder, so I had to de- and reinstall it. Done that, opened one of my projects, continued working and realised that I couldn’t dig into the charting sources anymore (F3):

After quite a search and a clean install on a new PC, Jens noticed a small message in the status bar of the builder after entering the serial number: “Extracting chart sources”. The rest was easy:

  1. Quit Flexbuilder or Eclipse
  2. Delete your serial information (Look for a file called ‘license.properties’ in the Flex installation directory (C:\ProgramData\Adobe\Flex\license.properties on Vista, /Library/Application\ Support/Adobe/Flex/license.properties on OSX))
  3. Launch Flexbuilder, re-enter your serial
  4. Done, the chart sources are available again.

Maybe this becomes useful for some of you …

I just found a nice way to automatically truncate text in datagrid columns and show tooltips for truncated elements, that I wanted to share:

package
{
	import mx.controls.dataGridClasses.DataGridItemRenderer;
 
	public class TruncateToolTipRenderer extends DataGridItemRenderer
	{
		private var textTruncated:Boolean = false;
		private var originalText:String;
 
		public function TruncateDataGridItemRenderer()
		{
			super();
		}
 
		override public function set text(value:String):void
		{
			super.text = value;
			originalText = value;
			textTruncated = truncateToFit();
		}
 
		override public function validateProperties():void
		{
			super.validateProperties();
			toolTip = textTruncated ? originalText : null;
		}
	}
}

Just set the itemRenderer property of your column to the new TruncateToolTipRenderer. Neat!

Update: … and it’s a lot easier if you just set the itemRenderer to mx.controls.Label, because a Label already has truncate and tooltip functionality. As so often in Flex, everything is built in. Lesson learned!