Search in sources :

Example 6 with ScrollBarPanel

use of limelight.ui.model.inputs.ScrollBarPanel in project limelight by slagyr.

the class PropPanelLayout method buildRows.

protected LinkedList<Row> buildRows(PropPanel panel) {
    LinkedList<Row> rows = new LinkedList<Row>();
    Row currentRow = newRow(panel, rows);
    for (Panel child : panel.getChildren()) {
        if (!(child instanceof ScrollBarPanel) && !child.isFloater()) {
            if (!currentRow.isEmpty() && !currentRow.fits(child)) {
                currentRow = newRow(panel, rows);
            }
            currentRow.add(child);
        }
    }
    return rows;
}
Also used : Panel(limelight.ui.Panel) ScrollBarPanel(limelight.ui.model.inputs.ScrollBarPanel) ScrollBarPanel(limelight.ui.model.inputs.ScrollBarPanel) LinkedList(java.util.LinkedList)

Example 7 with ScrollBarPanel

use of limelight.ui.model.inputs.ScrollBarPanel in project limelight by slagyr.

the class ParentPanelBase method add.

public void add(int index, limelight.ui.Panel child) {
    if (sterilized && !(child instanceof ScrollBarPanel))
        throw new SterilePanelException(this.toString());
    final Lock lock = getTreeLock();
    try {
        lock.lock();
        synchronized (children) {
            if (index == -1)
                children.add(child);
            else
                children.add(index, child);
            readonlyChildren = null;
        }
        child.setParent(this);
        doPropagateSizeChangeUp(this);
        markAsNeedingLayout();
    } finally {
        lock.unlock();
    }
}
Also used : ScrollBarPanel(limelight.ui.model.inputs.ScrollBarPanel) Lock(java.util.concurrent.locks.Lock)

Example 8 with ScrollBarPanel

use of limelight.ui.model.inputs.ScrollBarPanel in project limelight by slagyr.

the class ScrollBarPainterTest method setUpHorizontally.

private void setUpHorizontally() {
    scrollBar = new ScrollBarPanel(ScrollBarPanel.HORIZONTAL);
    scrollBar.setSize(100, 15);
    scrollBar.setValue(0);
    scrollBar.configure(1, 100);
    graphics = new MockGraphics();
    images = ScrollBarPainter.horizontalImages;
}
Also used : MockGraphics(limelight.ui.MockGraphics) ScrollBarPanel(limelight.ui.model.inputs.ScrollBarPanel)

Example 9 with ScrollBarPanel

use of limelight.ui.model.inputs.ScrollBarPanel in project limelight by slagyr.

the class LayoutTest method scrollBarLayout.

@Test
public void scrollBarLayout() throws Exception {
    parent.getStyle().setScrollbars("on");
    Layouts.on(root);
    ScrollBarPanel verticalScrollBar = parent.getVerticalScrollbar();
    assertEquals(100 - ScrollBarPanel.GIRTH, verticalScrollBar.getX());
    assertEquals(0, verticalScrollBar.getY());
    ScrollBarPanel horizontalScrollBar = parent.getHorizontalScrollbar();
    assertEquals(0, horizontalScrollBar.getX());
    assertEquals(100 - ScrollBarPanel.GIRTH, horizontalScrollBar.getY());
}
Also used : ScrollBarPanel(limelight.ui.model.inputs.ScrollBarPanel) Test(org.junit.Test)

Aggregations

ScrollBarPanel (limelight.ui.model.inputs.ScrollBarPanel)9 MockGraphics (limelight.ui.MockGraphics)2 Test (org.junit.Test)2 LinkedList (java.util.LinkedList)1 Lock (java.util.concurrent.locks.Lock)1 Panel (limelight.ui.Panel)1 Box (limelight.util.Box)1