本文整理汇总了Java中com.sun.javafx.scene.control.behavior.KeyBinding类的典型用法代码示例。如果您正苦于以下问题:Java KeyBinding类的具体用法?Java KeyBinding怎么用?Java KeyBinding使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
KeyBinding类属于com.sun.javafx.scene.control.behavior包,在下文中一共展示了KeyBinding类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: matchActionForEvent
import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
/**
* From {@code BehaviorBase}
*
* @param keyBindings
* @param e
* @return
*/
private static String matchActionForEvent(List<KeyBinding> keyBindings, KeyEvent e) {
if (e == null) {
throw new NullPointerException("KeyEvent must not be null");
}
KeyBinding match = null;
int specificity = 0;
int maxBindings = keyBindings.size();
for (int i = 0; i < maxBindings; i++) {
KeyBinding binding = keyBindings.get(i);
int s = binding.getSpecificity(null, e);
if (s > specificity) {
specificity = s;
match = binding;
}
}
String action = null;
if (match != null) {
action = match.getAction();
}
return action;
}
示例2: StarRatingControlSkin
import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
/**
* Creates a new StarRatingControlSkin
* @param control
*/
public StarRatingControlSkin(final StarRatingControl control) {
super(control, new BehaviorBase<>(control, Collections.<KeyBinding>emptyList()));
HBox stars = createStarPane();
HBox disabledStars = createStarPane(CSS_STYLE_INACITVE);
stars.setMaxWidth(radius * 10);
disabledStars.setMaxWidth(radius * 10);
stars.setClip(rectangle);
layout.getChildren().addAll(disabledStars, stars);
getChildren().clear();
getChildren().add(layout);
rectangle.widthProperty().bind(
Bindings.when(control.ratingProperty().isEqualTo(0.0, 0.0))
.then(0.0)
.otherwise(control.ratingProperty().multiply(stars.widthProperty())
)
);
rectangle.heightProperty().bind(disabledStars.heightProperty());
}
示例3: TagItPanelSkin
import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
/**
* Creates a new TagItControlSkin
* @param control
*/
public TagItPanelSkin(TagItPanel<T> control) {
super(control, new BehaviorBase<>(control, Collections.<KeyBinding> emptyList()));
getChildren().add(layout);
control.getTags().addListener(tagsChangedListener);
registerChangeListener(control.suggestionProviderProperty(), "SUGGESTION_PROVIDER");
registerChangeListener(control.editableProperty(), "EDITABLE");
layout.setColumnHalignment(HPos.LEFT);
layout.setRowValignment(VPos.CENTER);
layout.setVgap(5);
layout.setHgap(5);
layoutTags();
}
示例4: AutoFillTextBoxBehavior
import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
public AutoFillTextBoxBehavior(AutoFillTextBox<T> textBox, List<KeyBinding> keys) {
super(textBox, keys);
}
示例5: createKeyBindings
import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
protected List<KeyBinding> createKeyBindings() {
return DOUBLESLIDER_BINDINGS;
}
示例6: createKeyBindings
import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
@Override protected List<KeyBinding> createKeyBindings()
{
return KEY_BINDINGS;
}
示例7: SunburstViewSkin
import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
/**
* Creates a new SunburstViewSkin
* @param control
*/
public SunburstViewSkin(final SunburstView<T> control) {
super(control, new BehaviorBase<>(control, Collections.<KeyBinding> emptyList()));
control.rootItemProperty().addListener(x -> updateRootModel());
control.selectedItemProperty().addListener(x -> updateSelectedItem());
control.colorStrategy().addListener(x -> updateRootModel());
control.maxDeepness().addListener(x -> updateRootModel());
getChildren().clear();
getChildren().addAll(sunburst);
center = new SunburstCenter();
updateRootModel();
}
示例8: SlideCheckBoxBehavior
import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
public SlideCheckBoxBehavior(final C button, final List<KeyBinding> bindings) {
super(button, bindings);
}
示例9: createKeyBindings
import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
@Override protected List<KeyBinding> createKeyBindings() {
return DOUBLESLIDER_BINDINGS;
}
示例10: getKeyBindingList
import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
public List<KeyBinding> getKeyBindingList() {
return keyBindingList;
}
示例11: TagControlSkin
import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
public TagControlSkin(final TagControl control) {
super(control, new BehaviorBase<>(control, Collections.<KeyBinding> emptyList()));
layout = new HBox();
tagCircle = new Circle();
tagCircle.setRadius(4);
tagCircle.setId("tag-dot");
tagname = new Label("Cool");
tagname.setAlignment(Pos.CENTER);
tagRemoveButton.getStyleClass().add("remove-button");
//layout.setSpacing(5);
layout.setAlignment(Pos.CENTER);
HBox.setMargin(tagCircle, new Insets(0,2,0,3)); spaceing += 5;
layout.getChildren().addAll(tagCircle, tagname);
getChildren().add(layout);
// register listeners
registerChangeListener(control.tagProperty(), "TAG");
registerChangeListener(control.removableProperty(), "REMOVABLE");
tagRemoveButton.setOnMouseClicked(me -> {
control.fireEvent(new RemovedActionEvent());
me.consume();
});
layout.setOnMouseClicked(me -> control.fireEvent(new ActionEvent()));
updateRemoveButton();
updateView();
}