Jim Connors' Weblog
Hooray! Acrobat Reader for [Open]Solaris x86
Today truly marks a milestone in the history of Solaris for the x86/x64 platform. One of the most ubiquitous applications, Adobe Reader (notably Acrobat), is now available on [Open]Solaris for both Sparc and x86.
It's been a long time coming, one argument for the lack of Solaris x86 support till now was that [Open]Solaris didn't have the critical mass. That's a hard one to swallow for the following reasons:
- There's been a Solaris Sparc version for a long time. Solaris x86 downloads outnumber Sparc downloads by a large factor.
- Versions for AIX and HP-UX, which have a significantly smaller installed base, are available. Maybe IBM and HP payed a lot of money for this?
- Until recently there were versions even for the likes of OS/2 and UnixWare.
Perhaps open source alternatives are becoming good enough to pose a threat? Whatever the reason, we welcome the arrival of Acrobat Reader and Adobe's change of heart.
You can get your copy here.
Happy Downloading!
Posted at 05:17PM Mar 24, 2009 by jtc in Sun | Comments[0]
Bindstorming
It is within our nature, even in the most infinitesimal way, to leave our mark on this world before we exit it. I'd like to coin the following term, heretofore unseen in the JavaFX space, and submit it as my humble contribution to the human collective:
bindstorm \'bïnd•storm\ (noun): condition where a multitude of JavaFX bind recalculations severely hampers interactive performance
Yeah, I know, using the word you wish to define inside its definition is bad, but there is precedent for this: (1) Fancy-schmancy, hoity-toity college dictionaries do it all the time. (2) Mathematicians and computer scientists call this recursion: that mysterious concept which developers use to impress others of their programming prowess.
Don't get me wrong, JavaFX binding is incredibly powerful. Heck, we dedicated a whole chapter to it in our soon-to-be-released book JavaFX: Developing Rich Internet Applications. But binding does come with a price, and like most anything else, over-consumption can lead to abuse.
Consider this use case: you've got a JavaFX application with dozens or maybe even hundreds of Nodes that are part of the scenegraph. Each of the Nodes are ultimately sized and positioned in proportion to height and width instance variables that are passed on down. If you define width and height at startup and have no interest in a resizeable interface, then you stand a good chance of avoiding the use of many bind expressions. The one potential twist here is that if you're sincerely interested in a non-resizeable application, but want it to consume the entire screen, what do you do? As screens come in all shapes and sizes, you may not know what the resolution is at start time. JavaFX has an elegant solution for this which uses binding.
Here's a simple application which defines a Rectangle and Circle that fill the entire screen. You can click anywhere within the Circle to exit the application. Notice the number of binds required to get this to work.
import javafx.stage.*;
import javafx.scene.*;
import javafx.scene.shape.*;
import javafx.scene.paint.*;
import javafx.scene.input.*;
function run() : Void {
var stage: Stage = Stage {
fullScreen: true
scene: Scene {
content: [
Rectangle {
width: bind stage.width
height: bind stage.height
fill: Color.BLUE
}
Circle {
centerX: bind stage.width / 2
centerY: bind stage.height / 2
radius: bind if (stage.width < stage.height) then
stage.width / 2 else stage.height / 2
fill: Color.RED
onMouseClicked: function(me: MouseEvent) {
FX.exit();
}
}
]
}
}
}
Imagine what this would look like if you had lots of complex custom components with many more dependencies on height and width. In addition to the potential performance impact, this could be error-prone and cumbersome to code. To avoid the over usage of binding and the potential for a bindstorm, applications of this sort could be re-written as follows:
import javafx.stage.*;
import javafx.scene.*;
import javafx.scene.shape.*;
import javafx.scene.paint.*;
import javafx.scene.input.*;
function run() : Void {
var AWTtoolkit = java.awt.Toolkit.getDefaultToolkit ();
var screenSizeFromAWT = AWTtoolkit.getScreenSize ();
Stage {
fullScreen: true
scene: Scene {
content: [
Rectangle {
width: screenSizeFromAWT.width
height: screenSizeFromAWT.height
fill: Color.BLUE
}
Circle {
centerX: screenSizeFromAWT.width / 2
centerY: screenSizeFromAWT.height / 2
radius: if (screenSizeFromAWT.width <
screenSizeFromAWT.height) then
screenSizeFromAWT.width / 2
else screenSizeFromAWT.height / 2
fill: Color.RED
onMouseClicked: function(me: MouseEvent) {
FX.exit();
}
}
]
}
}
}
We achieve the same effect as the first example by first making a call to a method in the java.awt.Toolkit package. With this information we can statically define our scenegraph without the use of binding.
There is one caveat to this solution. As the AWT (Advanced Windowing Toolkit) is an integral part of Java SE, this code should be portable across all JavaFX desktops. However, if you wish to deploy a JavaFX Mobile solution, the AWT calls would likely change. Is there a mechanism that might work across both models?
As a final thought, while we're on this theme of coining terms, my compadres Jim Clarke and Eric Bruno, co-authors of the aforementioned JavaFX book, jokingly asked what word could be used to describe this scenario:
"Condition where binds lead to binds that leads back to the original bind, ending up in a Stack fault?"
BindQuake? BindTsunami? Bindless? BindSpin? BindHole (BlackHole)? BindPit?
Posted at 03:20PM Mar 19, 2009 by jtc in Sun | Comments[3]