本文整理匯總了Java中javafx.scene.control.Accordion類的典型用法代碼示例。如果您正苦於以下問題:Java Accordion類的具體用法?Java Accordion怎麽用?Java Accordion使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Accordion類屬於javafx.scene.control包,在下文中一共展示了Accordion類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import javafx.scene.control.Accordion; //導入依賴的package包/類
@Override
public void init(SensorThingsService service, FeatureOfInterest entity, GridPane gridProperties, Accordion accordionLinks, Label labelId, boolean editable) {
this.labelId = labelId;
this.entity = entity;
int i = 0;
textName = addFieldTo(gridProperties, i, "Name", new TextField(), false, editable);
textDescription = addFieldTo(gridProperties, ++i, "Description", new TextArea(), true, editable);
textEncodingType = addFieldTo(gridProperties, ++i, "EncodingType", new TextField(), false, editable);
textFeature = addFieldTo(gridProperties, ++i, "Feature", new TextArea(), false, editable);
if (accordionLinks != null) {
try {
TitledPane tp = new TitledPane("Observations", createCollectionPaneFor(entity.observations().query()));
accordionLinks.getPanes().add(tp);
} catch (NullPointerException e) {
// Happens when entity is new.
}
}
}
示例2: bind
import javafx.scene.control.Accordion; //導入依賴的package包/類
public void bind(final Accordion accordion, final String propertyName) {
Object selectedPane = props.getProperty(propertyName);
for (TitledPane tp : accordion.getPanes()) {
if (tp.getText() != null && tp.getText().equals(selectedPane)) {
accordion.setExpandedPane(tp);
break;
}
}
accordion.expandedPaneProperty().addListener(new ChangeListener<TitledPane>() {
@Override
public void changed(ObservableValue<? extends TitledPane> ov, TitledPane t, TitledPane expandedPane) {
if (expandedPane != null) {
props.setProperty(propertyName, expandedPane.getText());
}
}
});
}
示例3: EventAccoridion
import javafx.scene.control.Accordion; //導入依賴的package包/類
public EventAccoridion(EditEventable manager, String name, Button... addedButtons) {
this.name = name;
this.manager = manager;
pane = new BorderPane();
accordion = new Accordion();
initializeButtons(addedButtons);
pane.setBottom(buttons);
pane.setCenter(accordion);
tiles = new ArrayList<>();
generateTiles(1);
this.setText(name);
this.setContent(pane);
this.setClosable(false);
}
示例4: createObject
import javafx.scene.control.Accordion; //導入依賴的package包/類
protected Object createObject(double width, double height, int panes_num, Double content_width, Double content_height) {
Accordion accordion = new Accordion();
for (int i = 0; i < panes_num; i++) {
Label label = new Label("Pane " + i + " Content");
label.setAlignment(Pos.TOP_LEFT);
if (content_width != null && content_height != null) {
label.setPrefSize(content_width, content_height);
label.setMinSize(content_width, content_height);
label.setMaxSize(content_width, content_height);
}
TitledPane titled_pane = new TitledPane("Pane " + i, label);
accordion.getPanes().add(titled_pane);
}
accordion.setMaxSize(width, height);
accordion.setPrefSize(width, height);
accordion.setStyle("-fx-border-color: darkgray;");
return accordion;
}
示例5: initVars
import javafx.scene.control.Accordion; //導入依賴的package包/類
public void initVars(City city,Accordion accordion) {
this.city = city;
this.accordion = accordion;
factoryPanes = new HashMap<>();
inFocus = 0;
accordion.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
Platform.runLater(new Runnable() {
@Override
public void run() {
inFocus = accordion.getPanes().indexOf(accordion.getExpandedPane());
}
});
}
});
}
示例6: createConferences
import javafx.scene.control.Accordion; //導入依賴的package包/類
private Accordion createConferences() {
Accordion accordion = new Accordion();
final TitledPane india = createConference("JavaOne India", 17.385371, 78.484268, "http://steveonjava.com/wp-content/uploads/2011/03/javaone-india.png");
accordion.getPanes().add(india);
accordion.getPanes().add(createConference("OSCON", 45.515008, -122.693253, "http://steveonjava.com/wp-content/uploads/2011/05/oscon.png"));
accordion.getPanes().add(createConference("Devoxx", 51.206883, 4.44, "http://steveonjava.com/wp-content/uploads/2010/07/LogoDevoxxNeg150.png"));
accordion.getPanes().add(createConference("J-Fall", 52.219913, 5.474253, "http://steveonjava.com/wp-content/uploads/2011/11/jfall3.png"));
accordion.getPanes().add(createConference("JavaOne SF", 37.775057, -122.416534, "http://steveonjava.com/wp-content/uploads/2010/07/JavaOne-2010-Speaker.png"));
accordion.getPanes().add(createConference("Jazoon", 47.382079, 8.528137, "http://steveonjava.com/wp-content/uploads/2010/04/jazoon.png"));
accordion.getPanes().add(createConference("GeeCON", 50.064633, 19.949799, "http://steveonjava.com/wp-content/uploads/2011/03/geecon.png"));
india.setExpanded(true);
accordion.setExpandedPane(india);
accordion.expandedPaneProperty().addListener((ObservableValue<? extends TitledPane> ov, TitledPane t, TitledPane t1) -> {
if (t1 != null) {
((ConferencePane) t1).navigateTo();
}
});
return accordion;
}
示例7: AccordionSample
import javafx.scene.control.Accordion; //導入依賴的package包/類
public AccordionSample() {
super(150,150);
TitledPane t1 = new TitledPane("Node 1", new Button("Button"));
TitledPane t2 = new TitledPane("Node 2", new Text("String"));
TitledPane t3 = new TitledPane("Node 3", new Rectangle(120,50, Color.RED));
Accordion accordion = new Accordion();
accordion.getPanes().add(t1);
accordion.getPanes().add(t2);
accordion.getPanes().add(t3);
getChildren().add(accordion);
}
示例8: start
import javafx.scene.control.Accordion; //導入依賴的package包/類
@Override public void start(Stage stage) {
stage.setTitle("TitledPane");
Scene scene = new Scene(new Group(), 450, 250);
TitledPane gridTitlePane = new TitledPane();
GridPane grid = new GridPane();
grid.setVgap(4);
grid.setPadding(new Insets(5, 5, 5, 5));
grid.add(new Label("First Name: "), 0, 0);
grid.add(new TextField(), 1, 0);
grid.add(new Label("Last Name: "), 0, 1);
grid.add(new TextField(), 1, 1);
grid.add(new Label("Email: "), 0, 2);
grid.add(new TextField(), 1, 2);
grid.add(new Label("Attachment: "), 0, 3);
grid.add(label,1, 3);
gridTitlePane.setText("Grid");
gridTitlePane.setContent(grid);
final Accordion accordion = new Accordion ();
for (int i = 0; i < imageNames.length; i++) {
images[i] =
new Image(getClass().getResourceAsStream(imageNames[i]+".jpg"));
pics[i] = new ImageView(images[i]);
tps[i] = new TitledPane(imageNames[i],pics[i]);
}
accordion.getPanes().addAll(tps);
accordion.expandedPaneProperty().addListener(
(ObservableValue<? extends TitledPane> ov, TitledPane old_val,
TitledPane new_val) -> {
if (new_val != null) {
label.setText(accordion.getExpandedPane().getText()
+ ".jpg");
}
});
HBox hbox = new HBox(10);
hbox.setPadding(new Insets(20, 0, 0, 20));
hbox.getChildren().setAll(gridTitlePane, accordion);
Group root = (Group)scene.getRoot();
root.getChildren().add(hbox);
stage.setScene(scene);
stage.show();
}
示例9: fillAccordion
import javafx.scene.control.Accordion; //導入依賴的package包/類
@Override
protected void fillAccordion (Accordion accordion) {
myGame.getAuthorshipData().getMyCreatedSpritesMap().values().stream().forEach(c -> {
TitledPane toAdd = createAccordionPane(c);
accordion.getPanes().add(toAdd);
accordion.expandedPaneProperty().set(toAdd);
});
}
示例10: makeLists
import javafx.scene.control.Accordion; //導入依賴的package包/類
private Node makeLists() {
Accordion lists = new Accordion();
TitledPane games = new TitledPane();
games.setText(databaseProperties.getString("Games"));
ListView<String> actualGames = new ListView<>();
List<String> authoredGames = database.getStatsbyUser(user.getProperty(VoogaUser.USER_NAME).toString()).stream()
.map(e -> e.getProperty(StatCell.MY_GAME).toString()).collect(Collectors.toList());
actualGames.getItems().setAll(authoredGames);
actualGames.setOnMouseClicked(e -> clickList(actualGames.getSelectionModel().getSelectedItem()));
games.setContent(actualGames);
lists.getPanes().addAll(games);
lists.setPrefWidth(DATA_WIDTH * ACCORDION_SIZE_FACTOR);
return lists;
}
示例11: drawNode
import javafx.scene.control.Accordion; //導入依賴的package包/類
@Override
public Node drawNode() {
Accordion node = (Accordion) createObject();
TitledPane pane = node.getPanes().get(index);
node.setExpandedPane(pane);
if (node.getExpandedPane() != pane) {
reportGetterFailure("getExpandedPane()");
}
return node;
}
示例12: initVars
import javafx.scene.control.Accordion; //導入依賴的package包/類
public void initVars(Universe universe, Country playersCountry, Controller controller, Accordion universeAccordion){
this.universe = universe;
this.playersCountry = playersCountry;
this.controller = controller;
this.universeAccordion = universeAccordion;
}
示例13: start
import javafx.scene.control.Accordion; //導入依賴的package包/類
@Override
public void start(Stage stage) throws Exception {
ACCORDION_ACTIONS = new Accordion(giveReward(), tasks(),
history());
Label lblTitle = new Label("Rewards APP");
lblTitle.setFont(Font.font(25));
Scene scene = new Scene(new VBox(lblTitle, ACCORDION_ACTIONS), 700, 600);
stage.setScene(scene);
stage.setTitle("Rewards App!");
stage.show();
}
示例14: testAccordionControlAdjuster
import javafx.scene.control.Accordion; //導入依賴的package包/類
@Test
public void testAccordionControlAdjuster() {
Adjuster adjuster = Adjuster.getAdjuster(Accordion.class);
assertThat(adjuster, is(instanceOf(ControlAdjuster.class)));
assertThat(adjuster.getNodeClass(), is(sameInstance(Control.class)));
}
示例15: bind
import javafx.scene.control.Accordion; //導入依賴的package包/類
public void bind(final Accordion accordion, final String propertyName) {
Object selectedPane = props.getProperty(propertyName);
for (TitledPane tp : accordion.getPanes()) {
if (tp.getText() != null && tp.getText().equals(selectedPane)) {
accordion.setExpandedPane(tp);
break;
}
}
accordion.expandedPaneProperty().addListener((ov, t, expandedPane) -> {
if (expandedPane != null) {
props.setProperty(propertyName, expandedPane.getText());
}
});
}