Menu Pilihan:
Getting Started With JavaFX Production Suite
JavaFX Production Suite is a set of tools for designers that facilitates the process of incorporating rich graphic assets into JavaFX applications.
This tutorial shows designers how to export graphics from Adobe Illustrator or Adobe Photoshop, and how to view exported JavaFX graphics. It also provides some useful information about Production Suite.
JavaFX Production Suite enables designers to convert graphics to JavaFX format so that the individual graphic objects can be manipulated by developers in JavaFX applications. For example, the 15 Puzzle, one of the samples included in the JavaFX application, is based on a single graphic, but the objects have been manipulated programmatically so that the user can move them around on the screen. The game is shown in the following screenshot.
The following tutorial uses the artwork from the 15-Puzzle sample to show you how to export JavaFX Graphics from either Adobe Photoshop or Adobe Illustrator and how to view the exported graphic. Following the tutorial, there is more information about JavaFX Production Suite, with tips on how to maximize the efficiency of your interaction with developers.
Tutorial: Export and View Your First JavaFX Graphic
1. Launch Adobe Illustrator or Adobe Photoshop
Open Adobe Illustrator or Adobe Photoshop .
2. Open the 15-Puzzle Sample Graphic
- Open one of the 15-puzzle sample graphics.
- If you are using Adobe Photoshop, open fifteen.psd, shown in Figure 1.
This file is also located in theart/ps
directory after you unzip the sample, located in the/Samples/puzzle15
folder of the Production Suite installation. - If you are using Adobe Illustrator, open fifteen.ai, shown in Figure 2.
This file is also located in theart/ai
directory after you unzip the sample, located in the/Samples/puzzle15
folder of the Production Suite installation.
- If you are using Adobe Photoshop, open fifteen.psd, shown in Figure 1.
- Make a note of the names of the graphic objects in the graphic, particularly those with a jfx: prefix.
The names of the graphic objects that are prefixed with jfx: are the ones that will be manipulated as objects in the JavaFX application. Note that these graphics objects have the same names in both the Adobe Photoshop and Adobe Illustrator artwork, as shown in Figures 1 and 2 respectively, . Even though the graphics look very different, as long as the graphic object names are the same, the two graphics can be used interchangeably in the application.
- Select one of the following two procedures, depending on whether you are using Adobe Photoshop or Adobe Illustrator.
3a. Export from Adobe Photoshop to JavaFX
- Choose File > Automate > Save for JavaFX.
The Export Options screen opens. This might take some time, depending on the size of the graphic.
- Select Show Preview.
For more information about the Save and Preview options in this dialog box, see Save and Preview Options During Export.
- Click Save, choose a location for the JavaFX graphic, and click Save again.
3b. Export from Adobe Illustrator to JavaFX
- Choose File > Save for JavaFX.
The Export Options screen opens. This might take some time, depending on the size of the graphic.
- Select Show Preview.
For more information about the Save and Preview options in this dialog box, see Save and Preview Options During Export.
- Click Save, choose a location for the JavaFX graphic, and click Save again.
4. View the Exported File in JavaFX Graphics Viewer
If you accept the default file name, the JavaFX graphic is saved as fifteen.fxz
. You can view FXZ files using JavaFX Graphics Viewer, as shown in the following figure:
Open fifteen.fxz
in JavaFX Graphics Viewer by double-clicking the FXZ file. You can use the toolbar to zoom in, zoom out, fit to screen, or change the magnification. You can also preview the graphic as it will appear in desktop or mobile applications. If you used the artboards feature when exporting from Adobe Illustrator CS4, you can view individual artboards by choosing which FXD file to view.
Save and Preview Options During Export
When you export a graphic from Adobe Photoshop or Illustrator, you have a number of preview and save options:
Option | Result |
---|---|
Fit on Screen or a percentage of magnification | Size the graphic to fit the preview window, or choose a percentage of magnification. Does not affect how the graphic is saved. |
Preserve 'JFX:" IDs only | It is easier for application developers to identify the objects to be manipulated if you select this option and assign jfx: prefixes to the objects that will be manipulated programmatically. If you do not select this checkbox, ID values will be assigned to all graphic objects when exported. |
Desktop or Mobile preview | Preview the graphic as it will appear in a desktop or mobile application. Does not affect how the graphic is saved. |
Export options for effects | In Adobe Photoshop, you can choose whether to export effects such as Drop Shadow, Glow, and so on. In Adobe Illustrator, you have several options for how effects are exported. For a list of supported effects, see the Production Suite online help. |
Rasterize texts (Adobe Photoshop) | If the Rasterize Texts option is selected, text objects will be saved as PNG files. If this checkbox is cleared, then text is saved as part of the FXD description and can be edited by the developer. |
Use artboards (Adobe Illustrator) | If your Adobe Illustrator CS4 artwork contains artboards, selecting this checkbox will result in a separate FXD file being created for each artboard. This helps developers to work with individual artboards. |
Embed fonts (Adobe Illustrator) | Choosing this option embeds font information as separate files in the FXZ file. Selecting this option allows fonts to be preserved whether or not they exist on the system on which desktop applications run. Applications deployed to mobile devices will ignore embedded fonts. |
Statistics | You can preview the file size and the number of JavaFX nodes that the graphic will contain when saved. These numbers can be related to performance and become especially important when deploying to mobile applications. |
For more detailed information about the save and preview options, see the Production Suite online help.
JavaFX Graphics File Formats
When you export a graphic from Adobe Illustrator or Adobe Photoshop to JavaFX, a file with an FXZ extension is created. FXZ is a compressed file format. It contains at least one file with an FXD extension, which contains a text description of the graphic. In addition, the FXZ file can contain embedded assets such as image files or fonts. The FXZ file is used by developers in their JavaFX applications.
Production Suite Workflow Tips
Designers should produce a rough sketch containing at minimum the graphic objects that will be manipulated programmatically. This gives developers something use as a placeholder in their applications while waiting for the final artwork. For example, the 15-Puzzle sample includes an Adobe Illustrator file that contains a rough drawing of the puzzle, as shown in the following figure. Note that the names of the graphic objects that will be used by the developer have already been created in the rough drawing. This early agreement on object names is a critical part of the designer-developer interaction.
Designers and developers work closely throughout the project to make sure they agree on what graphic objects will be manipulated in the application and what the names of those graphic objects will be. As the visual design evolves, developers can drop new versions of the artwork into their application. Frequent testing of the graphic is important to maintain an efficient designer-developer workflow.
Because the names of graphic objects are used as ID values in the JavaFX graphic, it is important to following naming conventions. You should also review the list of supported effects and features in Adobe Photoshop or Illustrator. Mobile applications have some additional constraints in terms of what mobile devices will support. For more information about these topics, see the Production Suite online help.
Production Suite SVG Graphics Converter
If you work with SVG format, Production Suite includes an SVG conversion tool, which converts SVG files to JavaFX format. As shown in Figure 7, you enter the path to the source SVG file and the destination path for the JavaFX graphics file. You can choose whether to create JavaFX IDs for all elements, or only those which have a jfx: prefix.
Production Suite Components
Production Suite contains the following tools and aids:
JavaFX Production Suite Component | Description |
---|---|
JavaFX Plugin for Adobe Illustrator | An Adobe Illustrator plugin, which enables conversion to JavaFX format. There are plugins for Adobe Illustrator CS3 and CS4. |
JavaFX Plugin for Adobe Photoshop | An Adobe Photoshop plugin, which enables conversion to JavaFX format. There are plugins for Adobe Illustrator CS3 and CS4. |
JavaFX Media Factory | Media Factory contains two tools:
|
Production Suite Help | Online help for all of the Production Suite tools. |
Samples | Sample applications that you can try. |
In this tutorial, you used the plugins for Adobe Illustrator and Adobe Photoshop to save JavaFX graphics files, and the JavaFX Graphics Viewer to view the result.The following sections describe the other tools in more detail.
Where to Go Next
Check Out the Production Suite Online Help
The Production Suite online help contains procedures, best practices, and tips for creating effective graphics for JavaFX applications. To access the online help system, go to the /Help
folder of the Production Suite installation directory and open index.html
.
Check Out Artwork in Other Production Suite Samples
JavaFX Production Suite contains several samples, including the 1- Puzzle sample that was demonstrated here. All of the samples contain original artwork, which you can examine and try converting.
You can access the samples as follows:
- In the Production Suite installation directory, go to the
/Samples
folder. - For descriptions of the samples open
index.html
in a browser.
- To view the artwork, open one of the sample folders and uncompress the zip file, then open the unzipped file and navigate to the
art
folder.
Yang Sering Dibaca:
-
Supercharge your Ajax development with Google Web Toolkit (GWT) If you develop web applications and ha...
-
As one of the devices are quite successful products on the market, no longer how long Corby Samsung S3650 will be developed in the form of W...
0 comments: