I am designing a mile stone task scheduler class. For each item (See Attached Bitmap), you have a start point and end point which is represented by a symbol (triangle, square, circle) and between a rectangle representing the connector line.
Now, each item has 5 possible labels, one displaying the start date (drawn around the start point symbol), one displaying the end date (drawn around the end point symbol), and 3 description labels drawn anywhere around the item. My problem is that I need to come up with a solution to determine where to draw each label so that no label conflicts with another. Each label can have a vertical and horizontal justification which is based on the symbol or connector line. TOP | MIDDLE| BOTTOM and LEFT|CENTER|MIDDLE.
E.G. Of problem: If the start date and end date are the same, then the right symbol and connector line are not drawn, but all five labels are drawn around the left symbol. If all the items are to be drawn with the justification TOP | CENTER, then they would be drawn over each other at the top of the left symbol.
Any hints on how I can solve this problem?
Note: The order of drawing the labels is from 0-4 top to bottom.
drawing process relies on a relative object as start point. in normal example, first and last symbols, and lines are drawn first. now you have three options to select as a relative point. in second example of start/end time being the same, you have only one relative point to select.
drawing process relies on a relative object as start point. in normal example, first and last symbols, and lines are drawn first. now you have three options to select as a relative point. in second example of start/end time being the same, you have only one relative point to select.
Kuphryn
Thanks for your reply Kuphryn, my problem is not necessarily the point of reference, but how do I go about determining the label position based on the point of reference, the index of the label, and the text alignment specified.
In the example bitmap, label 2, 3, and 4 have the connector as referece, but, what if 4 had a vertical alignment of "TOP" specified, that would mean 4 must be drawn above the connector, and labels 2 and 3 have to be moved up to accomadate 4.
This gets even tougher since each label, must be able to accomadate a different font and font size.
One solution I thought of, but not sure if it is overkill, is to create 3 - 3X3X5 matrix's of "Label positions", where the first 3 is Left symbol, connector, and right symbol labels, then the 3X3X5 matrix represents all the different alignment values and the 5 deep is because there is 5 lables.
This would probably not be very efficient for drawing however?
Mike B
Last edited by MikeB; September 5th, 2006 at 03:07 PM.
This depends on design specifically drawing. one case you draw all objects. now select a different object based on its position attribute. another case each object draws itself. key is no collision via keeping track of the set of position attributes.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.