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


Java DropTarget.addDropTargetListener方法代码示例

本文整理汇总了Java中java.awt.dnd.DropTarget.addDropTargetListener方法的典型用法代码示例。如果您正苦于以下问题:Java DropTarget.addDropTargetListener方法的具体用法?Java DropTarget.addDropTargetListener怎么用?Java DropTarget.addDropTargetListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.dnd.DropTarget的用法示例。


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

示例1: installDropTargetHandler

import java.awt.dnd.DropTarget; //导入方法依赖的package包/类
/**
 * 
 */
protected void installDropTargetHandler()
{
	DropTarget dropTarget = graphComponent.getDropTarget();

	try
	{
		if (dropTarget != null)
		{
			dropTarget.addDropTargetListener(this);
			currentDropTarget = dropTarget;
		}
	}
	catch (TooManyListenersException tmle)
	{
		// should not happen... swing drop target is multicast
	}
}
 
开发者ID:GDSRS,项目名称:TrabalhoFinalEDA2,代码行数:21,代码来源:mxGraphHandler.java

示例2: EditorRuler

import java.awt.dnd.DropTarget; //导入方法依赖的package包/类
/**
 * Constructs a new ruler for the specified graph and orientation.
 * 
 * @param graph The graph to create the ruler for.
 * @param orientation The orientation to use for the ruler.
 */
public EditorRuler(mxGraphComponent graphComponent, int orientation) {
  this.orientation = orientation;
  this.graphComponent = graphComponent;
  updateIncrementAndUnits();

  graphComponent.getGraph().getView().addListener(mxEvent.SCALE, repaintHandler);
  graphComponent.getGraph().getView().addListener(mxEvent.TRANSLATE, repaintHandler);
  graphComponent.getGraph().getView().addListener(mxEvent.SCALE_AND_TRANSLATE, repaintHandler);

  graphComponent.getGraphControl().addMouseMotionListener(this);

  DropTarget dropTarget = graphComponent.getDropTarget();

  try {
    if (dropTarget != null) {
      dropTarget.addDropTargetListener(this);
    }
  } catch (TooManyListenersException tmle) {
    // should not happen... swing drop target is multicast
  }

  setBorder(BorderFactory.createLineBorder(Color.black));
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:30,代码来源:EditorRuler.java

示例3: EditorRuler

import java.awt.dnd.DropTarget; //导入方法依赖的package包/类
/**
 * Constructs a new ruler for the specified graph and orientation.
 * 
 * @param graph
 *            The graph to create the ruler for.
 * @param orientation
 *            The orientation to use for the ruler.
 */
public EditorRuler(mxGraphComponent graphComponent, int orientation)
{
	this.orientation = orientation;
	this.graphComponent = graphComponent;
	updateIncrementAndUnits();

	graphComponent.getGraph().getView().addListener(
			mxEvent.SCALE, repaintHandler);
	graphComponent.getGraph().getView().addListener(
			mxEvent.TRANSLATE, repaintHandler);
	graphComponent.getGraph().getView().addListener(
			mxEvent.SCALE_AND_TRANSLATE, repaintHandler);

	graphComponent.getGraphControl().addMouseMotionListener(this);

	DropTarget dropTarget = graphComponent.getDropTarget();

	try
	{
		if (dropTarget != null)
		{
			dropTarget.addDropTargetListener(this);
		}
	}
	catch (TooManyListenersException tmle)
	{
		// should not happen... swing drop target is multicast
	}

	setBorder(BorderFactory.createLineBorder(Color.black));
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:40,代码来源:EditorRuler.java

示例4: installDropTargetHandler

import java.awt.dnd.DropTarget; //导入方法依赖的package包/类
/**
 * 
 */
protected void installDropTargetHandler() {
  DropTarget dropTarget = graphComponent.getDropTarget();

  try {
    if (dropTarget != null) {
      dropTarget.addDropTargetListener(this);
      currentDropTarget = dropTarget;
    }
  } catch (TooManyListenersException tmle) {
    // should not happen... swing drop target is multicast
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:16,代码来源:mxGraphHandler.java

示例5: MainWindow

import java.awt.dnd.DropTarget; //导入方法依赖的package包/类
public MainWindow(File fileFromCommandLine) {
    configSaver = ConfigSaver.getLoadedInstance();
    windowPosition = configSaver.getMainWindowPosition();
    luytenPrefs = configSaver.getLuytenPreferences();

    mainMenuBar = new MainMenuBar(this);
    this.setJMenuBar(mainMenuBar);

    this.adjustWindowPositionBySavedState();
    this.setHideFindBoxOnMainWindowFocus();
    this.setShowFindAllBoxOnMainWindowFocus();
    this.setQuitOnWindowClosing();
    this.setTitle(TITLE);
    this.setIconImage(new ImageIcon(
            Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("/resources/kidney.png"))).getImage());

    model = new Model(this);
    this.getContentPane().add(model);

    if (fileFromCommandLine != null) {
        model.checkFileSelected(fileFromCommandLine);
    }

    try {
        DropTarget dt = new DropTarget();
        dt.addDropTargetListener(new DropListener(this));
        this.setDropTarget(dt);
    } catch (Exception e) {
        Luyten.showExceptionDialog("Exception!", e);
    }

    fileDialog = new FileDialog(this);
    // fileSaver = new FileSaver(bar, label);

    this.setExitOnEscWhenEnabled(model);

    if (fileFromCommandLine == null || fileFromCommandLine.getName().toLowerCase().endsWith(".jar")
            || fileFromCommandLine.getName().toLowerCase().endsWith(".zip")) {
        model.startWarmUpThread();
    }

    if (RecentFiles.load() > 0)
        mainMenuBar.updateRecentFiles();
}
 
开发者ID:hsswx7,项目名称:CS4500GroupProject,代码行数:45,代码来源:MainWindow.java


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