use of javafx.scene.layout.Pane in project Gargoyle by callakrsos.
the class SkinPreviewViewComposite method previewTabInit.
@FxPostInitialize
public void previewTabInit() {
Task<Void> task = new Task<Void>() {
@Override
protected Void call() throws Exception {
Thread.sleep(5000L);
Platform.runLater(() -> {
//메뉴바 배경.
{
Background background = mbSample.getBackground();
Color fill = (Color) background.getFills().get(0).getFill();
colorMbSample.setValue(fill);
//메뉴바 텍스트
{
Label lookup = (Label) mbSample.lookup(".label");
Color textFill = (Color) lookup.getTextFill();
colorMbLabelSample.setValue(textFill);
}
}
//Hbox 배경.
{
Background background = hboxSample.getBackground();
Color fill = (Color) background.getFills().get(0).getFill();
colorHboxSample.setValue(fill);
}
{
//선택디지않는 탭 색상 처리.
Set<Node> lookupAll = tabpaneSample.lookupAll(".tab:top");
lookupAll.forEach(lookup -> {
Optional<PseudoClass> findFirst = lookup.getPseudoClassStates().stream().filter(v -> {
return "selected".equals(v.getPseudoClassName());
}).findFirst();
if (findFirst.isPresent()) {
Label selectedTabLabel = (Label) lookup.lookup(".tab-label");
Color textFill = (Color) selectedTabLabel.getTextFill();
colorSelectedTabText.setValue(textFill);
} else {
Label selectedTabLabel = (Label) lookup.lookup(".tab-label");
Color textFill = (Color) selectedTabLabel.getTextFill();
colorUnSelectedTabText.setValue(textFill);
}
});
{
lookupAll.stream().findFirst().ifPresent(n -> {
Pane p = (Pane) n;
Background background = p.getBackground();
Color fill = (Color) background.getFills().get(0).getFill();
colorTabSample1Selected.setValue(fill);
});
}
}
});
return null;
}
};
Window window = this.getScene().getWindow();
if (window != null) {
FxUtil.showLoading(window, task);
} else
FxUtil.showLoading(task);
}
use of javafx.scene.layout.Pane in project jgnash by ccavanaugh.
the class TransactionDialog method buildTab.
private Tab buildTab(final String tabName, final SlipType slipType) {
try {
final FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("BankSlip.fxml"), resources);
final Pane pane = fxmlLoader.load();
final SlipController slipController = fxmlLoader.getController();
// Override the default event handler for the enter and cancel buttons
slipController.enterButton.setOnAction(event -> handleEnterAction(slipController));
slipController.cancelButton.setOnAction(event -> tabPane.getScene().getWindow().hide());
slipController.setSlipType(slipType);
slipController.accountProperty().bind(accountProperty());
final Tab tab = new Tab(tabName);
tab.setContent(pane);
tab.setUserData(slipController);
return tab;
} catch (final IOException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, e.getLocalizedMessage(), e);
}
return new Tab();
}
use of javafx.scene.layout.Pane in project jgnash by ccavanaugh.
the class InvestmentSlipManager method buildReinvestDividendTab.
private SlipControllerContainer buildReinvestDividendTab(final String name) {
try {
final FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("ReinvestDividendSlip.fxml"), resources);
final Pane pane = fxmlLoader.load();
final ReinvestDividendSlipController slipController = fxmlLoader.getController();
slipController.accountProperty().bind(accountProperty());
return new SlipControllerContainer(name, slipController, pane);
} catch (final IOException e) {
throw new RuntimeException(e);
}
}
use of javafx.scene.layout.Pane in project jgnash by ccavanaugh.
the class InvestmentSlipManager method buildReturnOfCapitalTab.
private SlipControllerContainer buildReturnOfCapitalTab(final String name) {
try {
final FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("ReturnOfCapitalSlip.fxml"), resources);
final Pane pane = fxmlLoader.load();
final ReturnOfCapitalSlipController slipController = fxmlLoader.getController();
slipController.accountProperty().bind(accountProperty());
return new SlipControllerContainer(name, slipController, pane);
} catch (final IOException e) {
throw new RuntimeException(e);
}
}
use of javafx.scene.layout.Pane in project trex-stateless-gui by cisco-system-traffic-generator.
the class NotificationPanel method buildUI.
/**
* Build component UI
*/
private void buildUI() {
this.setSpacing(5);
// add notification message
notificationContainer = new Pane();
notificationContainer.setPrefSize(184, 64);
notificationContainer.getStyleClass().add("notificationContainer");
notificationLabel = new Label();
notificationLabel.setPrefSize(155, 60);
notificationLabel.setWrapText(true);
notificationLabel.getStyleClass().add("notificationMsg");
notificationContainer.getChildren().add(notificationLabel);
getChildren().add(notificationContainer);
// add notification icon
VBox iconHolder = new VBox();
iconHolder.setPrefHeight(68);
iconHolder.setAlignment(Pos.CENTER);
ImageView notificationIcon = new ImageView(new Image("/icons/info_icon.png"));
notificationIcon.getStyleClass().add("notificationIcon");
notificationIcon.setOnMouseClicked((MouseEvent event) -> {
notificationContainer.setVisible(!notificationContainer.isVisible());
});
iconHolder.getChildren().add(notificationIcon);
getChildren().add(iconHolder);
}
Aggregations