org.argouml.uml.reveng
Class ImportCommon

java.lang.Object
  extended by org.argouml.uml.reveng.ImportCommon
All Implemented Interfaces:
ImportSettings, ImportSettingsInternal
Direct Known Subclasses:
Import

public abstract class ImportCommon
extends java.lang.Object
implements ImportSettingsInternal

Source language import class - GUI independent superclass.

Specific Swing and SWT/Eclipse importers will extend this class.

NOTE:Any change to the public API here must be tested in both Swing (standalone ArgoUML) and Eclipse (ArgoEclipse) environments.


Field Summary
protected static int MAX_PROGRESS_IMPORT
          The % maximum progress required to import.
protected static int MAX_PROGRESS_PREPARE
          The % maximum progress required to preparing for import.
 
Fields inherited from interface org.argouml.uml.reveng.ImportSettings
DETAIL_CLASSIFIER, DETAIL_CLASSIFIER_FEATURE, DETAIL_FULL
 
Constructor Summary
protected ImportCommon()
           
 
Method Summary
protected  void doImport(org.argouml.taskmgmt.ProgressMonitor monitor)
          Import the selected source modules.
protected  ImportInterface getCurrentModule()
           
 java.lang.String getEncoding()
          The default encoding.
protected  java.util.List<java.io.File> getFileList(org.argouml.taskmgmt.ProgressMonitor monitor)
          Get the files.
 java.util.List<java.lang.String> getImportClasspath()
          Deprecated. for 0.25.7 by tfmorris. This is a Java importer specific method.
abstract  int getImportLevel()
           
abstract  java.lang.String getInputSourceEncoding()
           
 java.util.List<java.lang.String> getLanguages()
          Returns the possible languages in which the user can import the sources.
protected  java.util.Hashtable<java.lang.String,ImportInterface> getModules()
           
protected  java.io.File getSelectedFile()
          Deprecated. for 0.25.4 by tfmorris. Use getSelectedFiles().
protected  java.io.File[] getSelectedFiles()
           
 java.lang.String getSrcPath()
           
protected  void initCurrentDiagram()
          Compute and cache the current diagram interface.
 boolean isChangedOnly()
          The flag for: changed/new files only.
abstract  boolean isChangedOnlySelected()
           
 boolean isCreateDiagrams()
          The flag for: create diagrams from imported code.
abstract  boolean isCreateDiagramsSelected()
           
 boolean isDescend()
          The flag for: descend directories recursively.
abstract  boolean isDescendSelected()
           
 boolean isDiagramLayout()
          The flag for: perform automatic diagram layout.
abstract  boolean isDiagramLayoutSelected()
           
 boolean isMinimizeFigs()
          The flag for: minimise class icons in diagrams.
abstract  boolean isMinimizeFigsSelected()
           
 void layoutDiagrams(org.argouml.taskmgmt.ProgressMonitor monitor, int startingProgress)
          Layouts the diagrams.
protected  void setCurrentModule(ImportInterface module)
           
protected  void setSelectedFile(java.io.File file)
          Deprecated. for 0.25.5 by tfmorris. Use setSelectedFiles(File[]).
protected  void setSelectedFiles(java.io.File[] files)
           
protected  void setSelectedSuffixFilter(org.argouml.util.SuffixFilter suffixFilter)
          Set the selected (file) suffix filter.
 void setSrcPath(java.lang.String path)
          Set path for processed directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.argouml.uml.reveng.ImportSettings
isAttributeSelected, isDatatypeSelected
 

Field Detail

MAX_PROGRESS_PREPARE

protected static final int MAX_PROGRESS_PREPARE
The % maximum progress required to preparing for import.

See Also:
Constant Field Values

MAX_PROGRESS_IMPORT

protected static final int MAX_PROGRESS_IMPORT
The % maximum progress required to import.

See Also:
Constant Field Values
Constructor Detail

ImportCommon

protected ImportCommon()
Method Detail

getImportLevel

public abstract int getImportLevel()
Specified by:
getImportLevel in interface ImportSettings
Returns:
the level of import detail requested by the user. One of DETAIL_CLASSIFIER, DETAIL_CLASSIFIER_FEATURE, or DETAIL_FULL.

initCurrentDiagram

protected void initCurrentDiagram()
Compute and cache the current diagram interface.


getInputSourceEncoding

public abstract java.lang.String getInputSourceEncoding()
Specified by:
getInputSourceEncoding in interface ImportSettings
Returns:
string representing the character encoding of the input source files.

getFileList

protected java.util.List<java.io.File> getFileList(org.argouml.taskmgmt.ProgressMonitor monitor)
Get the files. We generate it based on their specified file suffixes.

Parameters:
monitor - progress monitor which can be used to cancel long running request
Returns:
the list of files to be imported

setSrcPath

public void setSrcPath(java.lang.String path)
Set path for processed directory.

Parameters:
path - the given path

getSrcPath

public java.lang.String getSrcPath()
Returns:
path for processed directory.

isCreateDiagramsSelected

public abstract boolean isCreateDiagramsSelected()
Specified by:
isCreateDiagramsSelected in interface ImportSettings
Specified by:
isCreateDiagramsSelected in interface ImportSettingsInternal
Returns:
true if the user has request diagrams to be created for packages contained in the imported source code.

isMinimizeFigsSelected

public abstract boolean isMinimizeFigsSelected()
Specified by:
isMinimizeFigsSelected in interface ImportSettings
Specified by:
isMinimizeFigsSelected in interface ImportSettingsInternal
Returns:
true, if user has requested that new figures placed in diagrams should be minimized so they don't show internal compartments.

isDiagramLayoutSelected

public abstract boolean isDiagramLayoutSelected()
Specified by:
isDiagramLayoutSelected in interface ImportSettingsInternal
Returns:
true if the user has requested automatic layout for figures placed on diagrams.

isDescendSelected

public abstract boolean isDescendSelected()
Specified by:
isDescendSelected in interface ImportSettingsInternal
Returns:
true if the directory tree should be descended recursively importing all parseable files.

isChangedOnlySelected

public abstract boolean isChangedOnlySelected()
Specified by:
isChangedOnlySelected in interface ImportSettingsInternal
Returns:
true if user as requested that only sources files which have been changed since the last import should be imported this time. If false, all files should be imported, regardless of their modification date.

getModules

protected java.util.Hashtable<java.lang.String,ImportInterface> getModules()

setSelectedFile

@Deprecated
protected void setSelectedFile(java.io.File file)
Deprecated. for 0.25.5 by tfmorris. Use setSelectedFiles(File[]).

Parameters:
file - the selected file

getSelectedFile

@Deprecated
protected java.io.File getSelectedFile()
Deprecated. for 0.25.4 by tfmorris. Use getSelectedFiles().

Returns:
the first selected file.

setSelectedFiles

protected void setSelectedFiles(java.io.File[] files)

setSelectedSuffixFilter

protected void setSelectedSuffixFilter(org.argouml.util.SuffixFilter suffixFilter)
Set the selected (file) suffix filter.

Parameters:
suffixFilter - the (file) suffix filter

getSelectedFiles

protected java.io.File[] getSelectedFiles()

setCurrentModule

protected void setCurrentModule(ImportInterface module)

getCurrentModule

protected ImportInterface getCurrentModule()

getLanguages

public java.util.List<java.lang.String> getLanguages()
Returns the possible languages in which the user can import the sources.

Returns:
a list of Strings with the names of the languages available

isDescend

public boolean isDescend()
The flag for: descend directories recursively. This should be asked by the GUI for initialization.

Returns:
the flag stored in KEY_IMPORT_GENERAL_SETTINGS_FLAGS key or true if this is null.

isChangedOnly

public boolean isChangedOnly()
The flag for: changed/new files only. This should be asked by the GUI for initialization.

Returns:
the flag stored in KEY_IMPORT_GENERAL_SETTINGS_FLAGS key or true if this is null.

isCreateDiagrams

public boolean isCreateDiagrams()
The flag for: create diagrams from imported code. This should be asked by the GUI for initialization.

Returns:
the flag stored in KEY_IMPORT_GENERAL_SETTINGS_FLAGS key or true if this is null.

isMinimizeFigs

public boolean isMinimizeFigs()
The flag for: minimise class icons in diagrams. This should be asked by the GUI for initialization.

Returns:
the flag stored in KEY_IMPORT_GENERAL_SETTINGS_FLAGS key or true if this is null.

isDiagramLayout

public boolean isDiagramLayout()
The flag for: perform automatic diagram layout. This should be asked by the GUI for initialization.

Returns:
the flag stored in KEY_IMPORT_GENERAL_SETTINGS_FLAGS key or true if this is null.

getEncoding

public java.lang.String getEncoding()
The default encoding. This should be asked by the GUI for initialization.

Returns:
the encoding stored in Argo.KEY_INPUT_SOURCE_ENCODING key or if this is null the default system encoding

getImportClasspath

public java.util.List<java.lang.String> getImportClasspath()
Deprecated. for 0.25.7 by tfmorris. This is a Java importer specific method.

Gets the import classpaths. This should be asked by the GUI for initialization.

Returns:
a list with Strings representing the classpaths

layoutDiagrams

public void layoutDiagrams(org.argouml.taskmgmt.ProgressMonitor monitor,
                           int startingProgress)
Layouts the diagrams.

Parameters:
monitor - the progress meter. Null if not progress updates desired.
startingProgress - the actual progress until now

doImport

protected void doImport(org.argouml.taskmgmt.ProgressMonitor monitor)
Import the selected source modules.

Parameters:
monitor - a ProgressMonitor to both receive progress updates and to be polled for user requests to cancel.


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Cookbook