本文整理汇总了Java中com.intellij.uiDesigner.componentTree.ComponentTree.setDropTargetComponent方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentTree.setDropTargetComponent方法的具体用法?Java ComponentTree.setDropTargetComponent怎么用?Java ComponentTree.setDropTargetComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.uiDesigner.componentTree.ComponentTree
的用法示例。
在下文中一共展示了ComponentTree.setDropTargetComponent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dragExit
import com.intellij.uiDesigner.componentTree.ComponentTree; //导入方法依赖的package包/类
public void dragExit(DropTargetEvent dte) {
try {
ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
if (componentTree != null) {
componentTree.setDropTargetComponent(null);
}
myUseDragDelta = false;
if (myDraggedComponentList != null) {
cancelDrag();
setDraggingState(myDraggedComponentList, false);
myEditor.getActiveDecorationLayer().removeFeedback();
myDraggedComponentList = null;
myEditor.setDesignTimeInsets(2);
}
myDraggedComponentsCopy = null;
}
catch (Exception e) {
LOG.error(e);
}
}
示例2: dragExit
import com.intellij.uiDesigner.componentTree.ComponentTree; //导入方法依赖的package包/类
public void dragExit(DropTargetEvent dte)
{
try
{
ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
if(componentTree != null)
{
componentTree.setDropTargetComponent(null);
}
myUseDragDelta = false;
if(myDraggedComponentList != null)
{
cancelDrag();
setDraggingState(myDraggedComponentList, false);
myEditor.getActiveDecorationLayer().removeFeedback();
myDraggedComponentList = null;
myEditor.setDesignTimeInsets(2);
}
myDraggedComponentsCopy = null;
}
catch(Exception e)
{
LOG.error(e);
}
}
示例3: dragOver
import com.intellij.uiDesigner.componentTree.ComponentTree; //导入方法依赖的package包/类
public void dragOver(DropTargetDragEvent dtde) {
try {
if (myComponentDragObject == null) {
dtde.rejectDrag();
return;
}
final int dx = dtde.getLocation().x - myLastPoint.x;
final int dy = dtde.getLocation().y - myLastPoint.y;
if (myDraggedComponentsCopy != null && myDraggedComponentList != null) {
for (RadComponent aMySelection : myDraggedComponentsCopy) {
aMySelection.shift(dx, dy);
}
}
myLastPoint = dtde.getLocation();
myEditor.getDragLayer().repaint();
ComponentDropLocation location = myGridInsertProcessor.processDragEvent(dtde.getLocation(), myComponentDragObject);
ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
if (!location.canDrop(myComponentDragObject) ||
(myDraggedComponentList != null && FormEditingUtil.isDropOnChild(myDraggedComponentList, location))) {
if (componentTree != null) {
componentTree.setDropTargetComponent(null);
}
dtde.rejectDrag();
}
else {
if (componentTree != null) {
componentTree.setDropTargetComponent(location.getContainer());
}
dtde.acceptDrag(dtde.getDropAction());
}
}
catch (Exception e) {
LOG.error(e);
}
}
示例4: drop
import com.intellij.uiDesigner.componentTree.ComponentTree; //导入方法依赖的package包/类
public void drop(final DropTargetDropEvent dtde) {
try {
ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
if (componentTree != null) {
componentTree.setDropTargetComponent(null);
}
final DraggedComponentList dcl = DraggedComponentList.fromTransferable(dtde.getTransferable());
if (dcl != null) {
CommandProcessor.getInstance().executeCommand(myEditor.getProject(),
new Runnable() {
public void run() {
if (processDrop(dcl, dtde.getLocation(), dtde.getDropAction())) {
myEditor.refreshAndSave(true);
}
}
}, UIDesignerBundle.message("command.drop.components"), null);
}
else {
ComponentItem componentItem = SimpleTransferable.getData(dtde.getTransferable(), ComponentItem.class);
if (componentItem != null) {
myEditor.getMainProcessor().setInsertFeedbackEnabled(false);
new InsertComponentProcessor(myEditor).processComponentInsert(dtde.getLocation(), componentItem);
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
PaletteToolWindowManager.getInstance(myEditor).clearActiveItem();
myEditor.getActiveDecorationLayer().removeFeedback();
myEditor.getLayeredPane().setCursor(null);
myEditor.getGlassLayer().requestFocus();
myEditor.getMainProcessor().setInsertFeedbackEnabled(true);
}
});
}
}
myDraggedComponentsCopy = null;
myEditor.repaintLayeredPane();
}
catch (Exception e) {
LOG.error(e);
}
}
示例5: dragOver
import com.intellij.uiDesigner.componentTree.ComponentTree; //导入方法依赖的package包/类
public void dragOver(DropTargetDragEvent dtde)
{
try
{
if(myComponentDragObject == null)
{
dtde.rejectDrag();
return;
}
final int dx = dtde.getLocation().x - myLastPoint.x;
final int dy = dtde.getLocation().y - myLastPoint.y;
if(myDraggedComponentsCopy != null && myDraggedComponentList != null)
{
for(RadComponent aMySelection : myDraggedComponentsCopy)
{
aMySelection.shift(dx, dy);
}
}
myLastPoint = dtde.getLocation();
myEditor.getDragLayer().repaint();
ComponentDropLocation location = myGridInsertProcessor.processDragEvent(dtde.getLocation(), myComponentDragObject);
ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
if(!location.canDrop(myComponentDragObject) || (myDraggedComponentList != null && FormEditingUtil.isDropOnChild(myDraggedComponentList,
location)))
{
if(componentTree != null)
{
componentTree.setDropTargetComponent(null);
}
dtde.rejectDrag();
}
else
{
if(componentTree != null)
{
componentTree.setDropTargetComponent(location.getContainer());
}
dtde.acceptDrag(dtde.getDropAction());
}
}
catch(Exception e)
{
LOG.error(e);
}
}
示例6: drop
import com.intellij.uiDesigner.componentTree.ComponentTree; //导入方法依赖的package包/类
public void drop(final DropTargetDropEvent dtde)
{
try
{
ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
if(componentTree != null)
{
componentTree.setDropTargetComponent(null);
}
final DraggedComponentList dcl = DraggedComponentList.fromTransferable(dtde.getTransferable());
if(dcl != null)
{
CommandProcessor.getInstance().executeCommand(myEditor.getProject(), new Runnable()
{
public void run()
{
if(processDrop(dcl, dtde.getLocation(), dtde.getDropAction()))
{
myEditor.refreshAndSave(true);
}
}
}, UIDesignerBundle.message("command.drop.components"), null);
}
else
{
ComponentItem componentItem = SimpleTransferable.getData(dtde.getTransferable(), ComponentItem.class);
if(componentItem != null)
{
myEditor.getMainProcessor().setInsertFeedbackEnabled(false);
new InsertComponentProcessor(myEditor).processComponentInsert(dtde.getLocation(), componentItem);
ApplicationManager.getApplication().invokeLater(new Runnable()
{
public void run()
{
PaletteToolWindowManager.getInstance(myEditor).clearActiveItem();
myEditor.getActiveDecorationLayer().removeFeedback();
myEditor.getLayeredPane().setCursor(null);
myEditor.getGlassLayer().requestFocus();
myEditor.getMainProcessor().setInsertFeedbackEnabled(true);
}
});
}
}
myDraggedComponentsCopy = null;
myEditor.repaintLayeredPane();
}
catch(Exception e)
{
LOG.error(e);
}
}