Search in sources :

Example 1 with Panel

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

the class TextPanelMouseProcessor method processMousePressed.

public void processMousePressed(MousePressedEvent e) {
    final Panel panel = e.getRecipient();
    inWordSelectionMode = false;
    TextLocation location = model.getLocationAt(e.getLocation());
    model.startSelection(location);
    model.setCaretLocation(location, XOffsetStrategy.FITTING, YOffsetStrategy.FITTING);
    model.setCaretOn(true);
    handleMultipleClicks(e);
    panel.markAsDirty();
    panel.getStage().getKeyListener().focusOn(panel);
    lastClickTime = System.currentTimeMillis();
}
Also used : Panel(limelight.ui.Panel) TextLocation(limelight.ui.text.TextLocation)

Example 2 with Panel

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

the class Mouse method drag.

public static void drag(PropProxy prop, int x, int y, int modifiers, int click_count) {
    Point location = pointFor(prop, x, y);
    Panel owner = ownerOf(location, prop);
    new MouseDraggedEvent(modifiers, location, click_count).dispatch(owner);
}
Also used : Panel(limelight.ui.Panel) PropPanel(limelight.ui.model.PropPanel)

Example 3 with Panel

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

the class PropPanelTest method setUp.

@Before
public void setUp() throws Exception {
    root = new ScenePanel(new FakePropProxy(), new FakePlayerRecruiter());
    prop = new FakePropProxy();
    panel = new PropPanel(prop);
    root.add(panel);
    root.setProduction(new FakeProduction());
    root.setStage(new MockStage());
    style = panel.getStyle();
    CastingDirector.installed();
    FakeFileSystem.installed();
    Context.instance().bufferedImageCache = new SimpleCache<Panel, BufferedImage>();
}
Also used : Panel(limelight.ui.Panel) ScrollBarPanel(limelight.ui.model.inputs.ScrollBarPanel) FakePlayerRecruiter(limelight.model.api.FakePlayerRecruiter) FakeProduction(limelight.model.FakeProduction) BufferedImage(java.awt.image.BufferedImage) Before(org.junit.Before)

Example 4 with Panel

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

the class InputPanelUtil method nextInputPanel.

public static InputPanel nextInputPanel(Panel start) {
    InputPanel next = null;
    InputPanel first = null;
    boolean foundMe = false;
    for (Panel panel : start.getRoot()) {
        if (panel instanceof InputPanel) {
            if (foundMe) {
                next = (InputPanel) panel;
                break;
            } else if (panel == start)
                foundMe = true;
            if (first == null)
                first = (InputPanel) panel;
        }
    }
    if (next != null)
        return next;
    else
        return first;
}
Also used : Panel(limelight.ui.Panel)

Example 5 with Panel

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

the class PropogateToParentAction method invoke.

public void invoke(Event event) {
    PanelEvent panelEvent = (PanelEvent) event;
    final Panel parent = panelEvent.getRecipient().getParent();
    if (parent != null)
        panelEvent.dispatch(parent);
}
Also used : PanelEvent(limelight.ui.events.panel.PanelEvent) Panel(limelight.ui.Panel)

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