|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.gui.graphdocument.persistence.GraphDocumentReader
Base implementation of the DocumentReader interface for reading
GraphDocuments.
| Constructor Summary | |
GraphDocumentReader(ApplicationFrame appFrame,
RuleRegistry defaultRegistry,
LayoutController defaultLayoutController,
GraphDocumentReaderConflictHandler conflictHandler)
Constructor |
|
GraphDocumentReader(Frame rootFrame,
UIManager uiManager,
MDIComponent mdiComponent,
RepositoryContainer repositoryContainer,
Preferences preferences,
RuleRegistry defaultRegistry,
LayoutController defaultLayoutController,
GraphDocumentReaderConflictHandler conflictHandler)
Constructor. |
|
| Method Summary | |
protected void |
applyLayoutContext(VisualGraphView vgv,
java.lang.String recentNLC,
java.lang.String recentELC,
int apply_what)
Whenever a document is loaded, we might need to handle a previously stored LayoutContext. |
protected void |
configureNewDocument(GraphDocument gd)
Configures a newly loaded document. |
protected boolean |
doValidateDocument(GraphDocument document)
This method is called, whenever a document is opened. |
void |
enableAddingUnconflictingRules(boolean enable)
Enables disables the automatic adding of unconflicting rules to the defaults and all open documents |
Attribute |
getLayoutContextAttribute()
Reads the LayoutContexts attribute from the internal
layoutConfiguration field. |
protected java.lang.String |
getNewGeometryDescName(java.lang.String oldName)
Returns the new name for a geometry when the option RENAME_LOADED loaded has been chosen. |
protected java.lang.String |
getNewGeometryItemName(java.lang.String oldName)
Returns the new name for a geometry when the option RENAME_LOADED loaded has been chosen. |
protected java.lang.String |
getNewImageName(java.lang.String oldName)
Returns the new name for a image when the option RENAME_LOADED loaded has been chosen. |
protected java.lang.String |
getNewLayoutContextName(java.lang.String oldName)
Returns the new name for a layout context when the option RENAME_LOADED loaded has been chosen. |
protected java.lang.String |
getNewRuleName(java.lang.String oldName)
Returns the new name for a rule when the option RENAME_LOADED loaded has been chosen. |
protected java.lang.String |
getNewStyleDescName(java.lang.String oldName)
Returns the new name for a style when the option RENAME_LOADED loaded has been chosen. |
protected java.lang.String |
getNewStyleItemName(java.lang.String oldName)
Returns the new name for a style when the option RENAME_LOADED loaded has been chosen. |
protected java.util.List |
getOpenedVisualGraphViewList()
Returns the list of all currently used VisualGraphView
instances of the currently open documents. |
boolean |
isAddingUnconflictingRules()
Returns true, if the reader is adding unconflicting rules to the defaults and open documents |
protected void |
loadData(GraphDocument graphdocument,
java.io.InputStream input)
Method loadData reads a VisualGraphView from a given file by using the appropriate Builder instances. |
protected VisualGraphView |
loadVisualGraphView(GraphDocument graphdocument)
Method openXMLFile reads a VisualGraphView from a given file by using the appropriate Builder instances. |
boolean |
readDocument(Document doc,
java.io.InputStream input)
Reads data from the input stream to build the contents of the given (empty) document. |
protected abstract void |
showError(java.lang.String message,
java.lang.String title)
Displays an error message |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected final ApplicationFrame appFrame
protected final UIManager uiManager
protected final RuleRegistry defaultRegistry
protected LayoutController defaultLayoutController
protected AttributeList list
protected AttributeList geometries
protected AttributeList styles
protected AttributeSet layoutConfiguration
protected AttributeList images
protected AttributeList rules
protected java.util.List conflict_geometryitems
protected java.util.List conflict_geometrydescriptors
protected java.util.List conflict_styleitems
protected java.util.List conflict_styledescriptors
protected java.util.List conflict_styleitemnames
protected java.util.List conflict_styledescriptornames
protected java.util.List conflict_rules
protected java.util.List conflict_layout
protected boolean showLayoutConflict
protected boolean showStylesConflict
protected boolean showStyleNamesConflict
protected boolean showGeometryConflict
protected boolean showRulesConflict
protected java.util.List conflict_images
protected boolean showImageConflict
protected final MDIComponent mdiComponent
protected final RepositoryContainer repositoryContainer
protected final Preferences preferences
protected final Frame mainFrame
protected final GraphDocumentReaderConflictHandler conflictHandler
| Constructor Detail |
public GraphDocumentReader(ApplicationFrame appFrame,
RuleRegistry defaultRegistry,
LayoutController defaultLayoutController,
GraphDocumentReaderConflictHandler conflictHandler)
appFrame - The application framedefaultRegistry - The default rule registrydefaultLayoutController - The default layout controllerconflictHandler - The handler for conflicts that may appear while
opening graph documents. Must not be null!
public GraphDocumentReader(Frame rootFrame,
UIManager uiManager,
MDIComponent mdiComponent,
RepositoryContainer repositoryContainer,
Preferences preferences,
RuleRegistry defaultRegistry,
LayoutController defaultLayoutController,
GraphDocumentReaderConflictHandler conflictHandler)
ApplicationFrame.
rootFrame - The root frame of the guiuiManager - The UIManager of the applicationmdiComponent - The MDIComponent of the guirepositoryContainer - The RepositoryContainer of the guipreferences - The Preferences of the applicationdefaultRegistry - The default rule registrydefaultLayoutController - The default layout controllerconflictHandler - The handler for conflicts that may appear while
opening graph documents. Must not be null!| Method Detail |
public boolean readDocument(Document doc,
java.io.InputStream input)
throws ReadException,
BuildException
DocumentReader
readDocument in interface DocumentReaderdoc - The document to buildinput - The input stream containing the data
ReadException - this is thrown if reading the data from the
input stream failed
BuildException - this is thrown if building the document from
the data failedpublic Attribute getLayoutContextAttribute()
LayoutContexts attribute from the internal
layoutConfiguration field. If the LayoutContexts
could be found, the first value from the resulting AttributeSet is returned.
null.protected boolean doValidateDocument(GraphDocument document)
readDocument(Document, InputStream) method calls this method to allow a
validation of the document. Subclasses may override this method to apply
a detailed validation process on the given document.
document - the Document instance to validate
true to indicate a successful validation,
false otherwise.protected void configureNewDocument(GraphDocument gd)
gd - The GraphDocument to configure
protected final void loadData(GraphDocument graphdocument,
java.io.InputStream input)
throws ReadException,
BuildException
graphdocument - input -
ReadException
BuildException
protected final VisualGraphView loadVisualGraphView(GraphDocument graphdocument)
throws BuildException
graphdocument -
java.lang.Exception
BuildException
protected void applyLayoutContext(VisualGraphView vgv,
java.lang.String recentNLC,
java.lang.String recentELC,
int apply_what)
VisualGraphView.
vgv - recentNLC - recentELC - apply_what - protected final java.util.List getOpenedVisualGraphViewList()
VisualGraphView
instances of the currently open documents.
VisualGraphView instances.public final void enableAddingUnconflictingRules(boolean enable)
enable - True to enablepublic final boolean isAddingUnconflictingRules()
protected final java.lang.String getNewLayoutContextName(java.lang.String oldName)
RENAME_LOADED loaded has been chosen.
oldName - The old name of the layout context that had a conflict
protected final java.lang.String getNewStyleDescName(java.lang.String oldName)
RENAME_LOADED loaded has been chosen.
oldName - The old name of the style that had a conflict
protected final java.lang.String getNewStyleItemName(java.lang.String oldName)
RENAME_LOADED loaded has been chosen.
oldName - The old name of the style that had a conflict
protected final java.lang.String getNewGeometryDescName(java.lang.String oldName)
RENAME_LOADED loaded has been chosen.
oldName - The old name of the geometry that had a conflict
protected final java.lang.String getNewGeometryItemName(java.lang.String oldName)
RENAME_LOADED loaded has been chosen.
oldName - The old name of the geometry that had a conflict
protected final java.lang.String getNewRuleName(java.lang.String oldName)
RENAME_LOADED loaded has been chosen.
oldName - The old name of the rule that had a conflict
protected final java.lang.String getNewImageName(java.lang.String oldName)
RENAME_LOADED loaded has been chosen.
oldName - The old name of the image that had a conflict
protected abstract void showError(java.lang.String message,
java.lang.String title)
message - The message to displaytitle - The title of the dialog to display
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||