本文整理匯總了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);
}
}