pl.edu.agh.cast.ui.navigator
Class DiagramFile

java.lang.Object
  extended by pl.edu.agh.cast.ui.navigator.DiagramFile

public class DiagramFile
extends java.lang.Object

A wrapper for holding a File (probably) containing a serialized IDiagram. Necessary for lazy-loading diagrams in the NavigatorTreeView.

Author:
awos

Constructor Summary
DiagramFile(org.eclipse.core.resources.IFile f)
          Creates a wrapper for a diagram file, trying to read its diagram settings from it.
 
Method Summary
 IDiagramSettings getDiagramSettings()
          Gets diagram settings
 org.eclipse.core.resources.IFile getFile()
           
 IDiagram readDiagram()
          Tries to read diagram from underlying file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiagramFile

public DiagramFile(org.eclipse.core.resources.IFile f)
Creates a wrapper for a diagram file, trying to read its diagram settings from it.

Parameters:
f - file to wrap
Throws:
java.lang.IllegalArgumentException - when file is not a correct diagram file
Method Detail

getFile

public org.eclipse.core.resources.IFile getFile()

readDiagram

public IDiagram readDiagram()
Tries to read diagram from underlying file

Returns:
diagram, if it can be read successfully, or null if diagram cannot be read (e.g. because of a new version etc.)

getDiagramSettings

public IDiagramSettings getDiagramSettings()
Gets diagram settings

Returns:
non-null diagram settings


Copyright © 2007-2008 AGH University of Science and Technology. All Rights Reserved.