当前位置: 首页>>代码示例>>Java>>正文


Java DraggedComponentList类代码示例

本文整理汇总了Java中com.intellij.uiDesigner.designSurface.DraggedComponentList的典型用法代码示例。如果您正苦于以下问题:Java DraggedComponentList类的具体用法?Java DraggedComponentList怎么用?Java DraggedComponentList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DraggedComponentList类属于com.intellij.uiDesigner.designSurface包,在下文中一共展示了DraggedComponentList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testGrowComponent

import com.intellij.uiDesigner.designSurface.DraggedComponentList; //导入依赖的package包/类
public void testGrowComponent() {
  myContainer.setLayout(new GridLayoutManager(2, 2));

  //  *|.       *** .
  //
  //  ***   ->  *****
  insertComponent(0, 0, 1, 1);
  RadComponent c = insertComponent(1, 0, 1, 2);

  GridInsertLocation location = new GridInsertLocation(myContainer, 0, 0, GridInsertMode.ColumnAfter);
  DraggedComponentList dcl = DraggedComponentList.withComponents(myDropComponent);
  assertTrue(location.canDrop(dcl));
  doDrop(location);
  assertEquals(3, myManager.getGridColumnCount(myContainer));
  assertEquals(3, c.getConstraints().getColSpan());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:GridInsertLocationTest.java

示例2: testInsertGrowMultiple

import com.intellij.uiDesigner.designSurface.DraggedComponentList; //导入依赖的package包/类
public void testInsertGrowMultiple() {
  setGridSize(4, 4);

  // * . . .
  // . . . .
  // . . . .
  // . . . *

  insertComponent(0, 0, 1, 1);
  insertComponent(3, 3, 1, 1);

  // * . . .
  // . . . .
  // * . . .
  // * . . *
  RadComponent c1 = createComponent(0, 0, 2, 1);
  RadComponent c2 = createComponent(0, 1, 1, 1);

  GridInsertLocation location = new GridInsertLocation(myContainer, 1, 0, GridInsertMode.RowAfter);
  DraggedComponentList dcl = DraggedComponentList.withComponents(c1, c2);
  assertTrue(location.canDrop(dcl));
  location.processDrop(null, new RadComponent[] {c1, c2}, null, dcl);
  assertEquals(6, myManager.getGridRowCount(myContainer));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:GridInsertLocationTest.java

示例3: testInsertGrowMultiple1x1

import com.intellij.uiDesigner.designSurface.DraggedComponentList; //导入依赖的package包/类
public void testInsertGrowMultiple1x1() {
  setGridSize(2, 2);

  // * .
  //
  // . *

  insertComponent(0, 0, 1, 1);
  insertComponent(1, 1, 1, 1);

  // * *
  // *
  // * .
  RadComponent c1 = createComponent(0, 0, 2, 1);
  RadComponent c2 = createComponent(0, 1, 1, 1);

  GridInsertLocation location = new GridInsertLocation(myContainer, 1, 0, GridInsertMode.RowAfter);
  DraggedComponentList dcl = DraggedComponentList.withComponents(c1, c2);
  assertTrue(location.canDrop(dcl));
  location.processDrop(null, new RadComponent[] {c1, c2}, null, dcl);
  assertEquals(3, myManager.getGridRowCount(myContainer));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:GridInsertLocationTest.java

示例4: testInsertGrowSingle1x1

import com.intellij.uiDesigner.designSurface.DraggedComponentList; //导入依赖的package包/类
public void testInsertGrowSingle1x1() {
  setGridSize(2, 2);

  // * .
  //
  // . *

  insertComponent(0, 0, 1, 1);
  insertComponent(1, 1, 1, 1);

  setComponentDimensions(myDropComponent, 0, 0, 2, 2);
  GridInsertLocation location = new GridInsertLocation(myContainer, 1, 0, GridInsertMode.RowAfter);
  DraggedComponentList dcl = DraggedComponentList.withComponents(myDropComponent);
  assertTrue(location.canDrop(dcl));
  doDrop(location);
  assertEquals(3, myManager.getGridRowCount(myContainer));
  final RadComponent addedComponent = myContainer.getComponents()[2];
  assertEquals(1, addedComponent.getConstraints().getRowSpan());
  assertEquals(1, addedComponent.getConstraints().getColSpan());

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:GridInsertLocationTest.java

示例5: testInsertGrowSingle

import com.intellij.uiDesigner.designSurface.DraggedComponentList; //导入依赖的package包/类
public void testInsertGrowSingle() {
  setGridSize(4, 4);

  // * . . .
  // . . . .
  // . . . .
  // . . . *

  insertComponent(0, 0, 1, 1);
  insertComponent(3, 3, 1, 1);

  setComponentDimensions(myDropComponent, 0, 0, 2, 2);
  GridInsertLocation location = new GridInsertLocation(myContainer, 1, 0, GridInsertMode.RowAfter);
  DraggedComponentList dcl = DraggedComponentList.withComponents(myDropComponent);
  assertTrue(location.canDrop(dcl));
  doDrop(location);
  assertEquals(6, myManager.getGridRowCount(myContainer));
  final RadComponent addedComponent = myContainer.getComponents()[2];
  assertEquals(2, addedComponent.getConstraints().getRowSpan());
  assertEquals(2, addedComponent.getConstraints().getColSpan());

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:GridInsertLocationTest.java

示例6: isDropOnChild

import com.intellij.uiDesigner.designSurface.DraggedComponentList; //导入依赖的package包/类
public static boolean isDropOnChild(final DraggedComponentList draggedComponentList, final ComponentDropLocation location)
{
	if(location.getContainer() == null)
	{
		return false;
	}

	for(RadComponent component : draggedComponentList.getComponents())
	{
		if(isChild(location.getContainer(), component))
		{
			return true;
		}
	}
	return false;
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:17,代码来源:FormEditingUtil.java

示例7: isDropOnChild

import com.intellij.uiDesigner.designSurface.DraggedComponentList; //导入依赖的package包/类
public static boolean isDropOnChild(final DraggedComponentList draggedComponentList,
                                    final ComponentDropLocation location) {
  if (location.getContainer() == null) {
    return false;
  }

  for (RadComponent component : draggedComponentList.getComponents()) {
    if (isChild(location.getContainer(), component)) {
      return true;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:FormEditingUtil.java

示例8: testInsertColumnAfter

import com.intellij.uiDesigner.designSurface.DraggedComponentList; //导入依赖的package包/类
public void testInsertColumnAfter() {
  assertEquals(1, myManager.getGridColumnCount(myContainer));

  insertComponent(0, 0, 1, 1);

  GridInsertLocation location = new GridInsertLocation(myContainer, 0, 0, GridInsertMode.ColumnAfter);
  DraggedComponentList dcl = DraggedComponentList.withComponents(myDropComponent);
  assertTrue(location.canDrop(dcl));
  doDrop(location);
  assertEquals(2, myManager.getGridColumnCount(myContainer));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:GridInsertLocationTest.java

示例9: testInsertRowBefore

import com.intellij.uiDesigner.designSurface.DraggedComponentList; //导入依赖的package包/类
public void testInsertRowBefore() {
  setGridSize(2, 1);
  insertComponent(0, 0, 1, 1);
  final RadComponent c = insertComponent(1, 0, 1, 1);

  GridInsertLocation location = new GridInsertLocation(myContainer, 1, 0, GridInsertMode.RowBefore);
  DraggedComponentList dcl = DraggedComponentList.withComponents(myDropComponent);
  assertTrue(location.canDrop(dcl));
  doDrop(location);
  assertEquals(2, c.getConstraints().getRow());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:GridInsertLocationTest.java

示例10: testInsertInMiddleOfComponentColumn

import com.intellij.uiDesigner.designSurface.DraggedComponentList; //导入依赖的package包/类
public void testInsertInMiddleOfComponentColumn() {
  myContainer.setLayout(new GridLayoutManager(1, 2));
  insertComponent(0, 0, 1, 2);

  GridInsertLocation location = new GridInsertLocation(myContainer, 0, 0, GridInsertMode.ColumnAfter);
  DraggedComponentList dcl = DraggedComponentList.withComponents(myDropComponent);
  assertFalse(location.canDrop(dcl));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:GridInsertLocationTest.java

示例11: testInsertInMiddleOfComponentRow

import com.intellij.uiDesigner.designSurface.DraggedComponentList; //导入依赖的package包/类
public void testInsertInMiddleOfComponentRow() {
  setGridSize(2, 1);
  insertComponent(0, 0, 2, 1);

  GridInsertLocation location = new GridInsertLocation(myContainer, 0, 0, GridInsertMode.RowAfter);
  DraggedComponentList dcl = DraggedComponentList.withComponents(myDropComponent);
  assertFalse(location.canDrop(dcl));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:GridInsertLocationTest.java

示例12: testInsertInsideBigComponent

import com.intellij.uiDesigner.designSurface.DraggedComponentList; //导入依赖的package包/类
public void testInsertInsideBigComponent() {
  setGridSize(2, 2);
  insertComponent(0, 0, 1, 1);
  insertComponent(1, 0, 1, 2);

  setComponentDimensions(myDropComponent, 0, 0, 2, 1);
  GridInsertLocation location = new GridInsertLocation(myContainer, 0, 0, GridInsertMode.ColumnAfter);
  assertFalse(location.canDrop(DraggedComponentList.withComponents(myDropComponent)));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:GridInsertLocationTest.java

示例13: testInsertDifferentRows

import com.intellij.uiDesigner.designSurface.DraggedComponentList; //导入依赖的package包/类
public void testInsertDifferentRows() {
  setGridSize(2, 1);
  insertComponent(0, 0, 1, 1);
  insertComponent(1, 0, 1, 1);

  RadComponent c1 = createComponent(0, 0, 1, 1);
  RadComponent c2 = createComponent(1, 0, 1, 1);

  GridInsertLocation location = new GridInsertLocation(myContainer, 1, 0, GridInsertMode.RowAfter);
  DraggedComponentList dcl = DraggedComponentList.withComponents(c1, c2);
  assertTrue(location.canDrop(dcl));
  location.processDrop(null, new RadComponent[] {c1, c2}, null, dcl);
  assertEquals(4, myManager.getGridRowCount(myContainer));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:GridInsertLocationTest.java

示例14: doDrop

import com.intellij.uiDesigner.designSurface.DraggedComponentList; //导入依赖的package包/类
private void doDrop(final GridInsertLocation location) {
  location.processDrop(null, new RadComponent[] {myDropComponent}, null, DraggedComponentList.withComponents(myDropComponent));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:GridInsertLocationTest.java

示例15: drop

import com.intellij.uiDesigner.designSurface.DraggedComponentList; //导入依赖的package包/类
@Override
public void drop(DropTargetDropEvent dtde)
{
	try
	{
		final DraggedComponentList dcl = DraggedComponentList.fromTransferable(dtde.getTransferable());
		ComponentItem componentItem = SimpleTransferable.getData(dtde.getTransferable(), ComponentItem.class);
		if(dcl != null || componentItem != null)
		{
			final TreePath path = getPathForLocation((int) dtde.getLocation().getX(), (int) dtde.getLocation().getY());
			final RadComponent targetComponent = getComponentFromPath(path);
			if(!myEditor.ensureEditable())
			{
				return;
			}
			if(targetComponent instanceof RadContainer)
			{
				final ComponentDropLocation dropLocation = ((RadContainer) targetComponent).getDropLocation(null);
				if(dcl != null)
				{
					if(!FormEditingUtil.isDropOnChild(dcl, dropLocation))
					{
						RadComponent[] components = dcl.getComponents().toArray(new RadComponent[dcl.getComponents().size()]);
						RadContainer[] originalParents = dcl.getOriginalParents();
						final GridConstraints[] originalConstraints = dcl.getOriginalConstraints();
						for(int i = 0; i < components.length; i++)
						{
							originalParents[i].removeComponent(components[i]);
						}
						dropLocation.processDrop(myEditor, components, null, dcl);
						for(int i = 0; i < originalConstraints.length; i++)
						{
							if(originalParents[i].getLayoutManager().isGrid())
							{
								FormEditingUtil.deleteEmptyGridCells(originalParents[i], originalConstraints[i]);
							}
						}
					}
				}
				else
				{
					new InsertComponentProcessor(myEditor).processComponentInsert(componentItem, dropLocation);
				}
			}
			myEditor.refreshAndSave(true);
		}
		setDropTargetComponent(null);
	}
	catch(Exception e)
	{
		LOG.error(e);
	}
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:54,代码来源:ComponentTree.java


注:本文中的com.intellij.uiDesigner.designSurface.DraggedComponentList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。