Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[nebula-dev] New topic in forum Nebula, called Ganttchart Zoom In/Out problem, by Muhammad Salman

Title: Eclipse Community Forums
Subject: Ganttchart Zoom In/Out problem Author: Muhammad Salman Date: Wed, 12 February 2014 06:30
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 0 times)
Attachment: 2.JPG
(Size: 19.56KB, Downloaded 0 times)
Attachment: 3.JPG
(Size: 17.29KB, Downloaded 0 times)
Attachment: 4.JPG
(Size: 14.32KB, Downloaded 0 times)
[ Reply ][ Quote ][ View Topic/Message ][ Unsubscribe from this forum ]

Back to the top