當前位置: 首頁>>代碼示例>>Java>>正文


Java DragPane類代碼示例

本文整理匯總了Java中com.kotcrab.vis.ui.layout.DragPane的典型用法代碼示例。如果您正苦於以下問題:Java DragPane類的具體用法?Java DragPane怎麽用?Java DragPane使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DragPane類屬於com.kotcrab.vis.ui.layout包,在下文中一共展示了DragPane類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: process

import com.kotcrab.vis.ui.layout.DragPane; //導入依賴的package包/類
@Override
public void process(LmlParser parser, LmlTag tag, DragPane actor, String rawAttributeData) {
    WidgetGroup group = actor.getGroup();
    String id = parser.parseString(rawAttributeData, group);
    LmlUtilities.setActorId(group, id);
    parser.getActorsMappedByIds().put(id, group);
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:8,代碼來源:GroupIdLmlAttribute.java

示例2: attachTo

import com.kotcrab.vis.ui.layout.DragPane; //導入依賴的package包/類
@Override
public void attachTo(final LmlTag tag) {
    if (tag.getActor() instanceof DragPane) {
        ((DragPane) tag.getActor()).setDraggable(draggable);
    } else {
        draggable.attachTo(tag.getActor());
    }
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:9,代碼來源:DraggableLmlTag.java

示例3: getNewInstanceOfGroup

import com.kotcrab.vis.ui.layout.DragPane; //導入依賴的package包/類
@Override
protected Group getNewInstanceOfGroup(final LmlActorBuilder builder) {
    final DragPaneLmlActorBuilder dragPaneBuilder = (DragPaneLmlActorBuilder) builder;
    final DragPane dragPane = new DragPane(dragPaneBuilder.getGroupType().getGroup());
    dragPane.setDraggable(dragPaneBuilder.getGroupType().getDraggable(dragPane.getGroup()));
    return dragPane;
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:8,代碼來源:DragPaneLmlTag.java

示例4: addToOtherGroup

import com.kotcrab.vis.ui.layout.DragPane; //導入依賴的package包/類
@Override
protected boolean addToOtherGroup(final Actor actor, final DragPane dragPane, final Actor directPaneChild) {
    final int actorIndex = group.getChildren().indexOf(actor, true);
    int childIndex = group.getChildren().indexOf(directPaneChild, true);
    if (childIndex >= 0) { // Same group:
        if (group.isIndexBlocked(childIndex)
                || !hasSwapListenerApproval(group, actor, group, directPaneChild)) {
            return CANCEL;
        }
        final Object[] children = group.getChildren().items;
        children[actorIndex] = directPaneChild;
        children[childIndex] = actor;
        group.childrenChanged();
    } else { // Dragged into a different group:
        if (dragPane.getGroup() instanceof FixedSizeGridGroup) {
            childIndex = dragPane.getGroup().getChildren().indexOf(directPaneChild, true);
            final FixedSizeGridGroup targetGroup = (FixedSizeGridGroup) dragPane.getGroup();
            if (targetGroup.isIndexBlocked(childIndex)
                    || !isSwapApproved(group, actor, targetGroup, directPaneChild)) {
                return CANCEL;
            }
            dragPane.addActorAt(childIndex, actor);
            group.getParent().addActorAt(actorIndex, directPaneChild); // Replaces Draggable listener.
        } else { // Not expected, dragged into a non-GridGroup:
            return CANCEL;
        }
    }
    return APPROVE;
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:30,代碼來源:FixedSizeGridGroup.java

示例5: getHandledType

import com.kotcrab.vis.ui.layout.DragPane; //導入依賴的package包/類
@Override
public Class<DragPane> getHandledType() {
    return DragPane.class;
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:5,代碼來源:DragPaneListenerLmlAttribute.java

示例6: process

import com.kotcrab.vis.ui.layout.DragPane; //導入依賴的package包/類
@Override
public void process(final LmlParser parser, final LmlTag tag, final DragPane actor, final String rawAttributeData) {
    actor.setListener(new DragPane.DragPaneListener.LimitChildren(parser.parseInt(rawAttributeData, actor)));
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:5,代碼來源:MaxChildrenLmlAttribute.java

示例7: process

import com.kotcrab.vis.ui.layout.DragPane; //導入依賴的package包/類
@Override
public void process(final LmlParser parser, final LmlTag tag, final DragPane actor, final String rawAttributeData) {
    if (!parser.parseBoolean(rawAttributeData, actor)) {
        actor.setListener(new DragPane.DragPaneListener.AcceptOwnChildren());
    }
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:7,代碼來源:AcceptForeignLmlAttribute.java

示例8: getComponentActors

import com.kotcrab.vis.ui.layout.DragPane; //導入依賴的package包/類
@Override
protected Actor[] getComponentActors(final Actor actor) {
    return new Actor[] { ((DragPane) actor).getGroup() };
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:5,代碼來源:DragPaneLmlTag.java

示例9: addDirectlyToPane

import com.kotcrab.vis.ui.layout.DragPane; //導入依賴的package包/類
@Override
protected boolean addDirectlyToPane(final Draggable draggable, final Actor actor, final DragPane dragPane) {
    return CANCEL; // Prohibited. Can only swap children.
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:5,代碼來源:FixedSizeGridGroup.java

示例10: accept

import com.kotcrab.vis.ui.layout.DragPane; //導入依賴的package包/類
@Override
protected boolean accept(final Actor actor, final DragPane dragPane) {
    return dragPane != null && dragPane.getGroup() instanceof FixedSizeGridGroup
            && super.accept(actor, dragPane);
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:6,代碼來源:FixedSizeGridGroup.java

示例11: addToHorizontalGroup

import com.kotcrab.vis.ui.layout.DragPane; //導入依賴的package包/類
@Override
protected boolean addToHorizontalGroup(final Actor actor, final DragPane dragPane,
        final Actor directPaneChild) {
    return CANCEL;
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:6,代碼來源:FixedSizeGridGroup.java

示例12: addToVerticalGroup

import com.kotcrab.vis.ui.layout.DragPane; //導入依賴的package包/類
@Override
protected boolean addToVerticalGroup(final Actor actor, final DragPane dragPane, final Actor directPaneChild) {
    return CANCEL;
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:5,代碼來源:FixedSizeGridGroup.java

示例13: addToFloatingGroup

import com.kotcrab.vis.ui.layout.DragPane; //導入依賴的package包/類
@Override
protected boolean addToFloatingGroup(final Draggable draggable, final Actor actor, final DragPane dragPane) {
    return CANCEL;
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:5,代碼來源:FixedSizeGridGroup.java

示例14: addDirectlyToPane

import com.kotcrab.vis.ui.layout.DragPane; //導入依賴的package包/類
@Override
protected boolean addDirectlyToPane(final Actor actor, final DragPane dragPane) {
    return CANCEL; // Prohibited. Can only swap children.
}
 
開發者ID:gdx-libs,項目名稱:gdx-lml-vis,代碼行數:5,代碼來源:FixedSizeGridGroup.java

示例15: TabbedPane

import com.kotcrab.vis.ui.layout.DragPane; //導入依賴的package包/類
public TabbedPane (TabbedPaneStyle style, Sizes sizes) {
	this.style = style;
	this.sizes = sizes;
	listeners = new Array<TabbedPaneListener>();

	sharedCloseActiveButtonStyle = VisUI.getSkin().get("close-active-tab", VisImageButtonStyle.class);

	group = new ButtonGroup<Button>();

	mainTable = new TabbedPaneTable(this);
	tabsPane = new DragPane(style.vertical ? new VerticalFlowGroup() : new HorizontalFlowGroup());
	configureDragPane(style);

	mainTable.setBackground(style.background);

	tabs = new Array<Tab>();
	tabsButtonMap = new IdentityMap<Tab, TabButtonTable>();

	Cell<DragPane> tabsPaneCell = mainTable.add(tabsPane);
	Cell<Image> separatorCell = null;

	if (style.vertical) {
		tabsPaneCell.top().growY().minSize(0, 0);
	} else {
		tabsPaneCell.left().growX().minSize(0, 0);
	}

	//note: if separatorBar height/width is not set explicitly it may sometimes disappear
	if (style.separatorBar != null) {
		if (style.vertical) {
			separatorCell = mainTable.add(new Image(style.separatorBar)).growY().width(style.separatorBar.getMinWidth());
		} else {
			mainTable.row();
			separatorCell = mainTable.add(new Image(style.separatorBar)).growX().height(style.separatorBar.getMinHeight());
		}
	} else {
		//make sure that tab will fill available space even when there is no separatorBar image set
		if (style.vertical) {
			mainTable.add().growY();
		} else {
			mainTable.add().growX();
		}
	}

	mainTable.setPaneCells(tabsPaneCell, separatorCell);
}
 
開發者ID:kotcrab,項目名稱:vis-editor,代碼行數:47,代碼來源:TabbedPane.java


注:本文中的com.kotcrab.vis.ui.layout.DragPane類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。