public class MediaBagElement extends Object implements Editable, Domable, Comparable
MediaBagElements
are the members of MediaBag
objects. Media elements have a name, a reference to a file (the fileName
)
and, when initialized, a data
field containing the raw content of
the media. They have also a flag indicating if the data must be saved into the
JClicProject
file or must be mantained as a single
reference to a external file.Modifier and Type | Field and Description |
---|---|
boolean |
animated |
static String |
ELEMENT_NAME |
static String |
FILE |
static String |
NAME |
boolean |
projectFlag |
static String |
SAVE |
boolean |
saveFlag |
static String |
USAGE |
Constructor and Description |
---|
MediaBagElement(String fileName)
Creates new MediaBagElement
|
MediaBagElement(String fileName,
Object data) |
MediaBagElement(String fileName,
Object data,
String name) |
Modifier and Type | Method and Description |
---|---|
void |
clearData() |
int |
compareTo(Object obj) |
void |
decUsageCount() |
protected void |
finalize() |
Object |
getData() |
Editor |
getEditor(Editor parent)
Returns the
Editor associated to this object. |
String |
getFileName() |
Image |
getImage() |
Element |
getJDomElement() |
protected static MediaBagElement |
getMediaBagElement(Element e) |
String |
getMetaData() |
String |
getName()
Getter for property name.
|
ImageIcon |
getThumbNail(int maxWidth,
int maxHeight,
FileSystem fs) |
void |
incUsageCount() |
boolean |
isEmpty() |
boolean |
isImage() |
boolean |
isInternal() |
boolean |
isUsed() |
boolean |
isWaitingForImage() |
Image |
prepareAndGetImage(FileSystem fs) |
boolean |
prepareImage(FileSystem fs) |
void |
setData(Object sData) |
void |
setFileName(String sName) |
void |
setMetaData(String meta) |
void |
setName(String name)
Setter for property name.
|
void |
setProperties(Element e,
Object aux) |
String |
toString() |
public boolean projectFlag
public boolean saveFlag
public boolean animated
public static final String ELEMENT_NAME
public static final String FILE
public static final String NAME
public static final String SAVE
public static final String USAGE
public MediaBagElement(String fileName)
public Element getJDomElement()
getJDomElement
in interface Domable
protected static MediaBagElement getMediaBagElement(Element e) throws Exception
Exception
public void setProperties(Element e, Object aux) throws Exception
setProperties
in interface Domable
Exception
public Editor getEditor(Editor parent)
Editable
Editor
associated to this object.public boolean isEmpty()
public void setFileName(String sName)
public String getFileName()
public void setMetaData(String meta)
public String getMetaData()
public boolean isImage()
public void setData(Object sData)
public void clearData()
public Object getData()
public boolean isInternal()
public void incUsageCount()
public void decUsageCount()
public boolean isUsed()
protected void finalize() throws Throwable
public boolean prepareImage(FileSystem fs) throws Exception
Exception
public Image prepareAndGetImage(FileSystem fs) throws Exception
Exception
public ImageIcon getThumbNail(int maxWidth, int maxHeight, FileSystem fs)
public boolean isWaitingForImage()
public String getName()
public void setName(String name)
name
- New value of property name.public int compareTo(Object obj)
compareTo
in interface Comparable
Copyright © 2004-15 Francesc Busquets (fbusquets@xtec.cat) & Departament d'Educació de la Generalitat de Catalunya (info@xtec.cat)
Licensed under the terms of the GNU General Public License.