diff options
Diffstat (limited to 'vdrmanager')
4 files changed, 68 insertions, 47 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java index 0348441..e44e4b5 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java @@ -22,6 +22,9 @@ public abstract class Event { return new Timer(this); } + public abstract Timer getTimer(); + + public TimerState getTimerState() { return TimerState.None; } diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/EventListItem.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/EventListItem.java index e37aa3c..3f85891 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/EventListItem.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/EventListItem.java @@ -20,9 +20,9 @@ public class EventListItem extends Event { this.event = event; } - private final Recording rec; - private final Timer timer; - private final Epg epg; + //private final Recording rec; + //private final Timer timer; + //private final Epg epg; private final String header; // @@ -37,71 +37,75 @@ public class EventListItem extends Event { // throw new IllegalArgumentException("Uknown event type " + event); // } - public EventListItem(final Recording rec) { + + public EventListItem(final Event rec) { super(rec); event = rec; this.header = null; - this.rec = rec; - this.epg = null; - this.timer = null; - } - - public EventListItem(final Timer timer) { - super(timer); - event = timer; - this.header = null; - this.timer = timer; - this.epg = null; - this.rec = null; - } - - public EventListItem(final Epg epg) { - super(epg); - event = epg; - this.header = null; - this.timer = null; - this.epg = epg; - this.rec = null; +// this.rec = rec; + // this.epg = null; + //this.timer = null; } +// +// public EventListItem(final Recording rec) { +// super(rec); +// event = rec; +// this.header = null; +// this.rec = rec; +// this.epg = null; +// this.timer = null; +// } +// +// public EventListItem(final Timer timer) { +// super(timer); +// event = timer; +// this.header = null; +// this.timer = timer; +// this.epg = null; +// this.rec = null; +// } +// +// public EventListItem(final Epg epg) { +// super(epg); +// event = epg; +// this.header = null; +// this.timer = null; +// this.epg = epg; +// this.rec = null; +// } @Override public TimerState getTimerState() { - if (epg != null) { - return epg.getTimerState(); - } - return super.getTimerState(); + return event.getTimerState(); } public EventListItem(final String header) { this.header = header; - this.timer = null; - this.epg = null; - this.rec = null; } public boolean isHeader() { return header != null; } - public boolean isTimer() { - return timer != null; - } +// public boolean isTimer() { +// return event instanceof Timer; +// } public String getHeader() { return header; } - public Timer getTimer() { - return timer; - } - - public Epg getEpg() { - return epg; - } - - public Recording getRecording() { - return rec; - } +// public Timer getTimer() { +// return timer; +// } +// +// public Epg getEpg() { +// return epg; +// } +// +// public Recording getRecording() { +// return rec; +// } // public Event getEvent() { // return event; @@ -119,7 +123,7 @@ public class EventListItem extends Event { final EventFormatter formatter = new EventFormatter(this); final StringBuilder text = new StringBuilder(); - text.append(isTimer() ? "Timer: " : "Event: "); + text.append("Timer / Event: "); text.append("Channel: ").append(getChannelNumber()); text.append(" (").append(getChannelName()).append("), "); text.append("Zeit: ").append(formatter.getDate()).append(" ") @@ -127,4 +131,9 @@ public class EventListItem extends Event { return text.toString(); } + @Override + public Timer getTimer() { + return event.getTimer(); + } + }
\ No newline at end of file diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java index 8209004..bab52d0 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java @@ -62,6 +62,11 @@ public class Recording extends Event{ public String toCommandLine(){ return String.valueOf(index); } + + @Override + public Timer getTimer() { + return null; + } } diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Timer.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Timer.java index 7765a36..397453b 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Timer.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Timer.java @@ -169,4 +169,8 @@ public class Timer extends Event { flags = flags & ~ENABLED; } } + + public Timer getTimer() { + return this; + } } |