Java 类javafx.scene.control.Skin 实例源码

项目:Medusa    文件:Clock.java   
@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);
    }
}
项目:Medusa    文件:FGauge.java   
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();
}
项目:factoryfx    文件:BreadCrumbBarWidthFixed.java   
/**
 * {@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;
        }

    };
}
项目:JFXMaterial    文件:TextInput.java   
@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;
}
项目:CSS-Editor-FX    文件:AutoCompletionCodeAreaBind.java   
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);
    }
  }
}
项目:Gargoyle    文件:ComponentClassifier.java   
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);

        });
    }
项目:Gargoyle    文件:MacroControl.java   
@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;
}
项目:Gargoyle    文件:MacroControl.java   
/**
 * 매크로 동작을 멈춘다.
 *
 * @작성자 : 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();
}
项目:Gargoyle    文件:AbstractFxVoAutoCompletionBinding.java   
/**
 * 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);
        }
    }
}
项目:Gargoyle    文件:AgendaExam.java   
@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();
}
项目:Medusa    文件:Gauge.java   
@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);
    }
}
项目:CSS-Editor-FX    文件:AutoCompletionCodeAreaBind.java   
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);
    }
  }
}
项目:hol1634    文件:CustomControl.java   
@Override protected Skin createDefaultSkin() {
    switch(skinType) {
        case SWITCH: return new SwitchSkin(CustomControl.this);
        case LED   :
        default    : return new LedSkin(CustomControl.this);
    }
}
项目:meja    文件:JfxSegmentView.java   
@Override
public void updateLayout() {
    SegmentView.super.updateLayout();
    final Skin<?> skin = getSkin();
    if (skin != null) {
        ((JfxSegmentViewSkin) skin).redraw();
    }
}
项目:mars-sim    文件:MaterialDesignToggleButton.java   
@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;
}
项目:mars-sim    文件:MaterialDesignButton.java   
@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;
}
项目:Cachoeira    文件:MaterialButton.java   
@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;
}
项目:javafx-widgets    文件:AutoCompletionBinding.java   
/**
 * Selects the first suggestion (if any), so the user can choose it by
 * pressing enter immediately.
 *
 * @param autoCompletionPopup
 *          the auto completion popup.
 */
private void selectFirstSuggestion(AutoCompletePopup<?> autoCompletionPopup) {
  final Skin<?> skin = autoCompletionPopup.getSkin();
  if (skin instanceof AutoCompletePopupSkin) {
    final AutoCompletePopupSkin<?> au = (AutoCompletePopupSkin<?>) skin;
    final ListView<?> li = (ListView<?>) au.getNode();
    if ((li.getItems() != null) && ! li.getItems().isEmpty()) {
      li.getSelectionModel().select(0);
    }
  }
}
项目:javafx-widgets    文件:CustomTextField.java   
@Override
protected Skin<?> createDefaultSkin() {
  return new CustomTextFieldSkin(this) {
    @Override
    public ObjectProperty<Node> leftProperty() {
      return CustomTextField.this.leftProperty();
    }

    @Override
    public ObjectProperty<Node> rightProperty() {
      return CustomTextField.this.rightProperty();
    }
  };
}
项目:javafx-widgets    文件:CustomPasswordField.java   
@Override
protected Skin<?> createDefaultSkin() {
  return new CustomTextFieldSkin(this) {
    @Override
    public ObjectProperty<Node> leftProperty() {
      return CustomPasswordField.this.leftProperty();
    }

    @Override
    public ObjectProperty<Node> rightProperty() {
      return CustomPasswordField.this.rightProperty();
    }
  };
}
项目:SONDY    文件:DataManipulationUI.java   
public final void filterUI(){
        GridPane gridLEFT = new GridPane();
        // Labels
        Label stopwordsLabel = new Label("Stop words removal");
        UIUtils.setSize(stopwordsLabel, Main.columnWidthLEFT/2, 24);
        Label resizingLabel = new Label("Resizing");
        UIUtils.setSize(resizingLabel, Main.columnWidthLEFT/2, 24);
        gridLEFT.add(stopwordsLabel,0,0);
        gridLEFT.add(new Rectangle(0,3),0,1);
        gridLEFT.add(resizingLabel,0,2);

        // Values
        stopwordLists = new StopwordSets();
        stopwordListsCheckComboBox = new CheckComboBox<>(stopwordLists.availableSets);
        stopwordListsCheckComboBox.setStyle("-fx-font-size: 12px;"); 
        stopwordListsCheckComboBox.skinProperty().addListener(new ChangeListener<Skin>() {
        @Override
        public void changed(ObservableValue<? extends Skin> observable, Skin oldValue, Skin newValue) {
             if(oldValue==null && newValue!=null){
                 CheckComboBoxSkin skin = (CheckComboBoxSkin)newValue;
                 ComboBox combo = (ComboBox)skin.getChildren().get(0);
                 combo.setPrefWidth(Main.columnWidthLEFT/2);
                 combo.setMaxWidth(Double.MAX_VALUE);
             }
        }
});
//        stopwordListsCheckComboBox.setMaxWidth(Double.MAX_VALUE);

//        UIUtils.setSize(stopwordListsCheckComboBox,Main.columnWidthLEFT/2, 24);
        gridLEFT.add(stopwordListsCheckComboBox,1,0);
        resizeSlider = new RangeSlider();
        resizeSlider.setBlockIncrement(0.1);
        UIUtils.setSize(resizeSlider,Main.columnWidthLEFT/2, 24);
        resizeSlider.resize(Main.columnWidthLEFT/2, 24);
        gridLEFT.add(resizeSlider,1,2);

        HBox filterDatasetBOTH = new HBox(5);
        filterDatasetBOTH.getChildren().addAll(gridLEFT,createFilterButton());
        grid.add(filterDatasetBOTH,0,11);
    }
项目:JFTClient    文件:JFTClient.java   
private TreeView<Node> createTree(TreeItem<Node> root) {
    return new TreeView<Node>(root) {
        @Override
        protected Skin createDefaultSkin() {
            return new CustomTreeViewSkin<>(this);
        }
    };
}
项目:SunburstJ    文件:SunburstView.java   
/**
 * Returns the color of the given item.
 * @param item The item for which the color should be returned
 * @return
 */
public Color getItemColor(WeightedTreeItem<T> item) {

    Skin<?> skin = this.getSkin();
    //System.out.println(skin);
    Color color = null;
    if(skin instanceof SunburstViewSkin){
       //System.out.println("is SunburstViewSkin");
       color =((SunburstViewSkin) skin).getItemColor(item);
    }

    return color;

}
项目:WatchlistPro    文件:ToggleButtonStyler.java   
@Override public void style(final ToggleButton button) {
    super.style(button);
    button.setSkin(new AquaToggleButtonSkin(button));
    Skin<?> skin = button.getSkin();
    if (skin != null && skin instanceof AquaButtonSkin) {
        ((AquaButtonSkin) skin).iconProperty().setValue(icon);
    }
}
项目:WatchlistPro    文件:ButtonStyler.java   
@Override public void style(final Button button) {
    super.style(button);
    button.setSkin(new AquaButtonSkin(button));
    Skin<?> skin = button.getSkin();
    if (skin != null && skin instanceof AquaButtonSkin) {
        ((AquaButtonSkin) skin).iconProperty().setValue(icon);
    }
}
项目:WatchlistPro    文件:AquaTextFieldSkin.java   
@Override public boolean isSettable(TextField n) {
    Skin<?> skin = n.getSkin();
    if (skin != null && skin instanceof AquaTextFieldSkin) {
        return ((AquaTextFieldSkin) skin).showSearchIcon == null || !((AquaTextFieldSkin) skin).showSearchIcon.isBound();
    }
    return false;
}
项目:WatchlistPro    文件:AquaTextFieldSkin.java   
@SuppressWarnings("unchecked") @Override public StyleableProperty<Boolean> getStyleableProperty(TextField n) {
    Skin<?> skin = n.getSkin();
    if (skin != null && skin instanceof AquaTextFieldSkin) {
        return (StyleableProperty<Boolean>) ((AquaTextFieldSkin) skin).showSearchIconProperty();
    }
    return null;
}
项目:WatchlistPro    文件:AquaButtonSkin.java   
@Override public boolean isSettable(Button n) {
    Skin<?> skin = n.getSkin();
    if (skin != null && skin instanceof AquaButtonSkin) {
        return ((AquaButtonSkin) skin).icon == null || !((AquaButtonSkin) skin).icon.isBound();
    }
    return false;
}
项目:WatchlistPro    文件:AquaButtonSkin.java   
@SuppressWarnings("unchecked") @Override public StyleableProperty<MacOSDefaultIcons> getStyleableProperty(Button n) {
    Skin<?> skin = n.getSkin();
    if (skin != null && skin instanceof AquaButtonSkin) {
        return (StyleableProperty<MacOSDefaultIcons>) ((AquaButtonSkin) skin).iconProperty();
    }
    return null;
}
项目:FEFEditor    文件:ToggleSwitch.java   
/** {@inheritDoc} */
@Override protected Skin<?> createDefaultSkin() {
    return new ToggleSwitchSkin(this);
}
项目:EC_GroupProj_CSC143    文件:FXSpace.java   
/**
 * Don't worry about this, it's necessary but useless.
 */
@Override
protected Skin<FXSpace> createDefaultSkin() {
    return new FXSpaceSkin(this);
}
项目:fxutils    文件:EditableLabel.java   
@Override
protected Skin<?> createDefaultSkin() { 
    return new EditableLabelSkin(this); 
}
项目:dynamo    文件:Switch.java   
@Override protected Skin<?> createDefaultSkin() {
    return new SwitchSkin(this);
}
项目:dynamo    文件:Load.java   
@Override protected Skin<?> createDefaultSkin() {
    return new LoadSkin(this);
}
项目:dynamo    文件:LevelBar.java   
@Override protected Skin<?> createDefaultSkin() {
    return new LevelBarSkin(this);
}
项目:dynamo    文件:Transformer.java   
@Override protected Skin<?> createDefaultSkin() {
    return new TransformerSkin(this);
}
项目:dynamo    文件:Alarm.java   
@Override protected Skin<?> createDefaultSkin() {
    return new AlarmSkin(this);
}
项目:dynamo    文件:Display.java   
@Override protected Skin<?> createDefaultSkin() {
    return new DisplaySkin(this);
}
项目:dynamo    文件:Generator.java   
@Override protected Skin<?> createDefaultSkin() {
    return new GeneratorSkin(this);
}
项目:CalendarFX    文件:IntroPane.java   
@Override
protected Skin<?> createDefaultSkin() {
    return new IntroPaneSkin(this);
}