Using the TRUNCATE and WORD_WRAP modes for my IlvGeneralNode and IlvSDMCompositeNode labels

Article ID: 2320
Last updated: 29 May, 2018
Article ID: 2320
Last updated: 29 May, 2018
Revision: 3
Views: 670
Posted: 03 Aug, 2010
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

How do I use the TRUNCATE and WORD_WRAP modes for my IlvGeneralNode and IlvSDMCompositeNode labels?

Answer

If you have very long labels, you may want to consider using automatic word wrapping or truncation to keep the lengths at a reasonable size. Such features are available only if the label is represented by an IlvText object.

If you use an IlvGeneralNode (with its useIlvText property set to the default value true), its label will always be represented by an IlvText object. The IlvGeneralNode includes a labelMode property to determine how it should wrap large label strings. (See the IlvGeneralMode.setLabelMode(int mode) method)

node {

class : "ilog.views.sdm.graphic.IlvGeneralNode" ;

label : "@name" ;

labelMode : "TRUNCATE" ;

useIlvText : "true" ;

}

If you use an IlvSDMCompositeNode, you have to explicitly declare one of the children as an IlvText. Then you can set the

wrappingMode property on the IlvText child.

node {

class : "ilog.views.sdm.graphic.IlvSDMCompositeNode" ;

children[0] : "@+Text" ;

}

#Text {

class : "ilog.views.graphic.IlvText" ;

label : "@name" ;

wrappingMode : "ilog.views.graphic.IlvText.WRAP_WORD";

wrappingWidth : "60";

}

Both approaches affect the underlying IlvText object and the wrapping will proceed normally.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2320
Last updated: 29 May, 2018
Revision: 3
Views: 670
Posted: 03 Aug, 2010 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Also listed in


Others in this category