本文整理匯總了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);
}
}
示例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();
}
示例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;
}
};
}
示例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;
}
示例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);
}
}
}
示例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);
});
}
示例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;
}
示例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();
}
示例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);
}
}
}
示例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();
}
示例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);
}
}
示例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);
}
}
示例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();
}
}
示例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;
}
示例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;
}