- Skill Level Beginner
- Product JavaFX
- Key Features Performance, Graphics, Language Enhancements
- Last Updated May 2009
The JavaFX 1.2 SDK is a significant update to the JavaFX 1.1 SDK. The JavaFX 1.2 SDK includes changes to the APIs that are not forward compatible. Some classes, APIs, and variables have been removed from the JavaFX 1.1 SDK, while newer classes, APIs, and variables have been added to the JavaFX 1.2 SDK.
The JavaFX 1.2 SDK release is not binary compatible with the JavaFX 1.1 SDK. This means that your application and all libraries that it depends on must be recompiled with the JavaFX 1.2 SDK.
Legend (Added:
, Removed:
, Changed:
)
Animation
Packages affected: javafx.animation, javafx.animation.transition
Transition.interpolateis now namedinterpolator.
Old: public override var interpolate = Interpolator.LINEAR;New: public override var interpolator = Interpolator.LINEAR;The Transitionclass inherits from theTimelineclass.
The Transition.durationvariable inSequentialTransitionandParallelTransitionis inaccessible. However, the public-read protected variablescycleDurationandtotalDurationare now included in theTimeline.

public-read protected var cycleDuration: Duration
public-read protected var totalDuration: Duration
- The
timelinesvariable is no longer included inKeyFrame. Subtimelines are no longer supported. This functionality is now supported byParallelTransitionandSequentialTransition.
- The
timelineDirtyvariable is no longer included in theTransitionclass. ThemarkDirty()function provides the same support as the oldtimelineDirtyvariable.timelineDirty, previously a protected variable of theTransitionclass, is now a local variable and can be modified through a protectedmarkDirty()function in theTransitionclass. This change enables a third-party library to extend the JavaFXTransitionbase class to implement additionalTransitionclasses. The existingTransitionclasses, such asTranslationTransition,RotateTranslation, andPathTransition, work as before.
Old: timelineDirty = true;New: markDirty()
Asynchronous Operations
Package affected: javafx.async
- The
AbstractAsyncOperationandRemoteTextDocumentclasses are no longer included in thejavafx.asyncpackage. Thejavafx.io.http.HttpRequestclass can be used instead of thejavafx.async.RemoteTextDocumentclass.
- The following classes are new to the
javafx.asyncpackage.
Effects
Package affected: javafx.scene.effect
Graphics
Packages affected: javafx.scene.transform, javafx.scene.image, javafx.ext.swing, javafx.scene, javafx.scene.layout, javafx.stage, javafx.geometry, javafx.scene.paint
- The variables for the matrix elements in the
javafx.scene.transform.Affineclass are now named as follows:
m00 --> mxx
m01 --> mxy
m02 --> tx
m10 --> myx
m11 --> myy
m12 --> ty
However, the more common use case of using theTransform.affinemethod is not affected.
Old: Affine { m00: 1 m10: 0 m01: 0 m11: 1 m02: 25 m12: 15 }New: Affine { mxx: 1 myx: 0 mxy: 0 myy: 1 tx: 25 ty: 15 } javafx.scene.image.Image.fromBufferedImage(image:java.awt.image.BufferedImage)is now namedjavafx.ext.swing.SwingUtils.toFXImage(image:java.awt.image.BufferedImage). The parameters and functionality are identical to the old method.
- The
javafx.scenepackage supports the following new classes:
- The
javafx.geometrypackage supports the following new classes:
- No events should be delivered when
Nodeis disabled.
- An application should not expect events on a disabled
Node. - Mouse and key event handlers should not be invoked when
Nodeis disabled. - A focused
Nodeshould lose focus when it becomes disabled.
- An application should not expect events on a disabled
- The
enabledvariable of Swing components in thejavafx.ext.swingpackage is no longer included. Thedisablevariable is still available and sufficient to handle the enabling and disabling of components.
- New layout variables are now included in
javafx.scene.Node,javafx.scene.CustomNode, andjavafx.scene.Group:
layoutInfolayoutBoundslayoutXlayoutY
- The preferred method to position a node for layout is
layoutXandlayoutYinstead of usingtranslateXandtranslateY. WhiletranslateXandtranslateYmost likely will work,layoutXandlayoutYwill have better performance. Also, if you do a legitimatetranslateXandtranslateY, the original value is lost if you did not uselayoutXandlayoutY.
- The default
layoutBoundsof a Node does not include clip, its effect, or any of its transforms.
- The implicit pivot of a Node when using the
scaleX,scaleY, orrotatevariables is the (untransformed) center of thelayoutBounds.
- The
boundsInScenevariable is no longer included in theNode,Group, andCustomNodeclasses. ThelocalToScene(boundsInLocal)function provides the same support as the oldboundsInScenevariable. TheboundsInScenevariable was expensive to compute, and thelocalToScene(boundsInLocal)function gives better performance because binding to thelocalToScenefunction is not allowed.
Old: node.boundsInSceneNew: node.localToScene(node.boundsInLocal) - The
javafx.scene.layoutpackage now includes the following classes.
Tidak ada komentar:
Posting Komentar