Search in sources :

Example 1 with XYLayout

use of org.develnext.jphp.swing.XYLayout in project jphp by jphp-compiler.

the class UIElement method __setAnchors.

@Signature(@Arg("value"))
protected Memory __setAnchors(Environment env, Memory... args) {
    ComponentProperties data = SwingExtension.getProperties(getComponent());
    data.anchors.clear();
    if (args[0].isArray()) {
        ForeachIterator iterator = args[0].getNewIterator(env, false, false);
        while (iterator.next()) {
            Anchor anchor = Anchor.valueOf(iterator.getValue().toString().toUpperCase());
            if (anchor == null)
                env.exception(env.trace(), "Invalid anchor value - " + iterator.getValue());
            data.anchors.add(anchor);
        }
    } else {
        Anchor anchor = Anchor.valueOf(args[0].toString().toUpperCase());
        if (anchor == null)
            env.exception(env.trace(), "Invalid anchor value - " + args[0]);
    }
    if (getComponent().getParent() != null) {
        LayoutManager layout = getComponent().getParent().getLayout();
        if (!(layout instanceof XYLayout))
            env.exception(env.trace(), "Layout must be an instance of XYLayout");
    }
    return Memory.NULL;
}
Also used : ForeachIterator(php.runtime.lang.ForeachIterator) Anchor(org.develnext.jphp.swing.misc.Anchor) ComponentProperties(org.develnext.jphp.swing.ComponentProperties) XYLayout(org.develnext.jphp.swing.XYLayout)

Example 2 with XYLayout

use of org.develnext.jphp.swing.XYLayout in project jphp by jphp-compiler.

the class UIDesktopPanel method onInit.

@Override
protected void onInit(Environment env, Memory... args) {
    pane = new JDesktopPane();
    pane.setLayout(new XYLayout());
    pane.setDragMode(JDesktopPane.LIVE_DRAG_MODE);
}
Also used : XYLayout(org.develnext.jphp.swing.XYLayout)

Example 3 with XYLayout

use of org.develnext.jphp.swing.XYLayout in project jphp by jphp-compiler.

the class UIForm method onInit.

@Override
protected void onInit(Environment env, Memory... args) {
    frame = new JFrameX();
    frame.setLayout(new XYLayout());
}
Also used : JFrameX(org.develnext.jphp.swing.support.JFrameX) XYLayout(org.develnext.jphp.swing.XYLayout)

Aggregations

XYLayout (org.develnext.jphp.swing.XYLayout)3 ComponentProperties (org.develnext.jphp.swing.ComponentProperties)1 Anchor (org.develnext.jphp.swing.misc.Anchor)1 JFrameX (org.develnext.jphp.swing.support.JFrameX)1 ForeachIterator (php.runtime.lang.ForeachIterator)1