Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 344579

Summary: Minute level zooming support
Product: z_Archived Reporter: Ersan Demircioglu <ersandemircioglu>
Component: NebulaAssignee: Emil Crumhorn <emil.crumhorn>
Status: CLOSED INVALID QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Modified AbstractPaintManager.java
none
Modified GanttComposite.java
none
Modified ISettings.java
none
Modified ViewPortHandler.java none

Description Ersan Demircioglu CLA 2011-05-03 10:05:40 EDT
Build Identifier: 

Maximum zooming level support hourly representation. However, for some short events (only few minutes long), this level is not enough to track. Minute level zooming support would be nice and useful.  

Reproducible: Always
Comment 1 Ersan Demircioglu CLA 2011-05-03 10:08:16 EDT
In fact, I have add minute zooming support, by coping hour zooming implementation and changing them to provide minute level zooming support. How can I commit these changes?
Comment 2 Emil Crumhorn CLA 2011-05-04 04:21:58 EDT
Hi Ersan,

Please attach the code changes as an attachment to this bug (text file, java files, zip file, whatever you prefer) so I can merge the changes with the code.

Thanks,
Emil
Comment 3 Ersan Demircioglu CLA 2011-05-04 04:38:46 EDT
Created attachment 194672 [details]
Modified AbstractPaintManager.java

Line 607: change from 
if (ganttComposite.getCurrentView() == ISettings.VIEW_DAY) {
            extra = 0;
        }

to 

if (ganttComposite.getCurrentView() == ISettings.VIEW_DAY || ganttComposite.getCurrentView() == ISettings.VIEW_HOURS) {
            extra = 0;
        }
Comment 4 Ersan Demircioglu CLA 2011-05-04 04:40:24 EDT
Created attachment 194673 [details]
Modified GanttComposite.java

Many changes in code.
Comment 5 Ersan Demircioglu CLA 2011-05-04 04:42:11 EDT
Created attachment 194674 [details]
Modified ISettings.java

New View and Zoom levels are added

public static final int VIEW_HOURS                     = 0;
    // zoom levels
public static final int MIN_ZOOM_LEVEL                 = -3;
public static final int ZOOM_MINUTES_MAX               = -3;
public static final int ZOOM_MINUTES_MEDIUM            = -2;
public static final int ZOOM_MINUTES_NORMAL            = -1;
Comment 6 Ersan Demircioglu CLA 2011-05-04 04:43:26 EDT
Created attachment 194675 [details]
Modified ViewPortHandler.java

Two new functions are added.

/**
	 * Jumps to the next minute.
	 */
	public void nextMinute() {
		Calendar mCalendar = _ganttComposite.getRootCalendar();
		mCalendar.add(Calendar.MINUTE, 1);
		
		if (mCalendar.get(Calendar.MINUTE) >= 60) {
			mCalendar.add(Calendar.HOUR_OF_DAY, 1);
		}
		
		if (mCalendar.get(Calendar.HOUR_OF_DAY) >= 24) {
			mCalendar.add(Calendar.DATE, 1);
			mCalendar.set(Calendar.HOUR_OF_DAY, 0);
		}

		_ganttComposite.setNoRecalc();
		_ganttComposite.moveXBounds(false);
		_ganttComposite.redraw();
	}

	/**
	 * Jumps to the previous minute.
	 */
	public void prevMinute() {
		Calendar mCalendar = _ganttComposite.getRootCalendar();
		mCalendar.add(Calendar.MINUTE, -1);

		if (mCalendar.get(Calendar.MINUTE) < 0) {
			mCalendar.add(Calendar.HOUR_OF_DAY, -1);
		}
		
		if (mCalendar.get(Calendar.HOUR_OF_DAY) < 0) {
			mCalendar.add(Calendar.DATE, -1);
			// -1 !!
			mCalendar.set(Calendar.HOUR_OF_DAY, 24 - 1);
		}

		_ganttComposite.setNoRecalc();
		_ganttComposite.moveXBounds(true);
		_ganttComposite.redraw();
	}
Comment 7 Wim Jongman CLA 2011-06-07 13:18:28 EDT
Is this done?
Comment 8 Emil Crumhorn CLA 2011-06-09 03:55:25 EDT
(In reply to comment #7)
> Is this done?

No, not yet. I have tested the code but it needs additional work to be properly integrated. I have no ETA at the moment.
Comment 9 Wim Jongman CLA 2019-12-12 15:58:27 EST
This bug does not have a target milestone assigned and is automatically closed as part of the 2.3.0 release cleanup.

It could be that this bug is accidentally closed for which we apologize.

If this bug is still relevant, please re-open and set a target milestone.