Skip to content

Commit

Permalink
Added two additional fonts for the lcd displays in the gauges
Browse files Browse the repository at this point in the history
The fonts could be selected via the Gauge.LcdFont enum.
  • Loading branch information
Gerrit Grunwald committed May 31, 2012
1 parent 106c9c6 commit 686b723
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ src/main/java/Demo.java
/nbbuild/
/dist/
nbproject
build.xml
build.xml
.DS_Store
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,14 @@ private void prepareLcd() {
LCD_VALUE_FONT = Font.loadFont(getClass().getResourceAsStream("/jfxtras/labs/scene/control/gauge/digital.ttf"), (0.5833333333 * SIZE));
lcdDigitalFontSizeFactor = 1.9098073909;
break;
case PIXEL:
LCD_VALUE_FONT = Font.loadFont(getClass().getResourceAsStream("/jfxtras/labs/scene/control/gauge/pixel.ttf"), (0.5208333333 * SIZE));
lcdDigitalFontSizeFactor = 1.0;
break;
case PHONE_LCD:
LCD_VALUE_FONT = Font.loadFont(getClass().getResourceAsStream("/jfxtras/labs/scene/control/gauge/phonelcd.ttf"), (0.4583333333 * SIZE));
lcdDigitalFontSizeFactor = 1.0;
break;
case STANDARD:
default:
LCD_VALUE_FONT = Font.font("Verdana", FontWeight.NORMAL, (0.5 * SIZE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1459,6 +1459,14 @@ public void drawLcdContent() {
LCD_VALUE_FONT = Font.loadFont(getClass().getResourceAsStream("/jfxtras/labs/scene/control/gauge/bus.ttf"), (0.6 * LCD_FRAME.getLayoutBounds().getHeight()));
UNIT_Y_OFFSET = 2.0;
break;
case PIXEL:
LCD_VALUE_FONT = Font.loadFont(getClass().getResourceAsStream("/jfxtras/labs/scene/control/gauge/pixel.ttf"), (0.6 * LCD_FRAME.getLayoutBounds().getHeight()));
UNIT_Y_OFFSET = 2.0;
break;
case PHONE_LCD:
LCD_VALUE_FONT = Font.loadFont(getClass().getResourceAsStream("/jfxtras/labs/scene/control/gauge/phonelcd.ttf"), (0.6 * LCD_FRAME.getLayoutBounds().getHeight()));
UNIT_Y_OFFSET = 2.0;
break;
case STANDARD:
default:
LCD_VALUE_FONT = Font.font("Verdana", FontWeight.NORMAL, (0.6 * LCD_FRAME.getLayoutBounds().getHeight()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,14 @@ public void drawLcdContent() {
LCD_VALUE_FONT = Font.loadFont(getClass().getResourceAsStream("/jfxtras/labs/scene/control/gauge/bus.ttf"), (0.6 * LCD_FRAME.getLayoutBounds().getHeight()));
UNIT_Y_OFFSET = 2.0;
break;
case PIXEL:
LCD_VALUE_FONT = Font.loadFont(getClass().getResourceAsStream("/jfxtras/labs/scene/control/gauge/pixel.ttf"), (0.6 * LCD_FRAME.getLayoutBounds().getHeight()));
UNIT_Y_OFFSET = 2.0;
break;
case PHONE_LCD:
LCD_VALUE_FONT = Font.loadFont(getClass().getResourceAsStream("/jfxtras/labs/scene/control/gauge/phonelcd.ttf"), (0.6 * LCD_FRAME.getLayoutBounds().getHeight()));
UNIT_Y_OFFSET = 2.0;
break;
case STANDARD:
default:
LCD_VALUE_FONT = Font.font("Verdana", FontWeight.NORMAL, (0.6 * LCD_FRAME.getLayoutBounds().getHeight()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,14 @@ public void drawLcdContent() {
LCD_VALUE_FONT = Font.loadFont(getClass().getResourceAsStream("/jfxtras/labs/scene/control/gauge/bus.ttf"), (0.6 * LCD_FRAME.getLayoutBounds().getHeight()));
UNIT_Y_OFFSET = 2.0;
break;
case PIXEL:
LCD_VALUE_FONT = Font.loadFont(getClass().getResourceAsStream("/jfxtras/labs/scene/control/gauge/pixel.ttf"), (0.6 * LCD_FRAME.getLayoutBounds().getHeight()));
UNIT_Y_OFFSET = 2.0;
break;
case PHONE_LCD:
LCD_VALUE_FONT = Font.loadFont(getClass().getResourceAsStream("/jfxtras/labs/scene/control/gauge/phonelcd.ttf"), (0.6 * LCD_FRAME.getLayoutBounds().getHeight()));
UNIT_Y_OFFSET = 2.0;
break;
case STANDARD:
default:
LCD_VALUE_FONT = Font.font("Verdana", FontWeight.NORMAL, (0.6 * LCD_FRAME.getLayoutBounds().getHeight()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,14 @@ public void drawLcdContent() {
LCD_VALUE_FONT = Font.loadFont(getClass().getResourceAsStream("/jfxtras/labs/scene/control/gauge/bus.ttf"), (0.6 * LCD_FRAME.getLayoutBounds().getHeight()));
UNIT_Y_OFFSET = 2.0;
break;
case PIXEL:
LCD_VALUE_FONT = Font.loadFont(getClass().getResourceAsStream("/jfxtras/labs/scene/control/gauge/pixel.ttf"), (0.6 * LCD_FRAME.getLayoutBounds().getHeight()));
UNIT_Y_OFFSET = 2.0;
break;
case PHONE_LCD:
LCD_VALUE_FONT = Font.loadFont(getClass().getResourceAsStream("/jfxtras/labs/scene/control/gauge/phonelcd.ttf"), (0.6 * LCD_FRAME.getLayoutBounds().getHeight()));
UNIT_Y_OFFSET = 2.0;
break;
case STANDARD:
default:
LCD_VALUE_FONT = Font.font("Verdana", FontWeight.NORMAL, (0.6 * LCD_FRAME.getLayoutBounds().getHeight()));
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/jfxtras/labs/scene/control/gauge/Gauge.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ public static enum KnobDesign {
public static enum LcdFont {
STANDARD,
LCD,
BUS
BUS,
PIXEL,
PHONE_LCD
}
public static enum NumberFormat {
AUTO("0"),
Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit 686b723

Please sign in to comment.