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