Package javax.swing

Examples of javax.swing.JToolTip


  public Label(Widget parent, String name) throws GUIException {
    super(parent, name);
    label = new JLabel() {
      public JToolTip createToolTip() {
        /* Makes validation error tooltips look right */
        return new JToolTip();
      }
    };
    label.setForeground(Color.black);
  }
View Full Code Here


    }

    Border border = new CompoundBorder(WidgetUtils.BORDER_THIN, WidgetUtils.BORDER_EMPTY);
    panel.setBorder(border);

    JToolTip toolTip = new DCToolTip(this, panel);
    return toolTip;
  }
View Full Code Here

   * @param toolTipFeedback the text displayed in the tool tip
   *                    or <code>null</code> to make tool tip disappear.
   */
  public void setToolTipFeedback(String toolTipFeedback, float x, float y) {
    stopToolTipPropertiesEdition();
    JToolTip toolTip = getToolTip();
    // Change tool tip text   
    toolTip.setTipText(toolTipFeedback);   
    showToolTipComponentAt(toolTip, x , y);
  }
View Full Code Here

   * Returns the tool tip of the plan.
   */
  private JToolTip getToolTip() {
    // Create tool tip for this component
    if (this.toolTip == null) {
      this.toolTip = new JToolTip();
      this.toolTip.setComponent(this);
    }
    return this.toolTip;
  }
View Full Code Here

    if (!OperatingSystem.isMacOSX()) {
      border = BorderFactory.createCompoundBorder(border, BorderFactory.createEmptyBorder(0, 3, 0, 2));
    }
    toolTipPropertiesPanel.setBorder(border);
    // Copy colors from tool tip instance (on Linux, colors aren't set in UIManager)
    JToolTip toolTip = getToolTip();
    toolTipPropertiesPanel.setBackground(toolTip.getBackground());
    toolTipPropertiesPanel.setForeground(toolTip.getForeground());

    // Add labels and text fields to tool tip panel
    for (int i = 0; i < toolTipEditedProperties.length; i++) {
      JFormattedTextField textField = this.toolTipEditableTextFields.get(toolTipEditedProperties [i]);
      textField.setValue(toolTipPropertyValues [i]);
View Full Code Here

            mainFrame.getMainFrameLoadSaveHelper().initialize();

            // Sets the size of the tooltip to match the rest of the GUI. -
            // Kristin
            JToolTip tempToolTip = mainFrame.mainFrameTree.getTableheader().createToolTip();
            UIManager.put("ToolTip.font", new FontUIResource(tempToolTip.getFont().deriveFont(Driver.getFontSize())));

            setupOSX();

            String loadFromURL = SystemProperties.getOSDependentProperty("findbugs.loadBugsFromURL");
View Full Code Here

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness
  {
    JToolTip t1 = new JToolTip();
    MetalToolTipUI ui1 = (MetalToolTipUI) MetalToolTipUI.createUI(t1);
    JToolTip t2 = new JToolTip();
    MetalToolTipUI ui2 = (MetalToolTipUI) MetalToolTipUI.createUI(t2);
    harness.check(ui1 == ui2);
  }
View Full Code Here

   */
  public void test(TestHarness harness
  {
    JButton button1 = new JButton("Test 1");
    button1.setMnemonic(KeyEvent.VK_B);
    JToolTip t1 = button1.createToolTip();
    MetalToolTipUI ui1 = (MetalToolTipUI) t1.getUI();
    harness.check(ui1.getAcceleratorString(), "Alt-B");

    JButton button2 = new JButton("Test 2");
    button2.setMnemonic(KeyEvent.VK_C);
    JToolTip t2 = button2.createToolTip();
    MetalToolTipUI ui2 = (MetalToolTipUI) t2.getUI();
    harness.check(ui2.getAcceleratorString(), "Alt-C");
    harness.check(ui1.getAcceleratorString(), "Alt-C");
    harness.check(ui1 == ui2);
  }
View Full Code Here

{
 
  public void test(TestHarness harness)
  {
    JButton component = new JButton("Button");
    JToolTip tt = new JToolTip();
    harness.check(tt.getComponent(), null);
    tt.setComponent(component);
    harness.check(tt.getComponent(), component);
  }
View Full Code Here

public class getAccessibleContext
  implements Testlet
{
  public void test(TestHarness harness)
  {
    JToolTip tt = new JToolTip();
    AccessibleContext att = tt.getAccessibleContext();
   
    // check the default values
    harness.check(att.getAccessibleName(), null);
    harness.check(att.getAccessibleDescription(), null);
    harness.check(att.getAccessibleComponent(), att);   
    harness.check(att.getAccessibleRole(), AccessibleRole.TOOL_TIP);

    // setting the tip text on the tool tip updates the accessible description
    tt.setTipText("XYZ");
    harness.check(att.getAccessibleDescription(), "XYZ");
    tt.setTipText(null);
    harness.check(att.getAccessibleDescription(), null);
   
    // setting the accessible description doesn't update the tip text
    att.setAccessibleDescription("ABC");
    harness.check(att.getAccessibleDescription(), "ABC");
    harness.check(tt.getTipText(), null);
   
    // ...and once an explicit description is set, it isn't changed by setting
    // the tip text
    tt.setTipText("DEF");
    harness.check(att.getAccessibleDescription(), "ABC");
   
    // TODO: the following should fire a property change event
    att.setAccessibleName("X");
    harness.check(att.getAccessibleName(), "X");

    // does getAccessibleContext() always return the same instance?
    AccessibleContext att2 = tt.getAccessibleContext();
    harness.check(att == att2);
  }
View Full Code Here

TOP

Related Classes of javax.swing.JToolTip

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.