|
@@ -4,9 +4,11 @@ import java.awt.BasicStroke;
|
|
|
import java.awt.Color;
|
|
import java.awt.Color;
|
|
|
import java.awt.Cursor;
|
|
import java.awt.Cursor;
|
|
|
import java.awt.Dimension;
|
|
import java.awt.Dimension;
|
|
|
|
|
+import java.awt.Font;
|
|
|
import java.awt.Graphics;
|
|
import java.awt.Graphics;
|
|
|
import java.awt.Graphics2D;
|
|
import java.awt.Graphics2D;
|
|
|
import java.awt.Rectangle;
|
|
import java.awt.Rectangle;
|
|
|
|
|
+import java.awt.RenderingHints;
|
|
|
import java.awt.event.MouseAdapter;
|
|
import java.awt.event.MouseAdapter;
|
|
|
import java.awt.event.MouseEvent;
|
|
import java.awt.event.MouseEvent;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -26,14 +28,14 @@ public class AgendaScrollPane extends JPanel {
|
|
|
private int xdifference, ydifference, xspacing;
|
|
private int xdifference, ydifference, xspacing;
|
|
|
private final int yspacing = 45;
|
|
private final int yspacing = 45;
|
|
|
private final int itempadding = 10;
|
|
private final int itempadding = 10;
|
|
|
- private final int heightoffset = 100;
|
|
|
|
|
|
|
+ private final int heightoffset = 50;
|
|
|
GregorianCalendar currentdate;
|
|
GregorianCalendar currentdate;
|
|
|
Agenda agenda;
|
|
Agenda agenda;
|
|
|
|
|
|
|
|
|
|
|
|
|
public AgendaScrollPane(final Agenda agenda, InfoPane pane){
|
|
public AgendaScrollPane(final Agenda agenda, InfoPane pane){
|
|
|
this.setOpaque(true);
|
|
this.setOpaque(true);
|
|
|
- this.setBackground(Color.WHITE);
|
|
|
|
|
|
|
+ this.setBackground(new Color(247,247,247));
|
|
|
this.infoPane = pane;
|
|
this.infoPane = pane;
|
|
|
this.agenda = agenda;
|
|
this.agenda = agenda;
|
|
|
this.setPreferredSize(new Dimension(600, yspacing*48+heightoffset));
|
|
this.setPreferredSize(new Dimension(600, yspacing*48+heightoffset));
|
|
@@ -158,7 +160,7 @@ public class AgendaScrollPane extends JPanel {
|
|
|
currentdate = date;
|
|
currentdate = date;
|
|
|
for(Act act : agenda.getActs()){
|
|
for(Act act : agenda.getActs()){
|
|
|
if(currentdate.compareTo(act.getActTime().getBeginTime()) <= 1 && currentdate.compareTo(act.getActTime().getEndTime()) >= -1){
|
|
if(currentdate.compareTo(act.getActTime().getBeginTime()) <= 1 && currentdate.compareTo(act.getActTime().getEndTime()) >= -1){
|
|
|
- agendaItems.add(new AgendaItemShape(act, agenda.getStages().indexOf(act.getStage()), new Color(250,209,101)));
|
|
|
|
|
|
|
+ agendaItems.add(new AgendaItemShape(act, agenda.getStages().indexOf(act.getStage()), new Color(200,40,40,240)));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
for(AgendaItemShape a:agendaItems){
|
|
for(AgendaItemShape a:agendaItems){
|
|
@@ -170,6 +172,7 @@ public class AgendaScrollPane extends JPanel {
|
|
|
public void paintComponent(Graphics g){
|
|
public void paintComponent(Graphics g){
|
|
|
super.paintComponent(g);
|
|
super.paintComponent(g);
|
|
|
Graphics2D g2 = (Graphics2D)g;
|
|
Graphics2D g2 = (Graphics2D)g;
|
|
|
|
|
+ g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
|
|
|
if(agenda.getStages().size() == 0){
|
|
if(agenda.getStages().size() == 0){
|
|
|
xspacing = 0;
|
|
xspacing = 0;
|
|
|
}else{
|
|
}else{
|
|
@@ -215,8 +218,9 @@ public class AgendaScrollPane extends JPanel {
|
|
|
g2.setColor(Color.LIGHT_GRAY);
|
|
g2.setColor(Color.LIGHT_GRAY);
|
|
|
g2.fillRect(0, 0, getWidth(), heightoffset);
|
|
g2.fillRect(0, 0, getWidth(), heightoffset);
|
|
|
for(int i = 0; i < agenda.getStages().size(); i++){
|
|
for(int i = 0; i < agenda.getStages().size(); i++){
|
|
|
|
|
+ g2.setFont(new Font("Arial", Font.PLAIN, 16));
|
|
|
g2.setColor(Color.black);
|
|
g2.setColor(Color.black);
|
|
|
- g2.drawString(agenda.getStages().get(i).getName(), i*xspacing+itempadding, heightoffset/2);
|
|
|
|
|
|
|
+ g2.drawString(agenda.getStages().get(i).getName(), i*xspacing+itempadding+140, heightoffset/2+5);
|
|
|
g2.setColor(new Color (100,100,100, 70));
|
|
g2.setColor(new Color (100,100,100, 70));
|
|
|
g2.drawLine(i*xspacing, getHeight(), i*xspacing, 0); //draws the vertical separation lines
|
|
g2.drawLine(i*xspacing, getHeight(), i*xspacing, 0); //draws the vertical separation lines
|
|
|
}
|
|
}
|