text
stringlengths
3
1.18M
package controlador; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import vista.VistaCategoria; import vista.VistaCliente; import vista.VistaCompra; import vista.VistaIngrediente; import vista.VistaListados; import vist...
package controlador; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JOptionPane; import javax.swing.JPanel; import modelo.ModeloCategoria; import vista.VistaCategoria; public class ControladorCategoria implements ActionListener{ private VistaCategoria vistacat...
package controlador; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import javax.swing.JOptionPane; import javax.swing.JPanel; import java.sql.ResultSet; import java.s...
package controlador; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import javax.swing.JOptionPane; import javax.swing.JPanel; import java.sql.ResultSet; import java.sql...
package controlador; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JOptionPane; import javax.swing.JPanel; import modelo.ModeloCliente; import vista.VistaCliente; public class ControladorCliente implements ActionListener{ private VistaCliente vistacliente; ...
package vista; import javax.swing.table.JTableHeader; import javax.swing.JPanel; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JComboBox; import javax.swing.JButton; import java.awt.Color; i...
package vista; import javax.swing.JPanel; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JComboBox; import javax.swing.JButton; import java.awt.Color; import java.awt.Font; import javax.swing.BorderFactory; import javax.swing.ComboBoxModel; import ja...
package vista; import javax.swing.JPanel; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JButton; import java.awt.Color; import java.awt.Font; import javax.swing.BorderFactory; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import...
package vista; import javax.swing.table.JTableHeader; import javax.swing.JPanel; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JComboBox; import javax.swing.JButton; import java.awt.Color; i...
package vista; import javax.swing.table.JTableHeader; import javax.swing.JPanel; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JComboBox; import javax.swing.JButton; import java.awt.Color; i...
package vista; import java.util.Vector; import javax.swing.table.AbstractTableModel; import modelo.ModeloIngredientes; import modelo.ModeloReporteIngredientesUsados; import modelo.ModeloReporteVentas; //import modelo.Accion; @SuppressWarnings("serial") public class VistaModeloTabla extends AbstractTable...
package vista; import javax.swing.JPanel; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JButton; import java.awt.Color; import java.awt.Font; import javax.swing.BorderFactory; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; impo...
package vista; import javax.swing.JPanel; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JButton; import java.awt.Color; import java.awt.Font; import javax.swing.BorderFactory; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; impo...
package vista; import javax.swing.JPanel; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JTable; import java.awt.Color; import java.awt.Font; import javax.swing.BorderFactory; import javax.swing.JButton; import modelo.ModeloOrden; import modelo.Mod...
package vista; import java.awt.BorderLayout; import java.awt.Color; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Vector; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.WindowConstants; import javax.swing.table.AbstractTableModel; ...
package vista; /* Laboratorio 1 (Lunes 1:00 p.m.) * * Integrantes: * * Mariela Carrera CI. 18683533 * * Abraham Mogollón CI. 18136645 * * Lianeth Barazarte CI. 20188630 * * Johann Morales CI 17627581 * * */ import javax.swing.JPanel; import javax.swing.JFrame; import ja...
package Utilidades; //import javax.swing.*; import javax.swing.text.*; import java.awt.*; @SuppressWarnings("serial") public class Limitador extends DefaultStyledDocument { int caracteres; public Limitador(int caracteres){ this.caracteres = caracteres; } public void insertString(int offs, S...
package Utilidades; public class ObjetoCombo { private String codigo; private String nombre; public ObjetoCombo(String codigo, String nombre) { this.codigo = codigo; this.nombre = nombre; } public String toString() { return this.nombre; } public String getCodigo() { return codigo; } ...
package modelo; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public abstract class ModeloBD { private final String driver="org.postgresql.Driver"; private final String bd="BD4-4"; private final String url="jdbc:post...
package modelo; import java.sql.ResultSet; import java.sql.SQLException; public class ModeloCategoria extends ModeloBD{ private String id; private String descripcion; public ModeloCategoria(){ super(); } public ModeloCategoria(String id, String descripcion) { super(); this.id = id;...
package modelo; import java.sql.ResultSet; public interface ModeloOrdenInterface { public ResultSet listarOrdenes(); }
package modelo; import java.sql.ResultSet; public abstract class ModeloOrdenDecorator implements ModeloOrdenInterface { protected ModeloOrdenInterface modeloOrdenInterface; public ModeloOrdenDecorator(ModeloOrdenInterface modeloOrdenInterface) { this.modeloOrdenInterface = modeloOrdenInterface; ...
package modelo; import java.sql.ResultSet; import java.sql.SQLException; public class ModeloIngredientes extends ModeloBD { private String id; private int stock; private String descripcion; private double costo; public ModeloIngredientes() { super(); } public ModeloIngredientes(Stri...
package modelo; import java.util.Vector; public abstract class ModeloProductoBuilder { protected ModeloProductos producto; public ModeloProductos getProducto() { return producto; } public void crearNuevoProducto() { producto = new ModeloProductos(); } public abstract ...
// LA3486 陈锋 import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Stack; import java.util.StringTokenizer; public class Main { static Reader stdin = new Read...
// UVa11294 Wedding // 陈锋 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Stack; import java.util.StringTokenizer; public class Main { pri...
/* NFCard is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. NFCard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY...
/* NFCard is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. NFCard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY...
/* NFCard is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. NFCard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY...
/* NFCard is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. NFCard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY...
/* NFCard is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. NFCard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY...
/* NFCard is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. NFCard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY...
/* NFCard is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. NFCard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY...
/* NFCard is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. NFCard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY...
/* NFCard is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. NFCard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY...
/* NFCard is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. NFCard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY...
/* NFCard is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. NFCard is distributed in the hope that it will be useful, but WITHOUT ANY WA...
/* NFCard is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. NFCard is distributed in the hope that it will be useful, but WITHOUT ANY WA...
/* NFCard is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. NFCard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY...
/* NFCard is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. NFCard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY...
// LA3486 陈锋 import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Stack; import java.util.StringTokenizer; public class Main { static Reader stdin = new Read...
// UVa11294 Wedding // 陈锋 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Stack; import java.util.StringTokenizer; public class Main { pri...
/* * Copyright 2013 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
/* * Copyright 2013 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
/* * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
/** Automatically generated file. DO NOT MODIFY */ package com.google.android.gcm; public final class BuildConfig { public final static boolean DEBUG = true; }
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
package org.slipbtn; import java.io.IOException; import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Paint; import android.graph...
package edu.bupt.Clat; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.E...
package edu.bupt.Clat; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.HashMap; import android.app.IntentService; import android....
package edu.bupt.Clat; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client....
package edu.bupt.Clat; import java.io.File; import java.io.FileOutputStream; import java.util.Scanner; import android.content.Context; import android.content.Intent; import android.util.Log; public class Tethering { private static String WiFiIPv6Address = null; private static String IPv6TetherInterface...
package edu.bupt.Clat; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.Scanner; //import android.app.Activity; import android.content.Context; import android.content.Intent; //import android.net.wifi.WifiManager; //import android.net.wifi.WifiInfo; //impo...
package edu.bupt.Clat; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; //import java.net.Inet4Address; import java.net.Inet4Address; import java.net.Inet6Address; import java.net.InetAddress; import java.net.NetworkInterface; import java.net.SocketException; import jav...
package edu.bupt.Clat; import android.content.Context; import android.content.pm.PackageManager.NameNotFoundException; import android.util.Log; public class Config { private static final String TAG = "Config"; public static final String UPDATE_SERVER = "http://[2001:250:f004:f001:250:56ff:fe8...
package edu.bupt.Clat; import org.json.JSONArray; import org.json.JSONObject; import android.util.Log; public class Update { public static int newVerCode = 0; public static String newVerName = ""; private static final String TAG = "Update"; private static String verjson = null; public static boolea...
package edu.bupt.Clat; //import org.update.*; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.Calendar; //import java.util.ArrayList; //import java.util.HashMap; //import java.util.Iterator; //import java.util.List; //import java.util....
/** * It represents one game of battleships. Each Game has two Players. * The Game keeps track of whose turn it is, * and is responsible for determining * which Player has won. */ public class Game { /** * The height and width of the grid */ public static final int GRID_SIZE = 10; Player player1; Player...
/** * PatrolBoat class. A "Patrol Boat" is the smallest ship in the game of * Battleships, occupying two grid squares. */ public class PatrolBoat extends Ship { /** * PatrolBoat constructor. Initialises the name and length of the * PatrolBoat. */ public PatrolBoat() { super("Patrol Boat", 2); } }
import javax.swing.JFrame; //imports JFrame library import javax.swing.JButton; //imports JButton library import java.awt.GridLayout; //imports GridLayout library public class KButton extends JButton{ // //each button needs to have its own coordinate and status. create a boolean flag for clicking //each button nee...
import java.util.ArrayList; /** * This abstract Ship class that contains fields and methods to handle ship object. * * @mathmodel each ship has a name and length * @constraint ship size must fit into its type 2, 3, 4 and 5 * @mathdef sequence of cell position * @initially constructor (String name, int ...
import java.util.Random; /** * we have a Jbutton ButtonGrid * It represents a grid that consists of cells. Every Grid belongs to a Player * and it manages the deployment of Ships onto it. */ public class Grid { private Cell[][] cells; private Player player; /** * Grid constructor. It creates the cells ...
/** * Destroyer class. A "Destroyer" is a ship that occupies two grid squares. */ public class Destroyer extends Ship { /** * Destroyer constructor. Initialises the name and length of the Destroyer. */ public Destroyer() { super("Destroyer", 2); } }
import java.util.ArrayList; /** * Player class. Each Player has a name, five ships and a Grid. A Player can * determine whether he or she has been defeated or not. */ public class Player { private String name; private Ship[] ships; private ArrayList<String> used; //private Grid grid; private ButtonGrid grid; ...
/** * Battleship class. A "Battleship" is a ship that occupies four grid squares. */ public class Battleship extends Ship { /** * Battleship constructor. Initialises the name and length of the * Battleship. */ public Battleship() { super("Battleship", 4); } }
import java.util.ArrayList; import java.util.List; public class BattleshipModel { private ArrayList<String> p1_used_cells = new ArrayList<String>(); private ArrayList<String> p2_used_cells = new ArrayList<String>(); private ArrayList<String> p1_ship_cells = new ArrayList<String>(); private ArrayList<String> p2_shi...
/** * AircraftCarrier type of ship and it takes 5 cells. */ public class AircraftCarrier extends Ship { /** * AircraftCarrier constructor to initialize the name and length. */ public AircraftCarrier() { super("Aircraft Carrier", 5); } }
/** * It provides submarine class that occupies three grid squares. * * @correspondence submarine is one of the valid type of ship that can be placed. * @convention Provide the name and length of submarine type of ship. * * @author vo, wu and wyan */ public final class Submarine extends Ship { /** * Submar...
import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.EmptyBorder; import java.util.*; import java.util.Timer; /** * This class manages the graphical user interface (GUI) for the game. * * @author */ public class UI { // Public static constants public static final int BOR...
/** * Cell class. A Cell is one element in a Grid. A Cell knows which Ship is * occupying it. Cell is responsible for handling attacks. As well as this, Cell * can calculate what the UI should display. */ public class Cell { /* * Constants */ // Attack constants - used by Cell.tryAttack public static final ...
import java.awt.event.ActionEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseEvent; import java.awt.event.ActionListener; import java.util.ArrayList; /** * Handles user interaction with listeners. * Calls view and model as needed * @author Vo, Wu and Wyan. * ...