Woo
This commit is contained in:
+12
-55
@@ -1,70 +1,27 @@
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
|
||||
|
||||
public class Artist implements Serializable{
|
||||
|
||||
private static final long serialVersionUID = 1;
|
||||
|
||||
private String name;
|
||||
public class Artist
|
||||
{
|
||||
private String genre;
|
||||
private ImageIcon image;
|
||||
private String name;
|
||||
private String description;
|
||||
private ImageIcon image;
|
||||
private int id;
|
||||
|
||||
public Artist(String name, String genre, String image, String description)
|
||||
public Artist(String genre, String name, String description, ImageIcon image, int id)
|
||||
{
|
||||
this.name = name;
|
||||
this.genre = genre;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
|
||||
if ( !image.equals("null")) {
|
||||
this.image = new ImageIcon(image);
|
||||
}
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public String getGenre()
|
||||
{
|
||||
return this.genre;
|
||||
}
|
||||
|
||||
public ImageIcon getImage()
|
||||
{
|
||||
return this.image;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return this.description;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setGenre(String genre)
|
||||
{
|
||||
this.genre = genre;
|
||||
}
|
||||
|
||||
public void setImageIconString(String image)
|
||||
{
|
||||
this.image = new ImageIcon(image);
|
||||
}
|
||||
|
||||
public void setImageIcon(ImageIcon image)
|
||||
{
|
||||
this.image = image;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setDescription(String description)
|
||||
public int getID()
|
||||
{
|
||||
this.description = description;
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+23
-112
@@ -1,123 +1,34 @@
|
||||
import java.io.Serializable;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
public class Event implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1;
|
||||
|
||||
private String eventName;
|
||||
private GregorianCalendar startDate;
|
||||
private GregorianCalendar endDate;
|
||||
public class Event
|
||||
{
|
||||
private int startTime;
|
||||
private int endTime;
|
||||
private Artist artist;
|
||||
private Stage stage;
|
||||
private String description;
|
||||
private int expectedPopularity;
|
||||
|
||||
public Event(String eventName, int startYear, int startMonth, int startDay,
|
||||
int startHour, int startMinute, int endYear, int endMonth,
|
||||
int endDay, int endHour, int endMinute, Artist artist, Stage stage,
|
||||
String description, int expectedPopularity) {
|
||||
this.eventName = eventName;
|
||||
this.startDate = new GregorianCalendar(startYear, startMonth - 1,
|
||||
startDay, startHour, startMinute);
|
||||
this.endDate = new GregorianCalendar(endYear, endMonth - 1, endDay,
|
||||
endHour, endMinute);
|
||||
this.stage = stage;
|
||||
private int id;
|
||||
|
||||
public Event(int startTime, int endTime, Artist artist, String description, int id)
|
||||
{
|
||||
this.startTime = startTime;
|
||||
this.endTime = endTime;
|
||||
this.artist = artist;
|
||||
this.description = description;
|
||||
this.expectedPopularity = expectedPopularity;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Event(String eventName, GregorianCalendar startDate,
|
||||
GregorianCalendar endDate, Artist artist, Stage stage,
|
||||
String description, int expectedPopularity) {
|
||||
this.eventName = eventName;
|
||||
this.startDate = startDate;
|
||||
this.endDate = endDate;
|
||||
this.artist = artist;
|
||||
this.stage = stage;
|
||||
this.description = description;
|
||||
this.expectedPopularity = expectedPopularity;
|
||||
public Artist getArtist()
|
||||
{
|
||||
return artist;
|
||||
}
|
||||
|
||||
public String getEventName() {
|
||||
return this.eventName;
|
||||
|
||||
public int getStartTime()
|
||||
{
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public GregorianCalendar getStartDate() {
|
||||
return this.startDate;
|
||||
}
|
||||
|
||||
public GregorianCalendar getEndDate() {
|
||||
return this.endDate;
|
||||
}
|
||||
|
||||
public Artist getArtist() {
|
||||
return this.artist;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
public Stage getStage() {
|
||||
return this.stage;
|
||||
}
|
||||
|
||||
public int getExpectedPopularity() {
|
||||
return this.expectedPopularity;
|
||||
}
|
||||
|
||||
public void setEventName(String name) {
|
||||
this.eventName = name;
|
||||
}
|
||||
|
||||
public void setStartDate(int startYear, int startMonth, int startDay,
|
||||
int startHour, int startMinute) {
|
||||
startDate.set(startYear, startMonth - 1, startDay, startHour,
|
||||
startMinute);
|
||||
}
|
||||
|
||||
public void setStartDate(GregorianCalendar startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public void setEndDate(int endYear, int endMonth, int endDay, int endHour,
|
||||
int endMinute) {
|
||||
endDate.set(endYear, endMonth - 1, endDay, endHour, endMinute);
|
||||
}
|
||||
|
||||
public void setEndDate(GregorianCalendar endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public void setArtist(Artist artist) {
|
||||
this.artist.setName(artist.getName());
|
||||
this.artist.setGenre(artist.getGenre());
|
||||
this.artist.setImageIcon(artist.getImage());
|
||||
this.artist.setDescription(artist.getDescription());
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public void setExpectedPopularity(int popularity) {
|
||||
this.expectedPopularity = popularity;
|
||||
}
|
||||
|
||||
public void setStage(Stage stage) {
|
||||
this.stage = stage;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
DateFormat format = new SimpleDateFormat("dd-MM-yyyy");
|
||||
format.setLenient(false);
|
||||
|
||||
return artist.getName() + " plays from "
|
||||
+ format.format(startDate.getTime()) + " to "
|
||||
+ format.format(endDate.getTime()) + ".";
|
||||
|
||||
public int getID()
|
||||
{
|
||||
return id + 10;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user