Wednesday, August 5, 2009

Steve at the SDForum

My good friend and co-author Stephen Chin has posted a screencast and slides from a talk he gave recently at the SDForum. Here is the link.

By the way, if you want to reproduce his greeting to the group using MigLayout, the code would look like this:

ResizableScene {
    width: 400
    height: 100
    fill: Color.GRAY
    content: MigLayout {
        constraints: "fill"
        content: [
            ResizableRectangle {
                effect: DropShadow{}
                fill: LinearGradient {
                    stops: [
                        Stop { color: Color.PURPLE }
                        Stop { color: Color.BLACK, offset: 1 }
                    ]
                }
                layoutInfo: nodeConstraints( "pos 20 20 container.x2-20 container.y2-20" )
            }
            Text {
                content: "Welcome SDForum Java SIG"
                font: Font.font( null, FontWeight.BOLD, 18 )
                fill: Color.WHITE
                layoutInfo: nodeConstraints( "center" )
            }
        ]
    }
}

No need for a Deck or a Border, MigLayout is all you need in this case. You can just use absolute positioning to create the 20 pixel border around the purple rectangle. And thanks to the container-relative positioning of MigLayout, the rectangle will resize with the scene just as in Steve's original demo.

Great presentation, Steve!

No comments:

Post a Comment

Please Note: All comments are moderated. That's why you won't see your comment appear right away. If it's not some stupid piece of spam, it will appear soon.

Note: Only a member of this blog may post a comment.