Revision 0d23b8b4

View differences:

ide/org.omnetpp.sequencechart/src/org/omnetpp/sequencechart/widgets/SequenceChart.java
153 153
	private static final Color NON_OVERLAPPING_EVENT_BACKGROUND_COLOR = ColorFactory.LIGHT_BLUE;
154 154
	
155 155
	private static final Color CRITICAL_EVENT_BACKGROUND_COLOR = ColorFactory.DARK_RED;
156
	private static final Color NON_CRITICAL_EVENT_BACKGROUND_COLOR = ColorFactory.LIGHT_PINK;
156
	private static final Color NON_CRITICAL_EVENT_BACKGROUND_COLOR = ColorFactory.SALMON;
157 157
	
158 158
	private static final Color SELF_EVENT_BACKGROUND_COLOR = ColorFactory.GREEN2;
159 159

  
160
	private static final Color EVENT_SELECTION_COLOR = ColorFactory.RED;
160
	private static final Color EVENT_SELECTION_COLOR = ColorFactory.ORANGE;
161 161
	private static final Color EVENT_BOOKMARK_COLOR = ColorFactory.CYAN;
162 162

  
163 163
	private static final Color ARROW_HEAD_COLOR = null; // defaults to line color
......
188 188

  
189 189
//	private static Font font = new Font(Display.getDefault(), "Arial", 8, SWT.NONE);
190 190
	private int fontHeight = -1; // cached for cases where a graphics is not available
191
	
192
	private static final int CRITICAL_PATH_LINE_WIDTH = 3+3; // line width for message dependencies on the critical path
193
	private static final Color CRITICAL_PATH_LINE_COLOR = ColorFactory.RED; // line color for message dependencies on the critical path
194
	
191 195

  
192 196
	/*************************************************************************************
193 197
	 * INTERNAL STATE
......
2863 2867
	}
2864 2868
	
2865 2869
	private void configureGraphics(Graphics graphics, long eventPtr) {
2866
		if (!showEventOverlapping && ! showCriticalPath) {
2870
		if (!showEventOverlapping && !showCriticalPath) {
2867 2871
			switch (eventLengthMode) {
2868 2872
			case NONE: // Show default colors
2869 2873
				if (isInitializationEvent(eventPtr)) {
......
2905 2909
			}
2906 2910
		} else if (showCriticalPath){ 
2907 2911
			graphics.setForegroundColor(EVENT_BORDER_COLOR);
2908
			
2909 2912
			if (sequenceChartFacade.isOnCriticalPath(sequenceChartFacade.IEvent_getEvent(eventPtr))) {
2910 2913
				graphics.setBackgroundColor(CRITICAL_EVENT_BACKGROUND_COLOR);
2911 2914
			} else {
......
2932 2935
		
2933 2936
		int length = getEventLength(eventPtr);
2934 2937
		
2938
		//graphics.fillRectangle(x - 2, y - 20, length, 40);
2935 2939
		graphics.fillRectangle(x - 2, y - 3, length, 10);
2936 2940
		graphics.setLineStyle(SWT.LINE_SOLID);
2941
		//graphics.drawRectangle(x - 2, y - 20, length - 1, 39);
2937 2942
		graphics.drawRectangle(x - 2, y - 3, length - 1, 9);
2938 2943

  
2939 2944
		if (showEventNumbers) {
......
3220 3225
	 */
3221 3226
	private boolean drawOrFitMessageDependency(long messageDependencyPtr, int fitX, int fitY, int tolerance, Graphics graphics, VLineBuffer vlineBuffer, long startEventPtr, long endEventPtr) {
3222 3227
		Assert.isTrue((graphics != null && vlineBuffer != null) || tolerance != -1);
3228
		
3229
		//if (graphics != null)
3230
		//	graphics.setLineWidth(3);
3223 3231

  
3224 3232
		long causeEventPtr = sequenceChartFacade.IMessageDependency_getCauseEvent(messageDependencyPtr);
3225 3233
		long consequenceEventPtr = sequenceChartFacade.IMessageDependency_getConsequenceEvent(messageDependencyPtr);
3234
		
3235
		Color currentForegroundColor = null;
3236
		int currentLineWidth = 0;
3237
		boolean changedLineStyleForCriticalPath = false;
3226 3238

  
3227 3239
		if (sequenceChartFacade.IMessageDependency_isReuse(messageDependencyPtr) && !showOtherMessageReuses)
3228 3240
			return false;
......
3320 3332
			}
3321 3333
		}
3322 3334

  
3335
		// change line style if critical path should be visualized
3336
		if (showCriticalPath && graphics != null) {
3337
			boolean causeOnPath = sequenceChartFacade.isOnCriticalPath(sequenceChartFacade.IEvent_getEvent(causeEventPtr));
3338
			boolean consequenceOnPath = sequenceChartFacade.isOnCriticalPath(sequenceChartFacade.IEvent_getEvent(consequenceEventPtr));
3339
			if (causeOnPath && consequenceOnPath) {
3340
				currentForegroundColor = graphics.getForegroundColor();
3341
				currentLineWidth = graphics.getLineWidth();
3342
				changedLineStyleForCriticalPath = true;
3343
				
3344
				graphics.setLineWidth(CRITICAL_PATH_LINE_WIDTH);
3345
				graphics.setForegroundColor(CRITICAL_PATH_LINE_COLOR);
3346
			}
3347
		}
3348
		
3323 3349
		// test if self-message
3324 3350
        if (y1 == y2) {
3325 3351
            // FIXME: this filters out non self messages too, e.g. filtered and returns to same module
......
3543 3569

  
3544 3570
		// when fitting we should have already returned
3545 3571
		Assert.isTrue(graphics != null);
3546

  
3572
		
3573
		// reset line style
3574
		if (changedLineStyleForCriticalPath && graphics != null) {
3575
			graphics.setLineWidth(currentLineWidth);
3576
			graphics.setForegroundColor(currentForegroundColor);
3577
		}
3578
		
3547 3579
		return false;
3548 3580
	}
3549 3581

  

Also available in: Unified diff