Search in sources :

Example 1 with IEllipsizer

use of edu.cmu.cs.hcii.cogtool.util.IEllipsizer in project cogtool by cogtool.

the class AbstractGraphicalSource method buildToolTipText.

/**
     * Build the ToolTip for this source.
     *
     * @return
     */
public static String buildToolTipText(TransitionSource source, String typeDescription) {
    // Use a string buffer for performance.
    StringBuilder strBuffer = new StringBuilder(source.getNameLabel() + " [" + typeDescription + "]");
    Iterator<Transition> transIter = source.getTransitions().values().iterator();
    IEllipsizer ellipsizer = new SWTStringUtil.SWTEllipsizer(SWTWidthComputer.DEFAULT_WIDTH, StringUtil.NO_FRONT, FontUtils.SYMBOL_FONT);
    while (transIter.hasNext()) {
        Transition transition = transIter.next();
        strBuffer.append("\n    ");
        String text = transition.toString(false, ellipsizer);
        strBuffer.append(text);
    }
    return strBuffer.toString();
}
Also used : Transition(edu.cmu.cs.hcii.cogtool.model.Transition) IEllipsizer(edu.cmu.cs.hcii.cogtool.util.IEllipsizer)

Aggregations

Transition (edu.cmu.cs.hcii.cogtool.model.Transition)1 IEllipsizer (edu.cmu.cs.hcii.cogtool.util.IEllipsizer)1