Search in sources :

Example 1 with LayoutUI

use of org.gephi.layout.spi.LayoutUI in project gephi by gephi.

the class LayoutPanel method buildTooltip.

private RichTooltip buildTooltip(LayoutBuilder builder) {
    String description = "";
    LayoutUI layoutUI = null;
    try {
        layoutUI = builder.getUI();
        if (layoutUI.getDescription() != null) {
            description = layoutUI.getDescription();
        }
        if (layoutUI.getQualityRank() < 0 || layoutUI.getSpeedRank() < 0) {
            layoutUI = null;
        }
    } catch (Exception e) {
        layoutUI = null;
    }
    RichTooltip richTooltip = new RichTooltip(builder.getName(), description);
    if (layoutUI != null) {
        LayoutDescriptionImage layoutDescriptionImage = new LayoutDescriptionImage(layoutUI);
        richTooltip.setMainImage(layoutDescriptionImage.getImage());
    }
    return richTooltip;
}
Also used : RichTooltip(org.gephi.ui.components.richtooltip.RichTooltip) LayoutUI(org.gephi.layout.spi.LayoutUI)

Aggregations

LayoutUI (org.gephi.layout.spi.LayoutUI)1 RichTooltip (org.gephi.ui.components.richtooltip.RichTooltip)1