4545import java .io .File ;
4646import java .io .IOException ;
4747import java .net .URL ;
48+ import java .util .List ;
4849import java .util .ResourceBundle ;
4950import java .util .UUID ;
5051import java .util .logging .Level ;
5556 */
5657public class EmbedImageDialogController implements Initializable {
5758
59+ @ SuppressWarnings ("unused" )
5860 @ FXML
5961 private DialogPane dialogPane ;
62+ @ SuppressWarnings ("unused" )
6063 @ FXML
6164 private Label fileLabel ;
65+ @ SuppressWarnings ("unused" )
6266 @ FXML
6367 private Label widthLabel ;
68+ @ SuppressWarnings ("unused" )
6469 @ FXML
6570 private Label heightLabel ;
71+ @ SuppressWarnings ("unused" )
6672 @ FXML
6773 private Button browseButton ;
74+ @ SuppressWarnings ("unused" )
6875 @ FXML
6976 private Button clipboardButton ;
77+ @ SuppressWarnings ("unused" )
7078 @ FXML
7179 private TextField fileName ;
80+ @ SuppressWarnings ("unused" )
7281 @ FXML
7382 private TextField width ;
83+ @ SuppressWarnings ("unused" )
7484 @ FXML
7585 private TextField height ;
86+ @ SuppressWarnings ("unused" )
7687 @ FXML
7788 private Label scaleLabel ;
89+ @ SuppressWarnings ("unused" )
7890 @ FXML
7991 private TextField scale ;
8092
8193 /**
8294 * This is set when image is selected from file or clipboard. It is not bound to
8395 * a UI component.
8496 */
85- private IntegerProperty widthProperty = new SimpleIntegerProperty ();
97+ private final IntegerProperty widthProperty = new SimpleIntegerProperty ();
8698 /**
8799 * This is the computed width value rendered in the UI component.
88100 */
89- private IntegerProperty scaledWidthProperty = new SimpleIntegerProperty ();
101+ private final IntegerProperty scaledWidthProperty = new SimpleIntegerProperty ();
90102 /**
91103 * This is set when image is selected from file or clipboard. It is not bound to
92104 * a UI component.
93105 */
94- private IntegerProperty heightProperty = new SimpleIntegerProperty ();
106+ private final IntegerProperty heightProperty = new SimpleIntegerProperty ();
95107 /**
96108 * This is the computed width value rendered in the UI component.
97109 */
98- private IntegerProperty scaledHeightProperty = new SimpleIntegerProperty ();
99- private SimpleStringProperty filenameProperty = new SimpleStringProperty ();
100- private DoubleProperty scaleProperty = new SimpleDoubleProperty (1.0 );
110+ private final IntegerProperty scaledHeightProperty = new SimpleIntegerProperty ();
111+ private final SimpleStringProperty filenameProperty = new SimpleStringProperty ();
112+ private final DoubleProperty scaleProperty = new SimpleDoubleProperty (1.0 );
101113
102114 private String id ;
103115
@@ -127,13 +139,14 @@ public void initialize(URL url, ResourceBundle resourceBundle){
127139 dialogPane .lookupButton (ButtonType .OK ).disableProperty ().bind (okButtonBinding );
128140 }
129141
142+ @ SuppressWarnings ("unused" )
130143 @ FXML
131144 public void browse (){
132145 FileChooser fileChooser = new FileChooser ();
133146 fileChooser .setTitle (Messages .SelectFile );
134147 fileChooser .getExtensionFilters ().addAll (
135- new FileChooser .ExtensionFilter ("Image files (jpg, png, gif)" , "*.jpg" , "*.png" , "*.gif" ),
136- new FileChooser . ExtensionFilter ( "All files" , "*.*" )
148+ new FileChooser .ExtensionFilter ("Image files (jpg, jpeg, png, gif)" , "*.jpg" , "*.jpeg" , "*. png" , "*.gif" )
149+
137150 );
138151
139152 File file = fileChooser .showOpenDialog (dialogPane .getScene ().getWindow ());
@@ -152,6 +165,7 @@ public void browse(){
152165 }
153166 }
154167
168+ @ SuppressWarnings ("unused" )
155169 @ FXML
156170 public void pasteClipboard (){
157171 image = Clipboard .getSystemClipboard ().getImage ();
0 commit comments