當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。