Restore
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Point;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.ArrayList;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class MyPanel extends JPanel {
|
||||
//instance variables
|
||||
private Model m;
|
||||
private ControllerClicks c;
|
||||
|
||||
public MyPanel(Model m, ControllerClicks c) {
|
||||
this.m = m;
|
||||
this.c = c;
|
||||
this.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
if(e.getButton() == MouseEvent.BUTTON1) {
|
||||
c.mouseClicked(e.getPoint());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
g.setColor(Color.RED);
|
||||
if(m.getPoints().size() == 1) {
|
||||
Point p = m.getPoints().get(0);
|
||||
g.drawRect((int)p.getX(), (int)p.getY(), 1, 1);
|
||||
}
|
||||
else {
|
||||
for(int i = 1; i < m.getPoints().size(); i++) {
|
||||
Point start = m.getPoints().get(i - 1);
|
||||
Point end = m.getPoints().get(i);
|
||||
g.drawLine((int)start.getX(), (int)start.getY(),
|
||||
(int)end.getX(), (int)end.getY());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public abstract class View<T extends Controller> extends JFrame implements ModelListener{
|
||||
//instance variables
|
||||
protected Model m;
|
||||
protected T c;
|
||||
|
||||
//constructor
|
||||
public View(Model m, T c) {
|
||||
this.m = m;
|
||||
this.c = c;
|
||||
this.setLocationRelativeTo(null);
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
m.addListener(this);
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void update();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import javax.swing.JLabel;
|
||||
|
||||
public class ViewNumber extends View<Controller>{
|
||||
//instance variable
|
||||
private JLabel label;
|
||||
|
||||
public ViewNumber(Model m, Controller c) {
|
||||
super(m, c);
|
||||
label = new JLabel();
|
||||
update();
|
||||
this.add(label);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
label.setText("Number of points is: " + m.numberOfPoints());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
public class ViewNumber {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public abstract class View<T extends Controller> extends JFrame implements ModelListener{
|
||||
//instance variables
|
||||
protected Model m;
|
||||
protected T c;
|
||||
|
||||
//constructor
|
||||
public View(Model m, T c) {
|
||||
this.m = m;
|
||||
this.c = c;
|
||||
this.setLocationRelativeTo(null);
|
||||
this.setSize(400, 300);
|
||||
m.addListener(this);
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void update();
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import java.awt.Point;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Model {
|
||||
//instance variables
|
||||
private ArrayList<Point> points;
|
||||
private ArrayList<ModelListener> listeners;
|
||||
|
||||
//constructor
|
||||
public Model() {
|
||||
points = new ArrayList<Point>();
|
||||
listeners = new ArrayList<ModelListener>();
|
||||
}
|
||||
|
||||
//methods
|
||||
public void addListener(ModelListener l) {
|
||||
listeners.add(l);
|
||||
}
|
||||
|
||||
public ArrayList<Point> getPoints(){
|
||||
return points;
|
||||
}
|
||||
|
||||
public void addPoint(Point p) {
|
||||
points.add(p);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
public void clearAllPoints() {
|
||||
points.clear();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
public void deleteLastPoint(){
|
||||
if(points.size() > 0) {
|
||||
points.remove(points.size()-1);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
private void notifyListeners() {
|
||||
for(ModelListener l: listeners) {
|
||||
l.update();
|
||||
}
|
||||
}
|
||||
|
||||
//test
|
||||
public void testModel() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
public class numberOfPoints {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public abstract class View<T extends Controller> extends JFrame implements ModelListener{
|
||||
//instance variables
|
||||
protected Model m;
|
||||
protected T c;
|
||||
|
||||
//constructor
|
||||
public View(Model m, T c) {
|
||||
this.m = m;
|
||||
this.c = c;
|
||||
this.setSize(400, 300);
|
||||
this.setLocationRelativeTo(null);
|
||||
m.addListener(this);
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void update();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public abstract class View<T extends Controller> extends JFrame implements ModelListener{
|
||||
//instance variables
|
||||
protected Model m;
|
||||
protected T c;
|
||||
|
||||
//constructor
|
||||
public View(Model m, T c) {
|
||||
this.m = m;
|
||||
this.c = c;
|
||||
this.setLocationRelativeTo(null);
|
||||
m.addListener(this);
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void update();
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import java.awt.Point;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Model {
|
||||
//instance variables
|
||||
private ArrayList<Point> points;
|
||||
private ArrayList<ModelListener> listeners;
|
||||
|
||||
//constructor
|
||||
public Model() {
|
||||
points = new ArrayList<Point>();
|
||||
listeners = new ArrayList<ModelListener>();
|
||||
}
|
||||
|
||||
//methods
|
||||
public void addListener(ModelListener l) {
|
||||
listeners.add(l);
|
||||
}
|
||||
|
||||
public ArrayList<Point> getPoints(){
|
||||
return points;
|
||||
}
|
||||
|
||||
public void addPoint(Point p) {
|
||||
points.add(p);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
public void clearAllPoints() {
|
||||
points.clear();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
public void deleteLastPoint(){
|
||||
if(points.size() > 0) {
|
||||
points.remove(points.size() - 1);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
private void notifyListeners() {
|
||||
for(ModelListener l: listeners) {
|
||||
l.update();
|
||||
}
|
||||
}
|
||||
|
||||
//test
|
||||
public void testModel() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
public class Start {
|
||||
public static void main(String[] args) {
|
||||
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Model m = new Model(); // Single shared model.
|
||||
|
||||
ControllerClicks c1 = new ControllerClicks(m);
|
||||
MyFrame v1 = new MyFrame(m, c1);
|
||||
|
||||
Controller c2 = new Controller(m);
|
||||
View v2 = new ViewNumber(m, c2);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class MyFrame extends View<ControllerClicks> {
|
||||
public MyFrame(Model m, ControllerClicks c) {
|
||||
super(m, c);
|
||||
this.setTitle("MyFrame Title");
|
||||
this.setSize(400, 300);
|
||||
|
||||
this.setLayout(new BorderLayout());
|
||||
|
||||
MyPanel centerPanel = new MyPanel(m, c);
|
||||
this.add(centerPanel, BorderLayout.CENTER);
|
||||
JPanel topPanel = new JPanel();
|
||||
this.add(topPanel, BorderLayout.PAGE_START);
|
||||
topPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
|
||||
|
||||
JButton resetButton = new JButton("Reset");
|
||||
resetButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.resetClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(resetButton);
|
||||
JButton undoButton = new JButton("Undo");
|
||||
undoButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.undoClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(undoButton);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void update() {
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import javax.swing.JLabel;
|
||||
|
||||
public class ViewNumber extends View<Controller>{
|
||||
//instance variable
|
||||
private JLabel label;
|
||||
|
||||
public ViewNumber(Model m, Controller c) {
|
||||
super(m, c);
|
||||
this.setTitle("View Number");
|
||||
this.setSize(200, 150);
|
||||
this.setLocationRelativeTo(null);
|
||||
label = new JLabel();
|
||||
update();
|
||||
this.add(label);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
label.setText("Number of points is: " + m.numberOfPoints());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class MyFrame extends View<ControllerClicks> {
|
||||
public MyFrame(Model m, ControllerClicks c) {
|
||||
super(m, c);
|
||||
this.setTitle("MyFrame Title");
|
||||
this.setSize(400, 300);
|
||||
|
||||
|
||||
this.setLayout(new BorderLayout());
|
||||
MyPanel centerPanel = new MyPanel(m, c);
|
||||
this.add(centerPanel, BorderLayout.CENTER);
|
||||
JPanel topPanel = new JPanel();
|
||||
this.add(topPanel, BorderLayout.PAGE_START);
|
||||
topPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
|
||||
|
||||
JButton resetButton = new JButton("Reset");
|
||||
resetButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.resetClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(resetButton);
|
||||
|
||||
JButton undoButton = new JButton("Undo");
|
||||
undoButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.undoClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(undoButton);
|
||||
|
||||
}
|
||||
|
||||
public void update() {
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
public class Test {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import javax.swing.JLabel;
|
||||
|
||||
public class ViewNumber extends View<Controller>{
|
||||
//instance variable
|
||||
private JLabel label;
|
||||
|
||||
public ViewNumber(Model m, Controller c) {
|
||||
super(m, c);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class MyFrame extends View<ControllerClicks> {
|
||||
public MyFrame(Model m, ControllerClicks c) {
|
||||
super(m, c);
|
||||
this.setTitle("MyFrame Title");
|
||||
this.setLayout(new BorderLayout());
|
||||
|
||||
MyPanel centerPanel = new MyPanel(m, c);
|
||||
this.add(centerPanel, BorderLayout.CENTER);
|
||||
JPanel topPanel = new JPanel();
|
||||
this.add(topPanel, BorderLayout.PAGE_START);
|
||||
topPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
|
||||
|
||||
JButton resetButton = new JButton("Reset");
|
||||
resetButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.resetClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(resetButton);
|
||||
JButton undoButton = new JButton("Undo");
|
||||
undoButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.undoClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(undoButton);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void update() {
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import javax.swing.JLabel;
|
||||
|
||||
public class ViewNumber extends View<Controller>{
|
||||
//instance variable
|
||||
private JLabel label;
|
||||
|
||||
public ViewNumber(Model m, Controller c) {
|
||||
super(m, c);
|
||||
this.setTitle("View Number");
|
||||
this.setSize(200, 200);
|
||||
label = new JLabel();
|
||||
update();
|
||||
this.add(label);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
label.setText("Number of points is: " + m.numberOfPoints());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class MyFrame extends View<ControllerClicks> {
|
||||
public MyFrame(Model m, ControllerClicks c) {
|
||||
super(m, c);
|
||||
this.setTitle("MyFrame Title");
|
||||
this.setSize(400, 300);
|
||||
this.setLocationRelativeTo(null);
|
||||
|
||||
this.setLayout(new BorderLayout());
|
||||
MyPanel centerPanel = new MyPanel(m, c);
|
||||
this.add(centerPanel, BorderLayout.CENTER);
|
||||
JPanel topPanel = new JPanel();
|
||||
this.add(topPanel, BorderLayout.PAGE_START);
|
||||
topPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
|
||||
|
||||
JButton resetButton = new JButton("Reset");
|
||||
resetButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.resetClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(resetButton);
|
||||
|
||||
JButton undoButton = new JButton("Undo");
|
||||
undoButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.undoClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(undoButton);
|
||||
|
||||
}
|
||||
|
||||
public void update() {
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class MyFrame extends View<ControllerClicks> {
|
||||
public MyFrame(Model m, ControllerClicks c) {
|
||||
super(m, c);
|
||||
this.setTitle("MyFrame Title");
|
||||
this.setSize(400, 300);
|
||||
this.setLocationRelativeTo(null);
|
||||
this.setLayout(new BorderLayout());
|
||||
|
||||
MyPanel centerPanel = new MyPanel(m, c);
|
||||
this.add(centerPanel, BorderLayout.CENTER);
|
||||
JPanel topPanel = new JPanel();
|
||||
this.add(topPanel, BorderLayout.PAGE_START);
|
||||
topPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
|
||||
|
||||
JButton resetButton = new JButton("Reset");
|
||||
resetButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.resetClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(resetButton);
|
||||
JButton undoButton = new JButton("Undo");
|
||||
undoButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.undoClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(undoButton);
|
||||
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
public void update() {
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class MyFrame extends View<ControllerClicks> {
|
||||
public MyFrame(Model m, ControllerClicks c) {
|
||||
super(m, c);
|
||||
this.setTitle("MyFrame Title");
|
||||
this.setLayout(new BorderLayout());
|
||||
|
||||
MyPanel centerPanel = new MyPanel(m, c);
|
||||
this.add(centerPanel, BorderLayout.CENTER);
|
||||
JPanel topPanel = new JPanel();
|
||||
this.add(topPanel, BorderLayout.PAGE_START);
|
||||
topPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
|
||||
|
||||
JButton resetButton = new JButton("Reset");
|
||||
resetButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.resetClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(resetButton);
|
||||
JButton undoButton = new JButton("Undo");
|
||||
undoButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.undoClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(undoButton);
|
||||
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
public void update() {
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public abstract class View<T extends Controller> extends JFrame implements ModelListener{
|
||||
//instance variables
|
||||
protected Model m;
|
||||
protected T c;
|
||||
|
||||
//constructor
|
||||
public View(Model m, T c) {
|
||||
this.m = m;
|
||||
this.c = c;
|
||||
this.setLocationRelativeTo(null);
|
||||
m.addListener(this);
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void update();
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
public class Start {
|
||||
public static void main(String[] args) {
|
||||
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Model m = new Model(); // Single shared model.
|
||||
|
||||
ControllerClicks c1 = new ControllerClicks(m);
|
||||
MyFrame v1 = new MyFrame(m, c1);
|
||||
MyFrame v3 = new MyFrame(m, c1);
|
||||
|
||||
Controller c2 = new Controller(m);
|
||||
ViewNumber v2 = new ViewNumber(m, c2);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public abstract class View<T extends Controller> extends JFrame implements ModelListener{
|
||||
//instance variables
|
||||
protected Model m;
|
||||
protected T c;
|
||||
|
||||
//constructor
|
||||
public View(Model m, T c) {
|
||||
this.m = m;
|
||||
this.c = c;
|
||||
this.setSize(400, 300);
|
||||
this.setLocationRelativeTo(null);
|
||||
m.addListener(this);
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void update();
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class MyFrame extends View<ControllerClicks> {
|
||||
public MyFrame(Model m, ControllerClicks c) {
|
||||
super(m, c);
|
||||
this.setTitle("MyFrame Title");
|
||||
this.setSize(400, 300);
|
||||
this.setLocationRelativeTo(null);
|
||||
this.setLayout(new BorderLayout());
|
||||
|
||||
MyPanel centerPanel = new MyPanel(m, c);
|
||||
this.add(centerPanel, BorderLayout.CENTER);
|
||||
JPanel topPanel = new JPanel();
|
||||
this.add(topPanel, BorderLayout.PAGE_START);
|
||||
topPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
|
||||
|
||||
JButton resetButton = new JButton("Reset");
|
||||
resetButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.resetClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(resetButton);
|
||||
JButton undoButton = new JButton("Undo");
|
||||
undoButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.undoClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(undoButton);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void update() {
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import javax.swing.JLabel;
|
||||
|
||||
public class ViewNumber extends View<Controller>{
|
||||
//instance variable
|
||||
private JLabel label;
|
||||
|
||||
public ViewNumber(Model m, Controller c) {
|
||||
super(m, c);
|
||||
this.setTitle("View Number");
|
||||
this.setSize(200, 150);
|
||||
label = new JLabel();
|
||||
update();
|
||||
this.add(label);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
label.setText("Number of points is: " + m.numberOfPoints());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class MyFrame extends View<ControllerClicks> {
|
||||
public MyFrame(Model m, ControllerClicks c) {
|
||||
super(m, c);
|
||||
this.setTitle("MyFrame Title");
|
||||
this.setSize(400, 300);
|
||||
this.setLocationRelativeTo(null);
|
||||
|
||||
this.setLayout(new BorderLayout());
|
||||
MyPanel centerPanel = new MyPanel(m, c);
|
||||
this.add(centerPanel, BorderLayout.CENTER);
|
||||
JPanel topPanel = new JPanel();
|
||||
this.add(topPanel, BorderLayout.PAGE_START);
|
||||
topPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
|
||||
|
||||
JButton resetButton = new JButton("Reset");
|
||||
resetButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.resetClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(resetButton);
|
||||
|
||||
JButton undoButton = new JButton("Undo");
|
||||
undoButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.undoClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(undoButton);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void update() {
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
public class Start {
|
||||
public static void main(String[] args) {
|
||||
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Model m = new Model(); // Single shared model.
|
||||
|
||||
ControllerClicks c1 = new ControllerClicks(m);
|
||||
MyFrame v1 = new MyFrame(m, c1);
|
||||
|
||||
Controller c2 = new Controller(m);
|
||||
ViewNumber v2 = new ViewNumber(m, c2);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import java.awt.Point;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Model {
|
||||
//instance variables
|
||||
private ArrayList<Point> points;
|
||||
private ArrayList<ModelListener> listeners;
|
||||
|
||||
//constructor
|
||||
public Model() {
|
||||
points = new ArrayList<Point>();
|
||||
listeners = new ArrayList<ModelListener>();
|
||||
}
|
||||
|
||||
//methods
|
||||
public void addListener(ModelListener l) {
|
||||
listeners.add(l);
|
||||
}
|
||||
|
||||
public ArrayList<Point> getPoints(){
|
||||
return points;
|
||||
}
|
||||
|
||||
public void addPoint(Point p) {
|
||||
points.add(p);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
public void clearAllPoints() {
|
||||
points.clear();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
public void deleteLastPoint(){
|
||||
if(points.size() > 0) {
|
||||
points.remove(points.size() - 1);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
private void notifyListeners() {
|
||||
for(ModelListener l: listeners) {
|
||||
l.update();
|
||||
}
|
||||
}
|
||||
|
||||
//test
|
||||
public void testModel() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class MyFrame extends View<ControllerClicks> {
|
||||
public MyFrame(Model m, ControllerClicks c) {
|
||||
super(m, c);
|
||||
this.setTitle("MyFrame Title");
|
||||
this.setSize(400, 300);
|
||||
this.setLocationRelativeTo(null);
|
||||
this.setLayout(new BorderLayout());
|
||||
|
||||
MyPanel centerPanel = new MyPanel(m, c);
|
||||
this.add(centerPanel, BorderLayout.CENTER);
|
||||
JPanel topPanel = new JPanel();
|
||||
this.add(topPanel, BorderLayout.PAGE_START);
|
||||
topPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
|
||||
|
||||
JButton resetButton = new JButton("Reset");
|
||||
resetButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.resetClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(resetButton);
|
||||
JButton undoButton = new JButton("Undo");
|
||||
undoButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.undoClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(undoButton);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void update() {
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import java.awt.Point;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Model {
|
||||
//instance variables
|
||||
private ArrayList<Point> points;
|
||||
private ArrayList<ModelListener> listeners;
|
||||
|
||||
//constructor
|
||||
public Model() {
|
||||
points = new ArrayList<Point>();
|
||||
listeners = new ArrayList<ModelListener>();
|
||||
}
|
||||
|
||||
//methods
|
||||
public void addListener(ModelListener l) {
|
||||
listeners.add(l);
|
||||
}
|
||||
|
||||
public ArrayList<Point> getPoints(){
|
||||
return points;
|
||||
}
|
||||
|
||||
public void addPoint(Point p) {
|
||||
points.add(p);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
public void clearAllPoints() {
|
||||
points.clear();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
public void deleteLastPoint(){
|
||||
points.remove(points.size()-1);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
private void notifyListeners() {
|
||||
for(ModelListener l: listeners) {
|
||||
l.update();
|
||||
}
|
||||
}
|
||||
|
||||
//test
|
||||
public void testModel() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public abstract class View<T extends Controller> extends JFrame implements ModelListener{
|
||||
//instance variables
|
||||
protected Model m;
|
||||
protected T c;
|
||||
|
||||
//constructor
|
||||
public View(Model m, T c) {
|
||||
this.m = m;
|
||||
this.c = c;
|
||||
m.addListener(this);
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void update();
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class MyFrame extends View<ControllerClicks> {
|
||||
public MyFrame(Model m, ControllerClicks c) {
|
||||
super(m, c);
|
||||
this.setTitle("MyFrame Title");
|
||||
this.setSize(400, 300);
|
||||
this.setLayout(new BorderLayout());
|
||||
|
||||
MyPanel centerPanel = new MyPanel(m, c);
|
||||
this.add(centerPanel, BorderLayout.CENTER);
|
||||
JPanel topPanel = new JPanel();
|
||||
this.add(topPanel, BorderLayout.PAGE_START);
|
||||
topPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
|
||||
|
||||
JButton resetButton = new JButton("Reset");
|
||||
resetButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.resetClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(resetButton);
|
||||
JButton undoButton = new JButton("Undo");
|
||||
undoButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
c.undoClicked();
|
||||
}
|
||||
});
|
||||
topPanel.add(undoButton);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void update() {
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import java.awt.Point;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Model {
|
||||
//instance variables
|
||||
private ArrayList<Point> points;
|
||||
private ArrayList<ModelListener> listeners;
|
||||
|
||||
//constructor
|
||||
public Model() {
|
||||
points = new ArrayList<Point>();
|
||||
listeners = new ArrayList<ModelListener>();
|
||||
}
|
||||
|
||||
//methods
|
||||
public void addListener(ModelListener l) {
|
||||
listeners.add(l);
|
||||
}
|
||||
|
||||
public ArrayList<Point> getPoints(){
|
||||
return points;
|
||||
}
|
||||
|
||||
public void addPoint(Point p) {
|
||||
points.add(p);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
public void clearAllPoints() {
|
||||
points.clear();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
public void deleteLastPoint(){
|
||||
if(points.size() > 0) {
|
||||
points.remove(points.size() - 1);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
private void notifyListeners() {
|
||||
for(ModelListener l: listeners) {
|
||||
l.update();
|
||||
}
|
||||
}
|
||||
|
||||
public int numberOfPoints() {
|
||||
return points.size();
|
||||
}
|
||||
|
||||
//test
|
||||
public void testModel() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public abstract class View<T extends Controller> extends JFrame implements ModelListener{
|
||||
//instance variables
|
||||
protected Model m;
|
||||
protected T c;
|
||||
|
||||
//constructor
|
||||
public View(Model m, T c) {
|
||||
this.m = m;
|
||||
this.c = c;
|
||||
this.setSize(400, 300);
|
||||
this.setLocationRelativeTo(null);
|
||||
m.addListener(this);
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void update();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public abstract class View<T extends Controller> extends JFrame implements ModelListener{
|
||||
//instance variables
|
||||
protected Model m;
|
||||
protected T c;
|
||||
|
||||
//constructor
|
||||
public View(Model m, T c) {
|
||||
this.m = m;
|
||||
this.c = c;
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
m.addListener(this);
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void update();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public abstract class View<T extends Controller> extends JFrame implements ModelListener{
|
||||
//instance variables
|
||||
protected Model m;
|
||||
protected T c;
|
||||
|
||||
//constructor
|
||||
public View(Model m, T c) {
|
||||
this.m = m;
|
||||
this.c = c;
|
||||
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
m.addListener(this);
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void update();
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import java.awt.Point;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Model {
|
||||
//instance variables
|
||||
private ArrayList<Point> points;
|
||||
private ArrayList<ModelListener> listeners;
|
||||
|
||||
//constructor
|
||||
public Model() {
|
||||
points = new ArrayList<Point>();
|
||||
listeners = new ArrayList<ModelListener>();
|
||||
}
|
||||
|
||||
//methods
|
||||
public void addListener(ModelListener l) {
|
||||
listeners.add(l);
|
||||
}
|
||||
|
||||
public ArrayList<Point> getPoints(){
|
||||
return points;
|
||||
}
|
||||
|
||||
public void addPoint(Point p) {
|
||||
points.add(p);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
public void clearAllPoints() {
|
||||
points.clear();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
public void deleteLastPoint(){
|
||||
if(points.size() > 0) {
|
||||
points.remove(points.size() - 1);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
private void notifyListeners() {
|
||||
for(ModelListener l: listeners) {
|
||||
l.update();
|
||||
}
|
||||
}
|
||||
|
||||
//test
|
||||
public static void testModel() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
public class Test {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public abstract class View<T extends Controller> extends JFrame implements ModelListener{
|
||||
//instance variables
|
||||
protected Model m;
|
||||
protected T c;
|
||||
|
||||
//constructor
|
||||
public View(Model m, T c) {
|
||||
this.m = m;
|
||||
this.c = c;
|
||||
this.setLocationRelativeTo(null);
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
m.addListener(this);
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void update();
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import java.awt.BorderLayout;
|
||||
|
||||
import javax.swing.JLabel;
|
||||
|
||||
public class ViewNumber extends View<Controller>{
|
||||
//instance variable
|
||||
private JLabel label;
|
||||
|
||||
public ViewNumber(Model m, Controller c) {
|
||||
super(m, c);
|
||||
this.setTitle("MyFrame Title");
|
||||
this.setLayout(new BorderLayout());
|
||||
label = new JLabel();
|
||||
update();
|
||||
this.add(label);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
label.setText("Number of points is: " + m.numberOfPoints());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import javax.swing.JLabel;
|
||||
|
||||
public class ViewNumber extends View<Controller>{
|
||||
//instance variable
|
||||
private JLabel label;
|
||||
|
||||
public ViewNumber(Model m, Controller c) {
|
||||
super(m, c);
|
||||
this.setTitle("View Number");
|
||||
this.setSize(200, 100);
|
||||
label = new JLabel();
|
||||
update();
|
||||
this.add(label);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
label.setText("Number of points is: " + m.numberOfPoints());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import javax.swing.JLabel;
|
||||
|
||||
public class ViewNumber extends View<Controller>{
|
||||
//instance variable
|
||||
private JLabel label;
|
||||
|
||||
public ViewNumber(Model m, Controller c) {
|
||||
super(m, c);
|
||||
this.setTitle("View Number");
|
||||
this.setSize(100, 100);
|
||||
label = new JLabel();
|
||||
update();
|
||||
this.add(label);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
label.setText("Number of points is: " + m.numberOfPoints());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
public class Start {
|
||||
public static void main(String[] args) {
|
||||
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Model m = new Model(); // Single shared model.
|
||||
|
||||
ControllerClicks c1 = new ControllerClicks(m);
|
||||
MyFrame v1 = new MyFrame(m, c1);
|
||||
|
||||
Controller c2 = new Controller(m);
|
||||
ViewNumber v2 = new ViewNumber(m, c2);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
public class Start {
|
||||
public static void main(String[] args) {
|
||||
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Model m = new Model(); // Single shared model.
|
||||
|
||||
ControllerClicks c1 = new ControllerClicks(m);
|
||||
MyFrame v1 = new MyFrame(m, c1);
|
||||
|
||||
ViewNumber v2 = new ViewNumber(m, c1);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public abstract class View<T extends Controller> extends JFrame implements ModelListener{
|
||||
//instance variables
|
||||
protected Model m;
|
||||
protected T c;
|
||||
|
||||
//constructor
|
||||
public View(Model m, T c) {
|
||||
this.m = m;
|
||||
this.c = c;
|
||||
this.setLocationRelativeTo(null);
|
||||
m.addListener(this);
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void update();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public abstract class View<T extends Controller> extends JFrame implements ModelListener{
|
||||
//instance variables
|
||||
protected Model m;
|
||||
protected T c;
|
||||
|
||||
//constructor
|
||||
public View(Model m, T c) {
|
||||
this.m = m;
|
||||
this.c = c;
|
||||
this.setLocationRelativeTo(null);
|
||||
m.addListener(this);
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void update();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import javax.swing.JLabel;
|
||||
|
||||
public class ViewNumber extends View<Controller>{
|
||||
//instance variable
|
||||
private JLabel label;
|
||||
|
||||
public ViewNumber(Model m, Controller c) {
|
||||
super(m, c);
|
||||
this.setTitle("View Number");
|
||||
this.setSize(300, 200);
|
||||
label = new JLabel();
|
||||
update();
|
||||
this.add(label);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
label.setText("Number of points is: " + m.numberOfPoints());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import javax.swing.JLabel;
|
||||
|
||||
public class ViewNumber extends View<Controller>{
|
||||
//instance variable
|
||||
private JLabel label;
|
||||
|
||||
public ViewNumber(Model m, Controller c) {
|
||||
super(m, c);
|
||||
label = new JLabel();
|
||||
update();
|
||||
this.add(label);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
label.setText("Number of points is: " + m.numberOfPoints());
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding=UTF-8
|
||||
version=1
|
||||
@@ -0,0 +1,4 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<launchPerspectives/>\r\n
|
||||
org.eclipse.debug.ui.save_dirty_editors_before_launch=always
|
||||
preferredTargets=default,org.eclipse.lsp4e.debug.toggleBreakpointTarget\:default|org.eclipse.lsp4e.debug.toggleBreakpointTarget\:org.eclipse.lsp4e.debug.toggleBreakpointTarget|
|
||||
@@ -0,0 +1,9 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.codeComplete.visibilityCheck=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
|
||||
org.eclipse.jdt.core.compiler.compliance=17
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.release=enabled
|
||||
org.eclipse.jdt.core.compiler.source=17
|
||||
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.junit.content_assist_favorite_static_members_migrated=true
|
||||
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.launching.PREF_VM_XML=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<vmSettings defaultVM\="57,org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType13,1683778295040" defaultVMConnector\="">\r\n <vmType id\="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType">\r\n <vm id\="1683778295040" name\="jre" path\="C\:\\Users\\Danie\\.p2\\pool\\plugins\\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.6.v20230204-1729\\jre"/>\r\n </vmType>\r\n</vmSettings>\r\n
|
||||
@@ -0,0 +1,10 @@
|
||||
content_assist_lru_history=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><history maxLHS\="100" maxRHS\="10"/>
|
||||
content_assist_number_of_computers=17
|
||||
content_assist_proposals_background=255,255,255
|
||||
content_assist_proposals_foreground=0,0,0
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.ui.formatterprofiles.version=22
|
||||
spelling_locale_initialized=true
|
||||
typefilter_migrated_2=true
|
||||
useAnnotationsPrefPage=true
|
||||
useQuickDiffPrefPage=true
|
||||
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jsch.core.hasChangedDefaultWin32SshHome=true
|
||||
@@ -0,0 +1,2 @@
|
||||
areThereWebServices=false
|
||||
eclipse.preferences.version=1
|
||||
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.m2e.discovery.pref.projects=
|
||||
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
knownEEFragments=
|
||||
@@ -0,0 +1,5 @@
|
||||
SWITCH_PERSPECTIVE_ON_PROJECT_CREATION=always
|
||||
eclipse.preferences.version=1
|
||||
platformState=1677130608974
|
||||
quickStart=false
|
||||
tipsAndTricks=true
|
||||
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.ui.navigator.ProjectExplorer.filterActivation=\:org.eclipse.jdt.java.ui.filters.HidePackageDeclaration\:org.eclipse.jdt.java.ui.filters.HideOutputFolder\:org.eclipse.buildship.ui.navigator.filter.gradle.subProject\:org.eclipse.ui.navigator.resources.nested.HideTopLevelProjectIfNested\:org.eclipse.buildship.ui.navigator.filter.gradle.buildfolder\:org.eclipse.jdt.java.ui.filters.HideEmptyInnerPackages\:org.eclipse.jst.j2ee.navigator.ui.filters.jetemitters\:org.eclipse.jdt.java.ui.filters.HideInnerClassFiles\:org.eclipse.ui.navigator.resources.filters.startsWithDot\:org.eclipse.jdt.java.ui.filters.HideEmptyLibraryContainers\:org.eclipse.jdt.java.ui.filters.HideImportDeclaration\:org.eclipse.jdt.java.ui.filters.HideSyntheticMembers\:org.eclipse.ui.navigator.resources.nested.HideFolderWhenProjectIsShownAsNested\:
|
||||
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
showIntro=false
|
||||
@@ -0,0 +1,10 @@
|
||||
//org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState=false
|
||||
//org.eclipse.ui.commands/state/org.eclipse.wst.xml.views.XPathView.processor.xpathprocessor/org.eclipse.ui.commands.radioState=xpath10
|
||||
PLUGINS_NOT_ACTIVATED_ON_STARTUP=;org.eclipse.m2e.discovery;
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_END=255,255,255
|
||||
org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_START=255,255,255
|
||||
org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_TEXT_COLOR=16,16,16
|
||||
org.eclipse.ui.workbench.ACTIVE_TAB_BG_END=255,255,255
|
||||
org.eclipse.ui.workbench.ACTIVE_TAB_BG_START=255,255,255
|
||||
org.eclipse.ui.workbench.INACTIVE_TAB_BG_START=242,242,242
|
||||
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
processedSchemes=,eclipse+command,eclipse+mpc
|
||||
@@ -0,0 +1,9 @@
|
||||
eclipse.preferences.version=1
|
||||
fontPropagated=true
|
||||
org.eclipse.wst.jsdt.ui.editor.tab.width=
|
||||
org.eclipse.wst.jsdt.ui.formatterprofiles.version=11
|
||||
org.eclipse.wst.jsdt.ui.javadoclocations.migrated=true
|
||||
proposalOrderMigrated=true
|
||||
tabWidthPropagated=true
|
||||
useAnnotationsPrefPage=true
|
||||
useQuickDiffPrefPage=true
|
||||
@@ -0,0 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.wst.ws.service.policy.ui.servicepols.wsiprofilecomp.wsiap.defaultProtocol=http\://schemas.xmlsoap.org/wsdl/soap/
|
||||
org.eclipse.wst.ws.service.policy.ui.servicepols.wsiprofilecomp.wsissbp.defaultProtocol=http\://schemas.xmlsoap.org/wsdl/soap/
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/Question2/src/Start.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="Start"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value=""/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Question2"/>
|
||||
</launchConfiguration>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/Question1/src/Start.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="Start"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value=""/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Question1"/>
|
||||
</launchConfiguration>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/Question1/src/Test.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="Test"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value=""/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Question1"/>
|
||||
</launchConfiguration>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<section name="Workbench">
|
||||
<section name="org.eclipse.debug.ui.SCOPED_SAVE_SELECTION_DIALOG">
|
||||
<item key="DIALOG_WIDTH" value="423"/>
|
||||
<item key="DIALOG_HEIGHT" value="493"/>
|
||||
<item key="DIALOG_FONT_NAME" value="1|Segoe UI|9.0|0|WINDOWS|1|-18|0|0|0|400|0|0|0|1|0|0|0|0|Segoe UI"/>
|
||||
</section>
|
||||
</section>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchHistory>
|
||||
<launchGroup id="org.eclipse.debug.ui.launchGroup.debug">
|
||||
<mruHistory>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Start (1)"/> "/>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Test"/> "/>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Start"/> "/>
|
||||
</mruHistory>
|
||||
<favorites/>
|
||||
</launchGroup>
|
||||
<launchGroup id="org.eclipse.debug.ui.launchGroup.profile">
|
||||
<mruHistory/>
|
||||
<favorites/>
|
||||
</launchGroup>
|
||||
<launchGroup id="org.eclipse.eclemma.ui.launchGroup.coverage">
|
||||
<mruHistory>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Start (1)"/> "/>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Test"/> "/>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Start"/> "/>
|
||||
</mruHistory>
|
||||
<favorites/>
|
||||
</launchGroup>
|
||||
<launchGroup id="org.eclipse.ui.externaltools.launchGroup">
|
||||
<mruHistory/>
|
||||
<favorites/>
|
||||
</launchGroup>
|
||||
<launchGroup id="org.eclipse.debug.ui.launchGroup.run">
|
||||
<mruHistory>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Start (1)"/> "/>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Test"/> "/>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Start"/> "/>
|
||||
</mruHistory>
|
||||
<favorites/>
|
||||
</launchGroup>
|
||||
</launchHistory>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>.org.eclipse.egit.core.cmp</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
java
|
||||
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
INDEX VERSION 1.131+E:\JAVA 2023\Lab12_2230026071\.metadata\.plugins\org.eclipse.jdt.core
|
||||
1865797976.index
|
||||
911535316.index
|
||||
2942156142.index
|
||||
2805711536.index
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user