Summary
Changing four existing ImageView
properties to styleable properties, with the names
-fx-preserve-ratio
-fx-smooth
-fx-fit-width
-fx-fit-height
Problem
The app developers want to control these properties via CSS style sheet.
Solution
The solution is to change these four properties in ImageView
to Styleable*Property and include them in public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData()
.
Specification
The change affects return value of a static method and the CSS Reference document:
--- a/modules/javafx.graphics/src/main/docs/javafx/scene/doc-files/cssref.html
+++ b/modules/javafx.graphics/src/main/docs/javafx/scene/doc-files/cssref.html
@@ -1882,12 +1882,35 @@
</thead>
<tbody>
<tr>
- <th class="propertyname" scope="row">-fx-image</th>
+ <th class="propertyname" scope="row">-fx-fit-height</th>
+ <td class="value"><a href="#typenumber" class="typelink"><number></a></td>
+ <td class="default">0</td>
+ <td>The height of the bounding box within which the source image is resized as necessary to fit.</td>
+ </tr>
+ <tr>
+ <th class="propertyname" scope="row">-fx-fit-width</th>
+ <td class="value"><a href="#typenumber" class="typelink"><number></a></td>
+ <td class="default">0</td>
+ <td>The width of the bounding box within which the source image is resized as necessary to fit.</td>
+ </tr>
+ <th class="propertyname" scope="row">-fx-image</th>
<td class="value"><a href="#typeurl" class="typelink"><uri></a></td>
<td class="default">null</td>
<td>Relative URLs are resolved against the URL of the stylesheet.</td>
</tr>
<tr>
+ <th class="propertyname" scope="row">-fx-preserve-ratio</th>
+ <td class="value"><a href="#typeboolean" class="typelink"><boolean></a></td>
+ <td class="default">false</td>
+ <td>Indicates whether to preserve the aspect ratio of the source image when scaling to fit the image within the fitting bounding box.</td>
+ </tr>
+ <tr>
+ <th class="propertyname" scope="row">-fx-smooth</th>
+ <td class="value"><a href="#typeboolean" class="typelink"><boolean></a></td>
+ <td class="default">Platform-specific</td>
+ <td>Indicates whether to use a better quality filtering algorithm or a faster one when transforming or scaling the source image to fit.</td>
+ </tr>
+ <tr>
<th colspan="4" class="parents" scope="row">Also has all properties of <a href="#node">Node</a></th>
</tr>
</tbody>
- csr of
-
JDK-8320359 ImageView: add styleable fitWidth, fitHeight, preserveRatio, smooth properties
- Resolved