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


Java ScrollPane.getContent方法代码示例

本文整理汇总了Java中javafx.scene.control.ScrollPane.getContent方法的典型用法代码示例。如果您正苦于以下问题:Java ScrollPane.getContent方法的具体用法?Java ScrollPane.getContent怎么用?Java ScrollPane.getContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.control.ScrollPane的用法示例。


在下文中一共展示了ScrollPane.getContent方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ensureVisible

import javafx.scene.control.ScrollPane; //导入方法依赖的package包/类
protected void ensureVisible(Node target) {
    ScrollPane scrollPane = getParentScrollPane(target);
    if (scrollPane == null) {
        return;
    }
    Node content = scrollPane.getContent();
    Bounds contentBounds = content.localToScene(content.getBoundsInLocal());
    Bounds viewportBounds = scrollPane.getViewportBounds();
    Bounds nodeBounds = target.localToScene(target.getBoundsInLocal());
    if (scrollPane.contains(nodeBounds.getMinX() - contentBounds.getMinX(), nodeBounds.getMinY() - contentBounds.getMinY())) {
        return;
    }
    double toVScroll = (nodeBounds.getMinY() - contentBounds.getMinY())
            * ((scrollPane.getVmax() - scrollPane.getVmin()) / (contentBounds.getHeight() - viewportBounds.getHeight()));
    scrollPane.setVvalue(toVScroll);
    double toHScroll = (nodeBounds.getMinX() - contentBounds.getMinX())
            * ((scrollPane.getHmax() - scrollPane.getHmin()) / (contentBounds.getWidth() - viewportBounds.getWidth()));
    scrollPane.setHvalue(toHScroll);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:20,代码来源:FXEventQueueDevice.java

示例2: scrollTo

import javafx.scene.control.ScrollPane; //导入方法依赖的package包/类
private void scrollTo(Node target) {
	ScrollPane scrollPane = getParentScrollPane(target);
	if (scrollPane == null)
		return;
	Node content = scrollPane.getContent();
	Bounds contentBounds = content.localToScene(content.getBoundsInLocal());
	Bounds viewportBounds = scrollPane.getViewportBounds();
	Bounds nodeBounds = target.localToScene(target.getBoundsInLocal());
	double toVScroll = (nodeBounds.getMinY() - contentBounds.getMinY())
			* ((scrollPane.getVmax() - scrollPane.getVmin())
					/ (contentBounds.getHeight() - viewportBounds.getHeight()));
	if (toVScroll >= scrollPane.getVmin() && toVScroll < scrollPane.getVmax())
		scrollPane.setVvalue(toVScroll);
	double toHScroll = (nodeBounds.getMinX() - contentBounds.getMinX())
			* ((scrollPane.getHmax() - scrollPane.getHmin())
					/ (contentBounds.getWidth() - viewportBounds.getWidth()));
	if (toHScroll >= scrollPane.getHmin() && toHScroll < scrollPane.getHmax())
		scrollPane.setHvalue(toHScroll);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:20,代码来源:ScrollPaneSample2.java

示例3: shouldHandleClickByInstructingController

import javafx.scene.control.ScrollPane; //导入方法依赖的package包/类
@Test public void shouldHandleClickByInstructingController() {
   systemUnderTest.handleBeingSelected();
   verify( controller ).displayContent( contentTitleCaptor.capture(), contentCaptor.capture() );
   
   assertThat( contentTitleCaptor.getValue(), is( instanceOf( SimpleConfigurationTitle.class ) ) );
   SimpleConfigurationTitle title = ( SimpleConfigurationTitle ) contentTitleCaptor.getValue();
   assertThat( title.getTitle(), is( DualPropertiesTreeItem.TITLE ) );
   assertThat( title.getDescription(), is( DualPropertiesTreeItem.DESCRIPTION ) );
   
   assertThat( contentCaptor.getValue(), is( instanceOf( ScrollPane.class ) ) );
   ScrollPane scroller = ( ScrollPane ) contentCaptor.getValue();
   assertThat( scroller.getContent(), is( instanceOf( DualPropertiesPanel.class ) ) );
   
   DualPropertiesPanel panel = ( DualPropertiesPanel ) scroller.getContent();
   assertThat( panel.hasConfiguration( configuration ), is( true ) );
}
 
开发者ID:DanGrew,项目名称:JttDesktop,代码行数:17,代码来源:DualPropertiesTreeItemTest.java

示例4: shouldHandleClickByInstructingController

import javafx.scene.control.ScrollPane; //导入方法依赖的package包/类
@Test public void shouldHandleClickByInstructingController() {
   systemUnderTest.handleBeingSelected();
   verify( controller ).displayContent( contentTitleCaptor.capture(), contentCaptor.capture() );
   
   assertThat( contentTitleCaptor.getValue(), is( instanceOf( SimpleConfigurationTitle.class ) ) );
   SimpleConfigurationTitle title = ( SimpleConfigurationTitle ) contentTitleCaptor.getValue();
   assertThat( title.getTitle(), is( FontsTreeItem.TITLE ) );
   assertThat( title.getDescription(), is( FontsTreeItem.DESCRIPTION ) );
   
   assertThat( contentCaptor.getValue(), is( instanceOf( ScrollPane.class ) ) );
   ScrollPane scroller = ( ScrollPane ) contentCaptor.getValue();
   assertThat( scroller.getContent(), is( instanceOf( FontsPanel.class ) ) );
   
   FontsPanel panel = ( FontsPanel ) scroller.getContent();
   assertThat( panel.hasConfiguration( configuration ), is( true ) );
}
 
开发者ID:DanGrew,项目名称:JttDesktop,代码行数:17,代码来源:FontsTreeItemTest.java

示例5: shouldHandleClickByInstructingController

import javafx.scene.control.ScrollPane; //导入方法依赖的package包/类
@Test public void shouldHandleClickByInstructingController() {
   systemUnderTest.handleBeingSelected();
   verify( controller ).displayContent( contentTitleCaptor.capture(), contentCaptor.capture() );
   
   assertThat( contentTitleCaptor.getValue(), is( instanceOf( SimpleConfigurationTitle.class ) ) );
   SimpleConfigurationTitle title = ( SimpleConfigurationTitle ) contentTitleCaptor.getValue();
   assertThat( title.getTitle(), is( DimensionsTreeItem.TITLE ) );
   assertThat( title.getDescription(), is( DimensionsTreeItem.DESCRIPTION ) );
   
   
   assertThat( contentCaptor.getValue(), is( instanceOf( ScrollPane.class ) ) );
   ScrollPane scroller = ( ScrollPane ) contentCaptor.getValue();
   assertThat( scroller.getContent(), is( instanceOf( DimensionsPanel.class ) ) );
   
   DimensionsPanel panel = ( DimensionsPanel ) scroller.getContent();
   assertThat( panel.hasConfiguration( configuration ), is( true ) );
}
 
开发者ID:DanGrew,项目名称:JttDesktop,代码行数:18,代码来源:DimensionsTreeItemTest.java

示例6: shouldHandleClickByInstructingController

import javafx.scene.control.ScrollPane; //导入方法依赖的package包/类
@Test public void shouldHandleClickByInstructingController() {
   systemUnderTest.handleBeingSelected();
   verify( controller ).displayContent( contentTitleCaptor.capture(), contentCaptor.capture() );
   
   assertThat( contentTitleCaptor.getValue(), is( instanceOf( SimpleConfigurationTitle.class ) ) );
   SimpleConfigurationTitle title = ( SimpleConfigurationTitle ) contentTitleCaptor.getValue();
   assertThat( title.getTitle(), is( ColoursTreeItem.TITLE ) );
   assertThat( title.getDescription(), is( ColoursTreeItem.DESCRIPTION ) );
   
   assertThat( contentCaptor.getValue(), is( instanceOf( ScrollPane.class ) ) );
   ScrollPane scroller = ( ScrollPane ) contentCaptor.getValue();
   assertThat( scroller.getContent(), is( instanceOf( ColoursPanel.class ) ) );
   
   ColoursPanel panel = ( ColoursPanel ) scroller.getContent();
   assertThat( panel.hasConfiguration( configuration ), is( true ) );
}
 
开发者ID:DanGrew,项目名称:JttDesktop,代码行数:17,代码来源:ColoursTreeItemTest.java

示例7: shouldHandleClickByInstructingController

import javafx.scene.control.ScrollPane; //导入方法依赖的package包/类
@Test public void shouldHandleClickByInstructingController() {
   systemUnderTest.handleBeingSelected();
   verify( controller ).displayContent( contentTitleCaptor.capture(), contentCaptor.capture() );
   
   assertThat( contentTitleCaptor.getValue(), is( instanceOf( SimpleConfigurationTitle.class ) ) );
   SimpleConfigurationTitle title = ( SimpleConfigurationTitle ) contentTitleCaptor.getValue();
   assertThat( title.getTitle(), is( SoundsTreeItem.TITLE ) );
   assertThat( title.getDescription(), is( SoundsTreeItem.DESCRIPTION ) );
   
   assertThat( contentCaptor.getValue(), is( instanceOf( ScrollPane.class ) ) );
   ScrollPane scroller = ( ScrollPane ) contentCaptor.getValue();
   assertThat( scroller.getContent(), is( instanceOf( SoundConfigurationPanel.class ) ) );
   
   SoundConfigurationPanel panel = ( SoundConfigurationPanel ) scroller.getContent();
   assertThat( panel.isAssociatedWith( configuration ), is( true ) );
}
 
开发者ID:DanGrew,项目名称:JttDesktop,代码行数:17,代码来源:SoundsTreeItemTest.java

示例8: shouldHandleClickByInstructingController

import javafx.scene.control.ScrollPane; //导入方法依赖的package包/类
@Test public void shouldHandleClickByInstructingController() {
   systemUnderTest.handleBeingSelected();
   verify( controller ).displayContent( contentTitleCaptor.capture(), contentCaptor.capture() );
   
   assertThat( contentTitleCaptor.getValue(), is( instanceOf( SimpleConfigurationTitle.class ) ) );
   SimpleConfigurationTitle title = ( SimpleConfigurationTitle ) contentTitleCaptor.getValue();
   assertThat( title.getTitle(), is( JobPolicyTreeItem.TITLE ) );
   assertThat( title.getDescription(), is( JobPolicyTreeItem.DESCRIPTION ) );
   
   assertThat( contentCaptor.getValue(), is( instanceOf( ScrollPane.class ) ) );
   ScrollPane scroller = ( ScrollPane ) contentCaptor.getValue();
   assertThat( scroller.getContent(), is( instanceOf( JobPolicyPanel.class ) ) );
   
   JobPolicyPanel panel = ( JobPolicyPanel ) scroller.getContent();
   assertThat( panel.hasConfiguration( configuration ), is( true ) );
}
 
开发者ID:DanGrew,项目名称:JttDesktop,代码行数:17,代码来源:JobPolicyTreeItemTest.java

示例9: shouldHandleClickByInstructingController

import javafx.scene.control.ScrollPane; //导入方法依赖的package包/类
@Test public void shouldHandleClickByInstructingController() {
   systemUnderTest.handleBeingSelected();
   verify( controller ).displayContent( contentTitleCaptor.capture(), contentCaptor.capture() );
   
   assertThat( contentTitleCaptor.getValue(), is( instanceOf( SimpleConfigurationTitle.class ) ) );
   SimpleConfigurationTitle title = ( SimpleConfigurationTitle ) contentTitleCaptor.getValue();
   assertThat( title.getTitle(), is( StatisticsStyleItem.TITLE ) );
   assertThat( title.getDescription(), is( StatisticsStyleItem.DESCRIPTION ) );
   
   assertThat( contentCaptor.getValue(), is( instanceOf( ScrollPane.class ) ) );
   ScrollPane scroller = ( ScrollPane ) contentCaptor.getValue();
   assertThat( scroller.getContent(), is( instanceOf( StatisticsStylePanel.class ) ) );
   
   StatisticsStylePanel panel = ( StatisticsStylePanel ) scroller.getContent();
   assertThat( panel.isAssociatedWith( configuration ), is( true ) );
}
 
开发者ID:DanGrew,项目名称:JttDesktop,代码行数:17,代码来源:StatisticsStyleItemTest.java

示例10: shouldHandleClickByInstructingController

import javafx.scene.control.ScrollPane; //导入方法依赖的package包/类
@Test public void shouldHandleClickByInstructingController() {
   systemUnderTest.handleBeingSelected();
   verify( controller ).displayContent( contentTitleCaptor.capture(), contentCaptor.capture() );
   
   assertThat( contentTitleCaptor.getValue(), is( instanceOf( SimpleConfigurationTitle.class ) ) );
   SimpleConfigurationTitle title = ( SimpleConfigurationTitle ) contentTitleCaptor.getValue();
   assertThat( title.getTitle(), is( StatisticsExclusionsItem.TITLE ) );
   assertThat( title.getDescription(), is( StatisticsExclusionsItem.DESCRIPTION ) );
   
   assertThat( contentCaptor.getValue(), is( instanceOf( ScrollPane.class ) ) );
   ScrollPane scroller = ( ScrollPane ) contentCaptor.getValue();
   assertThat( scroller.getContent(), is( instanceOf( StatisticsExclusionsPanel.class ) ) );
   
   StatisticsExclusionsPanel panel = ( StatisticsExclusionsPanel ) scroller.getContent();
   assertThat( panel.isAssociatedWith( configuration ), is( true ) );
}
 
开发者ID:DanGrew,项目名称:JttDesktop,代码行数:17,代码来源:StatisticsExclusionsItemTest.java

示例11: getSuggestedWidth

import javafx.scene.control.ScrollPane; //导入方法依赖的package包/类
@Override
public double getSuggestedWidth()
{
   	if(this.getChildren().size() < 2)
   	{
   		return 0;
   	}
   	
   	Node currentNode = this.getChildren().get(0);
   	
   	if(!(currentNode instanceof ScrollPane))
   	{
   		return 0;
   	}
   	
   	ScrollPane scrollPane = (ScrollPane)currentNode; 
   	Node content = scrollPane.getContent();
   	if(content == null)
   	{
   		return 0;
   	}    	
   	
   	return ((Region)content).getWidth() + 50;
}
 
开发者ID:deadlocker8,项目名称:BudgetMaster,代码行数:25,代码来源:MonthBarChart.java


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