Java 类javafx.scene.control.TitledPane 实例源码
项目:marathonv5
文件:RFXTitledPaneTest.java
@Test public void getText() {
TitledPane titledPane = (TitledPane) getPrimaryStage().getScene().getRoot().lookup(".titled-pane");
LoggingRecorder lr = new LoggingRecorder();
List<String> text = new ArrayList<>();
Platform.runLater(() -> {
RFXTitledPane rfxTitledPane = new RFXTitledPane(titledPane, null, null, lr);
titledPane.setExpanded(true);
rfxTitledPane.mouseButton1Pressed(null);
text.add(rfxTitledPane.getAttribute("text"));
});
new Wait("Waiting for titled pane text.") {
@Override public boolean until() {
return text.size() > 0;
}
};
AssertJUnit.assertEquals("Node 1", text.get(0));
}
项目:GameAuthoringEnvironment
文件:SelectSpriteSFV.java
@Override
protected void initView () {
myAccordion = getMyUIFactory().makeAccordion(300);
for (IDefinitionCollection<SpriteDefinition> def : mySprites) {
MultiChoiceEntryView<SpriteDefinition> myView =
new MultiChoiceEntryView<>(getMyLabels().getString(def.getTitleKey()),
def.getItems(), 300, 400,
AuthoringView.DEFAULT_ENTRYVIEW);
myView.getListView()
.setCellFactory(c -> new DraggableAddCell<SpriteDefinition>(mySelected
.getListView()));
myViews.add(myView);
TitledPane tp =
new TitledPane(getMyLabels().getString(def.getTitleKey()),
myView.getListView());
myAccordion.getPanes().add(tp);
}
mySelected.getListView()
.setCellFactory(c -> new DraggableRemoveCell<SpriteDefinition>(myAccordion));
mySelected.getListView().setPlaceholder(new Label("Drag Sprites Here"));
myContainer = getMyUIFactory().makeHBox(10, Pos.CENTER, myAccordion, mySelected.draw());
}
项目:SensorThingsManager
文件:EntityGuiController.java
@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.
}
}
}
项目:mokka7
文件:SessionManager.java
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());
}
}
});
}
项目:uPMT
文件:NewInterviewDialogController.java
@Override
public void initialize(URL location, ResourceBundle resources) {
// TODO Auto-generated method stub
this.btnValider.disableProperty().bind(canCreate);
current_step = collapse_step1;
collapse_step1.getContent().requestFocus();
accordion.expandedPaneProperty().addListener(
(ObservableValue<? extends TitledPane> ov, TitledPane old_val,
TitledPane new_val) -> {
if (new_val != null) {
current_step = new_val;
String id = new_val.getId();
if(id.equals("collapse_step1")){
nomEntretien.requestFocus();
}else if(id.equals("collapse_step2")){
participantEntretien.requestFocus();
}else if(id.equals("collapse_step3")){
dateEntretien.requestFocus();
}else if(id.equals("collapse_step4")){
}else if(id.equals("collapse_step5")){
}
}
});
}
项目:vars-annotation
文件:FilterableTreeItemDemo.java
private Node createAddItemPane() {
HBox box = new HBox(6);
TextField firstname = new TextField();
firstname.setPromptText("Enter first name ...");
TextField lastname = new TextField();
lastname.setPromptText("Enter last name ...");
Button addBtn = new Button("Add new actor to \"Folder 1\"");
addBtn.setOnAction(event -> {
FilterableTreeItem<Actor> treeItem = new FilterableTreeItem<>(new Actor(firstname.getText(), lastname.getText()));
folder1.getInternalChildren().add(treeItem);
});
addBtn.disableProperty().bind(Bindings.isEmpty(lastname.textProperty()));
box.getChildren().addAll(firstname, lastname, addBtn);
TitledPane pane = new TitledPane("Add new element", box);
pane.setCollapsible(false);
return pane;
}
项目:vars-annotation
文件:FilterableTreeItemDemo.java
private Node createFilteredTree() {
FilterableTreeItem<Actor> root = getTreeModel();
root.predicateProperty().bind(Bindings.createObjectBinding(() -> {
if (filterField.getText() == null || filterField.getText().isEmpty())
return null;
return TreeItemPredicate.create(actor -> actor.toString().contains(filterField.getText()));
}, filterField.textProperty()));
TreeView<Actor> treeView = new TreeView<>(root);
treeView.setShowRoot(false);
TitledPane pane = new TitledPane("Filtered TreeView", treeView);
pane.setCollapsible(false);
pane.setMaxHeight(Double.MAX_VALUE);
return pane;
}
项目:TechnicalAnalysisTool
文件:TatMain.java
/**
* When chart tab is changed, we reload indicators for the new chart
* @param category - selected category
* @param market - selected market
* @param code - selected code
*/
public void onSelectChartTab(String category, String market, String code){
String strTitle = "Indicator Setting";
TatAccordion indicatorAccordion = new TatAccordion();
if (leftBottomTabPane.hasTab(strTitle)){
leftBottomTabPane.removeTab(strTitle);
}
String strKey = category + "-" + market + "-" + code;
if (indicatorSettingPaneMap.get(strKey)!= null && indicatorSettingPaneMap.get(strKey).size() > 0){
leftBottomTabPane.addTab(strTitle, indicatorAccordion);
ArrayList<TitledPane> settings = indicatorSettingPaneMap.get(strKey);
Iterator<TitledPane> it = settings.iterator();
while(it.hasNext()){
indicatorAccordion.getPanes().addAll(it.next());
}
indicatorAccordion.setExpandedPane(indicatorSettingPaneMap.get(strKey).get(indicatorSettingPaneMap.get(strKey).size() - 1));
}
}
项目:Game-Engine-Vooga
文件:EventAccoridion.java
private TitledPane createTile() throws VoogaException {
if (name == null) {
return null;
}
String className = VoogaBundles.backendToGUIProperties.getString(name);
Class<?> c = null;
try {
c = Class.forName(className);
EventTitledPane titledPane;
Object o = c.getConstructor(EditEventable.class).newInstance(manager);
titledPane = (EventTitledPane) o;
return titledPane;
} catch (Exception e) {
throw new VoogaException(e.getMessage());
}
}
项目:Incubator
文件:DailySectionContentPresenter.java
private void onActionAddProjectToDailySection(ProjectModel model) {
LoggerFacade.INSTANCE.debug(this.getClass(), "On action add Project to DailySection"); // NOI18N
final TitledPane titledPane = new TitledPane();
titledPane.setText("(1) " + model.getTitle()); // NOI18N
titledPane.setUserData(model);
titledPane.setExpanded(false);
final ProjectContentView view = new ProjectContentView();
final ProjectContentPresenter presenter = view.getRealPresenter();
presenter.configure(model);
titledPane.setContent(view.getView());
vbDailySectionContent.getChildren().add(0, titledPane);
this.onActionEnsureTitledPaneIsVisible(titledPane);
}
项目:openjfx-8u-dev-tests
文件:TitledPaneApp.java
@Override
public Node drawNode() {
String title = "TitledPane";
Label content = new Label("Content");
TitledPane titledPane = new TitledPane(title, content);
if (titledPane.getText() != title) {
reportGetterFailure("getTitle()");
}
if (titledPane.getContent() != content) {
reportGetterFailure("getTitle()");
}
titledPane.setMinSize(SLOT_WIDTH, SLOT_HEIGHT);
titledPane.setMaxSize(SLOT_WIDTH, SLOT_HEIGHT);
titledPane.setPrefSize(SLOT_WIDTH, SLOT_HEIGHT);
titledPane.setStyle("-fx-border-color: darkgray;");
return titledPane;
}
项目:openjfx-8u-dev-tests
文件:TitledPaneApp.java
protected Object createObject(double width, double height, Double tab_width, Double tab_height) {
Label content = new Label("Content");
if (tab_width != null && tab_height != null) {
content.setMinSize(tab_width, tab_height);
content.setMaxSize(tab_width, tab_height);
content.setPrefSize(tab_width, tab_height);
}
TitledPane titled_pane = new TitledPane();
titled_pane.setText("Title");
titled_pane.setContent(content);
titled_pane.setMinSize(width, height);
titled_pane.setMaxSize(width, height);
titled_pane.setPrefSize(width, height);
titled_pane.setStyle("-fx-border-color: darkgray;");
return titled_pane;
}
项目:openjfx-8u-dev-tests
文件:AccordionApp.java
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;
}
项目:openjfx-8u-dev-tests
文件:DragDropWithControlsBase.java
protected void dnd() throws InterruptedException {
sceneSource.mouse().click(1, new Point(0, 0));
Wrap from = Lookups.byID(sceneSource, ID_DRAG_SOURCE, Node.class);
Wrap to = Lookups.byID(sceneTarget, ID_DRAG_TARGET, Node.class);
Point fromPoint = from.getClickPoint();
Point toPoint = to.getClickPoint();
final Object fromControl = from.getControl();
if (fromControl instanceof MenuBar || fromControl instanceof ToolBar
|| fromControl instanceof ScrollPane || fromControl instanceof Pagination) {
fromPoint = new Point(2, 2);
}
if (fromControl instanceof TitledPane) {
fromPoint = new Point(5, 30);
}
final Object toControl = to.getControl();
if (toControl instanceof MenuBar || toControl instanceof ToolBar
|| toControl instanceof ScrollPane || toControl instanceof Pagination) {
toPoint = new Point(2, 2);
}
if (toControl instanceof TitledPane) {
toPoint = new Point(30, 30);
}
dnd(from, fromPoint, to, toPoint);
}
项目:openjfx-8u-dev-tests
文件:AccordionTest.java
/**
* Test for Accordion user input
*/
@ScreenshotCheck
@Test(timeout = 300000)
public void userInputTest() throws Throwable {
openPage(Pages.InputTest.name());
//screenshotError = null;
Parent<Node> parent = getScene().as(Parent.class, Node.class);
for (int i = 0; i < AccordionApp.PANES_NUM; i++) {
Wrap wrap = parent.lookup(TitledPane.class).wrap(i);
wrap.mouse().click();
Thread.sleep(ANIMATION_DELAY);
ScreenshotUtils.checkPageContentScreenshot("AccordionTest-open-" + i);
}
ScreenshotUtils.throwScreenshotErrors();
}
项目:openjfx-8u-dev-tests
文件:AccordionApp.java
/**
*
* @param stage
* @throws Exception
*/
@Override
public void start(Stage stage) throws Exception {
VBox box = new VBox();
Scene scene = new Scene(box);
accordion.getPanes().add(new TitledPane("First pane", createTarget()));
accordion.getPanes().add(new TitledPane("Second pane", createTarget()));
box.getChildren().add(accordion);
Button reset = new Button("Reset");
reset.setOnAction(t -> {
reset();
});
box.getChildren().add(reset);
stage.setScene(scene);
stage.setWidth(250);
stage.setHeight(600);
stage.show();
}
项目:javatrove
文件:ApplicationEventHandler.java
@Handler
public void handleThrowable(ThrowableEvent event) {
Platform.runLater(() -> {
TitledPane pane = new TitledPane();
pane.setId("stacktrace");
pane.setCollapsible(false);
pane.setText("Stacktrace");
TextArea textArea = new TextArea();
textArea.setEditable(false);
pane.setContent(textArea);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
event.getThrowable().printStackTrace(new PrintStream(baos));
textArea.setText(baos.toString());
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("An unexpected error occurred");
alert.getDialogPane().setContent(pane);
alert.showAndWait();
});
}
项目:javatrove
文件:ApplicationEventHandler.java
@Handler
public void handleThrowable(ThrowableEvent event) {
Platform.runLater(() -> {
TitledPane pane = new TitledPane();
pane.setId("stacktrace");
pane.setCollapsible(false);
pane.setText("Stacktrace");
TextArea textArea = new TextArea();
textArea.setEditable(false);
pane.setContent(textArea);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
event.getThrowable().printStackTrace(new PrintStream(baos));
textArea.setText(baos.toString());
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("An unexpected error occurred");
alert.getDialogPane().setContent(pane);
alert.showAndWait();
});
}
项目:javatrove
文件:ApplicationEventHandler.java
@Handler
public void handleThrowable(ThrowableEvent event) {
Platform.runLater(() -> {
TitledPane pane = new TitledPane();
pane.setId("stacktrace");
pane.setCollapsible(false);
pane.setText("Stacktrace");
TextArea textArea = new TextArea();
textArea.setEditable(false);
pane.setContent(textArea);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
event.getThrowable().printStackTrace(new PrintStream(baos));
textArea.setText(baos.toString());
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("An unexpected error occurred");
alert.getDialogPane().setContent(pane);
alert.showAndWait();
});
}
项目:javatrove
文件:ApplicationEventHandler.java
@Handler
public void handleThrowable(ThrowableEvent event) {
Platform.runLater(() -> {
TitledPane pane = new TitledPane();
pane.setCollapsible(false);
pane.setText("Stacktrace");
TextArea textArea = new TextArea();
textArea.setEditable(false);
pane.setContent(textArea);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
event.getThrowable().printStackTrace(new PrintStream(baos));
textArea.setText(baos.toString());
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("An unexpected error occurred");
alert.getDialogPane().setContent(pane);
alert.showAndWait();
});
}
项目:javatrove
文件:ApplicationEventHandler.java
@Handler
public void handleThrowable(ThrowableEvent event) {
Platform.runLater(() -> {
TitledPane pane = new TitledPane();
pane.setId("stacktrace");
pane.setCollapsible(false);
pane.setText("Stacktrace");
TextArea textArea = new TextArea();
textArea.setEditable(false);
pane.setContent(textArea);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
event.getThrowable().printStackTrace(new PrintStream(baos));
textArea.setText(baos.toString());
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("An unexpected error occurred");
alert.getDialogPane().setContent(pane);
alert.showAndWait();
});
}
项目:javatrove
文件:ApplicationEventHandler.java
@Handler
public void handleThrowable(ThrowableEvent event) {
Platform.runLater(() -> {
TitledPane pane = new TitledPane();
pane.setCollapsible(false);
pane.setText("Stacktrace");
TextArea textArea = new TextArea();
textArea.setEditable(false);
pane.setContent(textArea);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
event.getThrowable().printStackTrace(new PrintStream(baos));
textArea.setText(baos.toString());
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("An unexpected error occurred");
alert.getDialogPane().setContent(pane);
alert.showAndWait();
});
}
项目:javatrove
文件:ApplicationEventHandler.java
@Handler
public void handleThrowable(ThrowableEvent event) {
Platform.runLater(() -> {
TitledPane pane = new TitledPane();
pane.setId("stacktrace");
pane.setCollapsible(false);
pane.setText("Stacktrace");
TextArea textArea = new TextArea();
textArea.setEditable(false);
pane.setContent(textArea);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
event.getThrowable().printStackTrace(new PrintStream(baos));
textArea.setText(baos.toString());
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("An unexpected error occurred");
alert.getDialogPane().setContent(pane);
alert.showAndWait();
});
}
项目:javatrove
文件:ApplicationEventHandler.java
@Handler
public void handleThrowable(ThrowableEvent event) {
Platform.runLater(() -> {
TitledPane pane = new TitledPane();
pane.setId("stacktrace");
pane.setCollapsible(false);
pane.setText("Stacktrace");
TextArea textArea = new TextArea();
textArea.setEditable(false);
pane.setContent(textArea);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
event.getThrowable().printStackTrace(new PrintStream(baos));
textArea.setText(baos.toString());
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("An unexpected error occurred");
alert.getDialogPane().setContent(pane);
alert.showAndWait();
});
}
项目:javatrove
文件:ApplicationEventHandler.java
@Handler
public void handleThrowable(ThrowableEvent event) {
Platform.runLater(() -> {
TitledPane pane = new TitledPane();
pane.setCollapsible(false);
pane.setText("Stacktrace");
TextArea textArea = new TextArea();
textArea.setEditable(false);
pane.setContent(textArea);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
event.getThrowable().printStackTrace(new PrintStream(baos));
textArea.setText(baos.toString());
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("An unexpected error occurred");
alert.getDialogPane().setContent(pane);
alert.showAndWait();
});
}
项目:javatrove
文件:ApplicationEventHandler.java
@Handler
public void handleThrowable(ThrowableEvent event) {
Platform.runLater(() -> {
TitledPane pane = new TitledPane();
pane.setCollapsible(false);
pane.setText("Stacktrace");
TextArea textArea = new TextArea();
textArea.setEditable(false);
pane.setContent(textArea);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
event.getThrowable().printStackTrace(new PrintStream(baos));
textArea.setText(baos.toString());
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("An unexpected error occurred");
alert.getDialogPane().setContent(pane);
alert.showAndWait();
});
}
项目:JttDesktop
文件:SoundConfigurationPanel.java
/**
* Method to construct the simple configuration options.
*/
private void constructSimplePane(){
GridPane simpleNode = new GridPane();
styling.configureFullWidthConstraints( simpleNode );
simplePane = new TitledPane( SIMPLE_TEXT, simpleNode );
add( simplePane, 0, 0 );
passFailRow = new SoundConfigurationRow( PASS_FAIL_TEXT, new PassFailApplier( configuration ) );
simpleNode.add( passFailRow, 0, 0 );
failPassRow = new SoundConfigurationRow( FAIL_PASS_TEXT, new FailPassApplier( configuration ) );
simpleNode.add( failPassRow, 0, 1 );
passPassRow = new SoundConfigurationRow( PASS_PASS_TEXT, new PassPassApplier( configuration ) );
simpleNode.add( passPassRow, 0, 2 );
faillFailRow = new SoundConfigurationRow( FAIL_FAIL_TEXT, new FailFailApplier( configuration ) );
simpleNode.add( faillFailRow, 0, 3 );
}
项目:JttDesktop
文件:SoundConfigurationPanel.java
/**
* Method to construct the advanced configuration options.
*/
private void constructAdvancedPane(){
GridPane advancedNode = new GridPane();
styling.configureFullWidthConstraints( advancedNode );
advancedPane = new TitledPane( ADVANCED_TEXT, advancedNode );
add( advancedPane, 0, 1 );
int rowNumber = 0;
for ( BuildResultStatus from : BuildResultStatus.values() ) {
for ( BuildResultStatus to : BuildResultStatus.values() ) {
SoundConfigurationRow row = new SoundConfigurationRow( from.name() + " -> " + to.name(), new IndividualChangeApplier( configuration, from, to ) );
rowNumber++;
advancedNode.add( row, 0, rowNumber );
rows.put( new BuildResultStatusChange( from, to ), row );
}
}
}
项目:JttDesktop
文件:ThemeBuilderPanel.java
/**
* Constructs a new {@link ThemeBuilderPanel}.
* @param styling the {@link JavaFxStyle}.
* @param shortcuts the {@link ThemeBuilderShortcutProperties}.
* @param theme the {@link BuildWallTheme} to configure.
*/
ThemeBuilderPanel( JavaFxStyle styling, ThemeBuilderShortcutProperties shortcuts, BuildWallTheme theme ) {
this.styling = styling;
this.shortcuts = shortcuts;
this.builderWall = new DisjointBuilderWall( theme );
this.add( builderWall, 0, 0 );
this.configurationPanel = new ThemeConfigurationPanel( theme, shortcuts );
this.scroller = new ScrollPane( configurationPanel );
this.scroller.setFitToWidth( true );
this.shortcutsPane = new TitledPane( SHORTCUTS_TITLE, new ThemeBuilderShortcutsPane( shortcuts ) );
styling.applyBasicPadding( shortcutsPane );
this.scrollerSplit = new BorderPane( scroller );
this.scrollerSplit.setTop( shortcutsPane );
this.add( scrollerSplit, 0, 1 );
this.styling.configureFullWidthConstraints( this );
}
项目:JttDesktop
文件:WrappedSystemDigestTest.java
@Test public void shouldInsertAndRemoveSystemDigest() {
parent = new BorderPane( display );
systemDigestPane = new TitledPane( "anything", systemDigest );
parent.setTop( systemDigestPane );
assertThat( parent.getTop(), is( systemDigestPane ) );
systemUnderTest = new WrappedSystemDigest( parent );
systemUnderTest.removeDigest();
assertThat( parent.getTop(), nullValue() );
systemUnderTest.insertDigest();
assertThat( parent.getTop(), is( systemDigestPane ) );
systemUnderTest.removeDigest();
assertThat( parent.getTop(), nullValue() );
systemUnderTest.insertDigest();
assertThat( parent.getTop(), is( systemDigestPane ) );
}
项目:JttDesktop
文件:SoundConfigurationPanelTest.java
@Test public void shouldContainSimpleElements(){
assertThat( systemUnderTest.getChildren().contains( systemUnderTest.simple() ), is( true ) );
TitledPane pane = systemUnderTest.simple();
assertThat( pane.getText(), is( SoundConfigurationPanel.SIMPLE_TEXT ) );
Region region = ( Region ) pane.getContent();
assertThat( region.getChildrenUnmodifiable().contains( systemUnderTest.passFailRow() ), is( true ) );
assertThat( region.getChildrenUnmodifiable().contains( systemUnderTest.failFailRow() ), is( true ) );
assertThat( region.getChildrenUnmodifiable().contains( systemUnderTest.failPassRow() ), is( true ) );
assertThat( region.getChildrenUnmodifiable().contains( systemUnderTest.passPassRow() ), is( true ) );
assertThat( systemUnderTest.passFailRow().getLabelText(), is( SoundConfigurationPanel.PASS_FAIL_TEXT ) );
assertThat( systemUnderTest.passPassRow().getLabelText(), is( SoundConfigurationPanel.PASS_PASS_TEXT ) );
assertThat( systemUnderTest.failFailRow().getLabelText(), is( SoundConfigurationPanel.FAIL_FAIL_TEXT ) );
assertThat( systemUnderTest.failPassRow().getLabelText(), is( SoundConfigurationPanel.FAIL_PASS_TEXT ) );
assertThat( systemUnderTest.passFailRow().isAssociatedWith( configuration ), is( true ) );
assertThat( systemUnderTest.passPassRow().isAssociatedWith( configuration ), is( true ) );
assertThat( systemUnderTest.failFailRow().isAssociatedWith( configuration ), is( true ) );
assertThat( systemUnderTest.failPassRow().isAssociatedWith( configuration ), is( true ) );
assertThat( systemUnderTest.passFailRow().isAssociatedWithType( PassFailApplier.class ), is( true ) );
assertThat( systemUnderTest.passPassRow().isAssociatedWithType( PassPassApplier.class ), is( true ) );
assertThat( systemUnderTest.failFailRow().isAssociatedWithType( FailFailApplier.class ), is( true ) );
assertThat( systemUnderTest.failPassRow().isAssociatedWithType( FailPassApplier.class ), is( true ) );
}
项目:JttDesktop
文件:SoundConfigurationPanelTest.java
@Test public void shouldContainAdvancedElements(){
assertThat( systemUnderTest.getChildren().contains( systemUnderTest.advanced() ), is( true ) );
TitledPane pane = systemUnderTest.advanced();
assertThat( pane.getText(), is( SoundConfigurationPanel.ADVANCED_TEXT ) );
Region region = ( Region ) pane.getContent();
for ( BuildResultStatus from : BuildResultStatus.values() ) {
for ( BuildResultStatus to : BuildResultStatus.values() ) {
SoundConfigurationRow row = systemUnderTest.rowFor( from, to );
assertThat( region.getChildrenUnmodifiable().contains( row ), is( true ) );
assertThat( row.getLabelText(), is( from.name() + " -> " + to.name() ) );
assertThat( row.isAssociatedWith( configuration ), is( true ) );
assertThat( row.isAssociatedWithType( IndividualChangeApplier.class ), is( true ) );
}
}
}
项目:JttDesktop
文件:BuildWallConfigurationPaneImplTest.java
@Test public void shouldContainNecessaryElements(){
Label label = systemUnderTest.titleLabel();
Assert.assertTrue( systemUnderTest.getChildren().contains( label ) );
TitledPane dimensionsPane = systemUnderTest.dimensionsPane();
Assert.assertTrue( systemUnderTest.getChildren().contains( dimensionsPane ) );
TitledPane fontPane = systemUnderTest.fontPane();
Assert.assertTrue( systemUnderTest.getChildren().contains( fontPane ) );
TitledPane policiesPane = systemUnderTest.jobPoliciesPane();
Assert.assertTrue( systemUnderTest.getChildren().contains( policiesPane ) );
TitledPane colourPane = systemUnderTest.colourPane();
Assert.assertTrue( systemUnderTest.getChildren().contains( colourPane ) );
}
项目:JttDesktop
文件:LaunchOptionsTest.java
@Test public void buildWallButtonShouldLaunchBuildWall(){
systemUnderTest.buildWallButton().getOnAction().handle( new ActionEvent() );
verify( window ).setContent( contentCaptor.capture() );
Node content = contentCaptor.getValue();
assertThat( content, instanceOf( BorderPane.class ) );
BorderPane wrapperPane = ( BorderPane ) ( ( BorderPane )content ).getCenter();
DualBuildWallDisplayImpl display = ( DualBuildWallDisplayImpl ) wrapperPane.getCenter();
assertThat( display.getOnContextMenuRequested(), instanceOf( DualBuildWallContextMenuOpener.class ) );
DualBuildWallContextMenuOpener opener = ( DualBuildWallContextMenuOpener ) display.getOnContextMenuRequested();
assertThat( opener.isSystemDigestControllable(), is( true ) );
assertThat( wrapperPane.getTop(), instanceOf( TitledPane.class ) );
TitledPane titledPane = ( TitledPane )wrapperPane.getTop();
assertThat( titledPane.getContent(), is( digest ) );
}
项目:drbookings
文件:BookingDetailsController.java
private void addRow1(final Pane content, final Booking be) {
final VBox box = new VBox();
final HBox box0 = new HBox();
final HBox box1 = new HBox();
final HBox box2 = new HBox();
box.setFillWidth(true);
box0.setFillHeight(true);
box1.setFillHeight(true);
box2.setFillHeight(true);
addCheckInNote(box0, be);
addCheckOutNote(box1, be);
addSpecialRequestNote(box2, be);
box.getChildren().addAll(box0, box1, box2);
final TitledPane pane = new TitledPane("Notes", box);
pane.setExpanded(false);
content.getChildren().add(pane);
}
项目:qupath
文件:SingleFeatureClassifierCommand.java
InputPane(final ObservableList<PathClass> availableClasses) {
// Input classes - classification will only be applied to objects of this class
listInputClasses.setItems(availableClasses);
listInputClasses.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
listInputClasses.setPrefHeight(200);
pane = new TitledPane("Input", listInputClasses);
pane.setCollapsible(false);
listInputClasses.getSelectionModel().selectedItemProperty().addListener((v, o, n) -> {
// Not sure why, but this needs to be deferred to later...
Platform.runLater(() -> selectedItemList.setAll(listInputClasses.getSelectionModel().getSelectedItems()));
});
Tooltip tooltip = new Tooltip("Select input classifications - only objects with these classes will be reclassified");
pane.setTooltip(tooltip);
listInputClasses.setTooltip(tooltip);
}
项目:qupath
文件:SingleFeatureClassifierCommand.java
MeasurementPane(final ObservableList<String> features) {
comboFeatures.setItems(features);
GridPane paneMeasurements = new GridPane();
paneMeasurements.add(comboFeatures, 0, 0, 2, 1);
Label labelThreshold = new Label("Threshold");
labelThreshold.setLabelFor(tfThreshold);
paneMeasurements.add(labelThreshold, 0, 1, 1, 1);
paneMeasurements.add(tfThreshold, 1, 1, 1, 1);
paneMeasurements.setHgap(5);
paneMeasurements.setVgap(5);
pane = new TitledPane("Measurement", paneMeasurements);
pane.setCollapsible(false);
pane.setTooltip(new Tooltip("Select measurement & threshold used to reclassify objects"));
tfThreshold.textProperty().addListener((v, o, n) -> {
try {
threshold.set(Double.parseDouble(n));
} catch (Exception e) {
threshold.set(Double.NaN);
}
});
}
项目:mars-sim
文件:MarsNode.java
public void createGreenhouses(TitledPane tp, Settlement settlement) {
VBox v = new VBox();
v.setSpacing(10);
v.setPadding(new Insets(0, 20, 10, 20));
List<Building> buildings = settlement.getBuildingManager().getACopyOfBuildings();
Iterator<Building> iter1 = buildings.iterator();
while (iter1.hasNext()) {
Building building = iter1.next();
if (building.hasFunction(FunctionType.FARMING)) {
// try {
Farming farm = (Farming) building.getFunction(FunctionType.FARMING);
Button b = createGreenhouseDialog(farm);
v.getChildren().add(b);
// }
// catch (BuildingException e) {}
}
}
tp.setContent(v);//"1 2 3 4 5..."));
tp.setExpanded(true);
}
项目:ShootOFF
文件:ArenaCoursesSlide.java
private Pane buildCoursePanes() {
final File coursesDirectory = new File(System.getProperty("shootoff.courses"));
final ItemSelectionPane<File> uncategorizedPane = buildCategoryPane(coursesDirectory);
coursePanes.getChildren().add(new TitledPane("Uncategorized Courses", uncategorizedPane));
categoryMap.put(coursesDirectory.getPath(), uncategorizedPane);
final File[] courseFolders = coursesDirectory.listFiles(FOLDER_FILTER);
if (courseFolders != null) {
for (final File courseFolder : courseFolders) {
coursePanes.getChildren().add(new TitledPane(courseFolder.getName().replaceAll("_", "") + " Courses",
buildCategoryPane(courseFolder)));
}
} else {
logger.error("{} does not appear to be a valid course directory", coursesDirectory.getPath());
}
return coursePanes;
}
项目:org.csstudio.display.builder
文件:Palette.java
/** Create a TilePane for each WidgetCategory
* @param parent Parent Pane
* @return Map of panes for each category
*/
private Map<WidgetCategory, Pane> createWidgetCategoryPanes(final Pane parent)
{
final Map<WidgetCategory, Pane> palette_groups = new HashMap<>();
for (final WidgetCategory category : WidgetCategory.values())
{
final TilePane palette_group = new TilePane();
palette_group.getStyleClass().add("palette_group");
palette_group.setPrefColumns(1);
palette_group.setMaxWidth(Double.MAX_VALUE);
palette_groups.put(category, palette_group);
palette_group.setHgap(2);
palette_group.setVgap(2);
final TitledPane pane = new TitledPane(category.getDescription(), palette_group);
pane.getStyleClass().add("palette_category");
parent.getChildren().add(pane);
}
return palette_groups;
}