use of javafx.scene.layout.Background in project JFoenix by jfoenixadmin.
the class JFXComboBox method defaultNodeConverter.
private static <T> NodeConverter<T> defaultNodeConverter() {
return new NodeConverter<T>() {
@Override
public Node toNode(T object) {
if (object == null)
return null;
StackPane selectedValueContainer = new StackPane();
selectedValueContainer.getStyleClass().add("combo-box-selected-value-container");
selectedValueContainer.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, null, null)));
Label selectedValueLabel;
if (object instanceof Label)
selectedValueLabel = new Label(((Label) object).getText());
else
selectedValueLabel = new Label(object.toString());
selectedValueLabel.setTextFill(Color.BLACK);
selectedValueContainer.getChildren().add(selectedValueLabel);
StackPane.setAlignment(selectedValueLabel, Pos.CENTER_LEFT);
StackPane.setMargin(selectedValueLabel, new Insets(0, 0, 0, 5));
return selectedValueContainer;
}
@SuppressWarnings("unchecked")
@Override
public T fromNode(Node node) {
return (T) node;
}
@Override
public String toString(T object) {
if (object == null)
return null;
if (object instanceof Label)
return ((Label) object).getText();
return object.toString();
}
};
}
use of javafx.scene.layout.Background in project JFoenix by jfoenixadmin.
the class JFXFillTransition method interpolate.
/**
* {@inheritDoc}
*/
@Override
protected void interpolate(double frac) {
if (start == null)
starting();
Color newColor = start.interpolate(end, frac);
if (Color.TRANSPARENT.equals(start))
newColor = new Color(end.getRed(), end.getGreen(), end.getBlue(), newColor.getOpacity());
region.get().setBackground(new Background(new BackgroundFill(newColor, radii, insets)));
}
use of javafx.scene.layout.Background in project Retrospector by NonlinearFruit.
the class Retrospector method init.
@Override
public void init() {
ImageView splash = new ImageView(new Image(SPLASH_IMAGE, SPLASH_WIDTH, SPLASH_HEIGHT, true, true));
loadProgress = new ProgressBar(0);
loadProgress.setPrefWidth(SPLASH_WIDTH);
progressText = new Label("Initializing . . .");
progressText.setBackground(new Background(new BackgroundFill(Color.GHOSTWHITE, new CornerRadii(5), new Insets(0))));
splashLayout = new VBox();
splashLayout.getChildren().addAll(splash, loadProgress, progressText);
progressText.setAlignment(Pos.CENTER);
// splashLayout.setEffect(new DropShadow());
splashLayout.setBackground(Background.EMPTY);
}
use of javafx.scene.layout.Background in project Smartcity-Smarthouse by TechnionYP5777.
the class MainSystemGuiController method init.
@Override
public void init(final SystemCore model, final URL location, final ResourceBundle __) {
try {
// home tab:
homeTab.setContent(homeTabHBox);
homePageImageView.setImage(new Image(getClass().getResourceAsStream("/icons/smarthouse-icon-logo.png")));
homePageImageView.setFitHeight(200);
// homePageImageView.fitHeightProperty().bind(homeTabHBox.heightProperty().divide(2));
final BackgroundImage myBI = new BackgroundImage(new Image(getClass().getResourceAsStream("/backgrounds/bg_4.png"), 0, 200, false, false), BackgroundRepeat.REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, BackgroundSize.DEFAULT);
homeTabHBox.setBackground(new Background(myBI));
// user tab:
userTab.setContent(createChildPresenter("user information.fxml").getRootViewNode());
// sensors tab:
sensorsTab.setContent(createChildPresenter("house_mapping.fxml").getRootViewNode());
// applications tab:
appsPresenterInfo = createChildPresenter("application_view.fxml");
appsTab.setContent(appsPresenterInfo.getRootViewNode());
} catch (final Exception ¢) {
¢.printStackTrace();
}
}
use of javafx.scene.layout.Background in project Smartcity-Smarthouse by TechnionYP5777.
the class Controller method initialize.
@Override
public void initialize(final URL location, final ResourceBundle __) {
pane.setPrefSize(1200, 800);
List<Tile> tiles = new ArrayList<>();
for (int i = 0; i < ROWS_NUM * TILES_IN_ROW; ++i) {
final Integer loc = i;
final Tile t = TileBuilder.create().prefSize(TILE_SIZE, TILE_SIZE).skinType(SkinType.TEXT).description("Choose a widget:\nClick me!\t\t").descriptionAlignment(Pos.CENTER).textVisible(true).build();
setTileEventHandlers(t, loc);
tiles.add(t);
}
pane.getChildren().addAll(tiles);
pane.setBackground(new Background(new BackgroundFill(Tile.BACKGROUND.darker(), null, null)));
// pane.setPadding(new Insets(5));
// pane.setPrefHeight((TILE_SIZE+8)*ROWS_NUM);
// pane.setPrefWidth((TILE_SIZE+8)*TILES_IN_ROW);
}
Aggregations