Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Ganttchart Zoom In/Out problem(when zoom in/out Events behaviour with respect to each other and time is not constant)
Ganttchart Zoom In/Out problem [message #1244464] Wed, 12 February 2014 11:30 Go to next message
Muhammad Salman is currently offline Muhammad SalmanFriend
Messages: 3
Registered: February 2014
Junior Member
When I zoom in or zoom out the bar length of the Event varies. In Zoom out its even go before the earlier event. In this code three events are considered they are connected and should be done after each other. I have attached some screenshots as well . Reply if any one knows how to fix it.


package sampletask.parts;

import java.util.*;

import javax.annotation.PostConstruct;

import org.eclipse.e4.ui.di.Focus;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.nebula.widgets.ganttchart.AbstractSettings;
import org.eclipse.nebula.widgets.ganttchart.GanttChart;
import org.eclipse.nebula.widgets.ganttchart.GanttEvent;



public class SamplePart {

	@PostConstruct
	public void createComposite(Composite parent) {

		//GanttChart _ganttchart = new GanttChart(parent, SWT.NONE, new GanttChartSettings());
		GanttChart _ganttchart = new GanttChart(parent, SWT.NONE, new AbstractSettings() { 
		
			@Override
			public boolean drawEventsDownToTheHourAndMinute() {
            return true;
        }
			@Override
			public boolean showNumberOfDaysOnBars() {
				return true;
				}
			
		});
		
		
		Calendar sdEventOne = Calendar.getInstance(); 
		Calendar edEventOne = Calendar.getInstance();
		Calendar sdEventTwo = Calendar.getInstance();
		Calendar edEventTwo = Calendar.getInstance();
		Calendar sdEventThree = Calendar.getInstance(); 
		Calendar edEventThree = Calendar.getInstance();
		
		
		
		sdEventOne.set(2014, 2, 12, 04, 30, 30); // Start Date & Time of Event One
		edEventOne.set(2014, 2, 15, 12, 30, 30);// End Date & Time of Event One
		
		sdEventTwo.set(2014, 2, 15, 14, 30, 30); // Start Date & Time of Event Two
		edEventTwo.set(2014, 2, 17, 17, 30, 30); // End Date & Time of Event Three
		
		sdEventThree.set(2014, 2, 18, 04, 30, 30); // Start Date & Time of Event Three
		edEventThree.set(2014, 2, 20, 17, 30, 30);// End Date & Time of Event Three
		
	        
		GanttEvent eventOne = new GanttEvent(_ganttchart, "Event One", sdEventOne, edEventOne, 100);
		GanttEvent eventTwo = new GanttEvent(_ganttchart, "Event Two", sdEventTwo, edEventTwo,50);
		GanttEvent eventThree = new GanttEvent(_ganttchart, "Event Three", sdEventThree, edEventThree,50);
		
		_ganttchart.addConnection(eventOne, eventTwo);
		_ganttchart.addConnection(eventTwo, eventThree);
		
	}
	

	@Focus
	public void setFocus() {
//		tableViewer.getTable().setFocus();
	}
}


  • Attachment: 1.JPG
    (Size: 22.24KB, Downloaded 522 times)
  • Attachment: 2.JPG
    (Size: 19.56KB, Downloaded 400 times)
  • Attachment: 3.JPG
    (Size: 17.29KB, Downloaded 375 times)
  • Attachment: 4.JPG
    (Size: 14.32KB, Downloaded 479 times)
Re: Ganttchart Zoom In/Out problem [message #1244534 is a reply to message #1244464] Wed, 12 February 2014 13:36 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2903
Registered: July 2012
Senior Member
Not sure, but are you using the latest code from the repository? I have pushed a fix recently that dealt with a similar issue.
Re: Ganttchart Zoom In/Out problem [message #1245074 is a reply to message #1244534] Thu, 13 February 2014 09:01 Go to previous messageGo to next message
Muhammad Salman is currently offline Muhammad SalmanFriend
Messages: 3
Registered: February 2014
Junior Member
yes I am using the latest version. I just updated again to be sure if it latest or not
Re: Ganttchart Zoom In/Out problem [message #1245801 is a reply to message #1245074] Fri, 14 February 2014 09:34 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2903
Registered: July 2012
Senior Member
I hope that it will be fixed with https://git.eclipse.org/r/#/c/21985/

Please checkout and test if everything works fine that way.
Previous Topic:PaperClips - Cancel a print job
Next Topic:GanttChart - Custom Context Menu
Goto Forum:
  


Current Time: Wed Dec 11 13:09:23 GMT 2024

Powered by FUDForum. Page generated in 0.03461 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top