Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.Tooltip$TooltipListenerList


    @Override
    public int getPreferredHeight(int width) {
        int preferredHeight = 0;

        Tooltip tooltip = (Tooltip)getComponent();
        Component content = tooltip.getContent();

        if (width != -1) {
            width -= (padding.left + padding.right + 2);
        }
View Full Code Here


    @Override
    public Dimensions getPreferredSize() {
        int preferredWidth = 0;
        int preferredHeight = 0;

        Tooltip tooltip = (Tooltip)getComponent();
        Component content = tooltip.getContent();

        if (content != null) {
            Dimensions contentSize = content.getPreferredSize();
            preferredWidth = contentSize.width;
            preferredHeight = contentSize.height;
View Full Code Here

        return new Dimensions(preferredWidth, preferredHeight);
    }

    @Override
    public void layout() {
        Tooltip tooltip = (Tooltip)getComponent();
        Component content = tooltip.getContent();

        if (content != null) {
            int contentWidth = Math.max(getWidth() - (padding.left + padding.right + 2), 0);
            int contentHeight = Math.max(getHeight() - (padding.top + padding.bottom + 2), 0);
            content.setSize(contentWidth, contentHeight);
View Full Code Here

    @Override
    public void install(Component component) {
        super.install(component);

        Tooltip tooltip = (Tooltip)component;

        dropShadowDecorator = new DropShadowDecorator(5, 2, 2);
        tooltip.getDecorators().add(dropShadowDecorator);

        tooltip.setContent(border);
        tooltip.getTooltipListeners().add(this);

        label.setText(tooltip.getText());
    }
View Full Code Here

        label.setText(tooltip.getText());
    }

    @Override
    public void uninstall() {
        Tooltip tooltip = (Tooltip)getComponent();

        tooltip.getDecorators().remove(dropShadowDecorator);
        dropShadowDecorator = null;

        tooltip.setContent(null);
        tooltip.getTooltipListeners().remove(this);
    }
View Full Code Here

            String tooltipText = component.getTooltipText();

            // The tooltip text may have been cleared while the timeout was
            // outstanding; if so, don't display the tooltip
            if (tooltipText != null) {
                Tooltip tooltip = new Tooltip(tooltipText);

                Point location = component.getDisplay().getMouseLocation();
                int x = location.x;
                int y = location.y;

                // Ensure that the tooltip stays on screen
                Display display = component.getDisplay();
                int tooltipHeight = tooltip.getPreferredHeight();
                if (y + tooltipHeight > display.getHeight()) {
                    y -= tooltipHeight;
                }

                tooltip.setLocation(x + 16, y);
                tooltip.open(component.getWindow());
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtk.Tooltip$TooltipListenerList

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.