當前位置: 首頁>>代碼示例>>Java>>正文


Java Skin類代碼示例

本文整理匯總了Java中javafx.scene.control.Skin的典型用法代碼示例。如果您正苦於以下問題:Java Skin類的具體用法?Java Skin怎麽用?Java Skin使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Skin類屬於javafx.scene.control包,在下文中一共展示了Skin類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createDefaultSkin

import javafx.scene.control.Skin; //導入依賴的package包/類
@Override protected Skin createDefaultSkin() {
    switch(skinType) {
        case YOTA2     : return new ClockSkin(Clock.this);
        case LCD       : return new LcdClockSkin(Clock.this);
        case PEAR      : return new PearClockSkin(Clock.this);
        case PLAIN     : return new PlainClockSkin(Clock.this);
        case DB        : return new DBClockSkin(Clock.this);
        case FAT       : return new FatClockSkin(Clock.this);
        case ROUND_LCD : return new RoundLcdClockSkin(Clock.this);
        case SLIM      : return new SlimClockSkin(Clock.this);
        case MINIMAL   : return new MinimalClockSkin(Clock.this);
        case DIGITAL   : return new DigitalClockSkin(Clock.this);
        case TEXT      : return new TextClockSkin(Clock.this);
        case DESIGN    : return new DesignClockSkin(Clock.this);
        case INDUSTRIAL: return new IndustrialClockSkin(Clock.this);
        case TILE      : return new TileClockSkin(Clock.this);
        case DIGI      : return new DigitalClockSkin(Clock.this);
        case CLOCK     :
        default        : return new ClockSkin(Clock.this);
    }
}
 
開發者ID:HanSolo,項目名稱:Medusa,代碼行數:22,代碼來源:Clock.java

示例2: FGauge

import javafx.scene.control.Skin; //導入依賴的package包/類
public FGauge(final Gauge GAUGE, final GaugeDesign DESIGN, final GaugeBackground BACKGROUND) {
    getStylesheets().add(getClass().getResource("framed-gauge.css").toExternalForm());
    getStyleClass().setAll("framed-gauge");
    gauge           = GAUGE;
    gaugeDesign     = DESIGN;
    gaugeBackground = BACKGROUND;

    Skin skin = gauge.getSkin();
    if (null != skin && gauge.getSkin().getClass() != GaugeSkin.class) {
        throw new RuntimeException("Please change Skin to GaugeSkin.");
    }

    init();
    initGraphics();
    registerListeners();
}
 
開發者ID:HanSolo,項目名稱:Medusa,代碼行數:17,代碼來源:FGauge.java

示例3: createDefaultSkin

import javafx.scene.control.Skin; //導入依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
protected Skin<?> createDefaultSkin() {
    return new BreadCrumbBarSkin<T>(this) {

        @Override
        protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) {
            double width = 0;
            for (Node node : getChildren()) {
                if (node instanceof BreadCrumbButton) {
                    width = width - ((BreadCrumbButton) node).getArrowWidth();
                }
                width += node.prefWidth(-1);
            }
            if (!getChildren().isEmpty()){
                width = width + ((BreadCrumbButton) getChildren().get(0)).getArrowWidth();
            }
            return width;
        }

    };
}
 
開發者ID:factoryfx,項目名稱:factoryfx,代碼行數:25,代碼來源:BreadCrumbBarWidthFixed.java

示例4: createDefaultSkin

import javafx.scene.control.Skin; //導入依賴的package包/類
@Override
protected Skin<?> createDefaultSkin() {

    Skin<?> defaultSkin = super.createDefaultSkin();
    getChildren().add(0, g);
    widthProperty().addListener(e -> {
        baseLine.setStartX(10);
        baseLine.setEndX(getWidth() - 10);

    });
    animationLine.setStroke(Color.web(Theme.BlueGreen.ACCENT_COLOR));
    animationLine.setStrokeWidth(3f);
    //   animationLine.setStroke(Color.web(Theme.BlueGreen.ACCENT_COLOR));

    return defaultSkin;
}
 
開發者ID:Tareq-SiSalem,項目名稱:JFXMaterial,代碼行數:17,代碼來源:TextInput.java

示例5: selectFirstSuggestion

import javafx.scene.control.Skin; //導入依賴的package包/類
private static void selectFirstSuggestion(AutoCompletePopup<?> autoCompletionPopup) {
  Skin<?> skin = autoCompletionPopup.getSkin();
  if (skin instanceof AutoCompletePopupSkin) {
    AutoCompletePopupSkin<?> au = (AutoCompletePopupSkin<?>) skin;
    ListView<?> li = (ListView<?>) au.getNode();
    if (li.getItems() != null && !li.getItems().isEmpty()) {
      li.getSelectionModel().select(0);
    }
  }
}
 
開發者ID:XDean,項目名稱:CSS-Editor-FX,代碼行數:11,代碼來源:AutoCompletionCodeAreaBind.java

示例6: print

import javafx.scene.control.Skin; //導入依賴的package包/類
void print(List<Node> controls) {

		System.out.println("#### 컨트롤 개수 ####");
		System.out.println(controls.size());

		controls.forEach(n -> {
			if (n instanceof Control) {
				Skin<?> skin = ((Control) n).getSkin();
				System.out.println("skin : " + skin);
				n.getPseudoClassStates();
			}
			System.out.println(n);

		});
	}
 
開發者ID:callakrsos,項目名稱:Gargoyle,代碼行數:16,代碼來源:ComponentClassifier.java

示例7: createDefaultSkin

import javafx.scene.control.Skin; //導入依賴的package包/類
@Override
protected Skin<?> createDefaultSkin() {

	MacroBaseSkin macroBaseSkin = new MacroBaseSkin(this);
	macroBaseSkin.setInitText(this.initText);
	
	//쿼리 실행시 로깅
	macroBaseSkin.setOnExecutedQuery(str ->{
		LOGGER.debug(str);
	});
	
	//쿼리 실행결과 로깅
	macroBaseSkin.setOnQueryDataUpdated((index, t) -> LOGGER.debug("{}, {}", index, t.toString()));
	return macroBaseSkin;
}
 
開發者ID:callakrsos,項目名稱:Gargoyle,代碼行數:16,代碼來源:MacroControl.java

示例8: stop

import javafx.scene.control.Skin; //導入依賴的package包/類
/**
 * 매크로 동작을 멈춘다.
 *
 * @작성자 : KYJ
 * @작성일 : 2016. 8. 30.
 * @return
 */
public boolean stop() {
	Skin<?> skin = this.getSkin();
	if (!(skin instanceof MacroBaseSkin)) {
		return false;
	}
	MacroBaseSkin mskin = (MacroBaseSkin) skin;
	return mskin.stop();
}
 
開發者ID:callakrsos,項目名稱:Gargoyle,代碼行數:16,代碼來源:MacroControl.java

示例9: selectFirstSuggestion

import javafx.scene.control.Skin; //導入依賴的package包/類
/**
 * Selects the first suggestion (if any), so the user can choose it by
 * pressing enter immediately.
 */
private void selectFirstSuggestion(AutoCompletePopup<?> autoCompletionPopup) {
	Skin<?> skin = autoCompletionPopup.getSkin();
	if (skin instanceof AutoCompletePopupSkin) {
		AutoCompletePopupSkin<?> au = (AutoCompletePopupSkin<?>) skin;
		ListView<?> li = (ListView<?>) au.getNode();
		if (li.getItems() != null && !li.getItems().isEmpty()) {
			li.getSelectionModel().select(0);
		}
	}
}
 
開發者ID:callakrsos,項目名稱:Gargoyle,代碼行數:15,代碼來源:AbstractFxVoAutoCompletionBinding.java

示例10: start

import javafx.scene.control.Skin; //導入依賴的package包/類
@Override
public void start(Stage primaryStage) throws Exception {
	Agenda agenda = new Agenda() {
		@Override
		public Skin<?> createDefaultSkin() {
			return new AgendaDaysFromDisplayedSkin(this);
		}
	};

	// setup appointment groups
	final Map<String, Agenda.AppointmentGroup> lAppointmentGroupMap = new TreeMap<String, Agenda.AppointmentGroup>();
	for (Agenda.AppointmentGroup lAppointmentGroup : agenda.appointmentGroups()) {
		lAppointmentGroupMap.put(lAppointmentGroup.getDescription(), lAppointmentGroup);
	}

	// accept new appointments
	agenda.newAppointmentCallbackProperty().set(new Callback<Agenda.LocalDateTimeRange, Agenda.Appointment>() {
		@Override
		public Agenda.Appointment call(LocalDateTimeRange dateTimeRange) {
			return new Agenda.AppointmentImplLocal().withStartLocalDateTime(dateTimeRange.getStartLocalDateTime())
					.withEndLocalDateTime(dateTimeRange.getEndLocalDateTime()).withSummary("new").withDescription("new")
					.withAppointmentGroup(lAppointmentGroupMap.get("group01"));
		}
	});

	BorderPane root = new BorderPane(agenda);

	root.getStylesheets()
			.add(AgendaSkinSwitcher.class
					.getResource("/jfxtras/internal/scene/control/skin/agenda/" + AgendaSkinSwitcher.class.getSimpleName() + ".css")
					.toExternalForm());

	primaryStage.setScene(new Scene(root));
	primaryStage.show();
}
 
開發者ID:callakrsos,項目名稱:Gargoyle,代碼行數:36,代碼來源:AgendaExam.java

示例11: createDefaultSkin

import javafx.scene.control.Skin; //導入依賴的package包/類
@Override protected Skin createDefaultSkin() {
    switch (skinType) {
        case AMP            : return new AmpSkin(Gauge.this);
        case BULLET_CHART   : return new BulletChartSkin(Gauge.this);
        case DASHBOARD      : return new DashboardSkin(Gauge.this);
        case FLAT           : return new FlatSkin(Gauge.this);
        case INDICATOR      : return new IndicatorSkin(Gauge.this);
        case KPI            : return new KpiSkin(Gauge.this);
        case MODERN         : return new ModernSkin(Gauge.this);
        case SIMPLE         : return new SimpleSkin(Gauge.this);
        case SLIM           : return new SlimSkin(Gauge.this);
        case SPACE_X        : return new SpaceXSkin(Gauge.this);
        case QUARTER        : return new QuarterSkin(Gauge.this);
        case HORIZONTAL     : return new HSkin(Gauge.this);
        case VERTICAL       : return new VSkin(Gauge.this);
        case LCD            : return new LcdSkin(Gauge.this);
        case TINY           : return new TinySkin(Gauge.this);
        case BATTERY        : return new BatterySkin(Gauge.this);
        case LEVEL          : return new LevelSkin(Gauge.this);
        case LINEAR         : return new LinearSkin(Gauge.this);
        case DIGITAL        : return new DigitalSkin(Gauge.this);
        case SIMPLE_DIGITAL : return new SimpleDigitalSkin(Gauge.this);
        case SECTION        : return new SectionSkin(Gauge.this);
        case BAR            : return new BarSkin(Gauge.this);
        case WHITE          : return new WhiteSkin(Gauge.this);
        case CHARGE         : return new ChargeSkin(Gauge.this);
        case SIMPLE_SECTION : return new SimpleSectionSkin(Gauge.this);
        case TILE_KPI       : return new TileKpiSkin(Gauge.this);
        case TILE_TEXT_KPI  : return new TileTextKpiSkin(Gauge.this);
        case TILE_SPARK_LINE: return new TileSparklineSkin(Gauge.this);
        case GAUGE          :
        default             : return new GaugeSkin(Gauge.this);
    }
}
 
開發者ID:HanSolo,項目名稱:Medusa,代碼行數:35,代碼來源:Gauge.java

示例12: createDefaultSkin

import javafx.scene.control.Skin; //導入依賴的package包/類
@Override protected Skin createDefaultSkin() {
    switch(skinType) {
        case SWITCH: return new SwitchSkin(CustomControl.this);
        case LED   :
        default    : return new LedSkin(CustomControl.this);
    }
}
 
開發者ID:HanSolo,項目名稱:hol1634,代碼行數:8,代碼來源:CustomControl.java

示例13: updateLayout

import javafx.scene.control.Skin; //導入依賴的package包/類
@Override
public void updateLayout() {
    SegmentView.super.updateLayout();
    final Skin<?> skin = getSkin();
    if (skin != null) {
        ((JfxSegmentViewSkin) skin).redraw();
    }
}
 
開發者ID:xzel23,項目名稱:meja,代碼行數:9,代碼來源:JfxSegmentView.java

示例14: createDefaultSkin

import javafx.scene.control.Skin; //導入依賴的package包/類
@Override
protected Skin<?> createDefaultSkin() {
    final ToggleButtonSkin buttonSkin = new ToggleButtonSkin(this);
    // Adding circleRipple as fist node of button nodes to be on the bottom
    this.getChildren().add(0, circleRipple);
    return buttonSkin;
}
 
開發者ID:mars-sim,項目名稱:mars-sim,代碼行數:8,代碼來源:MaterialDesignToggleButton.java

示例15: createDefaultSkin

import javafx.scene.control.Skin; //導入依賴的package包/類
@Override
protected Skin<?> createDefaultSkin() {
    final ButtonSkin buttonSkin = new ButtonSkin(this);
    // Adding circleRipple as fist node of button nodes to be on the bottom
    this.getChildren().add(0, circleRipple);
    return buttonSkin;
}
 
開發者ID:mars-sim,項目名稱:mars-sim,代碼行數:8,代碼來源:MaterialDesignButton.java


注:本文中的javafx.scene.control.Skin類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。