com.tensegrity.gui.swing.dialog.graphfilechooser
Class LayoutsFilter

java.lang.Object
  extended byjavax.swing.filechooser.FileFilter
      extended bycom.tensegrity.gui.swing.dialog.graphfilechooser.LayoutsFilter
All Implemented Interfaces:
ExtendedFileFilter

public class LayoutsFilter
extends javax.swing.filechooser.FileFilter
implements ExtendedFileFilter

The file filter for layouts XML files

Version:
$Id: LayoutsFilter.java,v 1.4 2006/01/05 12:34:34 BurkhardWick Exp $
Author:
Stepan Rutz, BurkhardWick

Field Summary
static java.lang.String[] extensions
          Java Serialization is no longer supported.
 
Constructor Summary
LayoutsFilter()
          Constructs a new GraphFilter instance.
 
Method Summary
 boolean accept(java.io.File f)
           
 java.lang.String getDescription()
          Returns a descriptive string for the tensegrity file format.
 java.lang.String[] getExtensionList()
          Returns an array with all valid extensions for this file type
 int getType()
          Returns the type of this filter.
 java.lang.String getValidFilename(java.io.File file)
          Method isValidFilename checks whether the given filename has a valid extension.
static boolean isValidExtension(java.lang.String ext)
          Method isValidExtension iterates through the list of extensions and checks whether the given extension matches one of the listed ones.
 void openInViewer(java.io.File file)
          Opens the given File in the viewer.
 boolean supportsOpenInViewer()
          Returns true if the file can be opened in the viewer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

extensions

public static java.lang.String[] extensions
Java Serialization is no longer supported. XML based storage only.

Constructor Detail

LayoutsFilter

public LayoutsFilter()
Constructs a new GraphFilter instance.

Method Detail

accept

public boolean accept(java.io.File f)

getDescription

public java.lang.String getDescription()
Returns a descriptive string for the tensegrity file format.

See Also:
FileFilter.getDescription()

isValidExtension

public static boolean isValidExtension(java.lang.String ext)
Method isValidExtension iterates through the list of extensions and checks whether the given extension matches one of the listed ones. If the first matching extension is found, true is returned, otherwise false.

Parameters:
ext - the extension to examine.
Returns:
boolean true if the extension is valid.

getValidFilename

public java.lang.String getValidFilename(java.io.File file)
Method isValidFilename checks whether the given filename has a valid extension. If not, its checked if its recognized as one of the supported filetypes.

Specified by:
getValidFilename in interface ExtendedFileFilter
Parameters:
file - the filename to check.
Returns:
boolean true if the filename is valid.

supportsOpenInViewer

public boolean supportsOpenInViewer()
Returns true if the file can be opened in the viewer.

Specified by:
supportsOpenInViewer in interface ExtendedFileFilter
Returns:
true if the file can be opened in the viewer.

getType

public int getType()
Returns the type of this filter.

Specified by:
getType in interface ExtendedFileFilter
Returns:
the type of this filter.

openInViewer

public void openInViewer(java.io.File file)
Opens the given File in the viewer.

Specified by:
openInViewer in interface ExtendedFileFilter
Parameters:
file - the File to open in the viewer.

getExtensionList

public java.lang.String[] getExtensionList()
Description copied from interface: ExtendedFileFilter
Returns an array with all valid extensions for this file type

Specified by:
getExtensionList in interface ExtendedFileFilter
Returns:
an array with all valid extensions for this file type


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.