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 |
Muhammad Salman 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)
|
|
| | | |
Goto Forum:
Current Time: Wed Dec 04 16:28:31 GMT 2024
Powered by FUDForum. Page generated in 0.05215 seconds
|