org.argouml.uml.reveng
Class Import

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

public class Import
extends ImportCommon
implements ImportSettings

This is the main class for the Swing importer framework. It extends ImportCommon which contains all the GUI independent pieces of the import framework.

The Service Providers Interface (SPI) to the individual language importers is defined in such a way that they can be completely GUI independent as well, receiving lists of source files and settings for the import and reporting progress via progress monitor API. It provides JPanels for tailoring the import run in the FileChooser.

The Import run is started by calling doFile(Project, File)

Supports recursive search in folder for source files with matching extensions.

There are three levels of detail for import:

  1. 0 - classifiers only
  2. 1 - classifiers plus feature specifications
  3. 2 - full import, feature detail (ie. operations with methods)


Field Summary
 
Fields inherited from class org.argouml.uml.reveng.ImportCommon
MAX_PROGRESS_IMPORT, MAX_PROGRESS_PREPARE
 
Fields inherited from interface org.argouml.uml.reveng.ImportSettings
DETAIL_CLASSIFIER, DETAIL_CLASSIFIER_FEATURE, DETAIL_FULL
 
Constructor Summary
Import(java.awt.Frame frame)
          Creates dialog window with chooser and configuration panel.
 
Method Summary
 void doFile()
          Parse all selected files.
 int getImportLevel()
           
 java.lang.String getInputSourceEncoding()
           
 boolean isAttributeSelected()
          Deprecated. 
 boolean isChangedOnlySelected()
           
 boolean isCreateDiagramsSelected()
           
 boolean isDatatypeSelected()
          Deprecated. 
 boolean isDescendSelected()
           
 boolean isDiagramLayoutSelected()
           
 boolean isMinimizeFigsSelected()
           
 
Methods inherited from class org.argouml.uml.reveng.ImportCommon
doImport, getCurrentModule, getEncoding, getFileList, getImportClasspath, getLanguages, getModules, getSelectedFile, getSelectedFiles, getSrcPath, initCurrentDiagram, isChangedOnly, isCreateDiagrams, isDescend, isDiagramLayout, isMinimizeFigs, layoutDiagrams, setCurrentModule, setSelectedFile, setSelectedFiles, setSelectedSuffixFilter, setSrcPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Import

public Import(java.awt.Frame frame)
Creates dialog window with chooser and configuration panel.

Parameters:
frame - the ui frame to display dialogs on
Method Detail

getInputSourceEncoding

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

isAttributeSelected

@Deprecated
public boolean isAttributeSelected()
Deprecated. 

Specified by:
isAttributeSelected in interface ImportSettings
Returns:
always returns false.

isDatatypeSelected

@Deprecated
public boolean isDatatypeSelected()
Deprecated. 

Specified by:
isDatatypeSelected in interface ImportSettings
Returns:
always returns false.

doFile

public void doFile()
Parse all selected files. It calls the actual parser methods depending on the type of the file.


getImportLevel

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

isCreateDiagramsSelected

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

isMinimizeFigsSelected

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

isDiagramLayoutSelected

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

isDescendSelected

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

isChangedOnlySelected

public boolean isChangedOnlySelected()
Specified by:
isChangedOnlySelected in interface ImportSettingsInternal
Specified by:
isChangedOnlySelected in class ImportCommon
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.


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Cookbook