com.tensegrity.gui.graphdocument
Class LayoutIOUtilities

java.lang.Object
  extended bycom.tensegrity.gui.graphdocument.LayoutIOUtilities

public class LayoutIOUtilities
extends java.lang.Object

This file includes basic helper methods for loading/saving all configurations that are stored within a single GraphPanel.

The saved files are stored in a human readable xml format that is used for serializing and deserializing nested AttributeSets and AttributeLists.

Version:
$Id: LayoutIOUtilities.java,v 1.9 2006/04/26 12:06:18 MichaelKegel Exp $
Author:
Stepan Rutz

Method Summary
static AttributeList getSettings(GraphPanel graphpanel)
          Returns an AttributeList of attribute-sets that contain the current layout settings for the given GraphPanel.
static void loadSettings(GraphPanel graphpanel, java.lang.String filename)
          Loads the layout settings from the given filename and applies them to th given GraphPanel.
static void saveSettings(GraphPanel graphpanel, java.lang.String filename)
          Saves the current layout settings of the given GraphPanel to a file with the given filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSettings

public static final AttributeList getSettings(GraphPanel graphpanel)
Returns an AttributeList of attribute-sets that contain the current layout settings for the given GraphPanel.

Parameters:
graphpanel - the GraphPanel to query for its layout settings.
Returns:
an AttributeList of attribute-sets that contain the current layout settings for the given GraphPanel.

saveSettings

public static final void saveSettings(GraphPanel graphpanel,
                                      java.lang.String filename)
                               throws WriteException
Saves the current layout settings of the given GraphPanel to a file with the given filename.

Parameters:
graphpanel - the GraphPanel whose layout settings should be saved.
filename - the filename to save under.
Throws:
WriteException - thrown when saving fails.

loadSettings

public static final void loadSettings(GraphPanel graphpanel,
                                      java.lang.String filename)
                               throws ReadException
Loads the layout settings from the given filename and applies them to th given GraphPanel.

Parameters:
graphpanel - the GraphPanel onto which the layout settings should be applied
filename - the filename that identifies the file where to load the layout settings from.
Throws:
XMLParseException - thrown if xml parsing fails.
ReadException - thrown when loading fails.


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