All graphics objects can be assigned a set of predefined properties. The properties determine the colour, outline thickness, line end types and whether or not an object is filled.All objects can also belong to multiple user defined categories. e.g. several lines can belong to a window.
Categories can also be assigned a set of predefined properties. When an object belongs to a category, it takes on the properties of that category.
Categories can have complex user defined structures. If we were to define a category called 'train' that has red lines, blue circles and yellow rectangles. We could then mark several objects of a drawing as belonging to that category, all the train lines would then be drawn as red, the train circles as blue and the train rectangles as yellow. If we then went on to modify the 'train' category so that all train lines were green, the drawing would immediately change and all the lines marked as belonging to the train would change to green.
From a drawing point of view, categories let us easily group several components of a drawing together and conveniently manipulate some properties of the group, e.g. line thickness or colour. However, if IPAD is being used as a front end to some third party software such as a code generator, categories have a different role. They let us mark objects with user defined DOC_NAME,INDX_DOC_NAME,NEXT_DOC_NAME,PREV_DOC_NAME,TMPL_NAME,__file__,__gnu__,__line__,__m4_version__,__unix__,builtin,changecom,changequote,changesyntax,debugfile,debugmode,decr,define,defn,divert,divnum,dnl,dumpdef,errprint,esyscmd,eval,format,ifdef,ifelse,include,incr,index,indir,len,m4exit,m4wrap,maketemp,patsubst,popdef,pushdef,regexp,shift,sinclude,substr,symbols,syncoutput,syscmd,sysval,traceoff,traceon,translit,undefine,undivert and allow us to easily visualise which objects have been marked by virtue of their properties when drawn on the screen or to paper.
A simple example of this would be where we draw two circles connected by a line. One of circles could be marked as belonging to the 'switch input' category, the other to the 'lamp output' category and the connecting line marked as belonging to the 'output follows input' category.
Categories also allow us to easily build components which can then be used as building blocks from which more complex components can be built. e.g. a group of lines could belong to the window category, the window could itself belong to the door category and also the house category, the colour of the window in the door can be different to the colour of the window on the house simply be overriding the colour in the house or door category. The colour of the window remains the same unless it is used as a door window or a house window.
When specifying the categories to which an object belongs, it is not necessary to list all the categories individually, since a category can be built using other categories. The category dialog allows us to quickly and easily edit the category list of an individual object or group of objects and also change the properties of the categories.
The category dialog consists of:
- effective properties status display area
this shows the result of applying the combination of properties and categories to a primitive object (e.g. a line, circle, curve etc.)- route display area
this shows the route taken to get to the current category. this is important when navigating categories since the route determines which category is derived from which other category, knowing only what the current category is meaningless.- active category list display area
this shows the list of categories for the current object, group of objects or derived category (the last category shown in the route display area). clicking on any of the category names displayed in the active category list display area will cause the property dialog for that category to become active, thus allowing that category's properties to be modified. it will also select that category name as the target of any 'delete', 'enter', 'up' or 'down' operation (see relevant button descriptions below).- available category list display area
this shows the list of all available categories that can be added to the current object, group of objects or derived category. If a category name is displayed prefixed with either '+' or '-' in front of it, this indicates that the category is composed of a list of other categories. If it is prefixed with a '+', then clicking on the '+' will cause the list of component categories to be displayed beneath it and the '+' will change to '-'. if it is prefixed with '-' then the currently displayed component list will disappear and the '-' will change to a '+'. clicking on any of the category names displayed in the available category list display area will cause the property dialog for that category to become active, thus allowing that category's properties to be modified. double clicking on any of the category names displayed in the available category list display area will cause the category to be appended to the category list of the currently selected object, group of objects or selected category.- property dialog
this is exactly like a normal property dialog and allows us to change the properties of the current category.- active property type selector
this consists of eight buttons, one each for each of the primitive objects (e.g. a line, circle, curve etc.). It allows us to specify which of the primitive objects the property dialog currently applies. The property dialog can apply to any combination of the primitive objects shown.- navigation buttons
the enter button allows us to enter into the currently selected category so that we can navigate and possibly modify a category from which the current category is derived. the exit button allows us to return to where we were before we entered the category.- edit buttons
the add button allows us to add a new category name entered via the keyboard. The delete button allows us to delete the currently selected category from the current object, group of objects or selected category.- modify priority buttons
the effective properties of a category depend on the order of the category list from which it is composed. The nearer the start of the list, the more important the category is when trying to determine the effective properties of the derived category. to change the order of the list, use the up button to move the currently selected category towards the start of the list, and the down button to move it towards the end of the list.- result button
this forces the category dialog to refresh all draw windows with the new categories.- ok and cancel buttons
the ok and cancel buttons should have different functions, but at the time of this writing, they both perform the same dismiss function. in the future the cancel button will provide a mechanism for undoing all changes to the category system that were made since the category dialog was invoked.