本文整理汇总了Java中com.sun.javafx.css.StyleManager类的典型用法代码示例。如果您正苦于以下问题:Java StyleManager类的具体用法?Java StyleManager怎么用?Java StyleManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StyleManager类属于com.sun.javafx.css包,在下文中一共展示了StyleManager类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: imageUrlProperty
import com.sun.javafx.css.StyleManager; //导入依赖的package包/类
private StyleableStringProperty imageUrlProperty() {
if (imageUrl == null) {
imageUrl = CssHelper.createStyleableStringProperty(this, PROP_NAME_IMAGE_URL, GRAPHIC, () -> {
final String url = imageUrlProperty().get();
if (url != null) {
final Image img = StyleManager.getInstance().getCachedImage(url);
if (img != null) {
graphicProperty().set(new ImageView(img));
}
} else {
graphicProperty().set(null);
}
});
}
return imageUrl;
}
示例2: DataManipulationUI
import com.sun.javafx.css.StyleManager; //导入依赖的package包/类
public DataManipulationUI(){
StyleManager.getInstance().addUserAgentStylesheet(PropertySheet.class.getResource("propertysheet.css").toExternalForm());
// Initializing the main grid
grid = new GridPane();
grid.setPadding(new Insets(5,5,5,5));
// Adding separators
grid.add(new Text("Available datasets"),0,0);
grid.add(new Separator(),0,1);
grid.add(new Text("Import a dataset"),0,3);
grid.add(new Separator(),0,4);
grid.add(new Text("Preprocess the selected dataset"),0,6);
grid.add(new Separator(),0,7);
grid.add(new Text("Filter the selected preprocessed dataset"),0,9);
grid.add(new Separator(),0,10);
// Initializing specific UIs
availableDatasetsUI();
newDatasetProperties = new HashMap<>();
importUI();
preprocessUI();
filterUI();
}
示例3: update
import com.sun.javafx.css.StyleManager; //导入依赖的package包/类
protected void update(String old, String cur)
{
if(old != null)
{
StyleManager.getInstance().removeUserAgentStylesheet(old);
}
StyleManager.getInstance().addUserAgentStylesheet(cur);
}
示例4: start
import com.sun.javafx.css.StyleManager; //导入依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
RuntimeExplorer.getInstance().run();
final URL stylesheetUrl = getClass().getResource("/resources/spotifx.css");
if (stylesheetUrl != null) {
Application.setUserAgentStylesheet(Application.STYLESHEET_MODENA);
StyleManager.getInstance().addUserAgentStylesheet(stylesheetUrl.toExternalForm());
}
}
示例5: start
import com.sun.javafx.css.StyleManager; //导入依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
Application.setUserAgentStylesheet(null);
StyleManager.getInstance().addUserAgentStylesheet(ApplicationFX.getCurrentThemeCss());
//Application.setUserAgentStylesheet(ApplicationFX.getCurrentThemeCss());
app = new ApplicationFX();
app.start(primaryStage);
}
示例6: initializeDefaultUserAgentStylesheet
import com.sun.javafx.css.StyleManager; //导入依赖的package包/类
/**
* Helper function to add the default style sheet of DockFX to the user agent style sheets.
*/
public final static void initializeDefaultUserAgentStylesheet() {
StyleManager.getInstance().addUserAgentStylesheet(DockPane.class.getResource("default.css").toExternalForm());
}
示例7: setStylesheet
import com.sun.javafx.css.StyleManager; //导入依赖的package包/类
@Override
public void setStylesheet() {
Application.setUserAgentStylesheet(Application.STYLESHEET_MODENA);
StyleManager.getInstance().addUserAgentStylesheet(url);
}
示例8: installDefaultStyle
import com.sun.javafx.css.StyleManager; //导入依赖的package包/类
public static void installDefaultStyle() {
StyleManager.getInstance()
.addUserAgentStylesheet("AnchorFX.css");
}
示例9: initializeDefaultUserAgentStylesheet
import com.sun.javafx.css.StyleManager; //导入依赖的package包/类
/**
* Helper function to add the default style sheet of DockFX to the user agent style sheets.
*/
public final static void initializeDefaultUserAgentStylesheet() {
StyleManager.getInstance()
.addUserAgentStylesheet(DockPane.class.getResource("default.css").toExternalForm());
}
示例10: main
import com.sun.javafx.css.StyleManager; //导入依赖的package包/类
public static void main(String[] args)
{
StyleManager.getInstance().addUserAgentStylesheet(PropertySheet.class.getResource("propertysheet.css").toExternalForm());
launch(args);
}
示例11: start
import com.sun.javafx.css.StyleManager; //导入依赖的package包/类
@Override
public void start(final Stage primaryStage) {
StyleManager.getInstance()
.addUserAgentStylesheet(getClass().getResource("/de/chaosfisch/uploader/resources/style.css")
.toExternalForm());
final boolean useMasterPassword = configuration.getBoolean(IPersistenceService.MASTER_PASSWORD, false);
if (useMasterPassword) {
dialogHelper.showInputDialog("Masterpasswort", "Masterpasswort:", new Callback() {
@Override
public void onInput(final InputDialogController controller, final String input) {
if (Strings.isNullOrEmpty(input)) {
controller.input.getStyleClass().add("input-invalid");
} else {
persistenceService.generateBackup();
persistenceService.setMasterPassword(input);
controller.closeDialog(null);
}
}
}, true);
}
if (!persistenceService.loadFromStorage()) {
if (useMasterPassword) {
dialogHelper.showErrorDialog("Closing..", "Invalid password.");
} else {
dialogHelper.showErrorDialog("Closing..", "Unknown error occured.");
}
Platform.exit();
} else {
persistenceService.cleanStorage();
Platform.setImplicitExit(false);
initApplication(primaryStage);
uploadService.resetUnfinishedUploads();
uploadService.startStarttimeCheck();
LOGGER.info("Verifying accounts");
final List<Account> accounts = accountService.getAll();
for (final Account account : accounts) {
if (!accountService.verifyAccount(account)) {
LOGGER.warn("Account is invalid: {}", account.getName());
dialogHelper.showAccountPermissionsDialog(account);
}
}
}
}
示例12: addGlobalFocusListener
import com.sun.javafx.css.StyleManager; //导入依赖的package包/类
/**
* Set the focus listener as user agent stylesheet for the whole application with given main
* theme.
*
* <p>
* Reference: <a href="https://bugs.openjdk.java.net/browse/JDK-8077918">JDK-8077918</a>
*
* @param url
* of main theme stylesheet
*
* @see #addFocusListener(Scene)
* @see #addGlobalFocusListener()
*/
public void addGlobalFocusListener(String url) {
FXOK.registerPopup(this);
Application.setUserAgentStylesheet(url);
StyleManager.getInstance().addUserAgentStylesheet(getUserAgentStyleSheet());
}