当前位置: 首页>>代码示例>>Java>>正文


Java Accordion类代码示例

本文整理汇总了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.
        }
    }
}
 
开发者ID:hylkevds,项目名称:SensorThingsManager,代码行数:20,代码来源:EntityGuiController.java

示例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());
            }
        }
    });
}
 
开发者ID:comtel2000,项目名称:mokka7,代码行数:19,代码来源:SessionManager.java

示例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);
}
 
开发者ID:sjain28,项目名称:Game-Engine-Vooga,代码行数:18,代码来源:EventAccoridion.java

示例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;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:19,代码来源:AccordionApp.java

示例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());
				}
			});
		}
	});
}
 
开发者ID:pirocks,项目名称:sem2-final-project,代码行数:18,代码来源:CityAccordion.java

示例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;
}
 
开发者ID:ewidgetfx,项目名称:ewidgetfx,代码行数:20,代码来源:ConferenceTour.java

示例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);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:12,代码来源:AccordionSample.java

示例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();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:49,代码来源:TitledPaneSample.java

示例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);
    });
}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:9,代码来源:AuthoringSideBar.java

示例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;
}
 
开发者ID:sjain28,项目名称:Game-Engine-Vooga,代码行数:15,代码来源:DataBaseDisplay.java

示例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;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:11,代码来源:AccordionApp.java

示例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;
	}
 
开发者ID:pirocks,项目名称:sem2-final-project,代码行数:8,代码来源:UniverseAccordion.java

示例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();
}
 
开发者ID:jesuino,项目名称:jbpm-rewards-client,代码行数:12,代码来源:App.java

示例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)));
}
 
开发者ID:yumix,项目名称:javafx-dpi-scaling,代码行数:8,代码来源:AdjusterTest.java

示例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());
    }
  });
}
 
开发者ID:comtel2000,项目名称:jfxvnc,代码行数:15,代码来源:SessionContext.java


注:本文中的javafx.scene.control.Accordion类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。