本文整理汇总了Java中com.jfoenix.controls.JFXToggleButton类的典型用法代码示例。如果您正苦于以下问题:Java JFXToggleButton类的具体用法?Java JFXToggleButton怎么用?Java JFXToggleButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JFXToggleButton类属于com.jfoenix.controls包,在下文中一共展示了JFXToggleButton类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import com.jfoenix.controls.JFXToggleButton; //导入依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
final VBox pane = new VBox();
pane.setSpacing(30);
pane.setStyle("-fx-background-color:#EEE; -fx-padding: 40;");
ToggleButton button = new ToggleButton("JavaFx Toggle");
pane.getChildren().add(button);
JFXToggleButton toggleButton = new JFXToggleButton();
toggleButton.setText("New Skin");
pane.getChildren().add(toggleButton);
JFXToggleNode node = new JFXToggleNode();
final GlyphIcon heartIcon = GlyphsBuilder.create(FontAwesomeIconView.class)
.glyph(FontAwesomeIcon.HEART)
.build();
heartIcon.setStyle("-fx-padding: 10");
node.setGraphic(heartIcon);
pane.getChildren().add(node);
final Scene scene = new Scene(pane, 600, 400, Color.valueOf("#EEE"));
stage.setTitle("JFX Toggle Button Demo ");
scene.getStylesheets()
.add(ToggleButtonDemo.class.getResource("/css/jfoenix-components.css").toExternalForm());
stage.setScene(scene);
stage.setResizable(false);
stage.show();
}
示例2: updateToggleTransition
import com.jfoenix.controls.JFXToggleButton; //导入依赖的package包/类
private void updateToggleTransition() {
transition = new Timeline(
new KeyFrame(
Duration.ZERO,
new KeyValue(circleContainer.translateXProperty(),
-(line.getLayoutBounds().getWidth() / 2) + circleRadius,
Interpolator.EASE_BOTH),
new KeyValue(line.strokeProperty(),
((JFXToggleButton) getSkinnable()).getUnToggleLineColor(),
Interpolator.EASE_BOTH),
new KeyValue(circle.fillProperty(),
((JFXToggleButton) getSkinnable()).getUnToggleColor(),
Interpolator.EASE_BOTH)
),
new KeyFrame(
Duration.millis(100),
new KeyValue(circleContainer.translateXProperty(),
(line.getLayoutBounds().getWidth() / 2) - circleRadius,
Interpolator.EASE_BOTH),
new KeyValue(line.strokeProperty(),
((JFXToggleButton) getSkinnable()).getToggleLineColor(),
Interpolator.EASE_BOTH),
new KeyValue(circle.fillProperty(),
((JFXToggleButton) getSkinnable()).getToggleColor(),
Interpolator.EASE_BOTH)
)
);
}
示例3: flipToggleAction
import com.jfoenix.controls.JFXToggleButton; //导入依赖的package包/类
@FXML
protected void flipToggleAction(ActionEvent ev)
{
flipActive = ((JFXToggleButton)ev.getSource()).isSelected();
}
示例4: renderMainAction
import com.jfoenix.controls.JFXToggleButton; //导入依赖的package包/类
@FXML
protected void renderMainAction(ActionEvent e) {
renderMainActive = ((JFXToggleButton)e.getSource()).isSelected();
}
示例5: renderAlphaAction
import com.jfoenix.controls.JFXToggleButton; //导入依赖的package包/类
@FXML
protected void renderAlphaAction(ActionEvent e) {
renderAlphaActive = ((JFXToggleButton)e.getSource()).isSelected();
}
示例6: renderBetaAction
import com.jfoenix.controls.JFXToggleButton; //导入依赖的package包/类
@FXML
protected void renderBetaAction(ActionEvent e) {
renderBetaActive = ((JFXToggleButton)e.getSource()).isSelected();
}
示例7: getOrientation
import com.jfoenix.controls.JFXToggleButton; //导入依赖的package包/类
/**
* @return the orientation
*/
public JFXToggleButton getOrientation() {
return orientation;
}
示例8: setOrientation
import com.jfoenix.controls.JFXToggleButton; //导入依赖的package包/类
/**
* @param orientation the orientation to set
*/
public void setOrientation(JFXToggleButton orientation) {
this.orientation = orientation;
}
示例9: setMarryttsToggle
import com.jfoenix.controls.JFXToggleButton; //导入依赖的package包/类
/**
* @param marryttsToggle the marryttsToggle to set
*/
public void setMarryttsToggle(JFXToggleButton marryttsToggle) {
this.marryttsToggle = marryttsToggle;
}
示例10: setStylesheet
import com.jfoenix.controls.JFXToggleButton; //导入依赖的package包/类
public void setStylesheet(JFXToggleButton b, String cssFile) {
b.getStylesheets().clear();
b.getStylesheets().add(getClass().getResource(cssFile).toExternalForm());
}
示例11: updateCircle
import com.jfoenix.controls.JFXToggleButton; //导入依赖的package包/类
private void updateCircle() {
circle.setFill(getSkinnable().isSelected() ? ((JFXToggleButton) getSkinnable()).getToggleColor() : ((JFXToggleButton) getSkinnable())
.getUnToggleColor());
}
示例12: updateLine
import com.jfoenix.controls.JFXToggleButton; //导入依赖的package包/类
private void updateLine() {
line.setStroke(getSkinnable().isSelected() ? ((JFXToggleButton) getSkinnable()).getToggleLineColor() : ((JFXToggleButton) getSkinnable())
.getUnToggleLineColor());
}
示例13: getMarryTTSToggle
import com.jfoenix.controls.JFXToggleButton; //导入依赖的package包/类
/**
* Gets the marry TTS toggle.
*
* @return The toggle which is for enabling/disabling text to speech
* recognition
*/
public JFXToggleButton getMarryTTSToggle() {
return marryttsToggle;
}