Package javax.swing

Examples of javax.swing.TransferHandler$DragHandler


        panel = new JPanel();
        panel.setLayout(new BorderLayout());
        panel.add(sPane, BorderLayout.CENTER);
        panel.add(builder.getPanel(), BorderLayout.EAST);

  TransferHandler th = new FileListEditorTransferHandler();
  setTransferHandler(th);
        panel.setTransferHandler(th);

        // Add an input/action pair for deleting entries:
        getInputMap().put(KeyStroke.getKeyStroke("DELETE"), "delete");
View Full Code Here


        // Replace previous furniture catalog view by the new one
        JComponent oldFurnitureCatalogView = this.furnitureCatalogView.get();       
        if (oldFurnitureCatalogView != null) {
          JComponent newFurnitureCatalogView = (JComponent)homePane.controller.getFurnitureCatalogController().getView();
          newFurnitureCatalogView.setComponentPopupMenu(oldFurnitureCatalogView.getComponentPopupMenu());
          TransferHandler transferHandler = oldFurnitureCatalogView.getTransferHandler();
          newFurnitureCatalogView.setTransferHandler(transferHandler);
          JComponent splitPaneTopComponent = newFurnitureCatalogView;
          if (newFurnitureCatalogView instanceof Scrollable) {
            splitPaneTopComponent = new HomeScrollPane(newFurnitureCatalogView);
          } else {
View Full Code Here

        ImportedFurnitureWizardStepsPanel.class, "modelChoiceErrorLabel.text"));
    // Make modelChoiceErrorLabel visible only if an error occurred during model content loading
    this.modelChoiceErrorLabel.setVisible(false);
    this.modelPreviewComponent = new ModelPreviewComponent();
    // Add a transfer handler to model preview component to let user drag and drop a file in component
    this.modelPreviewComponent.setTransferHandler(new TransferHandler() {
        @Override
        public boolean canImport(JComponent comp, DataFlavor [] flavors) {
          return Arrays.asList(flavors).contains(DataFlavor.javaFileListFlavor);
        }
       
View Full Code Here

      try {
        String importTextureButtonText = SwingTools.getLocalizedLabelText(
            preferences, TextureChoiceComponent.class, "importTextureButton.text");
        this.texturePreviewLabel.setBorder(SwingTools.getDropableComponentBorder());
        // Add to label a transfer handler to let user drag and drop a file on it
        this.texturePreviewLabel.setTransferHandler(new TransferHandler() {
            @Override
            public boolean canImport(JComponent comp, DataFlavor [] flavors) {
              return Arrays.asList(flavors).contains(DataFlavor.javaFileListFlavor);
            }
           
View Full Code Here

        ImportedTextureWizardStepsPanel.class, "imageChoiceErrorLabel.text"));
    // Make imageChoiceErrorLabel visible only if an error occurred during image content loading
    this.imageChoiceErrorLabel.setVisible(false);
    this.imageChoicePreviewComponent = new ScaledImageComponent();
    // Add a transfer handler to image preview component to let user drag and drop an image in component
    this.imageChoicePreviewComponent.setTransferHandler(new TransferHandler() {
        @Override
        public boolean canImport(JComponent comp, DataFlavor [] flavors) {
          return Arrays.asList(flavors).contains(DataFlavor.javaFileListFlavor);
        }
       
View Full Code Here

        BackgroundImageWizardStepsPanel.class, "imageChoiceErrorLabel.text"));
    // Make imageChoiceErrorLabel visible only if an error occurred during image content loading
    this.imageChoiceErrorLabel.setVisible(false);
    this.imageChoicePreviewComponent = new ScaledImageComponent();
    // Add a transfer handler to image preview component to let user drag and drop an image in component
    this.imageChoicePreviewComponent.setTransferHandler(new TransferHandler() {
        @Override
        public boolean canImport(JComponent comp, DataFlavor [] flavors) {
          return Arrays.asList(flavors).contains(DataFlavor.javaFileListFlavor);
        }
       
View Full Code Here

 
  /** {@inheritDoc} */
  public boolean canImport(JComponent comp, DataFlavor[] transferFlavors) {
    boolean canImport = false;
    for (Iterator iterator = transferHandlers.iterator(); (iterator.hasNext()) && (!canImport);) {
      TransferHandler handler = (TransferHandler) iterator.next();
      canImport = handler.canImport(comp, transferFlavors);
    }
    return canImport;
  }
View Full Code Here

  /** {@inheritDoc} */
  public boolean importData(JComponent comp, Transferable t) {
    boolean wasImported = false;
   
    for (Iterator iterator = transferHandlers.iterator(); (iterator.hasNext()) && (!wasImported);) {
      TransferHandler handler = (TransferHandler) iterator.next();
      if (handler.canImport(comp, t.getTransferDataFlavors())) {
  wasImported = handler.importData(comp, t);
      }
    }
    return wasImported;
  }
View Full Code Here

  /**
   * Installs the TransferHandler for this component.
   */
  public void installTransferHandler() {
    if (editorPane != null && mTransferHandler == null) {
      TransferHandler defaultHandler = editorPane.getTransferHandler();

      net.suberic.pooka.gui.dnd.MultipleTransferHandler multiHandler = new net.suberic.pooka.gui.dnd.MultipleTransferHandler();
      multiHandler.addTransferHandler(defaultHandler);
      multiHandler.addTransferHandler(new net.suberic.pooka.gui.dnd.NewMessageTransferHandler());
      mTransferHandler = multiHandler;
View Full Code Here

    private static final String GEPHI_EXTENSION = "gephi";

    public static void register() {
        JFrame frame = (JFrame) WindowManager.getDefault().getMainWindow();
        frame.setTransferHandler(new TransferHandler() {

            @Override
            public boolean canImport(TransferHandler.TransferSupport support) {
                if (!support.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
                    return false;
View Full Code Here

TOP

Related Classes of javax.swing.TransferHandler$DragHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.