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:com.qspin.qtaste.ui.TestCaseTree.java

public TestCaseTree(TestCasePane testCasePn) {
    super();//from  w  ww .  j  av  a  2s  . c  om
    mTestCaseTree = this;
    this.setCellRenderer(new TestCaseTreeCellRenderer());

    testCasePane = testCasePn;
    testCasePane.setTestCaseTree(this);
    ToolTipManager.sharedInstance().registerComponent(this);

    FileNode rootFileNode = createRootFileNode();

    TCTreeNode rootNode = new TCTreeNode(rootFileNode, true);
    DefaultTreeModel tm = new DefaultTreeModel(rootNode);
    setModel(tm);
    generateScriptsTree(rootFileNode);
    TCTreeListener listener = new TCTreeListener();
    this.addMouseListener(listener);
    addTreeWillExpandListener(listener);
    addTreeSelectionListener(listener);
    TreeSelectionModel selModel = this.getSelectionModel();
    selModel.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);

    // drag drop initialization
    ds = new DragSource();
    dt = new DropTarget();

    ds.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this);
    try {
        dt.setComponent(this);
        dt.addDropTargetListener(this);
    } catch (java.util.TooManyListenersException e) {
        logger.error(e.getMessage());
    }

}

From source file:de.codesourcery.eve.skills.ui.components.impl.ItemChooserComponent.java

@Override
protected void onDetachHook() {
    ToolTipManager.sharedInstance().unregisterComponent(tree);
}

From source file:com.jidesoft.spring.richclient.docking.JideApplicationWindowFactory.java

private void configureDockingManager(DockingManager manager) {
    if (this.layoutVersion != null) {
        manager.setVersion(this.layoutVersion.shortValue());
    }/*from   ww  w .  j a v  a 2  s .  co m*/
    manager.setProfileKey(this.profileKey);
    manager.setRearrangable(this.rearrangable);
    manager.setResizable(this.resizable);
    manager.setContinuousLayout(this.continuousLayout);
    manager.setSensitiveAreaSize(this.sensitiveAreaSize);
    manager.setOutlineMode(this.outlineMode);
    manager.setGroupAllowedOnSidePane(this.groupAllowedOnSidePane);
    manager.setEasyTabDock(this.easyTabDocking);
    manager.setShowGripper(this.showGripper);
    manager.setShowTitleBar(this.showTitleBar);
    manager.setDoubleClickAction(this.doubleClickAction);
    manager.setHeavyweightComponentEnabled(this.heavyweightComponentEnabled);
    manager.setShowWorkspace(this.showWorkspace);
    manager.setFloatable(this.floatable);
    manager.setTabbedPaneCustomizer(this.tabbedPaneCustomizer);
    if (this.popupMenuCustomizer != null) {
        manager.setPopupMenuCustomizer(this.popupMenuCustomizer);
    }
    ToolTipManager.sharedInstance().setLightWeightPopupEnabled(!this.heavyweightComponentEnabled);
}

From source file:edu.uci.ics.jung.visualization.VisualizationViewer.java

/**
 * @param edgeToolTipTransformer the edgeToolTipTransformer to set
 *///from w  w  w. java  2  s.c o m
public void setEdgeToolTipTransformer(Transformer<E, String> edgeToolTipTransformer) {
    this.edgeToolTipTransformer = edgeToolTipTransformer;
    ToolTipManager.sharedInstance().registerComponent(this);
}

From source file:edu.uci.ics.jung.visualization.VisualizationViewer.java

/**
 * @param mouseEventToolTipTransformer the mouseEventToolTipTransformer to set
 *//*from  w ww .  ja  v  a  2s  .c om*/
public void setMouseEventToolTipTransformer(Transformer<MouseEvent, String> mouseEventToolTipTransformer) {
    this.mouseEventToolTipTransformer = mouseEventToolTipTransformer;
    ToolTipManager.sharedInstance().registerComponent(this);
}

From source file:lu.lippmann.cdb.graph.GraphViewImpl.java

/**
 * Constructor.//from   w  w  w.j a  v  a 2s.  c  o m
 */
@Inject
public GraphViewImpl(final EventPublisher eventPublisher, final CommandDispatcher commandDispatcher) {
    this.eventPublisher = eventPublisher;

    eventPublisher.markAsEventListener(this);

    /** initialize layout **/
    //final FRLayout<CNode,CEdge> layout = new FRLayout<CNode,CEdge>(new DirectedSparseGraph<CNode, CEdge>());
    final FRLayout<CNode, CEdge> layout = new FRLayout<CNode, CEdge>(new GraphWithOperations());
    layout.setMaxIterations(500);

    final VisualizationModel<CNode, CEdge> vm = new DefaultVisualizationModel<CNode, CEdge>(layout);

    this.vv = new VisualizationViewer<CNode, CEdge>(vm);

    this.vv.setPickSupport(new ShapePickSupport<CNode, CEdge>(vv, 10));

    this.cadralGraphMouse = new CadralGraphMouse(CShape.RECTANGLE, Color.WHITE, commandDispatcher);

    this.vv.setGraphMouse(this.cadralGraphMouse);

    /*
    LensSupport hyperbolicLayoutSupport = 
     new LayoutLensSupport<CNode,CEdge>(vv, new HyperbolicTransformer(vv, 
                vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.LAYOUT)),
                  new ModalLensGraphMouse());
            
    this.lensSupport  = 
     new LayoutLensSupport<CNode,CEdge>(vv, new MagnifyTransformer(vv, 
                vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.LAYOUT)),
                  new ModalLensGraphMouse(new LensMagnificationGraphMousePlugin(1.f, 6.f, .2f)));
            
    lensSupport.getLensTransformer().setLensShape(hyperbolicLayoutSupport.getLensTransformer().getLensShape());
            
      this.cadralGraphMouse.addItemListener(this.lensSupport.getGraphMouse().getModeListener());
     */

    /** Satelite view config **/
    final Dimension preferredSize2 = new Dimension(300, 300);
    this.vv2 = new SatelliteVisualizationViewer<CNode, CEdge>(vv, preferredSize2);
    vv2.scaleToLayout(new CrossoverScalingControl());

    /** about panel */
    this.aboutPanel = new AboutPanel(true);

    /** Default mode */
    setViewMode(ViewMode.Add);

    /** Gimme the time to show the rules **/
    ToolTipManager.sharedInstance().setDismissDelay(50000);

    /** Local **/
    this.sharedLabel.setText(GraphConnectionStatus.LOCAL.name());

    if (vv.getGraphMouse() instanceof CadralGraphMouse
            && vv.getGraphLayout().getGraph() instanceof GraphWithOperations) {
        //((CadralGraphMouse)vv.getGraphMouse()).setClickedGraph((GraphWithOperations)layout.getGraph());
        ((CadralGraphMouse) vv.getGraphMouse())
                .setClickedGraph((GraphWithOperations) vv.getGraphLayout().getGraph());
    }
}

From source file:corelyzer.ui.CorelyzerApp.java

/**
 * Entry point of the application. Initialized the application, starts up
 * the corelyzer.helper.SceneGraph system, and setups up last known
 * settings.//from w  ww . ja  v a2  s.c  o m
 *
 * @param args
 *           Plugin names and input session file, if there's any
 */
public static void main(final String[] args) {
    doStartupChecks();

    CRPreferences prefs = handlePreferences();

    // If somehow the user click on 'Cancel' in their first run, just quit.
    if (prefs == null) {
        System.exit(0);
    }

    // Test Quaqua Look and Feel
    /*
     * if (prefs.getUseQuaqua()) {
     * System.setProperty("Quaqua.tabLayoutPolicy", "wrap");
     *
     * try { UIManager.setLookAndFeel(
     * "ch.randelshofer.quaqua.QuaquaLookAndFeel"); } catch (Exception e) {
     * System.err.println("Exception in setting LAF: " + e); } }
     */

    String[] plugins = initPlugins();

    CorelyzerApp myApp = new CorelyzerApp(plugins, prefs);
    // CRNotificationPrompt.notifyGrowl("Execution", "Status",
    // "Corelyzer Started");

    if (prefs.getAutoCheckVersion()) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                AboutDialog aboutDlg = new AboutDialog(CorelyzerApp.getApp().getMainFrame());
                aboutDlg.checkUpdateAction(true);
                aboutDlg.dispose();
            }
        });
    }

    if (myApp.preferences.isInited) {
        myApp.startup();
        myApp.pingLaunchTracker();
    }

    // apply preferences
    SceneGraph.startUp();
    SceneGraph.setTexBlockDirectory(myApp.preferences.texBlock_Directory);

    // apply ui preferences
    myApp.preferences.applyUIConfig();

    // file association
    // on windows when app start with associated file
    boolean bOpenFile = false;
    if (myApp.fileassociation.length() == 0) {
        for (int i = 0; i < args.length; i++) {
            System.out.println("app args[" + i + "]:" + args[i]);
            if (args[i].toLowerCase().endsWith(".cml")) {
                myApp.fileassociation = args[i];
                bOpenFile = true;
            }
        }
    } else {
        bOpenFile = true;
    }

    // load associated file if app start with it: windows only
    if (bOpenFile) {
        StateLoader stateLoader = new StateLoader();
        stateLoader.loadState(myApp.fileassociation);
        myApp.updateGLWindows();
    }

    myApp.installPaletteVisibilityManager();

    // show tooltips for 10 seconds before dismissing - default time seems a bit too short
    ToolTipManager.sharedInstance().setDismissDelay(10000);
}

From source file:com.alvermont.terraj.fracplanet.ui.TerrainViewerFrame.java

/**
 * Called to initialize the display being managed by this object
 *//*from ww  w .  j a  v  a 2  s  .co m*/
public void initialize() {
    final MathUtils utils = new MathUtils(new Random(getAllParams().getTerrainParameters().getTerrainSeed()));

    this.pd = new ProgressDialog(this, false);

    // disable lightweight menus so they don't appear behind the GL canvas
    ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
    /* // zzing 24 Feb 2013  We don't need this with JOGL 2
            try {
    JarLibraryLoader.setupPath();
            
    JarLibraryLoader.extractLibrary("jogl");
    JarLibraryLoader.extractLibrary("jogl_awt");
    JarLibraryLoader.extractLibrary("jogl_cg");
    JarLibraryLoader.extractLibrary("jogl_drihack");
            } catch (Exception e) {
    log.error("Failed to load native libraries from jar file", e);
            }
    */
    try {
        GLProfile glProfile = GLProfile.getDefault();
        System.out.println(glProfile);
        GLCapabilities cap = new GLCapabilities(glProfile);
        System.out.println(cap);
        GLCanvas c = new GLCanvas(cap);

        this.canvas = c;
        this.terrainPanel.add(this.canvas);

        //            System.out.println(this.canvas.getGL());

        //new GLCanvas(new GLCapabilities(GLProfile.getDefault()));
        /*GLProfile glprofile = GLProfile.getDefault();
        GLCapabilities glcapabilities = new GLCapabilities( glprofile );
        final GLCanvas glcanvas = new GLCanvas( glcapabilities );
        this.canvas = glcanvas; */
    } catch (Throwable e) {
        // this is fatal
        e.printStackTrace();

        System.exit(1);
    }

    this.canvas.setPreferredSize(new Dimension(0, 0));
    this.canvas.setMinimumSize(new Dimension(0, 0));

    //        canvas.setGL(new DebugGL(canvas.getGL()));
    final RenderParameters rp = getAllParams().getRenderParameters();

    this.anim = new FPSAnimator(this.canvas, (int) rp.getFpsTarget());

    // generate the terrain
    final RegenAction action = new RegenAction("Regenerate");

    action.actionPerformed(new ActionEvent(this, 1, "Regenerate"));
}

From source file:lcmc.LCMC.java

/** Create the GUI and show it. */
protected static void createAndShowGUI(final Container mainFrame) {
    final java.util.List<Object> buttonGradient = Arrays.asList(new Object[] { new Float(.3f), new Float(0f),
            new ColorUIResource(ClusterBrowser.PANEL_BACKGROUND), new ColorUIResource(0xFFFFFF),
            new ColorUIResource(ClusterBrowser.BUTTON_PANEL_BACKGROUND) });
    final java.util.List<Object> checkboxGradient = Arrays.asList(
            new Object[] { new Float(.3f), new Float(0f), new ColorUIResource(ClusterBrowser.PANEL_BACKGROUND),
                    new ColorUIResource(ClusterBrowser.PANEL_BACKGROUND), new ColorUIResource(0xFFFFFF) });
    ToolTipManager.sharedInstance().setInitialDelay(TOOLTIP_INITIAL_DELAY);
    ToolTipManager.sharedInstance().setDismissDelay(TOOLTIP_DISMISS_DELAY);
    UIManager.put("TableHeader.background", Tools.getDefaultColor("DrbdMC.TableHeader"));
    UIManager.put("TableHeader.font", UIManager.getFont("Label.font"));
    UIManager.put("Button.gradient", buttonGradient);
    UIManager.put("Button.select", ClusterBrowser.PANEL_BACKGROUND);

    UIManager.put("CheckBox.gradient", checkboxGradient);
    UIManager.put("CheckBoxMenuItem.gradient", checkboxGradient);
    UIManager.put("RadioButton.gradient", checkboxGradient);
    UIManager.put("RadioButton.rollover", Boolean.TRUE);
    UIManager.put("RadioButtonMenuItem.gradient", checkboxGradient);
    UIManager.put("ScrollBar.gradient", buttonGradient);
    UIManager.put("ToggleButton.gradient", buttonGradient);

    UIManager.put("Menu.selectionBackground", ClusterBrowser.BUTTON_PANEL_BACKGROUND);
    UIManager.put("MenuItem.selectionBackground", ClusterBrowser.BUTTON_PANEL_BACKGROUND);
    UIManager.put("List.selectionBackground", ClusterBrowser.BUTTON_PANEL_BACKGROUND);
    UIManager.put("ComboBox.selectionBackground", ClusterBrowser.BUTTON_PANEL_BACKGROUND);
    UIManager.put("OptionPane.background", ClusterBrowser.BUTTON_PANEL_BACKGROUND);
    UIManager.put("Panel.background", ClusterBrowser.PANEL_BACKGROUND);

    /* Create and set up the window. */
    Tools.getGUIData().setMainFrame(mainFrame);

    /* Display the window. */
    mainFrame.setSize(Tools.getDefaultInt("DrbdMC.width"), Tools.getDefaultInt("DrbdMC.height"));
    mainFrame.setVisible(true);/* w  ww .j  a  va  2s . c  om*/
}