Skip to content

Examples

arigesher edited this page Dec 13, 2011 · 15 revisions

Disclaimer: Palantir Technologies is not affiliated with, endorsed or sponsored by Palantir.net, Inc. Palantir.net's website is http://palantir.net

Palantir Logo

Our tutorial has a good break-down of all the moving parts and an in-depth look at BoundJCheckBoxExample.java.

Intro Examples

The Intro examples implement the same program three different ways, to show how Cinch changes this sort of programming.

Program Lines of code Anonymous Listeners Description
IntroNoMVC.java 148 3 Has no model - values are stored in JComponents.
IntroLegacyMVC.java 270 6 Uses MVC as first described for Java. Model class requires two lines of boilerplate for every set method.
IntroCinchMVC.java 186 0 Uses very clean MVC. 71 lines of mostly auto-generated boilerplate for Model and Controller.

Simple Examples

CallOnUpdate Example

This is a small example used to illustrate the use of the @CallOnUpdate annotation.

See CallOnUpdate.java

BoundJCheckBoxExample

This examples illustrates using Cinch to effectively bind to a JCheckBox.

See BoundJCheckBoxExample.java

BoundJCheckBoxExample

This examples illustrates using Cinch to effectively bind to a JCheckBox.

See BoundJListExample.java

BoundExtentsExample

This example illustrates binding the extents on JSlider to a model using the @BoundExtent annotation.

See BoundExtentsExample.java

BoundLocationExample

This example illustrates binding the relative location of a JInternalFrame to a second InternalFrame using the @BoundLocation annotation.

See BoundLocationExample.java

FocusChangedExample

This example shows binding specific methods in the view to handle focus change events using the @OnFocusChange annotation.

See FocusChangedExample.java

OnChangeExample

This example shows how the @OnChange annotation can be used to call a method every time a ChangeEvent fires.

See OnChangeExample.java

More Complex Examples

SuperDemo

This examples shows off the interaction of inheritance with Cinch.

See the superdemo package, start looking at SuperDemo.java

The Cinch Demo

This is a fully-featured program that uses most of the features of Cinch in one place. A useful reference to consult when you're unsure exactly how something is to be used.

See the cinch demo package, start with DemoView.java