Left to do: fix time in timeline
This commit is contained in:
+23
-5
@@ -1,6 +1,7 @@
|
||||
import java.awt.BorderLayout;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
|
||||
@@ -12,7 +13,7 @@ public class TimelinePanel extends JPanel implements Panel {
|
||||
{
|
||||
super(new BorderLayout());
|
||||
|
||||
this.setSize(600, 600);
|
||||
this.setSize(1920, 1080);
|
||||
this.setVisible(true);
|
||||
timeline = new Timeline(this);
|
||||
this.add(timeline,BorderLayout.CENTER);
|
||||
@@ -21,14 +22,31 @@ public class TimelinePanel extends JPanel implements Panel {
|
||||
|
||||
public void refresh()
|
||||
{
|
||||
timeline.refresh();
|
||||
this.removeAll();
|
||||
this.add(timeline.createMainPanel(),BorderLayout.CENTER);
|
||||
this.add(timeline.createWestPanel(), BorderLayout.WEST);
|
||||
this.revalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(ArrayList<Event> event)
|
||||
public void update(ArrayList<Event> events)
|
||||
{
|
||||
timeline.setEvents(event);
|
||||
timeline.refresh();
|
||||
timeline.setEvents(events);
|
||||
System.out.println(events.size());
|
||||
|
||||
//dit fixt het half
|
||||
// if(events.size() == 0)
|
||||
// {
|
||||
// this.removeAll();
|
||||
// this.add(timeline.createWestPanel(),BorderLayout.WEST);
|
||||
// this.add(timeline, BorderLayout.CENTER);
|
||||
// this.revalidate();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// refresh();
|
||||
// }
|
||||
refresh();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user