Class FileComponent

Class FileComponent

FileComponent

public class FileComponent
implements ItemListener
This class defines for a given File-Handle a graphical representation. Im allgemeinen hat man ein verschiedenes "Aussehen" eines Files So soll ein Directory mit einem "Ordner" IMage versehen werden und ein .TXT File mit einem kleines Document, oder dem Icon der Applictation mit dem es "verbunden" ist. Diese Klasse entscheidet an dem gegebenen File-Objekt, wie die graphische Representation des File-Objekts aussehen soll. Ein File Objekt hat viele Attribute, die graphisch dargestellt werden koennen.

Der Name (evt mit Teilpfad, gesamtpfad).
Die groesse
Ein Icon fuer das File
die Zugriffsrechte
ob es noch vorhanden ist.
    Anm: es File das fuer exists() == false liefer
         ist nicht vorhanden, man muesste hier eine andere graphische
         darstellung waehlen
Anlegedatum
Zugriffsdatum
Aenderungsdatum

Man muss sicherlich eine Auswahlmaske definieren um festzulegen welche Attribute sichtbar sind und welche nicht. Die Componente die die Attribute sichtbar machen werden in einem cfContainer gespeichert.


Method Index

 o actionPerformed(ActionEvent)
Invoked when an action occurs.
 o getFile()
 o getInsets()
 o getOpen()
returns the status of the icon Sometimes you need different icons for "opened" and "closed" (e.g.
 o itemStateChanged(ItemEvent)
we implement the Standard behavior if a TextMarkComponent is clicked
 o setOpen(boolean)
sets the status for the icon
 o toString()
Returns the String representation of this NodeContainer values.

Methods

 o getFile
  public File getFile()
Returns:
s the File-Object which we represent graphically
 o getInsets
  public Insets getInsets()
Returns:
s insets with default vaules : (0,-5,0,-5)
 o getOpen
  public boolean getOpen()
returns the status of the icon Sometimes you need different icons for "opened" and "closed" (e.g. a directory folder) In the variable lopen this class stores the state of the icon
 o setOpen
  public void setOpen(boolean lopen)
sets the status for the icon
Parameters:
lopen - true means : choose a "open" icon
 o toString
  public String toString()
Returns the String representation of this NodeContainer values.
 o actionPerformed
  public void actionPerformed(ActionEvent e)
Invoked when an action occurs.
 o itemStateChanged
  public void itemStateChanged(ItemEvent e)
we implement the Standard behavior if a TextMarkComponent is clicked