本文整理汇总了Java中org.kordamp.ikonli.javafx.FontIcon.setIconSize方法的典型用法代码示例。如果您正苦于以下问题:Java FontIcon.setIconSize方法的具体用法?Java FontIcon.setIconSize怎么用?Java FontIcon.setIconSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kordamp.ikonli.javafx.FontIcon
的用法示例。
在下文中一共展示了FontIcon.setIconSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeIcon
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
private void initializeIcon() {
final Circle circle = (Circle) lookup("#iconBackground");
final FontIcon icon = (FontIcon) lookup("#icon");
circle.setFill(color.getColor(colorIntensity));
icon.setFill(color.getTextColor(colorIntensity));
if (command != null) {
icon.setIconLiteral("gmi-" + command.getIcon());
}
icon.setIconSize(24);
}
示例2: showOptions
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
@Override
public void showOptions() {
Dialog<String> dialog = new Dialog<>();
dialog.setTitle("Perception-Action Configuration");
dialog.setHeaderText("You can define next action in function of agent perception (up, left, right and down)");
dialog.getDialogPane().setPrefSize(500, 600);
FontIcon icon = new FontIcon(FontAwesome.COGS);
icon.setIconSize(64);
dialog.setGraphic(icon);
ButtonType applyChanges = new ButtonType("Apply", ButtonBar.ButtonData.OK_DONE);
dialog.getDialogPane().getButtonTypes().addAll(applyChanges, ButtonType.CANCEL);
try {
FXMLLoader fxmlLoader = new FXMLLoader(ClassLoader.getSystemClassLoader().getResource("PerceptionActionAgent.fxml"));
Parent root = fxmlLoader.load();
dialog.getDialogPane().setContent(root);
dialog.setResultConverter(dialogButton -> {
if (dialogButton == applyChanges) {
PerceptionActionAgentController configurationController = fxmlLoader.getController();
for (PerceptionActionAgentController.PerceptionRule rule : configurationController.tableContent) {
((PerceptionAction) getAlgorithm()).addRule(rule.getLeft(), rule.getRight(), rule.getUp(), rule.getDown(), Directions.valueOf(rule.getAction()));
}
return null;
}
return null;
});
} catch (IOException e) {
new ErrorView("No possible load agent configuration");
e.printStackTrace();
}
Optional<String> s = dialog.showAndWait();
}
示例3: initializeActionButton
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
private void initializeActionButton() {
// Find the action icon
actionButton = (JFXRippler) lookup("#actionButton");
final FontIcon actionButtonIcon = (FontIcon) lookup("#actionButtonIcon");
actionButtonIcon.setIconColor(Color.GREY.getColor(Color.Intensity.I900));
actionButton.setCursor(Cursor.HAND);
actionButton.setRipplerFill(Color.GREY.getColor(Color.Intensity.I500));
// Delegate that based on the query state updated the action icon
final Consumer<QueryState> updateIcon = (queryState) -> {
if (queryState.equals(QueryState.RUNNING)) {
actionButtonIcon.setIconLiteral("gmi-stop");
actionButtonIcon.setIconSize(24);
} else {
actionButtonIcon.setIconLiteral("gmi-play-arrow");
actionButtonIcon.setIconSize(24);
}
};
// Update the icon initially
updateIcon.accept(query.getQueryState());
// Update the icon when ever the query state is updated
query.queryStateProperty().addListener((observable, oldValue, newValue) -> updateIcon.accept(newValue));
actionButton.setMaskType(JFXRippler.RipplerMask.CIRCLE);
actionButton.getChildren().get(0).setOnMousePressed(event -> {
query.setQueryState(QueryState.UNKNOWN);
if (query.getQueryState().equals(QueryState.RUNNING)) {
query.cancel();
} else {
query.run();
}
});
}
示例4: addLocation
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
public void addLocation(final Location LOCATION) {
double x = (LOCATION.getLongitude() + 180) * (PREFERRED_WIDTH / 360) + MAP_OFFSET_X;
double y = (PREFERRED_HEIGHT / 2) - (PREFERRED_WIDTH * (Math.log(Math.tan((Math.PI / 4) + (Math.toRadians(LOCATION.getLatitude()) / 2)))) / (2 * Math.PI)) + MAP_OFFSET_Y;
FontIcon locationIcon = new FontIcon(null == LOCATION.getIconCode() ? locationIconCode : LOCATION.getIconCode());
locationIcon.setIconSize(LOCATION.getIconSize());
locationIcon.setTextOrigin(VPos.CENTER);
locationIcon.setIconColor(null == LOCATION.getColor() ? getLocationColor() : LOCATION.getColor());
locationIcon.setX(x - LOCATION.getIconSize() * 0.5);
locationIcon.setY(y);
StringBuilder tooltipBuilder = new StringBuilder();
if (!LOCATION.getName().isEmpty()) tooltipBuilder.append(LOCATION.getName());
if (!LOCATION.getInfo().isEmpty()) tooltipBuilder.append("\n").append(LOCATION.getInfo());
String tooltipText = tooltipBuilder.toString();
if (!tooltipText.isEmpty()) {
Tooltip tooltip = new Tooltip(tooltipText);
tooltip.setFont(Font.font(10));
Tooltip.install(locationIcon, tooltip);
}
if (null != LOCATION.getMouseEnterHandler()) locationIcon.setOnMouseEntered(new WeakEventHandler<>(LOCATION.getMouseEnterHandler()));
if (null != LOCATION.getMousePressHandler()) locationIcon.setOnMousePressed(new WeakEventHandler<>(LOCATION.getMousePressHandler()));
if (null != LOCATION.getMouseReleaseHandler()) locationIcon.setOnMouseReleased(new WeakEventHandler<>(LOCATION.getMouseReleaseHandler()));
if (null != LOCATION.getMouseExitHandler()) locationIcon.setOnMouseExited(new WeakEventHandler<>(LOCATION.getMouseExitHandler()));
locations.put(LOCATION, locationIcon);
}
示例5: initializeButton
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
private void initializeButton(Button btn, Ikon icon, String tooltip) {
final FontIcon fi = new FontIcon(icon);
fi.setIconSize(24);
btn.setGraphic(fi);
btn.setText(null);
btn.setTooltip(new Tooltip(tooltip));
}
示例6: initializeMenuButton
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
private void initializeMenuButton() {
LoggerFacade.INSTANCE.info(this.getClass(), "Initialize MenuButton"); // NOI18N
lMenuButton.setText(null);
lMenuButton.setCursor(Cursor.HAND);
final FontIcon fiBlockMenu = new FontIcon(Elusive.REMOVE_SIGN);
fiBlockMenu.setIconSize(36);
lMenuButton.setGraphic(fiBlockMenu);
}
示例7: initializeButtonPlayGame
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
private void initializeButtonPlayGame() {
LoggerFacade.INSTANCE.info(this.getClass(), "Initialize button PlayGame"); // NOI18N
lPlayGame.setText(null);
lPlayGame.setCursor(Cursor.HAND);
final FontIcon fiPlayAlt = new FontIcon(Elusive.PLAY_ALT);
fiPlayAlt.setIconSize(56);
lPlayGame.setGraphic(fiPlayAlt);
}
示例8: showOptions
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
@Override
public void showOptions() {
Dialog<String> dialog = new Dialog<>();
dialog.setTitle("Neural Network Agent Configuration");
dialog.setHeaderText("You can select the type of neural network and some properties");
dialog.getDialogPane().setPrefSize(500, 600);
FontIcon icon = new FontIcon(FontAwesome.COGS);
icon.setIconSize(64);
dialog.setGraphic(icon);
ButtonType applyChanges = new ButtonType("Apply", ButtonBar.ButtonData.OK_DONE);
dialog.getDialogPane().getButtonTypes().addAll(applyChanges, ButtonType.CANCEL);
try {
FXMLLoader fxmlLoader = new FXMLLoader(ClassLoader.getSystemClassLoader().getResource("NeuralNetworkAgentConfiguration.fxml"));
Parent root = fxmlLoader.load();
dialog.getDialogPane().setContent(root);
dialog.setResultConverter(dialogButton -> {
if (dialogButton == applyChanges) {
NeuralNetworkAgentConfigurationController configurationController = fxmlLoader.getController();
setAlgorithm(configurationController.getAlgorithm());
return null;
}
return null;
});
} catch (IOException e) {
new ErrorView("No possible load agent configuration");
e.printStackTrace();
}
Optional<String> s = dialog.showAndWait();
}
示例9: initGraphics
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
private void initGraphics() {
icon = new FontIcon(Material.MENU);
icon.setIconSize(24);
icon.setIconColor(Color.WHITE);
icon.toFront();
getChildren().add(icon);
StackPane.setAlignment(icon, Pos.TOP_LEFT);
StackPane.setMargin(icon, new Insets(5));
}
示例10: SwarmAgentView
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
public SwarmAgentView() {
Circle right = new Circle(10);
right.setTranslateX(-10);
right.setTranslateY(-10);
right.setFill(Color.BLUE);
FontIcon icon = new FontIcon(FontAwesome.BUG);
icon.setFill(Color.WHITE);
icon.setIconSize(16);
icon.setTranslateX(-16.5);
icon.setTranslateY(-6);
getChildren().addAll(right, icon);
}
示例11: ExplorerAgentView
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
public ExplorerAgentView() {
Circle right = new Circle(10);
right.setTranslateX(-10);
right.setTranslateY(-10);
right.setFill(Color.BLUE);
FontIcon icon = new FontIcon(FontAwesome.SEARCH);
icon.setFill(Color.WHITE);
icon.setIconSize(16);
icon.setTranslateX(-16.5);
icon.setTranslateY(-6);
getChildren().addAll(right, icon);
}
示例12: showOptions
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
/**
* Display a dialog with capacity of modified the resource settings
*/
@Override
public void showOptions() {
// TODO: Define it
Dialog dialog = new Dialog();
dialog.setTitle("Resource Configuration");
dialog.setHeaderText("You can set quantity, tag of resource");
FontIcon icon = new FontIcon(FontAwesome.COGS);
icon.setIconSize(64);
dialog.setGraphic(icon);
ButtonType applyChanges = new ButtonType("Apply", ButtonBar.ButtonData.OK_DONE);
dialog.getDialogPane().getButtonTypes().addAll(applyChanges, ButtonType.CANCEL);
HBox hbox = new HBox();
Label tagLabel = new Label("Tag:");
TextField tagInputField = new TextField();
Label quantityLabel = new Label("Quantity");
TextField quantityInputField = new TextField();
hbox.getChildren().addAll(tagLabel, tagInputField, quantityLabel, quantityInputField);
dialog.getDialogPane().setContent(hbox);
dialog.setResultConverter(dialogButton -> {
if (dialogButton == applyChanges) {
try {
setQuantity(Integer.parseInt(quantityInputField.getText()));
setTag(tagInputField.getText());
}
catch (Exception e) {
System.out.println("Error applying configuration"); // TODO:
}
}
return null;
});
dialog.showAndWait();
}
示例13: NeuralAgentView
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
public NeuralAgentView() {
Circle right = new Circle(10);
right.setTranslateX(-10);
right.setTranslateY(-10);
right.setFill(Color.BLUE);
FontIcon icon = new FontIcon(FontAwesome.RANDOM);
icon.setFill(Color.WHITE);
icon.setIconSize(16);
icon.setTranslateX(-16.5);
icon.setTranslateY(-6);
getChildren().addAll(right, icon);
}
示例14: AntView
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
public AntView() {
FontIcon icon = new FontIcon(FontAwesome.BUG);
icon.setFill(Color.WHITE);
icon.setIconSize(16);
icon.setTranslateX(-16.5);
icon.setTranslateY(-6);
getChildren().addAll(icon);
}
示例15: PAAgent
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
public PAAgent() {
Circle right = new Circle(10);
right.setTranslateX(-10);
right.setTranslateY(-10);
right.setFill(Color.BLUE);
FontIcon icon = new FontIcon(FontAwesome.EYE);
icon.setFill(Color.WHITE);
icon.setIconSize(16);
icon.setTranslateX(-16.5);
icon.setTranslateY(-6);
getChildren().addAll(right, icon);
}