public class MutableProgram extends Object implements Program
Modifier and Type | Field and Description |
---|---|
protected static Marker[] |
EMPTY_MARKER_ARR
A plugin array that can be shared by all the programs that are not marked
by any plugin.
|
static int |
MAX_SHORT_INFO_LENGTH
The maximum length of a short info.
|
protected String |
mTitle
Contains the title
|
DEFAULT_MARK_PRIORITY, HIGHER_MEDIUM_MARK_PRIORITY, INFO_AUDIO_DESCRIPTION, INFO_AUDIO_DOLBY_DIGITAL_5_1, INFO_AUDIO_DOLBY_SURROUND, INFO_AUDIO_MONO, INFO_AUDIO_STEREO, INFO_AUDIO_TWO_CHANNEL_TONE, INFO_CATEGORIE_ARTS, INFO_CATEGORIE_CHILDRENS, INFO_CATEGORIE_DOCUMENTARY, INFO_CATEGORIE_MAGAZINE_INFOTAINMENT, INFO_CATEGORIE_MOVIE, INFO_CATEGORIE_NEWS, INFO_CATEGORIE_OTHERS, INFO_CATEGORIE_SERIES, INFO_CATEGORIE_SHOW, INFO_CATEGORIE_SPORTS, INFO_LIVE, INFO_NEW, INFO_ORIGINAL_WITH_SUBTITLE, INFO_SUBTITLE, INFO_SUBTITLE_FOR_AURALLY_HANDICAPPED, INFO_VISION_16_TO_9, INFO_VISION_4_TO_3, INFO_VISION_BLACK_AND_WHITE, INFO_VISION_HD, IS_VALID_STATE, LOWER_MEDIUM_MARK_PRIORITY, MARK_PRIORITY, MAX_MARK_PRIORITY, MEDIUM_MARK_PRIORITY, MIN_MARK_PRIORITY, NO_MARK_PRIORITY, WAS_DELETED_STATE, WAS_UPDATED_STATE
Constructor and Description |
---|
MutableProgram(Channel channel,
Date localDate,
boolean isLoading)
Creates a new instance of MutableProgram.
|
MutableProgram(Channel channel,
Date localDate,
int localHours,
int localMinutes)
Deprecated.
Since 2.2.2. Use
MutableProgram(Channel, devplugin.Date, int, int, boolean) instead. |
MutableProgram(Channel channel,
Date localDate,
int localHours,
int localMinutes,
boolean isLoading)
Creates a new instance of MutableProgram.
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener listener)
Adds a ChangeListener to the program.
|
boolean |
equals(Object o) |
boolean |
equalsAllFields(MutableProgram program)
check if two programs are identical by their field contents
|
protected void |
fireStateChanged()
Send a ChangeEvent, whose source is this program, to each listener.
|
static String |
generateShortInfoFromDescription(String shortInfo)
Trimm text for shortinfo-field
|
byte[] |
getBinaryField(ProgramFieldType type)
Gets the value of a binary field from the program.
|
Channel |
getChannel()
Returns the channel object of this program.
|
Date |
getDate()
Returns the date of this program.
|
String |
getDateString()
get the date of this program as nicely formatted string
|
String |
getDescription()
Returns a description about the program.
|
String |
getEndTimeString()
get the end time of this program as nicely formatted string
|
protected Object |
getField(ProgramFieldType type,
int fieldFormat) |
int |
getFieldCount()
Gets the number of fields this program has.
|
Iterator<ProgramFieldType> |
getFieldIterator()
Gets an iterator over the types of all fields this program has.
|
int |
getHours()
Gets the hour-component of the start time of the program.
|
String |
getID()
Gets the ID of this program.
|
int |
getInfo()
Returns additional information of the program (or zero).
|
int |
getIntField(ProgramFieldType type)
Gets the value of a int field from the program.
|
String |
getIntFieldAsString(ProgramFieldType type)
Gets the value of a int field as String.
|
int |
getLength()
Gets the length of this program in minutes.
|
Date |
getLocalDate() |
int |
getLocalStartTime() |
PluginAccess[] |
getMarkedByPlugins()
Deprecated.
use
getMarkerArr() |
Marker[] |
getMarkerArr()
Gets all
Marker s that have marked this program. |
int |
getMarkPriority()
Gets the priority of the marking of this program.
|
int |
getMinutes()
Gets the minute-component of the start time of the program.
|
int |
getProgramState()
Returns the state of this program.
|
String |
getShortInfo()
Returns a short information about the program (about three lines).
|
int |
getStartTime()
Gets the the start time of the program in minutes after midnight.
|
String |
getTextField(ProgramFieldType type)
Gets the value of a text field from the program.
|
int |
getTimeField(ProgramFieldType type)
Gets the value of a time field from the program.
|
String |
getTimeFieldAsString(ProgramFieldType type)
Gets the value of a time field as String of the pattern "h:mm".
|
String |
getTimeString()
get the start time of this program as nicely formatted string
|
String |
getTitle()
Returns the title of this program.
|
boolean |
isExpired()
Gets whether this program is expired.
|
boolean |
isOnAir()
Gets whether this program is marked as "on air".
|
void |
mark(Marker marker)
Marks the program for a plugin.
|
void |
mark(Plugin javaPlugin)
Marks the program for a Java plugin.
|
void |
removeChangeListener(ChangeListener listener)
Removes a ChangeListener from the program.
|
void |
setBinaryField(ProgramFieldType type,
byte[] value)
Set a binary field.
|
void |
setDescription(String description)
Sets a description about the program.
|
protected void |
setField(ProgramFieldType type,
int fieldFormat,
Object value) |
void |
setInfo(int info)
Sets additional information of the program (or zero).
|
void |
setIntField(ProgramFieldType type,
int value)
Set an int field.
|
void |
setLength(int length)
Sets the length of this program in minutes.
|
protected void |
setMarkerArr(Marker[] marker)
Sets the marker array of this program.
|
protected void |
setMarkPriority(int markPriority)
Sets the mark priority for this program
|
void |
setProgramLoadingIsComplete()
Sets the loading state to false.
|
protected void |
setProgramState(int state)
Sets the state of this program to a
program state.
|
void |
setShortInfo(String shortInfo)
Sets a short information about the program (about three lines).
|
void |
setTextField(ProgramFieldType type,
String value)
Set a text field.
|
void |
setTimeField(ProgramFieldType type,
int value)
Set a time field.
|
void |
setTitle(String title)
Sets the title of this program.
|
String |
toString()
Gets a String representation of this program for debugging.
|
void |
unmark(Marker marker)
Removes the marks from the program for a plugin.
|
void |
unmark(Plugin javaPlugin)
Removes the marks from the program for a Java plugin.
|
void |
validateMarking()
Informs the ChangeListeners for repainting if a Plugin
uses more than one Icon for the Program.
|
public static final int MAX_SHORT_INFO_LENGTH
protected static final Marker[] EMPTY_MARKER_ARR
protected String mTitle
public MutableProgram(Channel channel, Date localDate, int localHours, int localMinutes)
MutableProgram(Channel, devplugin.Date, int, int, boolean)
instead.The parameters channel, date, hours and minutes build the ID. That's why they are not mutable.
channel
- The channel object of this program.localDate
- The date of this program.localHours
- The hour-component of the start time of the program.localMinutes
- The minute-component of the start time of the program.public MutableProgram(Channel channel, Date localDate, int localHours, int localMinutes, boolean isLoading)
The parameters channel, date, hours and minutes build the ID. That's why they are not mutable.
channel
- The channel object of this program.localDate
- The date of this program.localHours
- The hour-component of the start time of the program.localMinutes
- The minute-component of the start time of the program.isLoading
- If the program is curently being created.setProgramLoadingIsComplete()
public MutableProgram(Channel channel, Date localDate, boolean isLoading)
The parameters channel, date, hours and minutes build the ID. That's why they are not mutable.
channel
- The channel object of this program.localDate
- The date of this program.isLoading
- If the program is curently loading.setProgramLoadingIsComplete()
public void addChangeListener(ChangeListener listener)
addChangeListener
in interface Program
listener
- the ChangeListener to addfireStateChanged()
,
removeChangeListener(javax.swing.event.ChangeListener)
public void removeChangeListener(ChangeListener listener)
removeChangeListener
in interface Program
listener
- the ChangeListener to removefireStateChanged()
,
addChangeListener(javax.swing.event.ChangeListener)
protected void fireStateChanged()
public final String getTimeString()
Program
getTimeString
in interface Program
public final String getEndTimeString()
Program
getEndTimeString
in interface Program
public final String getDateString()
Program
getDateString
in interface Program
public boolean isOnAir()
public final void mark(Plugin javaPlugin)
public final void unmark(Plugin javaPlugin)
If the program wasn't marked for the plugin, nothing happens.
public final void mark(Marker marker)
public final void unmark(Marker marker)
If the program wasn't marked for the plugin, nothing happens.
public PluginAccess[] getMarkedByPlugins()
getMarkerArr()
Plugin
s that have marked this program.getMarkedByPlugins
in interface Program
public Marker[] getMarkerArr()
Program
Marker
s that have marked this program.getMarkerArr
in interface Program
public boolean isExpired()
public String getID()
public byte[] getBinaryField(ProgramFieldType type)
Program
getBinaryField
in interface Program
type
- The type of the wanted field. Must have a binary format.null
, if there is no
value for this field.public String getTextField(ProgramFieldType type)
Program
getTextField
in interface Program
type
- The type of the wanted field. Must have a text format.null
, if there is no
value for this field.public int getIntField(ProgramFieldType type)
Program
getIntField
in interface Program
type
- The type of the wanted field. Must have a int format.-1
, if there is no
value for this field.public String getIntFieldAsString(ProgramFieldType type)
getIntFieldAsString
in interface Program
type
- The type of the wanted field. Must have a int format.null
, if there is
no value for this field.public int getTimeField(ProgramFieldType type)
Program
getTimeField
in interface Program
type
- The type of the wanted field. Must have a time format.-1
, if there is no
value for this field.public String getTimeFieldAsString(ProgramFieldType type)
getTimeFieldAsString
in interface Program
type
- The type of the wanted field. Must have a time format.null
, if there is
no value for this field.protected Object getField(ProgramFieldType type, int fieldFormat)
public int getFieldCount()
getFieldCount
in interface Program
public Iterator<ProgramFieldType> getFieldIterator()
getFieldIterator
in interface Program
ProgramFieldType
s.public void setBinaryField(ProgramFieldType type, byte[] value)
type
- The type of the field.value
- The binary value to set.public void setTextField(ProgramFieldType type, String value)
type
- The type of the field.value
- The text value to set.public void setIntField(ProgramFieldType type, int value)
type
- The type of the field.value
- The int value to set.public void setTimeField(ProgramFieldType type, int value)
type
- The type of the field.value
- The time value to set.protected void setField(ProgramFieldType type, int fieldFormat, Object value)
public static String generateShortInfoFromDescription(String shortInfo)
shortInfo
- generate Text from this fieldpublic void setTitle(String title)
title
- the new title of this program.public String getTitle()
public void setShortInfo(String shortInfo)
If the legth of the short info exceeds 100 characters it will be cut using a smart algorithm.
shortInfo
- The new short info.public String getShortInfo()
getShortInfo
in interface Program
public void setDescription(String description)
description
- The description.public String getDescription()
getDescription
in interface Program
public int getStartTime()
getStartTime
in interface Program
public int getHours()
public int getMinutes()
getMinutes
in interface Program
public int getLocalStartTime()
public void setLength(int length)
length
- the new length.public int getLength()
public void setInfo(int info)
info
- The new additional information.public int getInfo()
public Channel getChannel()
getChannel
in interface Program
public Date getDate()
public Date getLocalDate()
public String toString()
public boolean equalsAllFields(MutableProgram program)
program
- true
, if all fields are equalprotected void setProgramState(int state)
state
- The state of this program.public int getProgramState()
getProgramState
in interface Program
public final void validateMarking()
validateMarking
in interface Program
Plugin.getMarkIconsForProgram(Program)
protected void setMarkerArr(Marker[] marker)
marker
- The marker array.public void setProgramLoadingIsComplete()
public int getMarkPriority()
getMarkPriority
in interface Program
protected void setMarkPriority(int markPriority)
TV-Browser 2.7.6, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)