Search in sources :

Example 6 with Panel

use of limelight.ui.Panel in project limelight by slagyr.

the class StageMouseListener method mouseWheelMoved.

public void mouseWheelMoved(MouseWheelEvent e) {
    if (getRoot() == null)
        return;
    final Panel panel = panelFor(e.getPoint());
    new limelight.ui.events.panel.MouseWheelEvent(e.getModifiers(), e.getPoint(), e.getClickCount(), e.getScrollType(), e.getScrollAmount(), e.getWheelRotation()).dispatch(panel);
}
Also used : Panel(limelight.ui.Panel) limelight.ui.events.panel(limelight.ui.events.panel)

Example 7 with Panel

use of limelight.ui.Panel in project limelight by slagyr.

the class StageMouseListener method mouseReleased.

public void mouseReleased(MouseEvent e) {
    if (getRoot() == null)
        return;
    Panel releasedPanel = panelFor(e.getPoint());
    new MouseReleasedEvent(e.getModifiers(), e.getPoint(), e.getClickCount()).dispatch(releasedPanel);
    if (releasedPanel == pressedPanel) {
        new MouseClickedEvent(e.getModifiers(), e.getPoint(), e.getClickCount()).dispatch(releasedPanel);
    }
}
Also used : Panel(limelight.ui.Panel)

Example 8 with Panel

use of limelight.ui.Panel in project limelight by slagyr.

the class PaintJob method paintChildren.

public void paintChildren(ParentPanelBase panel, Graphics2D graphics) {
    if (panel.hasChildren()) {
        Box innards = panel instanceof PropPanel ? ((PropPanel) panel).getPaddedBounds() : panel.getChildConsumableBounds();
        graphics.clipRect(innards.x, innards.y, innards.width, innards.height);
        for (Panel child : panel.getChildren()) if (!child.isFloater())
            paintChild(graphics, child);
        for (Panel child : panel.getChildren()) if (child.isFloater())
            paintChild(graphics, child);
    }
}
Also used : Panel(limelight.ui.Panel) Box(limelight.util.Box)

Example 9 with Panel

use of limelight.ui.Panel in project limelight by slagyr.

the class PanelIterator method next.

public Panel next() {
    Panel value = next;
    next = null;
    if (value != null) {
        Iterator<Panel> iterator = findNextValidIterator();
        if (iterator != null) {
            next = iterator.next();
            if (next instanceof ParentPanelBase) {
                final ParentPanelBase nextParent = (ParentPanelBase) next;
                if (nextParent.hasChildren())
                    iterators.push(nextParent.getChildren().iterator());
            }
        }
    }
    return value;
}
Also used : Panel(limelight.ui.Panel)

Example 10 with Panel

use of limelight.ui.Panel in project limelight by slagyr.

the class StyleAttributeTest method setUp.

@Before
public void setUp() throws Exception {
    panel = new MockChangeablePanel();
    attribute = new StyleAttribute("NAME", new IntegerAttributeCompiler(), new SimpleIntegerValue(50));
    Context.instance().bufferedImageCache = new SimpleCache<Panel, BufferedImage>();
}
Also used : MockChangeablePanel(limelight.ui.model.MockChangeablePanel) Panel(limelight.ui.Panel) MockChangeablePanel(limelight.ui.model.MockChangeablePanel) SimpleIntegerValue(limelight.styles.values.SimpleIntegerValue) IntegerAttributeCompiler(limelight.styles.compiling.IntegerAttributeCompiler) BufferedImage(java.awt.image.BufferedImage) Before(org.junit.Before)

Aggregations

Panel (limelight.ui.Panel)38 Test (org.junit.Test)13 MockPanel (limelight.ui.MockPanel)12 PropPanel (limelight.ui.model.PropPanel)9 BufferedImage (java.awt.image.BufferedImage)4 java.util (java.util)2 MockChangeablePanel (limelight.ui.model.MockChangeablePanel)2 InputPanel (limelight.ui.model.inputs.InputPanel)2 ScrollBarPanel (limelight.ui.model.inputs.ScrollBarPanel)2 Box (limelight.util.Box)2 Before (org.junit.Before)2 LinkedList (java.util.LinkedList)1 FakeProduction (limelight.model.FakeProduction)1 FakePlayerRecruiter (limelight.model.api.FakePlayerRecruiter)1 IntegerAttributeCompiler (limelight.styles.compiling.IntegerAttributeCompiler)1 SimpleIntegerValue (limelight.styles.values.SimpleIntegerValue)1 BufferedImagePool (limelight.ui.BufferedImagePool)1 limelight.ui.events.panel (limelight.ui.events.panel)1 PanelEvent (limelight.ui.events.panel.PanelEvent)1 TextLocation (limelight.ui.text.TextLocation)1