Skip to content

Commit

Permalink
Merge pull request #136 from runnermann/master
Browse files Browse the repository at this point in the history
Added CircleProgressNumberTile a modification of the CircleProgressTile. Gives the ability to …
  • Loading branch information
HanSolo authored Nov 23, 2022
2 parents 3ee4cb3 + 0ee10eb commit 75b9563
Show file tree
Hide file tree
Showing 4 changed files with 403 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/eu/hansolo/tilesfx/Demo.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public class Demo extends Application {
private Tile radialChartTile;
private Tile donutChartTile;
private Tile circularProgressTile;
private Tile circleProgresTileNum;
private Tile stockTile;
private Tile gaugeSparkLineTile;
private Tile radarChartTile1;
Expand Down Expand Up @@ -504,6 +505,13 @@ public class Demo extends Application {
.unit(Helper.PERCENTAGE)
.build();

circleProgresTileNum = TileBuilder.create()
.skinType(SkinType.CIRCLE_PROGRESS_NUM)
.prefSize(TILE_WIDTH, TILE_HEIGHT)
.title("CircularProgress Num Tile")
.text("Some text")
.build();

stockTile = TileBuilder.create()
.skinType(SkinType.STOCK)
.prefSize(TILE_WIDTH, TILE_HEIGHT)
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/eu/hansolo/tilesfx/Tile.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
import javafx.scene.layout.Region;
import javafx.scene.paint.Color;
import javafx.scene.paint.Stop;
import javafx.scene.shape.Circle;
import javafx.scene.shape.SVGPath;
import javafx.scene.text.Font;
import javafx.scene.text.TextAlignment;
Expand Down Expand Up @@ -146,6 +147,7 @@ public enum SkinType { SMOOTHED_CHART("ChartTileSkin"), BAR_CHART("BarChartTileS
LEADER_BOARD("LeaderBoardTileSkin"),
MAP("MapTileSkin"), RADIAL_CHART("RadialChartTileSkin"), DONUT_CHART("DonutChartTileSkin"),
CIRCULAR_PROGRESS("CircularProgressTileSkin"), STOCK("StockTileSkin"),
CIRCLE_PROGRESS_NUM("CircleProgressTileNumberSkin"),
GAUGE_SPARK_LINE("GaugeSparkLineTileSkin"), SMOOTH_AREA_CHART("SmoothAreaChartTileSkin"),
RADAR_CHART("RadarChartTileSkin"), RADAR_NODE_CHART("RadarNodeChartTileSkin"), COUNTRY("CountryTileSkin"),
CHARACTER("CharacterTileSkin"), FLIP("FlipTileSkin"), SWITCH_SLIDER("SwitchSliderTileSkin"),
Expand Down Expand Up @@ -6510,6 +6512,7 @@ private void setupBinding() {
case RADIAL_CHART : return new RadialChartTileSkin(Tile.this);
case DONUT_CHART : return new DonutChartTileSkin(Tile.this);
case CIRCULAR_PROGRESS : return new CircularProgressTileSkin(Tile.this);
case CIRCLE_PROGRESS_NUM : return new CircleProgressTileNumberSkin(Tile.this);
case STOCK : return new StockTileSkin(Tile.this);
case GAUGE_SPARK_LINE : return new GaugeSparkLineTileSkin(Tile.this);
case SMOOTH_AREA_CHART : return new SmoothAreaChartTileSkin(Tile.this);
Expand Down Expand Up @@ -6634,6 +6637,10 @@ public void presetTileParameters(final SkinType SKIN_TYPE) {
setBarBackgroundColor(getBackgroundColor().brighter());
setAnimated(true);
break;
case CIRCLE_PROGRESS_NUM:
setBarBackgroundColor(getBackgroundColor().brighter());
setAnimated(true);
break;
case STOCK:
setAnimated(false);
setAveragingPeriod(720);
Expand Down Expand Up @@ -6778,6 +6785,7 @@ public void setSkinType(final SkinType SKIN_TYPE) {
case RADIAL_CHART : setSkin(new RadialChartTileSkin(Tile.this)); break;
case DONUT_CHART : setSkin(new DonutChartTileSkin(Tile.this)); break;
case CIRCULAR_PROGRESS : setSkin(new CircularProgressTileSkin(Tile.this)); break;
case CIRCLE_PROGRESS_NUM: setSkin(new CircleProgressTileNumberSkin(Tile.this)); break;
case STOCK : setSkin(new StockTileSkin(Tile.this)); break;
case GAUGE_SPARK_LINE : setSkin(new GaugeSparkLineTileSkin(Tile.this)); break;
case SMOOTH_AREA_CHART : setSkin(new SmoothAreaChartTileSkin(Tile.this)); break;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/eu/hansolo/tilesfx/TileBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,10 @@ public final Tile build() {
TILE.setBarBackgroundColor(TILE.getBackgroundColor().brighter());
TILE.setAnimated(true);
break;
case CIRCLE_PROGRESS_NUM:
TILE.setBarBackgroundColor(TILE.getBackgroundColor().brighter());
TILE.setAnimated(true);
break;
case STOCK:
TILE.setAnimated(false);
TILE.setAveragingPeriod(720);
Expand Down
Loading

0 comments on commit 75b9563

Please sign in to comment.