use of limelight.ui.model.inputs.ScrollBarPanel in project limelight by slagyr.
the class ScrollBarPainterTest method setUpVertically.
private void setUpVertically() {
scrollBar = new ScrollBarPanel(ScrollBarPanel.VERTICAL);
scrollBar.setSize(15, 100);
scrollBar.setValue(0);
scrollBar.configure(1, 100);
graphics = new MockGraphics();
images = ScrollBarPainter.verticalImages;
}
use of limelight.ui.model.inputs.ScrollBarPanel in project limelight by slagyr.
the class PropPanelTest method shouldGetOwnerOfPointGivesPriorityToScrollBars.
@Test
public void shouldGetOwnerOfPointGivesPriorityToScrollBars() throws Exception {
panel.setSize(100, 100);
MockPanel child = new MockPanel();
child.setSize(100, 100);
child.setLocation(0, 0);
panel.add(child);
panel.addVerticalScrollBar();
ScrollBarPanel vertical = panel.getVerticalScrollbar();
vertical.setSize(15, 100);
vertical.setLocation(85, 0);
panel.addHorizontalScrollBar();
ScrollBarPanel horizontal = panel.getHorizontalScrollbar();
horizontal.setSize(100, 15);
horizontal.setLocation(0, 85);
assertSame(child, panel.getOwnerOfPoint(new Point(0, 0)));
assertSame(child, panel.getOwnerOfPoint(new Point(50, 50)));
assertSame(vertical, panel.getOwnerOfPoint(new Point(90, 50)));
assertSame(horizontal, panel.getOwnerOfPoint(new Point(50, 90)));
}
use of limelight.ui.model.inputs.ScrollBarPanel in project limelight by slagyr.
the class PropPanelLayout method layoutScrollBars.
// private boolean hasNonScrollBarChildren(PropPanel panel)
// {
// List<Panel> children = panel.getChildren();
// if(children.size() == 0)
// return false;
// else if(children.size() == 1)
// return !(children.contains(panel.getVerticalScrollbar()) || children.contains(panel.getHorizontalScrollbar()));
// else if(children.size() == 2)
// return !(children.contains(panel.getVerticalScrollbar()) && children.contains(panel.getHorizontalScrollbar()));
// else
// return true;
// }
private void layoutScrollBars(PropPanel panel, Dimension consumedDimensions) {
ScrollBarPanel vertical = panel.getVerticalScrollbar();
ScrollBarPanel horizontal = panel.getHorizontalScrollbar();
Box area = panel.getChildConsumableBounds();
if (vertical != null) {
vertical.setHeight(area.height);
vertical.setLocation(area.right() + 1, area.y);
vertical.configure(area.height, consumedDimensions.height);
}
if (horizontal != null) {
horizontal.setWidth(area.width);
horizontal.setLocation(area.x, area.bottom() + 1);
horizontal.configure(area.width, consumedDimensions.width);
}
}
use of limelight.ui.model.inputs.ScrollBarPanel in project limelight by slagyr.
the class PropPanel method addVerticalScrollBar.
public void addVerticalScrollBar() {
verticalScrollbar = new ScrollBarPanel(ScrollBarPanel.VERTICAL);
add(verticalScrollbar);
childConsumableBounds = null;
}
use of limelight.ui.model.inputs.ScrollBarPanel in project limelight by slagyr.
the class PropPanel method addHorizontalScrollBar.
public void addHorizontalScrollBar() {
horizontalScrollbar = new ScrollBarPanel(ScrollBarPanel.HORIZONTAL);
add(horizontalScrollbar);
childConsumableBounds = null;
}
Aggregations