com.tensegrity.gui.swt.dialog.graphfilechooser
Class SwtGraphFileChooserDialog

java.lang.Object
  extended byorg.eclipse.swt.widgets.Dialog
      extended bycom.tensegrity.gui.swt.dialog.SwtBaseDialog
          extended bycom.tensegrity.gui.swt.dialog.graphfilechooser.SwtGraphFileChooserDialog
All Implemented Interfaces:
Disposable, Evaluable, java.util.EventListener, GraphFileConstants, org.eclipse.swt.events.KeyListener, org.eclipse.swt.internal.SWTEventListener

public class SwtGraphFileChooserDialog
extends SwtBaseDialog
implements GraphFileConstants

This class should be used within the Tensegrity Framework in the SWT context instead of the swt FileDialog class. It supports several file format in saving mode (.xml, .svg, .jpg, .bmp, ..).

Version:
$Id: SwtGraphFileChooserDialog.java,v 1.14 2006/03/06 12:10:08 BurkhardWick Exp $
Author:
S�bastien Guyon

Field Summary
static java.lang.String bitmapFilterExtensions
          Predefined string of valid extensions.
static java.lang.String bitmapFilterName
          Predefined string of valid name.
static java.lang.String gifFilterExtensions
          Predefined string of valid extensions.
static java.lang.String gifFilterName
          Predefined string of valid name.
static java.lang.String graphFilterExtensions
          Predefined string of valid extensions.
static java.lang.String graphFilterName
          Predefined string of valid name.
static java.lang.String jpegFilterExtensions
          Predefined string of valid extensions.
static java.lang.String jpegFilterName
          Predefined string of valid name.
static java.lang.String pngFilterExtensions
          Predefined string of valid extensions.
static java.lang.String pngFilterName
          Predefined string of valid name.
static java.lang.String svgFilterExtensions
          Predefined string of valid extensions.
static java.lang.String svgFilterName
          Predefined string of valid name.
 
Fields inherited from class com.tensegrity.gui.swt.dialog.SwtBaseDialog
resourceClass, resourcePath
 
Fields inherited from interface com.tensegrity.gui.swing.dialog.graphfilechooser.GraphFileConstants
TYPE_ALL_FILES, TYPE_CUSTOM, TYPE_ELEMENTS, TYPE_GRAPHFILE, TYPE_LAYOUTS, TYPE_RASTER, TYPE_RASTER_BITMAP, TYPE_RASTER_GIF, TYPE_RASTER_JPEG, TYPE_RASTER_PNG, TYPE_SVG, TYPE_TEMPLATES
 
Constructor Summary
SwtGraphFileChooserDialog(org.eclipse.swt.widgets.Shell parent, int style, GraphFileChooser fileChooser, UIManager uiManager, int fileType)
           
SwtGraphFileChooserDialog(org.eclipse.swt.widgets.Shell parent, int style, UIManager uimanager, int fileType)
           Initializes the internal FileDialog with the filters represented by fileType.
 
Method Summary
 java.lang.String getCurrentDirectory()
          Returns the current directory.
 ExportSettings getExportSettings()
          Returns the ExportSettingsfor this GraphFileChooserDialog.
 java.lang.String getFileName()
          Returns the path of the first file that was selected in the dialog relative to the filter path
 java.lang.String[] getFileNames()
          Returns the paths of all files that were selected in the dialog relative to the filter path, or null if none are available.
 int getFileType()
          Returns the file type of the selected file
 java.lang.String[] getFilterExtensions()
          Returns the file extensions which the dialog will use to filter the files it shows.
 java.lang.String[] getFilterNames()
          Returns the file names which the dialog will use to filter the files it shows.
 java.lang.String getFilterPath()
          Returns the directory path that the dialog will use.
 boolean isCancelled()
          Returns true if the user cancelled the dialog
 void setCurrentDirectory(java.lang.String directory)
          Sets the current directory.
 void show()
           Opens the internal FileDialog.
 
Methods inherited from class com.tensegrity.gui.swt.dialog.SwtBaseDialog
applyEvList, dispose, getDialog, getTextCompositeLayoutData, getUIManager, installEvList, keyPressed, keyReleased, setDefaultResourceClassAndURL, setDescriptionText, setResourceClassAndURL, setTitleText
 
Methods inherited from class org.eclipse.swt.widgets.Dialog
checkSubclass, getParent, getStyle, getText, setText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graphFilterExtensions

public static java.lang.String graphFilterExtensions
Predefined string of valid extensions.


graphFilterName

public static java.lang.String graphFilterName
Predefined string of valid name.


svgFilterExtensions

public static java.lang.String svgFilterExtensions
Predefined string of valid extensions.


svgFilterName

public static java.lang.String svgFilterName
Predefined string of valid name.


bitmapFilterExtensions

public static java.lang.String bitmapFilterExtensions
Predefined string of valid extensions.


bitmapFilterName

public static java.lang.String bitmapFilterName
Predefined string of valid name.


gifFilterExtensions

public static java.lang.String gifFilterExtensions
Predefined string of valid extensions.


gifFilterName

public static java.lang.String gifFilterName
Predefined string of valid name.


jpegFilterExtensions

public static java.lang.String jpegFilterExtensions
Predefined string of valid extensions.


jpegFilterName

public static java.lang.String jpegFilterName
Predefined string of valid name.


pngFilterExtensions

public static java.lang.String pngFilterExtensions
Predefined string of valid extensions.


pngFilterName

public static java.lang.String pngFilterName
Predefined string of valid name.

Constructor Detail

SwtGraphFileChooserDialog

public SwtGraphFileChooserDialog(org.eclipse.swt.widgets.Shell parent,
                                 int style,
                                 UIManager uimanager,
                                 int fileType)

Initializes the internal FileDialog with the filters represented by fileType.

Parameters:
parent - a shell which will be the parent of the new instance.
style - the SWT style. SWT.SAVE or SWT.OPEN. Use SWT.MULTI in order to allow multiple selection.
uimanager - the UIManager used for the localized Strings.
fileType - the file-type used for filtering the dialog.

SwtGraphFileChooserDialog

public SwtGraphFileChooserDialog(org.eclipse.swt.widgets.Shell parent,
                                 int style,
                                 GraphFileChooser fileChooser,
                                 UIManager uiManager,
                                 int fileType)
Method Detail

show

public void show()

Opens the internal FileDialog.

Overrides:
show in class SwtBaseDialog

setCurrentDirectory

public void setCurrentDirectory(java.lang.String directory)
Sets the current directory.

Parameters:
directory - the directory to set.

getCurrentDirectory

public java.lang.String getCurrentDirectory()
Returns the current directory.

Returns:
the current directory.

getFileName

public java.lang.String getFileName()
Returns the path of the first file that was selected in the dialog relative to the filter path

Returns:
the relative path of the file

getFileNames

public java.lang.String[] getFileNames()
Returns the paths of all files that were selected in the dialog relative to the filter path, or null if none are available.

Returns:
the relative paths of the files

getFilterExtensions

public java.lang.String[] getFilterExtensions()
Returns the file extensions which the dialog will use to filter the files it shows.

Returns:
the file extensions filter

getFilterNames

public java.lang.String[] getFilterNames()
Returns the file names which the dialog will use to filter the files it shows.

Returns:
the file name filter

getFilterPath

public java.lang.String getFilterPath()
Returns the directory path that the dialog will use. File names in this path will appear in the dialog, filtered according to the filter extensions.

Returns:
the directory path string
See Also:
FileDialog.setFilterExtensions(java.lang.String[])

isCancelled

public boolean isCancelled()
Returns true if the user cancelled the dialog

Returns:
true if the user cancelled the dialog

getExportSettings

public ExportSettings getExportSettings()
Returns the ExportSettingsfor this GraphFileChooserDialog.

Returns:
the ExportSettingsfor this GraphFileChooserDialog.

getFileType

public int getFileType()
Returns the file type of the selected file

Returns:
the file type of the selected file


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