com.kotcrab.vis.ui.widget.VisScrollPane Java Examples

The following examples show how to use com.kotcrab.vis.ui.widget.VisScrollPane. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestFlowGroup.java    From vis-ui with Apache License 2.0 4 votes vote down vote up
public TestFlowGroup () {
		super("flow groups");

		TableUtils.setSpacingDefaults(this);
		columnDefaults(0).left();

		setResizable(true);
		addCloseButton();
		closeOnEscape();

		WidgetGroup group = new VerticalFlowGroup(2);

		String lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi luctus magna sit amet tellus egestas tincidunt. " +
				"Morbi tempus eleifend dictum. Nunc ex nisl, dignissim eget gravida vel, rutrum a nibh. Fusce congue odio ac elit " +
				"rhoncus rutrum. Donec nec lectus leo. Phasellus et consectetur ante. Cras vel consectetur mauris, sed semper lectus. ";
		String[] parts = lorem.split(" ");
		for (String part : parts) {
			group.addActor(new VisLabel(part));
		}

//		group.addActor(new VisLabel("Lorem ipsum"));
//		group.addActor(new VisLabel("dolor sit"));
//		group.addActor(new VisLabel("amet"));
//		group.addActor(new VisLabel("a\nb\nc"));
//		group.addActor(new VisLabel("Lorem ipsum"));
//		group.addActor(new VisLabel("dolor sit"));
//		group.addActor(new VisLabel("amet"));
//		group.addActor(new VisLabel("a\nb\nc"));
//		group.addActor(new VisLabel("Lorem ipsum"));
//		group.addActor(new VisLabel("dolor sit"));
//		group.addActor(new VisLabel("amet"));
//		group.addActor(new VisLabel("a\nb\nc"));

		VisScrollPane scrollPane = new VisScrollPane(group);
		scrollPane.setFadeScrollBars(false);
		scrollPane.setFlickScroll(false);
		scrollPane.setOverscroll(false, false);
		scrollPane.setScrollingDisabled(group instanceof HorizontalFlowGroup, group instanceof VerticalFlowGroup);
		add(scrollPane).grow();

		setSize(300, 150);
		centerWindow();
	}