Coloring selected objects based on the attribute values

Hey I want to change the background colour of the objects based on the attribute values. What are the ways to do it ? (directly or maybe by DXL). Also what are the ways to convert tne object text to italic or bold or underlined based on the attribute value?
archit12 - Tue Jul 10 05:58:49 EDT 2012

Re: Coloring selected objects based on the attribute values
llandale - Tue Jul 10 09:41:43 EDT 2012

You can change the color of text in a column based on the value of some enumerated attribute. You define various colors associated with each enumemerated value in the Attr Type, tell the column to have it's color based on that attribute, then save the view.

So if Criticality attr is defined as High, Moderate, Low with colors Red, Yellow, Green you can force any column even the Main to be based on that attribute.

-Louie

In one project I give all the modules a "z_Grey" enumerated attr default value "Grey" which has color "Grey" (I think Grey333). Users do not edit that attribute. I then try to define all my Attr-DXL and Layout columns to have color based on that attribute. Since the value of all objects is (default) Grey, those columns come out grey which gives visual indication that it is read-only. Since I've got lots of "summary" attr-DXL for these huge spread-sheet modules, I find that is a lot less time then fielding questions as to why their changes (to these attr-DXL columns) doesn't work.

Re: Coloring selected objects based on the attribute values
archit12 - Tue Jul 10 11:21:33 EDT 2012

llandale - Tue Jul 10 09:41:43 EDT 2012
You can change the color of text in a column based on the value of some enumerated attribute. You define various colors associated with each enumemerated value in the Attr Type, tell the column to have it's color based on that attribute, then save the view.

So if Criticality attr is defined as High, Moderate, Low with colors Red, Yellow, Green you can force any column even the Main to be based on that attribute.

-Louie

In one project I give all the modules a "z_Grey" enumerated attr default value "Grey" which has color "Grey" (I think Grey333). Users do not edit that attribute. I then try to define all my Attr-DXL and Layout columns to have color based on that attribute. Since the value of all objects is (default) Grey, those columns come out grey which gives visual indication that it is read-only. Since I've got lots of "summary" attr-DXL for these huge spread-sheet modules, I find that is a lot less time then fielding questions as to why their changes (to these attr-DXL columns) doesn't work.

Thanks a lot for the reply

I want to change the background color, not the text color also for the whole object. I am new to the Doors. So I am not sure if we can change background color based on enumerated attribute.

Also I want to do it for the whole object.

What I want is if an object has certain combination of attribute values (not just a single attribute), then it should be of a particular background color.

Re: Coloring selected objects based on the attribute values
llandale - Tue Jul 10 13:01:38 EDT 2012

archit12 - Tue Jul 10 11:21:33 EDT 2012
Thanks a lot for the reply

I want to change the background color, not the text color also for the whole object. I am new to the Doors. So I am not sure if we can change background color based on enumerated attribute.

Also I want to do it for the whole object.

What I want is if an object has certain combination of attribute values (not just a single attribute), then it should be of a particular background color.

Your settings can change the background color of all objects; I don't know of a way to change the background color of a particular object, sorry.

I've had a little luck with a Layout column with a colored Canvas so you could get one column with background color, but someone else will need to help there.

-Louie

Re: Coloring selected objects based on the attribute values
Mathias Mamsch - Wed Jul 11 12:18:16 EDT 2012

archit12 - Tue Jul 10 11:21:33 EDT 2012
Thanks a lot for the reply

I want to change the background color, not the text color also for the whole object. I am new to the Doors. So I am not sure if we can change background color based on enumerated attribute.

Also I want to do it for the whole object.

What I want is if an object has certain combination of attribute values (not just a single attribute), then it should be of a particular background color.

You can do this in a dxl layout column, but not in a normal/dxl attribute column.

For layouts we use:
 

{ 
    DBE canv = getCanvas()
        if (!null  canv) {
                background(getCanvas(), logicalReadOnlyTextBackgroundColor ) 
                color(getCanvas(), logicalInPlaceTextColor)
        }
}

 


To indicate to the user, that the DXL layout column is non editable. The only background color for attributes I know DOORS will display is the \highlight rtf command, which will allow you to give your text a background color. Maybe that helps, Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS