本文整理汇总了Java中javafx.scene.control.Hyperlink.setStyle方法的典型用法代码示例。如果您正苦于以下问题:Java Hyperlink.setStyle方法的具体用法?Java Hyperlink.setStyle怎么用?Java Hyperlink.setStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.Hyperlink
的用法示例。
在下文中一共展示了Hyperlink.setStyle方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addBrowser
import javafx.scene.control.Hyperlink; //导入方法依赖的package包/类
/**
*
*
* @param fileEntry
* @param contentSearch
* @param nodesToAdd
* @param idToShow
*
* @throws Exception
*/
private void addBrowser(final FileEntry fileEntry, final List<Node> nodesToAdd) throws Exception {
// TODO: text
final Hyperlink fulltextButton = new Hyperlink(g.getText("SEARCH_RESULT.SHOW_FULLTEXT"));
fulltextButton.setStyle("-fx-font-size:15px");
Platform.runLater(new Runnable() {
@Override
public void run() {
addTooltip(fulltextButton, g.getText("SEARCH_RESULT.SHOW_FULLTEXT_TOOLTIP"), -50, 35);
}
});
// ------------------------------------------------ //
fulltextButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
outTransition();
executeWorker(saveToXhtmlWorker(fileEntry));
}
});
// ------------------------------------------------ //
nodesToAdd.add(fulltextButton);
nodesToAdd.add(new Text(" "));
}
示例2: addDirectoryButton
import javafx.scene.control.Hyperlink; //导入方法依赖的package包/类
/**
*
*
* @param fileEntry
* @param nodesToAdd
*
* @throws Exception
*/
private void addDirectoryButton(final FileEntry fileEntry, final List<Node> nodesToAdd)
throws Exception {
Hyperlink openDirButton = new Hyperlink(g.getText("SEARCH_RESULT.SHOW_FILE"));
openDirButton.setStyle("-fx-font-size:15px");
// addImageIcon(openDirButton, Icon.FOLDER_OPEN, 0);
openDirButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
outTransition();
inTransitionAsWorker(1000);
executeWorker(openFileWorker(fileEntry.getPath(), true, 1));
}
});
nodesToAdd.add(openDirButton);
nodesToAdd.add(new Text(" "));
Platform.runLater(new Runnable() {
@Override
public void run() {
Thread.currentThread().setName(Config.APP_NAME + "JavaFX: Open dir tooltip");
addTooltip(openDirButton, g.getText("SEARCH_RESULT.OPEN_DIR_TOOLTIP"), -50, 35);
}
});
}
示例3: onStart
import javafx.scene.control.Hyperlink; //导入方法依赖的package包/类
@Override
public void onStart() {
stuffBox.prefWidthProperty().bind(Main.mainController.contentBox.widthProperty());
stuffBox.prefHeightProperty().bind(Main.mainController.contentBox.heightProperty());
if (credits.getChildren().isEmpty()) {
String yearString = "2017";
int year = Calendar.getInstance().get(Calendar.YEAR);
if (year > 2017) {
yearString += "-" + year;
}
Text text = new Text("©" + yearString + " - HEARTH PROJECT");
text.setStyle("-fx-fill: #FFFFFF; -fx-font-family: 'Lato', sans-serif; -fx-font-size: 12;");
Hyperlink hyperlink = new Hyperlink("http://hearthproject.uk/");
hyperlink.setStyle("-fx-text-fill: #FFFFFF; -fx-font-family: 'Lato', sans-serif; -fx-font-size: 12;");
hyperlink.setOnAction(e -> openHearthSite());
hyperlink.focusTraversableProperty().setValue(false);
Text creditsText = new Text("\nCredits:");
creditsText.setStyle("-fx-fill: #FFFFFF; -fx-font-family: 'Lato', sans-serif; -fx-font-size: 14; -fx-font-weight: bold");
credits.getChildren().addAll(text, hyperlink, creditsText);
addCredit("modmuss50 - Lead Developer", "https://twitter.com/modmuss50");
addCredit("Prospector - UX Manager", "https://twitter.com/ProfProspector");
addCredit("primetoxinz - Various Contributions", "https://github.com/primetoxinz");
addCredit("loading.io - Splash Loading .gif", "https://loading.io/");
addCredit("Yannick - Home, About, Download, Instances, and Update icons", "https://www.flaticon.com/authors/yannick");
addCredit("Gregor Cresnar - Package icon", "https://www.flaticon.com/authors/gregor-cresnar");
addCredit("Egor Rumyantsev - Settings icon", "https://www.flaticon.com/authors/egor-rumyantsev");
addCredit("Icomoon - Log Out icon", "https://www.flaticon.com/authors/icomoon");
}
}
示例4: addCredit
import javafx.scene.control.Hyperlink; //导入方法依赖的package包/类
public void addCredit(String credit, String url) {
Hyperlink hyperlink = new Hyperlink(credit);
hyperlink.setStyle("-fx-text-fill: #FFFFFF; -fx-font-family: 'Lato', sans-serif; -fx-font-size: 12;");
hyperlink.setOnAction((actionEvent) -> OperatingSystem.browseURI(url));
hyperlink.focusTraversableProperty().setValue(false);
credits.getChildren().add(hyperlink);
}
示例5: addFileButton
import javafx.scene.control.Hyperlink; //导入方法依赖的package包/类
/**
*
*
* @param fileEntry
* @param nodesToAdd
*
* @throws Exception
*/
private void addFileButton(final FileEntry fileEntry, final List<Node> nodesToAdd,
final Integer pageToOpen) throws Exception {
Hyperlink openFileButton = new Hyperlink(g.getText("SEARCH_RESULT.OPEN_FILE"));
openFileButton.setStyle("-fx-font-size:15px");
openFileButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
outTransition();
inTransitionAsWorker(1000);
// *INDENT-OFF*
executeWorker(
openFileWorker(
fileEntry.getPath(),
false, // open directory
pageToOpen == null ? 1 : pageToOpen // page
)
);
// *INDENT-ON*
}
});
nodesToAdd.add(openFileButton);
nodesToAdd.add(new Text(" "));
Platform.runLater(new Runnable() {
@Override
public void run() {
Thread.currentThread().setName(Config.APP_NAME + "JavaFX: Change Clipboard button text");
addTooltip(openFileButton, g.getText("SEARCH_RESULT.OPEN_FILE_TOOLTIP"), -50, 35);
}
});
}
示例6: addDetailsButton
import javafx.scene.control.Hyperlink; //导入方法依赖的package包/类
/**
*
*
* @param idToShow
* @param nodesToAdd
*
* @throws Exception
*/
private void addDetailsButton(final Integer idToShow, final List<Node> nodesToAdd)
throws Exception {
final Hyperlink openDetails = new Hyperlink(g.getText("SEARCH_RESULT.SHOW_DETAILS"));
openDetails.setStyle("-fx-font-size:15px");
openDetails.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
outTransition();
try {
// *INDENT-OFF*
executeWorker(
addResultToDetailPopup(
// results
g.getSearchResult(),
// fulltext-search-query for highlighting
g.getContentSearchLuceneQuery(),
idToShow
)
);
// *INDENT-ON*
} catch (Exception e) {
e.printStackTrace();
}
}
});
nodesToAdd.add(openDetails);
nodesToAdd.add(new Text(" "));
}
示例7: Cell
import javafx.scene.control.Hyperlink; //导入方法依赖的package包/类
private Cell(final ItemType item)
{
setSpacing(6);
StringBuilder builder = new StringBuilder()
.append("-fx-border-color: #cccccc;")
.append("-fx-border-radius: 5;")
.append("-fx-padding: 2 5 2 5;")
.append("-fx-background-radius: 5;")
.append("-fx-background-color: #ffffdd;)");
setStyle(builder.toString());
Node node;
if (nodeFactory != null)
{
node = nodeFactory.createNode(item);
}
else
{
node = new Label(String.valueOf(item));
}
getChildren().add(node);
deleteButton = new Hyperlink("X");
deleteButton.setStyle("-fx-padding: 0; -fx-text-fill: blue");
deleteButton.setOnAction(new EventHandler<ActionEvent>()
{
public void handle(ActionEvent event)
{
chosenItemCells.remove(Cell.this);
chosenItems.remove(item);
content.getChildren().remove(Cell.this);
layout();
}
});
getChildren().add(deleteButton);
}
示例8: Browser
import javafx.scene.control.Hyperlink; //导入方法依赖的package包/类
public Browser() {
for (int i = 0; i < captions.length; i++) {
final Hyperlink hpl = hpls[i] = new Hyperlink(captions[i]);
hpl.setStyle("-fx-font-size: 28; -fx-text-fill: white;");
//Image image = images[i] =
// new Image(getClass().getResourceAsStream(imageFiles[i]));
//hpl.setGraphic(new ImageView (image));
final String url = urls[i];
hpl.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent e) {
webEngine.load(url);
}
});
}
// load the home page
webEngine.load("http://www.medicamentosplm.com/labs/a.htm");
browser.setFontScale(1.5);
// create the toolbar
toolBar = new HBox();
toolBar.getChildren().addAll(hpls);
//add components
getChildren().add(toolBar);
getChildren().add(browser);
}
示例9: getHyperlink
import javafx.scene.control.Hyperlink; //导入方法依赖的package包/类
private Hyperlink getHyperlink() {
Hyperlink hyperlink = new Hyperlink(BUNDLE.getString("menu.about.source"));
hyperlink.setStyle("-fx-focus-color: transparent; -fx-faint-focus-color: transparent;");
hyperlink.setOnAction(e -> HOSTSERVICES.showDocument(hyperlink.getText()));
return hyperlink;
}