本文整理汇总了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
}
}
示例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));
}
示例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));
}
示例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
}
}
示例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();
}