Example usage for javax.swing ToolTipManager sharedInstance

List of usage examples for javax.swing ToolTipManager sharedInstance

Introduction

In this page you can find the example usage for javax.swing ToolTipManager sharedInstance.

Prototype

public static ToolTipManager sharedInstance() 

Source Link

Document

Returns a shared ToolTipManager instance.

Usage

From source file:org.jfree.chart.demo.SuperDemo.java

private JPanel createNoDemoSelectedPanel() {
    JPanel jpanel = new JPanel(new FlowLayout()) {

        private static final long serialVersionUID = 1L;

        public String getToolTipText() {
            return "(" + getWidth() + ", " + getHeight() + ")";
        }/*from   w  w  w .  j a  v a  2 s.  c o m*/

    };
    ToolTipManager.sharedInstance().registerComponent(jpanel);
    jpanel.add(new JLabel("No demo selected"));
    jpanel.setPreferredSize(new Dimension(600, 400));
    return jpanel;
}

From source file:edu.harvard.i2b2.query.ui.GroupPanel.java

/**
 * This method is called from within the constructor to initialize the form.
 *//*from   www . j  a va  2  s.  c  o m*/
private void initComponents() {
    jScrollPane1 = new javax.swing.JScrollPane();
    jClearButton = new javax.swing.JButton();
    jConstrainButton = new javax.swing.JButton();
    jExcludeButton = new javax.swing.JButton();
    jOccurrenceButton = new javax.swing.JButton();
    jNameLabel = new javax.swing.JLabel();
    jHintLabel = new javax.swing.JLabel();
    jTimingComboBox = new javax.swing.JComboBox();
    // jAnyvisitToggleButton = new javax.swing.JToggleButton();
    // jSamevisitToggleButton = new javax.swing.JToggleButton();

    setLayout(null);

    QueryConceptTreeNodeData tmpData = new QueryConceptTreeNodeData();
    tmpData.name("working ......");
    tmpData.tooltip("A root node");
    tmpData.visualAttribute("FAO");
    top = new DefaultMutableTreeNode(tmpData);
    // top = new DefaultMutableTreeNode("Root Node");
    treeModel = new DefaultTreeModel(top);
    // treeModel.addTreeModelListener(new MyTreeModelListener());

    jTree1 = new JTree(treeModel);

    jTree1.setDragEnabled(true);
    jTree1.setEditable(true);
    // jTree1.getSelectionModel().setSelectionMode
    // (TreeSelectionModel.SINGLE_TREE_SELECTION);
    // jTree1.setShowsRootHandles(true);
    // JScrollPane treeView = new JScrollPane(jTree1);
    jTree1.setRootVisible(false);
    jTree1.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    jTree1.setCellRenderer(new MyRenderer());
    ToolTipManager.sharedInstance().registerComponent(jTree1);

    setBorder(javax.swing.BorderFactory.createEtchedBorder());
    add(jScrollPane1);
    // jScrollPane1.setBounds(0, 40, 180, 200);

    jClearButton.setFont(new java.awt.Font("Tahoma", 1, 10));
    jClearButton.setText("X");
    jClearButton.setToolTipText("Clear all items from panel");
    jClearButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    jClearButton.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
    jClearButton.setMargin(new java.awt.Insets(2, 2, 2, 2));
    if (System.getProperty("os.name").toLowerCase().indexOf("mac") > -1) {
        jClearButton.setMargin(new java.awt.Insets(-10, -15, -10, -20));
    }
    jClearButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jClearButtonActionPerformed(evt);
        }
    });

    add(jClearButton);
    jClearButton.setBounds(160, 0, 18, 20);

    jConstrainButton.setText("Dates");
    jConstrainButton.setToolTipText("Constrain group by dates");
    jConstrainButton.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
    jConstrainButton.setMargin(new java.awt.Insets(2, 2, 2, 2));
    // jConstrainButton.setMargin(new java.awt.Insets(-10, -15, -10,-20));
    if (System.getProperty("os.name").toLowerCase().indexOf("mac") > -1) {
        jConstrainButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        // jConstrainButton.setMargin(new java.awt.Insets(2, 2, 2, 2));
        jConstrainButton.setMargin(new java.awt.Insets(-10, -15, -10, -20));
    }

    jConstrainButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jConstrainButtonActionPerformed(evt);
        }
    });

    add(jConstrainButton);
    jConstrainButton.setBounds(0, 20, 40, 21);

    jOccurrenceButton.setText("Occurs > 0x");
    jOccurrenceButton.setToolTipText("Set occurrence times");
    jOccurrenceButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jOccurrenceButton.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jOccurrenceButton.setMargin(new java.awt.Insets(2, 2, 2, 2));
    if (System.getProperty("os.name").toLowerCase().indexOf("mac") > -1) {
        jOccurrenceButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jOccurrenceButton.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jOccurrenceButton.setMargin(new java.awt.Insets(-10, -10, -10, -10));
    }
    jOccurrenceButton.setIconTextGap(0);
    jOccurrenceButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jOccurrenceButtonActionPerformed(evt);
        }
    });
    jOccurrenceButton.setBounds(40, 20, 90, 21);
    add(jOccurrenceButton);

    // jExcludeButton.setMnemonic('E');
    jExcludeButton.setText("Exclude");
    jExcludeButton.setToolTipText("Exclude all items in group");
    jExcludeButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jExcludeButton.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jExcludeButton.setMargin(new java.awt.Insets(2, 2, 2, 2));
    if (System.getProperty("os.name").toLowerCase().indexOf("mac") > -1) {
        jExcludeButton.setMargin(new java.awt.Insets(-10, -15, -10, -20));
        jExcludeButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    }
    jExcludeButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jExcludeButtonActionPerformed(evt);
        }
    });
    add(jExcludeButton);
    jExcludeButton.setBounds(130, 20, 48, 21);

    jNameLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jNameLabel.setText("Group 1");
    jNameLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jNameLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    add(jNameLabel);
    jNameLabel.setBounds(0, 0, 160, 20);
    jNameLabel.setTransferHandler(new GroupLabelTextHandler());
    jNameLabel.addMouseListener(new DragMouseAdapter());
    jNameLabel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseMoved(java.awt.event.MouseEvent evt) {
            jNameLabelMouseMoved(evt);
            // System.out.println("mouse x: "+evt.getX()+" y: "+evt.
            // getY());
            // System.out.println("name label x: "+jNameLabel.getX()+
            // " width: "+
            // jNameLabel.getWidth()+" y: "
            // +jNameLabel.getY()+" height "+jNameLabel.getHeight());
        }

    });
    jNameLabel.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseExited(java.awt.event.MouseEvent evt) {
            jNameLabelMouseExited(evt);
        }

    });

    /*
     * jAnyvisitToggleButton.setText("Any Visit");
     * add(jAnyvisitToggleButton); jAnyvisitToggleButton.setBounds(0, 40,
     * 89, 20);
     * 
     * jSamevisitToggleButton.setText("Same Visit");
     * add(jSamevisitToggleButton); jSamevisitToggleButton.setBounds(90, 40,
     * 88, 20);
     * 
     * ButtonGroup group = new ButtonGroup();
     * group.add(jAnyvisitToggleButton); group.add(jSamevisitToggleButton);
     * jAnyvisitToggleButton.setSelected(true);
     */

    jTree1.addTreeExpansionListener(this);
    jTree1.setTransferHandler(new TextHandler());
    add(jScrollPane1);
    jScrollPane1.setViewportView(jTree1);
    // jTree1.setToolTipText(
    // "Double click on a folder to view the items inside");
    // jScrollPane1.getViewport().setToolTipText(
    // "Double click on a folder to view the items inside");
    jScrollPane1.setBounds(0, 60, 180, 120);
    // jScrollPane1.setBounds(0, 60, 190, 270);
    // jScrollPane1.setBorder(javax.swing.BorderFactory.createLineBorder(new
    // java.awt.Color(0, 0, 0)));
    // jTree1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter()
    // {
    // public void mouseMoved(java.awt.event.MouseEvent evt) {
    // jScrollPane1MouseMoved(evt);
    // }

    // @Override
    // public void mouseDragged(MouseEvent e) {
    // jScrollPane1MouseMoved(e);
    // }

    // });
    // jTree1.addMouseListener(new java.awt.event.MouseAdapter() {
    // public void mouseExited(java.awt.event.MouseEvent evt) {
    // jScrollPane1MouseExited(evt);
    // }

    // @Override
    // public void mouseEntered(MouseEvent e) {

    // jScrollPane1MouseEntered(e);
    // }

    // });

    jHintLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jHintLabel.setText(
            "<html><center>Drag terms from Navigate, <br>" + "<left>Find and Workplace into this group");
    // jHintLabel.getFont();
    jHintLabel.setFont(new Font("SansSerif", Font.PLAIN, 9));
    // jHintLabel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jHintLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jHintLabel.setVerticalAlignment(javax.swing.SwingConstants.CENTER);
    // jHintLabel.setBackground(Color.WHITE);
    // jHintLabel.setForeground(Color.WHITE);
    add(jHintLabel);
    jHintLabel.setBounds(0, 120, 180, 30);

    jTimingComboBox.setModel(new javax.swing.DefaultComboBoxModel(
            new String[] { "Treat Independently", "Occurs in Same Encounter", "Items instance will be same" }));
    jTimingComboBox.setAlignmentX(5.0F);
    ListCellRenderer renderer = new DefaultListCellRenderer();
    ((JLabel) renderer).setHorizontalAlignment(SwingConstants.CENTER);
    jTimingComboBox.setRenderer(renderer);
    // jTimingComboBox.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
    add(jTimingComboBox);
    jTimingComboBox.setBounds(1, 40, 177, 20);
    jTimingComboBox.setEnabled(false);
}

From source file:com.monead.semantic.workbench.SemanticWorkbench.java

/**
 * Setup all the components/*from  www  .j  av  a2  s.  c om*/
 */
private void setupControls() {
    LOGGER.debug("setupControls");

    reasoningLevel = new JComboBox();
    for (ReasonerSelection reasoner : ReasonerSelection.values()) {
        reasoningLevel.addItem(reasoner);
    }
    reasoningLevel.setSelectedIndex(reasoningLevel.getItemCount() - 1);
    reasoningLevel.setToolTipText(((ReasonerSelection) reasoningLevel.getSelectedItem()).description());
    reasoningLevel.addActionListener(new ReasonerConfigurationChange());

    language = new JComboBox();
    language.addItem("Auto");
    for (String lang : FORMATS) {
        language.addItem(lang);
    }
    language.setSelectedIndex(0);

    assertedTripleCount = new JLabel(NOT_APPLICABLE_DISPLAY);
    assertedTripleCount.setHorizontalAlignment(JLabel.CENTER);
    inferredTripleCount = new JLabel(NOT_APPLICABLE_DISPLAY);
    inferredTripleCount.setHorizontalAlignment(JLabel.CENTER);

    runInferencing = new JButton("Create Model");
    runInferencing.setToolTipText(
            "Creates an ontology model using the provieed assertions " + "and the selected reasoning level");
    runInferencing.addActionListener(new ReasonerListener());

    runSparql = new JButton("Run Query");
    runSparql.addActionListener(new SparqlListener());

    sparqlServerInfo = new JLabel("Shutdown");
    sparqlServerInfo.setHorizontalAlignment(SwingConstants.CENTER);
    sparqlServerInfo.setBorder(BorderFactory.createTitledBorder("SPARQL Server Status"));

    proxyInfo = new JLabel("Disabled");
    proxyInfo.setHorizontalAlignment(SwingConstants.CENTER);
    proxyInfo.setBorder(BorderFactory.createTitledBorder("Proxy Status"));

    assertionsInput = new JTextArea(10, 50);
    assertionsInput.addKeyListener(new UserInputListener());
    assertionsInput.addCaretListener(new TextAreaCaratListener());

    inferredTriples = new JTextArea(10, 50);
    inferredTriples.setEditable(false);

    // SPARQL Input
    sparqlInput = new JTextArea(10, 50);
    sparqlInput.addKeyListener(new UserInputListener());
    sparqlInput.addCaretListener(new TextAreaCaratListener());

    // User id and password for accessing secured SPARQL endpoints
    sparqlServiceUserId = new JTextField(10);
    sparqlServicePassword = new JPasswordField(10);

    // SPARQL service URLs
    sparqlServiceUrl = new JComboBox();
    sparqlServiceUrl.setEditable(true);
    sparqlServiceUrl.addActionListener(new SparqlModelChoiceListener());
    sparqlServiceUrl.getEditor().getEditorComponent().addKeyListener(new UserInputListener());

    // Default graph if required
    defaultGraphUri = new JTextField();
    defaultGraphUri.setColumns(20);

    // Move through query history
    previousQuery = new JButton("Previous");
    previousQuery.addActionListener(new SparqlHistoryPreviousListener());
    nextQuery = new JButton("Next");
    nextQuery.addActionListener(new SparqlHistoryNextListener());

    // A basic default query
    sparqlInput.setText("select ?s ?p ?o where { ?s ?p ?o } limit 100");

    // Results table
    // sparqlResultsTable = new JTable(new SparqlTableModel());
    sparqlResultsTable = new JTable();

    // TODO Allow configuration to switch auto-resizing on/off (e.g. horizontal
    // scrolling)
    sparqlResultsTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

    sparqlResultsTable.setAutoCreateRowSorter(true);

    // Determine whether alternate tree icons exist
    if (ImageLibrary.instance().getImageIcon(ImageLibrary.ICON_TREE_CLASS) != null) {
        replaceTreeImages = true;
    }

    LOGGER.debug("Tree renderer, specialized icons available? " + replaceTreeImages);

    // Create the tree UI with a default model
    ontModelTree = new JTree(new DefaultTreeModel(new DefaultMutableTreeNode("No Tree Generated")));

    ontModelTree.addMouseListener(new OntologyModelTreeMouseListener());

    if (replaceTreeImages) {
        ToolTipManager.sharedInstance().registerComponent(ontModelTree);
        ontModelTree.setCellRenderer(new OntologyTreeCellRenderer());
    }

    // Status label
    status = new JLabel("Initializing");
}

From source file:net.sourceforge.squirrel_sql.client.Application.java

private void preferencesHaveChanged(PropertyChangeEvent evt) {
    final String propName = evt != null ? evt.getPropertyName() : null;

    if (propName == null || propName.equals(SquirrelPreferences.IPropertyNames.SHOW_TOOLTIPS)) {
        ToolTipManager.sharedInstance().setEnabled(_prefs.getShowToolTips());
    }//from   w w  w .  j  a  va2 s.c o m

    if (propName == null || propName.equals(SquirrelPreferences.IPropertyNames.JDBC_DEBUG_TYPE)) {
        setupJDBCLogging();
    }

    if (propName == null || propName.equals(SquirrelPreferences.IPropertyNames.LOGIN_TIMEOUT)) {
        DriverManager.setLoginTimeout(_prefs.getLoginTimeout());
    }

    if (propName == null || propName == SquirrelPreferences.IPropertyNames.PROXY) {
        new ProxyHandler().apply(_prefs.getProxySettings());
    }
}

From source file:net.sourceforge.squirrel_sql.fw.gui.debug.DebugEventListener.java

public void setEnabled(boolean enable) {
    Toolkit kit = Toolkit.getDefaultToolkit();
    if (enable) {
        /* register as a listener for mouse events */
        kit.addAWTEventListener(this, AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);

        /* show all tooltips for ten seconds before hiding */
        ToolTipManager.sharedInstance().setDismissDelay(10000);
    } else {//from  w w  w.j a v  a  2 s.co m
        kit.removeAWTEventListener(this);
    }
}

From source file:opendial.gui.stateviewer.StateViewer.java

/**
 * Creates a new graph viewer, connected to the component given as
 * argument.  The viewer initially displays an empty graph.
 * //from  w  w w .ja  v a2 s.c o m
 * @param tab the state viewer component
 */
public StateViewer(StateViewerTab tab) {
    super(new StaticLayout<String, Integer>(new DelegateForest<String, Integer>()));
    this.tab = tab;

    // scaling it by 60%
    final ScalingControl scaler = new CrossoverScalingControl();
    scaler.scale(this, 0.7f, getCenter());

    // setting various renderers and element transformers
    setBackground(Color.white);
    getRenderContext().setVertexLabelTransformer(new ToStringLabeller<String>());
    getRenderContext().setVertexShapeTransformer(new CustomVertexShapeRenderer());
    getRenderContext().setVertexFillPaintTransformer(new CustomVertexColourRenderer());
    getRenderContext().setVertexLabelRenderer(new CustomVertexLabelRenderer());
    getRenderer().getVertexLabelRenderer().setPosition(Position.S);
    setVertexToolTipTransformer(new CustomToolTipTransformer());
    ToolTipManager.sharedInstance().setDismissDelay(1000000000);

    // connects the graph to a custom mouse listener (for selecting nodes)
    DefaultModalGraphMouse<String, Integer> graphMouse = new DefaultModalGraphMouse<String, Integer>();
    graphMouse.setMode(Mode.PICKING);
    graphMouse.add(new PopupHandler(this));
    setGraphMouse(graphMouse);

    shownDistribs = new HashMap<String, DistributionViewer>();
}

From source file:opendial.gui.utils.StateViewer.java

/**
 * Creates a new graph viewer, connected to the component given as argument. The
 * viewer initially displays an empty graph.
 * /*from  www  . j ava  2s . c o m*/
 * @param tab the state viewer component
 */
public StateViewer(StateMonitorTab tab) {
    super(new StaticLayout<String, Integer>(new DelegateForest<String, Integer>()));
    this.tab = tab;

    // scaling it by 60%
    final ScalingControl scaler = new CrossoverScalingControl();
    scaler.scale(this, 0.7f, getCenter());

    // setting various renderers and element transformers
    setBackground(Color.white);
    getRenderContext().setVertexLabelTransformer(new ToStringLabeller<String>());
    getRenderContext().setVertexShapeTransformer(new CustomVertexShapeRenderer());
    getRenderContext().setVertexFillPaintTransformer(new CustomVertexColourRenderer());
    getRenderContext().setVertexLabelRenderer(new CustomVertexLabelRenderer());
    getRenderer().getVertexLabelRenderer().setPosition(Position.S);
    setVertexToolTipTransformer(new CustomToolTipTransformer());
    ToolTipManager.sharedInstance().setDismissDelay(1000000000);

    // connects the graph to a custom mouse listener (for selecting nodes)
    DefaultModalGraphMouse<String, Integer> graphMouse = new DefaultModalGraphMouse<String, Integer>();
    graphMouse.setMode(Mode.PICKING);

    graphMouse.add(new PopupHandler(this));
    setGraphMouse(graphMouse);

    shownDistribs = new HashMap<String, DistributionViewer>();
}

From source file:org.apache.log4j.chainsaw.LogUI.java

private void initPrefModelListeners() {
    applicationPreferenceModel.addPropertyChangeListener("identifierExpression", new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            handler.setIdentifierExpression(evt.getNewValue().toString());
        }/*  ww w . j  av  a 2 s  . c  o  m*/
    });
    handler.setIdentifierExpression(applicationPreferenceModel.getIdentifierExpression());

    applicationPreferenceModel.addPropertyChangeListener("toolTipDisplayMillis", new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            ToolTipManager.sharedInstance().setDismissDelay(((Integer) evt.getNewValue()).intValue());
        }
    });
    ToolTipManager.sharedInstance().setDismissDelay(applicationPreferenceModel.getToolTipDisplayMillis());

    applicationPreferenceModel.addPropertyChangeListener("responsiveness", new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            int value = ((Integer) evt.getNewValue()).intValue();
            handler.setQueueInterval((value * 1000) - 750);
        }
    });
    handler.setQueueInterval((applicationPreferenceModel.getResponsiveness() * 1000) - 750);

    applicationPreferenceModel.addPropertyChangeListener("tabPlacement", new PropertyChangeListener() {
        public void propertyChange(final PropertyChangeEvent evt) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    int placement = ((Integer) evt.getNewValue()).intValue();

                    switch (placement) {
                    case SwingConstants.TOP:
                    case SwingConstants.BOTTOM:
                        tabbedPane.setTabPlacement(placement);

                        break;

                    default:
                        break;
                    }
                }
            });
        }
    });

    applicationPreferenceModel.addPropertyChangeListener("statusBar", new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            boolean value = ((Boolean) evt.getNewValue()).booleanValue();
            setStatusBarVisible(value);
        }
    });
    setStatusBarVisible(applicationPreferenceModel.isStatusBar());

    applicationPreferenceModel.addPropertyChangeListener("receivers", new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            boolean value = ((Boolean) evt.getNewValue()).booleanValue();

            if (value) {
                showReceiverPanel();
            } else {
                hideReceiverPanel();
            }
        }
    });
    //    if (applicationPreferenceModel.isReceivers()) {
    //      showReceiverPanel();
    //    } else {
    //      hideReceiverPanel();
    //    }

    applicationPreferenceModel.addPropertyChangeListener("toolbar", new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            boolean value = ((Boolean) evt.getNewValue()).booleanValue();
            toolbar.setVisible(value);
        }
    });
    toolbar.setVisible(applicationPreferenceModel.isToolbar());

}

From source file:org.domainmath.gui.FileTreePanel.java

/**
 * Creates new form FileTreePanel//from w  w w  . java2s. c o  m
 * @param frame
 */

public FileTreePanel(MainFrame frame) {
    initComponents();
    this.frame = frame;
    fileTree.setEditable(true);
    addPopupMenuToFileTree();

    ToolTipManager.sharedInstance().registerComponent(fileTree);

    // handle right click event on File Tree.
    fileTree.addMouseListener(new MouseAdapter() {
        @Override
        public void mousePressed(MouseEvent e) {
            if (e.getClickCount() == 2) {
                TreePath path = fileTree.getPathForLocation(e.getX(), e.getY());
                Rectangle pathBounds = fileTree.getUI().getPathBounds(fileTree, path);
                if (pathBounds != null && pathBounds.contains(e.getX(), e.getY())) {
                    File file = (File) fileTree.getLastSelectedPathComponent();
                    selectFile(file);
                }
            }
        }
    });

    keyDeleteItem = KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0);
    keyRenameItem = KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0);
    keyOpenItem = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
    keyRefreshItem = KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0);
}

From source file:org.drugis.addis.gui.StudyGraph.java

protected JGraph createGraph(GraphLayoutCache layoutCache) {
    JGraph jgraph = new StudyJGraph(d_model, layoutCache);
    jgraph.setAntiAliased(true);//w ww .j  a v a 2s .  co m
    jgraph.setEditable(false);
    jgraph.setEnabled(false);
    ToolTipManager.sharedInstance().registerComponent(jgraph);
    return jgraph;
}