Debian Codegraph @

fontawesomefx-icons525/src/main/java/de/jensd/fx/glyphs/icons525/Icons525View.java

raw
1 /**
2 * Copyright (c) 2013-2016 Jens Deters http://www.jensd.de
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
6 * the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 *
16 */
17 package de.jensd.fx.glyphs.icons525;
18
19 import de.jensd.fx.glyphs.GlyphIcon;
20 import java.io.IOException;
21 import java.util.logging.Level;
22 import java.util.logging.Logger;
23 import javafx.scene.text.Font;
24
25 /**
26 *
27 * @author Jens Deters ([email protected])
28 */
29 public class Icons525View extends GlyphIcon<Icons525> {
30
31 public final static String TTF_PATH = "/de/jensd/fx/glyphs/icons525/525icons.ttf";
32
33 static {
34 try {
35 Font.loadFont(Icons525View.class.getResource(TTF_PATH).openStream(), 10.0d);
36 } catch (IOException ex) {
37 Logger.getLogger(Icons525View.class.getName()).log(Level.SEVERE, null, ex);
38 }
39
40 }
41
42 public Icons525View(Icons525 icon, String iconSize) {
43 super(Icons525.class);
44 setIcon(icon);
45 setStyle(String.format("-fx-font-family: %s; -fx-font-size: %s;", icon.fontFamily(), iconSize));
46 }
47
48 public Icons525View(Icons525 icon) {
49 this(icon, "1em");
50 }
51
52 public Icons525View() {
53 this(Icons525.ACROBAT);
54 }
55
56 @Override
57 public Icons525 getDefaultGlyph() {
58 return Icons525.ACROBAT;
59 }
60
61 }