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


Java BehaviorBase类代码示例

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


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

示例1: inject

import com.sun.javafx.scene.control.behavior.BehaviorBase; //导入依赖的package包/类
/**
 * Injects the given {@link BehaviorBase behavior} into the given
 * {@link BehaviorSkinBase skin} by using reflection.
 * 
 * @param pSkin the {@link BehaviorSkinBase skin}.
 * @param pBehavior the {@link BehaviorBase behavior} to inject.
 */
public static void inject(BehaviorSkinBase<?, ?> pSkin, BehaviorBase<?> pBehavior)
{
	try
	{
		Field behaviorField = BehaviorSkinBase.class.getDeclaredField("behavior");
		behaviorField.setAccessible(true);
		
		// The old behavior needs to be properly disposed, otherwise
		// the new behavior will not work at all.
		BehaviorBase<?> oldBehavior = (BehaviorBase<?>)behaviorField.get(pSkin);
		oldBehavior.dispose();
		
		behaviorField.set(pSkin, pBehavior);
	}
	catch (Exception e)
	{
		// TODO Injection failed, should be inform the user/client?
		e.printStackTrace();
	}
}
 
开发者ID:ivartanian,项目名称:JVx.javafx,代码行数:28,代码来源:FXBehaviorInjector.java

示例2: TaskProgressIndicatorSkin

import com.sun.javafx.scene.control.behavior.BehaviorBase; //导入依赖的package包/类
/***************************************************************************
 * *
 * Constructors                                                            *
 * *
 **************************************************************************/

public TaskProgressIndicatorSkin(ProgressIndicator control) {
    super(control, new BehaviorBase<>(control, Collections.emptyList()));

    this.control = control;

    // register listeners
    registerChangeListener(control.indeterminateProperty(), "INDETERMINATE");
    registerChangeListener(control.progressProperty(), "PROGRESS");
    registerChangeListener(control.visibleProperty(), "VISIBLE");
    registerChangeListener(control.parentProperty(), "PARENT");
    registerChangeListener(control.sceneProperty(), "SCENE");

    initialize();
}
 
开发者ID:fflewddur,项目名称:archivo,代码行数:21,代码来源:TaskProgressIndicatorSkin.java

示例3: StarRatingControlSkin

import com.sun.javafx.scene.control.behavior.BehaviorBase; //导入依赖的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

示例4: TagItPanelSkin

import com.sun.javafx.scene.control.behavior.BehaviorBase; //导入依赖的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

示例5: MacroBaseSkin

import com.sun.javafx.scene.control.behavior.BehaviorBase; //导入依赖的package包/类
/**
 * @param control
 */
public MacroBaseSkin(MacroControl control) {
	this(control, new BehaviorBase<MacroControl>(control, DATE_CELL_BINDINGS) {

		/*
		 * 이벤트 함수정의
		 *
		 * (non-Javadoc)
		 * 
		 * @see
		 * com.sun.javafx.scene.control.behavior.BehaviorBase#callAction(
		 * java.lang.String)
		 */
		@Override
		protected void callAction(String name) {
			LOGGER.debug("callAction : {} ", name);
			switch (name) {
			case "Clipboard":
				getControl().tbResultOnKeyReleased();
				break;
			}

		}

	});

}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:30,代码来源:MacroBaseSkin.java

示例6: JFXSpinnerSkin

import com.sun.javafx.scene.control.behavior.BehaviorBase; //导入依赖的package包/类
public JFXSpinnerSkin(JFXSpinner control) {
    super(control, new BehaviorBase<JFXSpinner>(control, Collections.emptyList()));

    this.control = control;

    blueColor = Color.valueOf("#4285f4");
    redColor = Color.valueOf("#db4437");
    yellowColor = Color.valueOf("#f4b400");
    greenColor = Color.valueOf("#0F9D58");

    arc = new Arc();
    arc.setManaged(false);
    arc.setStartAngle(0);
    arc.setLength(180);
    arc.getStyleClass().setAll("arc");
    arc.setFill(Color.TRANSPARENT);
    arc.setStrokeWidth(3);

    fillRect = new Rectangle();
    fillRect.setFill(Color.TRANSPARENT);
    text = new Text();
    text.getStyleClass().setAll("text", "percentage");
    final Group group = new Group(fillRect, arc, text);
    group.setManaged(false);
    arcPane = new StackPane(group);
    arcPane.setPrefSize(50, 50);
    getChildren().setAll(arcPane);

    // register listeners
    registerChangeListener(control.indeterminateProperty(), "INDETERMINATE");
    registerChangeListener(control.progressProperty(), "PROGRESS");
    registerChangeListener(control.visibleProperty(), "VISIBLE");
    registerChangeListener(control.parentProperty(), "PARENT");
    registerChangeListener(control.sceneProperty(), "SCENE");
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:36,代码来源:JFXSpinnerSkin.java

示例7: SunburstViewSkin

import com.sun.javafx.scene.control.behavior.BehaviorBase; //导入依赖的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: PropertySheetSkin

import com.sun.javafx.scene.control.behavior.BehaviorBase; //导入依赖的package包/类
public PropertySheetSkin(PropertySheet control) {
    super(control, new BehaviorBase<>(control, Collections.emptyList()));

    getChildren().add(accordion);

    control.getItems().addListener((ListChangeListener.Change<? extends PropertySheet.Item> change) -> updatePropertySheetContainer());
}
 
开发者ID:acmi,项目名称:xdat_editor,代码行数:8,代码来源:PropertySheetSkin.java

示例9: TagControlSkin

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