REFERENCE:

Expression Editor dialog

The "Expression" field is the essence of a mechanism for filtering out elements in the diagrams. It contains an expression written using the queries syntax described below.

This is how it works: before Together displays an element, it first checks if some "Show ..." options are turned off. If the user has unchecked some options, Together then:

Don't let this description confuse you. In practical terms: if you do not wish to show certain elements in the diagram, create an expression that will return "true" for the kind of element you want to hide. The effect is that if you uncheck that option, your expression will filter out all unwanted elements.

Normally, you shouldn't need to modify or create a new expression because Together ships with a set of predefined filters sufficient for most cases. Nevertheless, if you wish to adapt Together to your special needs, here is an explanation of the expression syntax used in the "Expression" field.

Expression field syntax

The "Expression" field must contain a Boolean query. A query is a command recognizable by Together which can be run immediately and can perform some action(s). A query can also return some result-- strings, objects, or a Boolean value for example.

Several Boolean queries can be grouped into one Boolean expression to formulate a nontrivial condition, using these logical operators: !, &&, || (they behave just like corresponding Java/C++ logical operators), and parentheses. For example:

 
((query1) || (query2)) && (!query3)

Possible Boolean queries are:

The names and values of some properties are defined in the RWI API (for example, in the RwiProperty and RwiShapeType interfaces), so it is expected that you are familiar with RWI (if you are not, see the API documentation in the \doc directory under your installation). The description of properties and different RwiElements can also be found in the RWI API documentation.

Here is how to create your own filter. Suppose, you want to be able to omit those protected classes in the diagrams which are read-only or implement any interface: In the "User defined" Show option, open an "Expression" field and enter this value:

 ((hasPropertyValue("$shapeType", "Class") && (!hasProperty("$interface"))) && hasProperty("$protected")) && (hasProperty("$readOnly") || hasProperty("$implements"))