Monthly Archive for January, 2009

KineticScrolling – Open Source

If you have seen our application Feedjii then you might know that we have a component that we call KineticScrolling (actually Apple is calling this type of behaviour KineticScrolling and we reused the same name). Well it’s time to show the implementation details and open source it but before we do it we want to go through the API to make sure nothing is missing. So here it is, if you feel something is missing feel free to comment.

public class JKineticScrolling {

	/**
	* Enumeration describing the direction of the scrolling component.
	*/
	public enum Direction { HORIZONTAL, VERTICAL, ANY };

	/**
	* Constructs a new KineticScrolling instance that uses Direction.VERTICAL
	* as scroll direction.
	*
	* @param componentToScroll component to scroll.
	*/
	public JKineticScrolling( JComponent componentToScroll );

	/**
	* Constructs a new KineticScrolling instance that uses Direction.VERTICAL
	* as scroll direction.
	*
	* @param componentToScroll component to scroll.
	* @param direction direction to scroll.
	*/
	public JKineticScrolling( JComponent componentToScroll, Direction direction);

	/**
	* Sets the animation time used to "throw" the component
	* after the user releases the mouse button.
	*
	* @param animationTime time used to animate the "thow".
	*/
	public void setAnimationTime(int animationTime);

}

So it’s really simple, all you have to do is create a new JKineticScrolling component, specifiy your component in the constructor and optionally change direction and animation time.

Next post contains a runnable example.

Mission accomplished

Our presentation at JFokus was haunted by some technical problems, which embarassingly enough caused very poor performance in Feedjii. Ouch! Despite this, we got very positive feedback, and we’re looking forward to having a pint and discussing Java GUI’s more in-depth at the conference pub tonight. For now, we’re just relaxing and enjoying the other speakers’ presentations.

See you at JFokus!

Next week it’s time for the third annual JFokus conference in Stockholm. We’ll be there to hold the full version of our lightning talk from Øredev, called Swing Rocks – A beautiful example. With 45 minutes instead of 15, we’ll have a lot of time to show you how to get started with Swing/Java2D programming. For those of you who have worked with Swing and Java2D before, we’ll talk a bit about performance and hardware acceleration, and provide some general tips and tricks. Hopefully there will be something for everyone to enjoy, so don’t miss out! We’re looking forward to see you there!

Please note that this presentation will be held in Swedish.