net.clackrouter.actions
Class AbstractActionFile

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by net.clackrouter.actions.AbstractActionDefault
          extended by net.clackrouter.actions.AbstractActionFile
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action, TranslatorConstants
Direct Known Subclasses:
ClackClearErrors, ClackOpenAssignment, FileConnect, FileExportGIF, FileExportJPG, FileNewView, FileOpen, FileOpenURL, FileSave

public abstract class AbstractActionFile
extends AbstractActionDefault

See Also:
Serialized Form

Nested Class Summary
protected  class AbstractActionFile.MyFileFilter
          Filter for the jgraphpad file format (*.pad or *.lib)
 
Field Summary
static boolean COMPRESS_FILES
          If the library files should be compressed (zipped)
 
Fields inherited from class net.clackrouter.actions.AbstractActionDefault
graphpad
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface net.clackrouter.jgraph.pad.resources.TranslatorConstants
PREFIX_COMPONENT, PREFIX_MESSAGE_ERROR, PREFIX_MESSAGE_INFORMATION, PREFIX_MESSAGE_WARING, SUFFIX_ACCELERATOR, SUFFIX_ACTION, SUFFIX_ICON, SUFFIX_IMAGE, SUFFIX_LABEL, SUFFIX_MENU, SUFFIX_MNEMONIC, SUFFIX_TEXT, SUFFIX_TITLE, SUFFIX_TOOL_TIP_TEXT
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
AbstractActionFile(ClackFramework graphpad)
          Constructor for AbstractActionFile.
 
Method Summary
static java.io.ObjectInputStream createInputStream(java.lang.String filename)
          Create an object input stream.
static java.io.ObjectInputStream createInputStream(java.lang.String filename, boolean compressed)
          Create an object input stream.
static java.io.ObjectOutputStream createOutputStream(java.lang.String filename)
          Create an object output stream.
static java.io.ObjectOutputStream createOutputStream(java.lang.String filename, boolean compressed)
          Create an object output stream.
protected  java.lang.String dialog(java.lang.String message, boolean open, java.lang.String extension, java.lang.String desc)
          Opens a dialog and return the filename.
 java.lang.String openDialog(java.lang.String message, java.lang.String extension, java.lang.String desc)
          Shows a file open dialog and returns the filename.
 java.lang.String saveDialog(java.lang.String message, java.lang.String extension, java.lang.String desc)
          Shows a file save dialog and returns the filename.
 
Methods inherited from class net.clackrouter.actions.AbstractActionDefault
getCurrentDocument, getCurrentGraph, getCurrentGraphLayoutCache, getGraphpad, getMenuComponent, getMenuComponents, getName, getPresentationText, getToolComponent, getToolComponents, setGraphpad, setSelectionAttributes, update
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Field Detail

COMPRESS_FILES

public static final boolean COMPRESS_FILES
If the library files should be compressed (zipped)

See Also:
Constant Field Values
Constructor Detail

AbstractActionFile

public AbstractActionFile(ClackFramework graphpad)
Constructor for AbstractActionFile.

Parameters:
graphpad -
Method Detail

openDialog

public java.lang.String openDialog(java.lang.String message,
                                   java.lang.String extension,
                                   java.lang.String desc)
Shows a file open dialog and returns the filename.


saveDialog

public java.lang.String saveDialog(java.lang.String message,
                                   java.lang.String extension,
                                   java.lang.String desc)
Shows a file save dialog and returns the filename.


dialog

protected java.lang.String dialog(java.lang.String message,
                                  boolean open,
                                  java.lang.String extension,
                                  java.lang.String desc)
Opens a dialog and return the filename. Returns null if cancelled.


createInputStream

public static java.io.ObjectInputStream createInputStream(java.lang.String filename,
                                                          boolean compressed)
                                                   throws java.lang.Exception
Create an object input stream.

Throws:
java.lang.Exception

createOutputStream

public static java.io.ObjectOutputStream createOutputStream(java.lang.String filename,
                                                            boolean compressed)
                                                     throws java.lang.Exception
Create an object output stream.

Throws:
java.lang.Exception

createInputStream

public static java.io.ObjectInputStream createInputStream(java.lang.String filename)
                                                   throws java.lang.Exception
Create an object input stream.

Throws:
java.lang.Exception

createOutputStream

public static java.io.ObjectOutputStream createOutputStream(java.lang.String filename)
                                                     throws java.lang.Exception
Create an object output stream.

Throws:
java.lang.Exception