当前位置: 首页>>代码示例>>Java>>正文


Java KeyBinding类代码示例

本文整理汇总了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;
}
 
开发者ID:XDean,项目名称:JavaFX-EX,代码行数:29,代码来源:UndoRedoKey.java

示例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());
}
 
开发者ID:Vidada-Project,项目名称:vidada-desktop,代码行数:28,代码来源:StarRatingControlSkin.java

示例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();
}
 
开发者ID:Vidada-Project,项目名称:vidada-desktop,代码行数:20,代码来源:TagItPanelSkin.java

示例4: AutoFillTextBoxBehavior

import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
public AutoFillTextBoxBehavior(AutoFillTextBox<T> textBox, List<KeyBinding> keys) {
    super(textBox, keys);
}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:4,代码来源:AutoFillTextBoxBehavior.java

示例5: createKeyBindings

import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
protected List<KeyBinding> createKeyBindings() {
    return DOUBLESLIDER_BINDINGS;
}
 
开发者ID:epigenome,项目名称:iTagPlot,代码行数:4,代码来源:DoubleSliderBehavior.java

示例6: createKeyBindings

import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
@Override protected List<KeyBinding> createKeyBindings() 
{		
	return KEY_BINDINGS;
}
 
开发者ID:ThibaudL,项目名称:GitHubProjectManagement,代码行数:5,代码来源:ListSpinnerBehavior.java

示例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();
}
 
开发者ID:IsNull,项目名称:SunburstJ,代码行数:22,代码来源:SunburstViewSkin.java

示例8: SlideCheckBoxBehavior

import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
public SlideCheckBoxBehavior(final C button, final List<KeyBinding> bindings) {
    super(button, bindings);
}
 
开发者ID:HanSolo,项目名称:JFX8CustomControls,代码行数:4,代码来源:SlideCheckBoxBehavior.java

示例9: createKeyBindings

import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
@Override protected List<KeyBinding> createKeyBindings() {
    return DOUBLESLIDER_BINDINGS;
}
 
开发者ID:obdq,项目名称:obdq,代码行数:4,代码来源:DoubleSliderBehavior.java

示例10: getKeyBindingList

import com.sun.javafx.scene.control.behavior.KeyBinding; //导入依赖的package包/类
public List<KeyBinding> getKeyBindingList() {
    return keyBindingList;
}
 
开发者ID:ewidgetfx,项目名称:ewidgetfx,代码行数:4,代码来源:TileSelector.java

示例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();
}
 
开发者ID:Vidada-Project,项目名称:vidada-desktop,代码行数:38,代码来源:TagControlSkin.java


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