• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AccessibleRole类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javafx.scene.AccessibleRole的典型用法代码示例。如果您正苦于以下问题:Java AccessibleRole类的具体用法?Java AccessibleRole怎么用?Java AccessibleRole使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AccessibleRole类属于javafx.scene包,在下文中一共展示了AccessibleRole类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: IndicatorButton

import javafx.scene.AccessibleRole; //导入依赖的package包/类
public IndicatorButton(int pageNumber) {
	this.pageNumber = pageNumber;
	setFocusTraversable(false);
	setIndicatorType();
	setTooltipVisible(isTooltipVisible());

	getSkinnable().getStyleClass().addListener(updateSkinIndicatorType);

	setOnAction(new EventHandler<ActionEvent>() {
		@Override
		public void handle(ActionEvent arg0) {
			int selected = getCurrentPageIndex();
			// We do not need to update the selection if it has not changed.
			if (selected != IndicatorButton.this.pageNumber) {
				pagination.setCurrentPageIndex(IndicatorButton.this.pageNumber);
				requestLayout();
			}
		}
	});

	tooltipVisibleProperty().addListener(updateTooltipVisibility);

	prefHeightProperty().bind(minHeightProperty());
	setAccessibleRole(AccessibleRole.PAGE_ITEM);
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:26,代码来源:CPagenationSkin.java


示例2: CodeEditor

import javafx.scene.AccessibleRole; //导入依赖的package包/类
public CodeEditor()
{
	webView = new WebView();
	aceEditor = new AceEditor();
	
	codeBodyProperty = aceEditor.getBodyProperty();
	acePageContentsProperty = aceEditor.getPage();
	
	initializeEngineEvents();
	
	webView.getEngine().loadContent(aceEditor.getPage().get());
	
	// Add interface to access Java model from Javascript
	JSObject jsObject = (JSObject) webView.getEngine().executeScript("window");
	jsObject.setMember("javaContentModel", this);
	
	acePageContentsProperty.addListener((observable, old, newValue) -> 
	{
		System.out.println("Loaded:\n" + newValue);
		webView.getEngine().loadContent(newValue);
	});
	
	codeBodyProperty.addListener(
			(observable, old, newValue) -> System.out.println("CodeProperty changed"));
	
	webView.setContextMenuEnabled(false);
	//TODO create custom context menu (right click menu)
	
	// TODO: move this to a js file
	aceEditor.addCustomJavascriptRoutine(() -> "editor.on(\"change\", function() {"
			+ "javaContentModel.updateTextFromJavascript(editor.getValue());"
			+ "});");

	setOnKeyReleased(event -> {
		System.out.println("key released");
		getBreakPoints();
	});

	setCenter(webView);
	this.accessibleRoleProperty().set(AccessibleRole.TEXT_AREA);
}
 
开发者ID:dhawal9035,项目名称:WebPLP,代码行数:42,代码来源:CodeEditor.java


示例3: BasicEntityEditorSkin

import javafx.scene.AccessibleRole; //导入依赖的package包/类
public BasicEntityEditorSkin(BasicEntityEditor<T> control) {
	super(control);
	this.control = control;
	this.control.showPopupProperty().addListener((v, o, n) -> {
		if (n) showPopup(); else hidePopup();
	});
	
	this.control.valueProperty().addListener(this::updateTextField);
	this.control.converterProperty().addListener(this::updateTextField);
	
	if (control.showPopupProperty().get()) showPopup(); else hidePopup();
	
	textField.textProperty().addListener(textInput);
	//textField.setManaged(false);
	textField.setEditable(true);
	
	valueField.setMouseTransparent(true);
	// As long as the screen-reader is concerned this node is not a list item.
	// This matters because the screen-reader counts the number of list item
	// within combo and speaks it to the user.
	valueField.setAccessibleRole(AccessibleRole.NODE);
	valueField.setAlignment(Pos.BASELINE_LEFT);
	valueField.setMaxWidth(Integer.MAX_VALUE);
	HBox.setHgrow(valueField, Priority.ALWAYS);
	valueField.textProperty().bind(Bindings.createObjectBinding(()-> {
		StringConverter<T> conv = control.converter.get();
		return conv.toString(control.getValue());
	}, control.converter, control.value));
	
	control.setOnKeyReleased(e -> {
		if (e.getCode() == KeyCode.DOWN) {
			showPopup();
		}
		else if (e.getCode() == KeyCode.F7) {
			if (e.isControlDown()) {
				hidePopup();
				control.editValue();
			}
			else {
				hidePopup();
				control.viewValue();
			}
		}
	});
	
	arrowButton.getStyleClass().addAll("arrow-button");
	
	valueField.visibleProperty().bind(control.showPopupProperty().not());
	textField.visibleProperty().bind(control.showPopupProperty());
	
	HBox hbox = new HBox();
	hbox.getStyleClass().remove("hbox");
	hbox.setOnMouseClicked(e -> onArrowClicked());
	hbox.setAlignment(Pos.BASELINE_LEFT);
	valueField.setStyle("-fx-padding: 0.5em 0.8ex");			
	StackPane sp = new StackPane(valueField, textField);
	
	//HBox.setHgrow(valueField, Priority.ALWAYS);
	//HBox.setHgrow(textField, Priority.ALWAYS);
	HBox.setHgrow(sp, Priority.ALWAYS);
	HBox.setHgrow(arrowButton, Priority.NEVER);
	HBox.setMargin(arrowButton, new Insets(5));
	hbox.getChildren().addAll(sp, arrowButton);
	getChildren().add(hbox);
	
}
 
开发者ID:salimvanak,项目名称:myWMS,代码行数:67,代码来源:BasicEntityEditor.java


示例4: initialize

import javafx.scene.AccessibleRole; //导入依赖的package包/类
private void initialize() {
    getStyleClass().add(DEFAULT_STYLE_CLASS);
    setAccessibleRole(AccessibleRole.DATE_PICKER);
    setEditable(true);
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:6,代码来源:JFXTimePicker.java



注:本文中的javafx.scene.AccessibleRole类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BaseProjectWizardFields类代码示例发布时间:2022-05-22
下一篇:
Java ClobDataID类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap