use of javafx.scene.image.ImageView in project POL-POM-5 by PlayOnLinux.
the class AbstractStepRepresentationWithHeader method drawHeader.
/**
* Draw the header at the top of the window
*/
private void drawHeader() {
// FIXME: use this variable to draw the title of the window
final String title = this.getParentWizardTitle();
Pane header = new Pane();
header.setId("header");
header.setPrefSize(722, 65);
header.setLayoutX(-1);
header.setLayoutY(-1);
header.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY)));
ImageView topImage = new ImageView(this.createTopImage());
topImage.setLayoutX(626);
header.getChildren().add(topImage);
getParent().getRoot().setTop(header);
}
use of javafx.scene.image.ImageView in project trex-stateless-gui by cisco-system-traffic-generator.
the class MainViewController method initializeInlineComponent.
/**
* Initialize in-line built component
*/
private void initializeInlineComponent() {
updateBtn.setGraphic(new ImageView(new Image("/icons/apply.png")));
newProfileBtn.setGraphic(new ImageView(new Image("/icons/add_profile.png")));
stopUpdateBtn.setGraphic(new ImageView(new Image("/icons/stop_update.png")));
devicesTreeArrowContainer.setImage(leftArrow);
// mapped profiles enabling with property
profileListBox.disableProperty().bind(disableProfileProperty);
newProfileBtn.disableProperty().bind(disableProfileProperty);
profileDetailLabel.disableProperty().bind(disableProfileProperty);
profileListBox.getItems().clear();
profileListBox.setItems(FXCollections.observableArrayList(getProfilesNameList()));
profileListBox.valueProperty().addListener(new UpdateProfileListener<>(profileListBox.getSelectionModel()));
updateProfileListProperty.bind(ProfileManager.getInstance().getUpdatedProperty());
updateProfileListProperty.addListener((ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) -> {
List<String> profiles = getProfilesNameList();
profileListBox.setItems(FXCollections.observableArrayList(profiles));
if (!profiles.contains(currentSelectedProfile)) {
tableView.reset();
profileDetailContainer.setVisible(false);
}
});
tableView = new PacketTableView(230, this, true);
profileTableViewContainer.getChildren().add(tableView);
serverStatusIcon.setImage(new Image("/icons/offline.png"));
// initialize right click menu
rightClickPortMenu = new ContextMenu();
addMenuItem(rightClickPortMenu, "Acquire", ContextMenuClickType.ACQUIRE, false);
addMenuItem(rightClickPortMenu, "Force Acquire", ContextMenuClickType.FORCE_ACQUIRE, false);
addMenuItem(rightClickPortMenu, "Release Acquire", ContextMenuClickType.RELEASE_ACQUIRE, false);
rightClickProfileMenu = new ContextMenu();
addMenuItem(rightClickProfileMenu, "Play", ContextMenuClickType.PLAY, false);
addMenuItem(rightClickProfileMenu, "Pause", ContextMenuClickType.PAUSE, false);
addMenuItem(rightClickProfileMenu, "Stop", ContextMenuClickType.STOP, false);
rightClickGlobalMenu = new ContextMenu();
addMenuItem(rightClickGlobalMenu, "Release All Ports", ContextMenuClickType.RELEASE_ALL, false);
addMenuItem(rightClickGlobalMenu, "Acquire All Ports", ContextMenuClickType.ACQUIRE_ALL, false);
addMenuItem(rightClickGlobalMenu, "Force Acquire All Ports", ContextMenuClickType.FORCE_ACQUIRE_ALL, false);
addMenuItem(rightClickGlobalMenu, "Re-Acquire my Ports", ContextMenuClickType.ACQUIRE_MY_PORT, false);
// initialize multiplexer
multiplierView = new MultiplierView(this);
multiplierOptionContainer.getChildren().add(multiplierView);
notificationPanel = new NotificationPanel();
notificationPanel.setNotificationMsg(DISABLED_MULTIPLIER_MSG);
notificationPanelHolder.getChildren().add(notificationPanel);
// add close
TrexApp.getPrimaryStage().setOnCloseRequest(new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent event) {
// handle aplpication close
DialogManager.getInstance().closeAll();
handleAppClose();
}
});
TrexApp.getPrimaryStage().setOnShown(new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent event) {
TrexApp.getPrimaryStage().focusedProperty().addListener((ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) -> {
if (newValue && tableView.isStreamEditingWindowOpen()) {
tableView.setStreamEditingWindowOpen(false);
streamTableUpdated();
}
});
}
});
TrexApp.getPrimaryStage().setOnCloseRequest(new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent event) {
System.exit(0);
}
});
logContainer.getChildren().add(LogsController.getInstance().getView());
consoleLogContainer.getChildren().add(LogsController.getInstance().getConsoleLogView());
// initialize countdown service
countdownService = new CountdownService();
countdownService.setPeriod(Duration.seconds(Constants.REFRESH_ONE_INTERVAL_SECONDS));
countdownService.setRestartOnFailure(false);
countdownService.setOnSucceeded((WorkerStateEvent event) -> {
int count = (int) event.getSource().getValue();
countdownValue.setText(String.valueOf(count) + " Sec");
if (count == 0) {
doUpdateAssignedProfile(getSelectedPortIndex());
}
});
devicesTree.getSelectionModel().selectedItemProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue observable, Object oldValue, Object newValue) {
handleTreeItemSelectionChanged();
}
});
}
use of javafx.scene.image.ImageView in project trex-stateless-gui by cisco-system-traffic-generator.
the class PacketBuilderHomeController method initialize.
@Override
public void initialize(URL url, ResourceBundle rb) {
trafficProfile = new TrafficProfile();
packetHex = new PacketHex(hexPane);
nextStreamBtn.setGraphic(new ImageView(new Image("/icons/next_stream.png")));
prevStreamBtn.setGraphic(new ImageView(new Image("/icons/prev_stream.png")));
packetInfo = new PacketInfo();
parser = new PacketParser();
}
use of javafx.scene.image.ImageView in project jgnash by ccavanaugh.
the class JasperViewerDialogController method setPage.
private void setPage(final int index) {
double contentsHeight = pagePane.getBoundsInLocal().getHeight();
double viewportHeight = scrollPane.getViewportBounds().getHeight();
ImageView iv = (ImageView) pagePane.getChildren().get(index);
scrollPane.setVvalue(iv.getBoundsInParent().getMinY() / (contentsHeight - viewportHeight));
setPageIndex(index);
}
use of javafx.scene.image.ImageView in project Gargoyle by callakrsos.
the class DialogUtil method showLoginDialog.
/**
* login Dialog 로그인 처리 다이얼로그
*
* @param consumer
* @return
*/
public static <T> Optional<Pair<String, String>> showLoginDialog(Consumer<? super Pair<String, String>> consumer) {
// Create the custom dialog.
Dialog<Pair<String, String>> dialog = new Dialog<>();
dialog.setTitle("Login Dialog");
dialog.setHeaderText("Look, a Custom Login Dialog");
dialog.setGraphic(new ImageView(new Image("file:resources/images/login.png")));
// Set the button types.
ButtonType loginButtonType = new ButtonType("Login", ButtonData.OK_DONE);
ButtonType localButtonType = new ButtonType("Local", ButtonData.APPLY);
dialog.getDialogPane().getButtonTypes().addAll(loginButtonType, localButtonType, ButtonType.CANCEL);
// Create the username and password labels and fields.
GridPane grid = new GridPane();
grid.setHgap(10);
grid.setVgap(10);
grid.setPadding(new Insets(20, 150, 10, 10));
TextField username = new TextField();
username.setPromptText("Username");
PasswordField password = new PasswordField();
password.setPromptText("Password");
grid.add(new Label("Username:"), 0, 0);
grid.add(username, 1, 0);
grid.add(new Label("Password:"), 0, 1);
grid.add(password, 1, 1);
// Enable/Disable login button depending on whether a username was
// entered.
Node loginButton = dialog.getDialogPane().lookupButton(loginButtonType);
loginButton.setDisable(true);
// Do some validation (using the Java 8 lambda syntax).
username.textProperty().addListener((observable, oldValue, newValue) -> {
loginButton.setDisable(newValue.trim().isEmpty());
});
dialog.getDialogPane().setContent(grid);
// Request focus on the username field by default.
Platform.runLater(() -> username.requestFocus());
// Convert the result to a username-password-pair when the login button
// is clicked.
dialog.setResultConverter(dialogButton -> {
if (dialogButton == loginButtonType) {
return new Pair<>(username.getText(), password.getText());
} else if (dialogButton == localButtonType) {
return new Pair<>(MEMO_LOCAL_USER, "");
}
return null;
});
Optional<Pair<String, String>> result = dialog.showAndWait();
result.ifPresent(consumer);
return result;
}
Aggregations