Stuff
This commit is contained in:
@@ -4,7 +4,6 @@ package Agenda;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
@@ -19,13 +19,13 @@ public class ControlPanel extends JPanel
|
||||
private static final long serialVersionUID = 6805244250902524351L;
|
||||
|
||||
private Panel p;
|
||||
JLabel timeLabel;
|
||||
|
||||
public ControlPanel(Panel p)
|
||||
public ControlPanel()
|
||||
{
|
||||
super();
|
||||
BoxLayout box = new BoxLayout(this, BoxLayout.X_AXIS);
|
||||
setLayout(box);
|
||||
this.p = p;
|
||||
setPreferredSize(new Dimension(0,50));
|
||||
setBorder(BorderFactory.createLineBorder(new Color(180, 180, 180)));
|
||||
setBackground(new Color(220, 220, 220));
|
||||
@@ -74,11 +74,11 @@ public class ControlPanel extends JPanel
|
||||
add(Box.createRigidArea(new Dimension(10,50)));
|
||||
|
||||
JPanel timePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
|
||||
timePanel.setPreferredSize(new Dimension(280,50));
|
||||
timePanel.setMaximumSize(new Dimension(280,50));
|
||||
timePanel.setPreferredSize(new Dimension(300,50));
|
||||
timePanel.setMaximumSize(new Dimension(300,50));
|
||||
add(timePanel);
|
||||
{
|
||||
JLabel timeLabel = new JLabel("00:00 00-00-000");
|
||||
timeLabel = new JLabel("00:00 00-00-000");
|
||||
timeLabel.setFont(new Font("Segoe UI", Font.PLAIN, 20));
|
||||
timePanel.add(timeLabel);
|
||||
|
||||
@@ -128,4 +128,19 @@ public class ControlPanel extends JPanel
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setPanel(Panel p)
|
||||
{
|
||||
this.p = p;
|
||||
}
|
||||
|
||||
public void setTime(String time)
|
||||
{
|
||||
timeLabel.setText(time);
|
||||
}
|
||||
|
||||
public void setPeople(int people)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+13
-1
@@ -17,7 +17,9 @@ import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.Iterator;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
@@ -63,12 +65,16 @@ public class Panel extends JPanel implements ActionListener
|
||||
Point2D cameraPoint = new Point2D.Double(getWidth() / 2, getHeight() / 2);
|
||||
float cameraScale = 1;
|
||||
PropertiesPanel pp;
|
||||
ControlPanel cp;
|
||||
Agenda agenda;
|
||||
Point2D lastClickPosition = new Point(0, 0);
|
||||
Point lastMousePosition = new Point(0, 0);
|
||||
Point2D selectionPosition = new Point(0, 0);
|
||||
Images images = new Images();
|
||||
javax.swing.Timer t;
|
||||
|
||||
SimpleDateFormat formatter;
|
||||
GregorianCalendar date;
|
||||
|
||||
int currentTime = 540;
|
||||
int tick = 0;
|
||||
@@ -89,10 +95,14 @@ public class Panel extends JPanel implements ActionListener
|
||||
this.selectionPosition = selectionPosition;
|
||||
}
|
||||
|
||||
Panel(PropertiesPanel pp)
|
||||
Panel(PropertiesPanel pp, ControlPanel cp)
|
||||
{
|
||||
this.pp = pp;
|
||||
this.cp = cp;
|
||||
cp.setPanel(this);
|
||||
pp.setPanel(this);
|
||||
date = new GregorianCalendar();
|
||||
formatter = new SimpleDateFormat("H:s dd-MM-yyyy");
|
||||
try
|
||||
{
|
||||
grass = ImageIO.read(new File("images/grass.jpg"));
|
||||
@@ -537,6 +547,8 @@ public class Panel extends JPanel implements ActionListener
|
||||
{
|
||||
tick = 0;
|
||||
currentTime++;
|
||||
date.setTimeInMillis(date.getTimeInMillis() + 1000);
|
||||
cp.setTime(formatter.format(date.getTime()));
|
||||
System.out.println(currentTime);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@ public class Window extends JFrame
|
||||
// CONTENT PANELS
|
||||
JPanel contentPanel = new JPanel(new BorderLayout());
|
||||
PropertiesPanel pp = new PropertiesPanel();
|
||||
fp = new Panel(pp);
|
||||
ControlPanel cp = new ControlPanel();
|
||||
fp = new Panel(pp, cp);
|
||||
contentPanel.add(fp, BorderLayout.CENTER);
|
||||
ControlPanel cp = new ControlPanel(fp);
|
||||
contentPanel.add(cp, BorderLayout.SOUTH);
|
||||
contentPanel.add(pp, BorderLayout.EAST);
|
||||
contentPanel.add(fp, BorderLayout.CENTER);
|
||||
|
||||
Reference in New Issue
Block a user