jsynoptic.ui
Class JSynopticPanels

java.lang.Object
  extended by jsynoptic.ui.JSynopticPanels
All Implemented Interfaces:
java.awt.event.ActionListener, java.beans.PropertyChangeListener, java.util.EventListener, JSynopticInterface, DiagramClipboardListener, DiagramSelectionListener, DesktopCardPanelListener
Direct Known Subclasses:
JSynopticFrame

public class JSynopticPanels
extends java.lang.Object
implements java.awt.event.ActionListener, DesktopCardPanelListener, DiagramClipboardListener, DiagramSelectionListener, java.beans.PropertyChangeListener, JSynopticInterface

The default implementation of JSynopticInterface in graphic mode It provides the integration of a FiledDesktopCarPanel on the right side with a SourcePanel on the left side. The left panel gathers all the sources used to build synoptics i.e. shapes and data sources. This class also provides all the actions for synoptics editing. These actions are available thanks to a tool bar or a menu item.

Version:
1.0 2001
Author:
Nicolas Brodu

Nested Class Summary
protected  class JSynopticPanels.FileChooserAccessory
           
protected  class JSynopticPanels.JSynopticFileTransfertHandler
          This TransferHanlder check for files drag and drop.
 
Field Summary
protected  javax.swing.Action aBack
           
protected  DiagramSelectionPropertiesPanel.SelectionAction aBackgroundColor
           
protected  javax.swing.Action aBackward
           
protected  javax.swing.Action aBottom
           
protected  javax.swing.JFrame aboutFrame
           
protected  javax.swing.Action aCopy
           
protected  javax.swing.Action aCut
           
protected  DiagramSelectionPropertiesPanel.SelectionAction aFontColor
           
protected  javax.swing.Action aForward
           
protected  javax.swing.Action aFront
           
protected  javax.swing.Action aFullScreen
           
protected  javax.swing.Action aGroup
           
protected  javax.swing.Action aHCenter
           
protected  javax.swing.Action aLeft
           
protected  DiagramSelectionPropertiesPanel.SelectionAction aLineColor
           
protected  javax.swing.Action aPaste
           
protected  javax.swing.Action aRegroup
           
protected  javax.swing.Action aRemove
           
protected  javax.swing.Action aRight
           
protected  javax.swing.Action aSelectAll
           
protected static boolean ASK_USER_TO_SAVE_A_MODIFIED_SHEET
          If true, user is asked whether or not to save a modified sheet, when a closing action has been performed on it.
protected  javax.swing.Action aTop
           
protected  javax.swing.Action aUngroup
           
protected  javax.swing.Action aVCenter
           
protected  javax.swing.JButton bAdjust
           
protected  javax.swing.JButton bAlign
           
protected  TemplateMenuBox bNew
           
protected  javax.swing.JButton bOpen
           
protected  javax.swing.JButton bPrint
           
protected  javax.swing.JButton bPrintImage
           
protected  javax.swing.JButton bRedo
           
protected  javax.swing.JButton bRefreshAllSheets
           
protected  javax.swing.JButton bSave
           
protected  javax.swing.JButton bSnapShot
           
protected  javax.swing.JButton bUndo
           
protected  javax.swing.JComboBox cbxAlign
           
protected  javax.swing.JComboBox cbxDepth
           
protected  javax.swing.JComboBox cbxGrid
           
protected  javax.swing.JComboBox cbxRotation
           
protected  ActionComboBox cbxSelection
           
protected  javax.swing.JComboBox cbxZoom
           
protected  java.util.TimerTask cleanStatusTask
           
protected  java.util.Timer cleanStatusTimer
           
protected  java.awt.Container container
           
protected  javax.swing.filechooser.FileFilter currentExportFileFilter
           
protected  javax.swing.filechooser.FileFilter currentOpenFileFilter
           
protected  javax.swing.filechooser.FileFilter currentSaveFileFilter
           
protected  FiledDesktopCardPanel desktopCardPanel
           
protected  javax.swing.Action dHorizontally
           
protected  javax.swing.Action dVertically
           
protected  javax.swing.JFileChooser exportFileChooser
           
protected  HelpViewer helpFrame
           
protected  boolean isEditable
           
protected  boolean isOpenProcessCancelled
           
protected  javax.swing.JMenu jmEdit
           
protected  javax.swing.JMenu jmFile
           
protected  javax.swing.JMenu jmHelp
           
protected  javax.swing.JMenu jmWindows
           
 java.util.Vector lockedShapes
           
protected static LogConfigurator logConfigurator
           
protected  javax.swing.JMenu mAlign
           
protected static int MAX_NUMBER_OF_RECENT_FILES
          Maximum number of files displayed in the open rencent file menu item
protected  javax.swing.JMenu mDepth
           
protected  java.lang.Object menuBar
           
static BasicMessageWriter messageWriter
           
protected  javax.swing.JMenuItem miAbout
           
protected  javax.swing.JMenuItem miChooseLanguage
           
protected  javax.swing.JMenuItem miClose
           
protected  javax.swing.JMenuItem miCloseAll
           
protected  javax.swing.JMenuItem miExit
           
protected  javax.swing.JMenuItem miExport
           
protected  javax.swing.JMenuItem miFindPlugins
           
protected  javax.swing.JMenuItem miHelp
           
protected  javax.swing.JMenuItem miNewAs
           
protected  javax.swing.JMenuItem miOpen
           
protected  javax.swing.JMenuItem miPreferencesPanel
           
protected  javax.swing.JMenuItem miPrint
           
protected  javax.swing.JMenuItem miPrintImage
           
protected  javax.swing.JMenu miRecentFiles
           
protected  javax.swing.JMenuItem miRedo
           
protected  javax.swing.JMenuItem miRefreshAllSheets
           
protected  javax.swing.JMenuItem miSave
           
protected  javax.swing.JMenuItem miSaveAll
           
protected  javax.swing.JMenuItem miSaveAs
           
protected  javax.swing.JMenuItem miSheetInformation
           
protected  javax.swing.JMenuItem miSnapShot
           
protected  javax.swing.JMenuItem miUndo
           
protected  javax.swing.JMenu mRotation
           
protected  javax.swing.JMenu mSel
           
protected  javax.swing.JFileChooser openFileChooser
           
protected  java.awt.Frame owner
           
protected  java.awt.print.PageFormat pageFormat
          Print format configuration
protected  PrintToImage printImage
           
protected  UserPropertiesEditor propEditor
           
protected static java.lang.String propPath
           
protected static java.lang.String propSplit
           
protected static int propSplitDefault
           
protected  java.util.ArrayList recentOpenedFiles
           
protected  UndoHandler.RedoAction redoAction
           
static MenuResourceBundle resources
          Resources
protected  javax.swing.JFileChooser saveFileChooser
           
protected  SourcePanel sourcePanel
           
protected  javax.swing.JSplitPane splitPane
           
protected  javax.swing.JLabel status
           
protected  long statusDelay
           
protected  javax.swing.JPanel statusPanel
           
protected  javax.swing.JToggleButton tbGridDisplay
           
protected  TemplateChooser templateChooser
           
protected  javax.swing.JToolBar toolbar
           
protected  UndoHandler.UndoAction undoAction
           
protected  int untitledDocumentNumber
           
protected static boolean USE_SELECTION_TOOL_BOXES
          True to display align,depth,format and group actions in the tool bar
protected static UserProperties userProperties
           
 
Constructor Summary
JSynopticPanels(java.util.Vector commands, java.awt.Frame owner, java.awt.Container container)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addAlignButtons(javax.swing.JToolBar tb)
           
 void addAlignMenu(javax.swing.JPopupMenu popup)
           
 void addComponent(ShapesContainer.ShapesComponent jc)
           
 void addComponent(ShapesContainer.ShapesComponent jc, java.io.File f)
           
 void addContainer(ShapesContainer sc)
           
 void addContainer(ShapesContainer sc, java.io.File f)
          Add a new synoptic The name of the synoptic is based on the file name used to load it
 void addDepthButtons(javax.swing.JToolBar tb)
           
 void addDepthMenu(javax.swing.JPopupMenu popup)
           
 void addEditButtons(javax.swing.JToolBar tb)
          Add edit buttons to a tool bar
 void addEditMenu(javax.swing.JPopupMenu popup)
          Add an edit menu to a popup menu
 void addEditMenu(java.lang.Object mb)
          Add an edit menu to a menu bar1999
 void addFileButtons(javax.swing.JToolBar tb)
          Add file buttons to a tool bar
 void addFileMenu(java.lang.Object mb)
          Add a file menu to a menu bar
 void addHelpMenu(java.lang.Object mb)
          Add a help menu to a menu bar
 void addLongActions(long actionMask, java.lang.Object target)
          Add a long action If the action is related to a shape, then the shape can be locked until action completion
 void addSelectionButtons(javax.swing.JToolBar tb)
           
 void addSelectionMenu(javax.swing.JPopupMenu popup)
           
 void addToolsMenu(java.lang.Object mb)
          Add a help menu to a menu bar
static void adjustComboBox(javax.swing.JComboBox b, java.awt.Dimension d)
           
protected  void adjustLayout()
          Default implementation for final layout tuning
 boolean canEdit()
           
 boolean canOpen()
           
 boolean canPrint()
           
 boolean canSave()
           
 void clipboardChanged(DiagramClipboard sel)
          The clipboard calls each listener when its content changes
protected  boolean close(DiagramComponent d)
           
protected  boolean closeAll()
           
 void componentSelected(javax.swing.JComponent d)
          The desktop card panel calls each listener when the selection changes and provides the new selected component
protected  void createActions()
           
 void createFileChooser(int action)
          Create a OPEN or SAVE FileChooser
protected  void createMenu()
          Default implementation to create menus
protected  void createStatusPanel()
          Default implementation for status panel
 void createToolBar()
          Default implementation to create tool bar
protected  void display()
          Default implementation to display the GUI (if needed)
protected  void exit()
           
protected  void exitPlugins()
          Some plugins need a particular treatment during Jsynoptic closing For instance when an external process was created in a plugin, it needs to be destroyed
protected  boolean export()
          Save current component
protected  boolean exportFile(java.io.File f)
           
 ShapesContainer.ShapesComponent getActiveComponent()
          Get the active synoptic
 ShapesContainer getActiveContainer()
          Get the active synoptic
 DiagramComponent getActiveDiagram()
           
 java.io.File getFile(javax.swing.JComponent jc)
           
 java.io.File getFile(ShapesContainer sc)
           
 javax.swing.JFileChooser getFileChooser()
           
 FiledDesktopCardPanel getFilePanel()
          Returns the FiledDesktopCardPanel used to display the synoptics If this class is not used by the implementation, then it will return null but the Builtin plugin (at least) will not work.
protected  java.io.File[] getFilesFromDialog(int action)
           
 boolean getIsOpenProcessCancelled()
           
 java.util.AbstractList getLockedShapes()
          Get the list of locked shapes
 java.awt.Frame getOwner()
           
 java.io.File getPath()
          Gets the current path
protected  Plugin getPluginForFilter(int action, javax.swing.filechooser.FileFilter activeFilter)
           
protected  Plugin getPluginToProcessFile(java.io.File f, int action, javax.swing.filechooser.FileFilter activeFilter)
           
 java.util.AbstractList getSelectionList()
          Get the selection, i.e. an element to interract with the current synoptic That can be, for instance, a ShapeCreator to generate a new shape in the current synoptic or a DataSource to be used as the source of the selected shape in the current synoptic
 SourceTree getSourceTree()
          Get the source tree which provides all the sources currently available
protected  void getStaticProperties(UserProperties prop)
           
 TemplateChooser getTemplateChooser()
           
protected  void init(java.util.Vector commands)
          Build the Jsynoptic editor components
protected  void layoutSourcePanelAndDesktopPanel()
          Default implementation to layout source panel and synoptic editor
protected  void loadProperties()
           
 void lockFileOpen()
           
 void lockFileSave()
           
 void lockPrint()
           
 void newComponent()
          Create a new active synoptic
 void newComponentAs()
           
 boolean open()
           
 boolean open(java.io.File f)
          Open a file.
protected  void print(DiagramComponent d)
          Print a DiagramComponent Open a print dilaog to allow user to specify print parameters
 void processCommand(java.lang.String command)
           
 void processCommands(java.util.Vector commands)
           
protected  void progress(int percent)
          A default implementation to be overridden
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void removeLongActions(long actionMask, java.lang.Object target)
          Remove a long action If the action was related to a shape and the shape was loacked then it becomes unlocked
protected  boolean save()
          Save current component
protected  boolean saveAll()
          Save all sheets
protected  boolean saveAs()
          Choose a file and save current component.
protected  boolean saveFile(java.io.File f)
           
protected  void saveProperties()
           
 void selectionChanged(DiagramSelection sel)
          The selection calls each listener when the selection changes
 void setFile(javax.swing.JComponent jc, java.io.File f)
           
 void setFile(ShapesContainer sc, java.io.File f)
           
 void setIsOpenProcessCancelled(boolean b)
           
protected  void setLogger()
           
 void setPath(java.io.File f)
          Changes the current path
protected  void setRecentFilesMenu()
           
protected  void setStaticProperties(UserProperties prop)
           
 void setStatus(java.lang.String message)
          Displays a status message
 void unlockFileOpen()
           
 void unlockFileSave()
           
 void unlockPrint()
           
protected  void updateUndoActions()
          Update the actions associated to the Undo/Redo buttons.
protected  void updateUndoEnabled()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resources

public static MenuResourceBundle resources
Resources


messageWriter

public static BasicMessageWriter messageWriter

undoAction

protected UndoHandler.UndoAction undoAction

redoAction

protected UndoHandler.RedoAction redoAction

desktopCardPanel

protected FiledDesktopCardPanel desktopCardPanel

sourcePanel

protected SourcePanel sourcePanel

userProperties

protected static UserProperties userProperties

logConfigurator

protected static LogConfigurator logConfigurator

pageFormat

protected java.awt.print.PageFormat pageFormat
Print format configuration


USE_SELECTION_TOOL_BOXES

protected static boolean USE_SELECTION_TOOL_BOXES
True to display align,depth,format and group actions in the tool bar


ASK_USER_TO_SAVE_A_MODIFIED_SHEET

protected static boolean ASK_USER_TO_SAVE_A_MODIFIED_SHEET
If true, user is asked whether or not to save a modified sheet, when a closing action has been performed on it.


MAX_NUMBER_OF_RECENT_FILES

protected static int MAX_NUMBER_OF_RECENT_FILES
Maximum number of files displayed in the open rencent file menu item


isEditable

protected boolean isEditable

untitledDocumentNumber

protected int untitledDocumentNumber

jmFile

protected javax.swing.JMenu jmFile

jmWindows

protected javax.swing.JMenu jmWindows

jmEdit

protected javax.swing.JMenu jmEdit

jmHelp

protected javax.swing.JMenu jmHelp

aCut

protected javax.swing.Action aCut

aCopy

protected javax.swing.Action aCopy

aPaste

protected javax.swing.Action aPaste

aRemove

protected javax.swing.Action aRemove

aSelectAll

protected javax.swing.Action aSelectAll

aFullScreen

protected javax.swing.Action aFullScreen

aGroup

protected javax.swing.Action aGroup

aUngroup

protected javax.swing.Action aUngroup

aRegroup

protected javax.swing.Action aRegroup

aFront

protected javax.swing.Action aFront

aForward

protected javax.swing.Action aForward

aBackward

protected javax.swing.Action aBackward

aBack

protected javax.swing.Action aBack

mDepth

protected javax.swing.JMenu mDepth

mRotation

protected javax.swing.JMenu mRotation

aLeft

protected javax.swing.Action aLeft

aRight

protected javax.swing.Action aRight

aTop

protected javax.swing.Action aTop

aBottom

protected javax.swing.Action aBottom

aVCenter

protected javax.swing.Action aVCenter

aHCenter

protected javax.swing.Action aHCenter

dHorizontally

protected javax.swing.Action dHorizontally

dVertically

protected javax.swing.Action dVertically

mAlign

protected javax.swing.JMenu mAlign

aboutFrame

protected javax.swing.JFrame aboutFrame

helpFrame

protected HelpViewer helpFrame

printImage

protected PrintToImage printImage

miNewAs

protected javax.swing.JMenuItem miNewAs

miOpen

protected javax.swing.JMenuItem miOpen

miRecentFiles

protected javax.swing.JMenu miRecentFiles

miClose

protected javax.swing.JMenuItem miClose

miCloseAll

protected javax.swing.JMenuItem miCloseAll

miSave

protected javax.swing.JMenuItem miSave

miSaveAs

protected javax.swing.JMenuItem miSaveAs

miSaveAll

protected javax.swing.JMenuItem miSaveAll

miExport

protected javax.swing.JMenuItem miExport

miPrint

protected javax.swing.JMenuItem miPrint

miPrintImage

protected javax.swing.JMenuItem miPrintImage

miSnapShot

protected javax.swing.JMenuItem miSnapShot

miRefreshAllSheets

protected javax.swing.JMenuItem miRefreshAllSheets

miExit

protected javax.swing.JMenuItem miExit

miFindPlugins

protected javax.swing.JMenuItem miFindPlugins

miUndo

protected javax.swing.JMenuItem miUndo

miRedo

protected javax.swing.JMenuItem miRedo

miPreferencesPanel

protected javax.swing.JMenuItem miPreferencesPanel

miChooseLanguage

protected javax.swing.JMenuItem miChooseLanguage

miAbout

protected javax.swing.JMenuItem miAbout

miHelp

protected javax.swing.JMenuItem miHelp

miSheetInformation

protected javax.swing.JMenuItem miSheetInformation

bNew

protected TemplateMenuBox bNew

bOpen

protected javax.swing.JButton bOpen

bSave

protected javax.swing.JButton bSave

bPrint

protected javax.swing.JButton bPrint

bPrintImage

protected javax.swing.JButton bPrintImage

bSnapShot

protected javax.swing.JButton bSnapShot

bRefreshAllSheets

protected javax.swing.JButton bRefreshAllSheets

bUndo

protected javax.swing.JButton bUndo

bRedo

protected javax.swing.JButton bRedo

bAdjust

protected javax.swing.JButton bAdjust

bAlign

protected javax.swing.JButton bAlign

tbGridDisplay

protected javax.swing.JToggleButton tbGridDisplay

cbxGrid

protected javax.swing.JComboBox cbxGrid

cbxZoom

protected javax.swing.JComboBox cbxZoom

cbxDepth

protected javax.swing.JComboBox cbxDepth

cbxRotation

protected javax.swing.JComboBox cbxRotation

cbxAlign

protected javax.swing.JComboBox cbxAlign

mSel

protected javax.swing.JMenu mSel

aLineColor

protected DiagramSelectionPropertiesPanel.SelectionAction aLineColor

aBackgroundColor

protected DiagramSelectionPropertiesPanel.SelectionAction aBackgroundColor

aFontColor

protected DiagramSelectionPropertiesPanel.SelectionAction aFontColor

cbxSelection

protected ActionComboBox cbxSelection

splitPane

protected javax.swing.JSplitPane splitPane

toolbar

protected javax.swing.JToolBar toolbar

status

protected javax.swing.JLabel status

statusPanel

protected javax.swing.JPanel statusPanel

cleanStatusTask

protected java.util.TimerTask cleanStatusTask

cleanStatusTimer

protected java.util.Timer cleanStatusTimer

statusDelay

protected long statusDelay

openFileChooser

protected javax.swing.JFileChooser openFileChooser

saveFileChooser

protected javax.swing.JFileChooser saveFileChooser

exportFileChooser

protected javax.swing.JFileChooser exportFileChooser

templateChooser

protected TemplateChooser templateChooser

currentOpenFileFilter

protected javax.swing.filechooser.FileFilter currentOpenFileFilter

currentSaveFileFilter

protected javax.swing.filechooser.FileFilter currentSaveFileFilter

currentExportFileFilter

protected javax.swing.filechooser.FileFilter currentExportFileFilter

lockedShapes

public java.util.Vector lockedShapes

propEditor

protected UserPropertiesEditor propEditor

owner

protected final java.awt.Frame owner

container

protected final java.awt.Container container

menuBar

protected java.lang.Object menuBar

isOpenProcessCancelled

protected boolean isOpenProcessCancelled

recentOpenedFiles

protected java.util.ArrayList recentOpenedFiles

propSplit

protected static java.lang.String propSplit

propPath

protected static java.lang.String propPath

propSplitDefault

protected static int propSplitDefault
Constructor Detail

JSynopticPanels

public JSynopticPanels(java.util.Vector commands,
                       java.awt.Frame owner,
                       java.awt.Container container)
Method Detail

getOwner

public java.awt.Frame getOwner()
Specified by:
getOwner in interface JSynopticInterface
Returns:
the frame to be used for dialogs creation

progress

protected void progress(int percent)
A default implementation to be overridden

Parameters:
percent -

init

protected void init(java.util.Vector commands)
Build the Jsynoptic editor components

Parameters:
commands - the commands to process

createStatusPanel

protected void createStatusPanel()
Default implementation for status panel


layoutSourcePanelAndDesktopPanel

protected void layoutSourcePanelAndDesktopPanel()
Default implementation to layout source panel and synoptic editor


adjustLayout

protected void adjustLayout()
Default implementation for final layout tuning


adjustComboBox

public static void adjustComboBox(javax.swing.JComboBox b,
                                  java.awt.Dimension d)

display

protected void display()
Default implementation to display the GUI (if needed)


exit

protected void exit()

closeAll

protected boolean closeAll()
Returns:
true if all sheets can be closed

close

protected boolean close(DiagramComponent d)
Parameters:
d, - a sheet to close
Returns:
if sheet can be closed

processCommands

public void processCommands(java.util.Vector commands)

processCommand

public void processCommand(java.lang.String command)

lockFileSave

public void lockFileSave()

unlockFileSave

public void unlockFileSave()

canSave

public boolean canSave()

lockFileOpen

public void lockFileOpen()

unlockFileOpen

public void unlockFileOpen()

canOpen

public boolean canOpen()

lockPrint

public void lockPrint()

unlockPrint

public void unlockPrint()

canPrint

public boolean canPrint()

setLogger

protected void setLogger()

saveProperties

protected void saveProperties()

setStaticProperties

protected void setStaticProperties(UserProperties prop)

getStaticProperties

protected void getStaticProperties(UserProperties prop)

loadProperties

protected void loadProperties()

exitPlugins

protected void exitPlugins()
Some plugins need a particular treatment during Jsynoptic closing For instance when an external process was created in a plugin, it needs to be destroyed


createActions

protected void createActions()

createMenu

protected void createMenu()
Default implementation to create menus


createToolBar

public void createToolBar()
Default implementation to create tool bar


addFileMenu

public void addFileMenu(java.lang.Object mb)
Add a file menu to a menu bar


addEditMenu

public void addEditMenu(java.lang.Object mb)
Add an edit menu to a menu bar1999


addFileButtons

public void addFileButtons(javax.swing.JToolBar tb)
Add file buttons to a tool bar


addEditButtons

public void addEditButtons(javax.swing.JToolBar tb)
Add edit buttons to a tool bar


addDepthButtons

public void addDepthButtons(javax.swing.JToolBar tb)

addSelectionButtons

public void addSelectionButtons(javax.swing.JToolBar tb)

addAlignButtons

public void addAlignButtons(javax.swing.JToolBar tb)

addEditMenu

public void addEditMenu(javax.swing.JPopupMenu popup)
Add an edit menu to a popup menu

Specified by:
addEditMenu in interface JSynopticInterface

addSelectionMenu

public void addSelectionMenu(javax.swing.JPopupMenu popup)

addDepthMenu

public void addDepthMenu(javax.swing.JPopupMenu popup)

addAlignMenu

public void addAlignMenu(javax.swing.JPopupMenu popup)

addToolsMenu

public void addToolsMenu(java.lang.Object mb)
Add a help menu to a menu bar


addHelpMenu

public void addHelpMenu(java.lang.Object mb)
Add a help menu to a menu bar


canEdit

public boolean canEdit()
Specified by:
canEdit in interface JSynopticInterface
Returns:
true if shapes can be modified (edited)

getActiveComponent

public ShapesContainer.ShapesComponent getActiveComponent()
Description copied from interface: JSynopticInterface
Get the active synoptic

Specified by:
getActiveComponent in interface JSynopticInterface
Returns:
the selected shapes component (JComponent derivative)

getActiveDiagram

public DiagramComponent getActiveDiagram()

getActiveContainer

public ShapesContainer getActiveContainer()
Description copied from interface: JSynopticInterface
Get the active synoptic

Specified by:
getActiveContainer in interface JSynopticInterface
Returns:
the selected shapes container

addComponent

public void addComponent(ShapesContainer.ShapesComponent jc,
                         java.io.File f)

addComponent

public void addComponent(ShapesContainer.ShapesComponent jc)

addContainer

public void addContainer(ShapesContainer sc,
                         java.io.File f)
Description copied from interface: JSynopticInterface
Add a new synoptic The name of the synoptic is based on the file name used to load it

Specified by:
addContainer in interface JSynopticInterface
Parameters:
sc - the shapes container
f - the file used to load it

addContainer

public void addContainer(ShapesContainer sc)

setFile

public void setFile(javax.swing.JComponent jc,
                    java.io.File f)

getFilePanel

public FiledDesktopCardPanel getFilePanel()
Description copied from interface: JSynopticInterface
Returns the FiledDesktopCardPanel used to display the synoptics If this class is not used by the implementation, then it will return null but the Builtin plugin (at least) will not work.

Specified by:
getFilePanel in interface JSynopticInterface
Returns:
the desktop card panel to navigate through synoptics

getFile

public java.io.File getFile(javax.swing.JComponent jc)

setFile

public void setFile(ShapesContainer sc,
                    java.io.File f)

getFile

public java.io.File getFile(ShapesContainer sc)

setRecentFilesMenu

protected void setRecentFilesMenu()

createFileChooser

public void createFileChooser(int action)
Create a OPEN or SAVE FileChooser

Parameters:
action - OPEN or SAVE action.

getFilesFromDialog

protected java.io.File[] getFilesFromDialog(int action)

getPluginForFilter

protected Plugin getPluginForFilter(int action,
                                    javax.swing.filechooser.FileFilter activeFilter)

getPluginToProcessFile

protected Plugin getPluginToProcessFile(java.io.File f,
                                        int action,
                                        javax.swing.filechooser.FileFilter activeFilter)

open

public boolean open()

open

public boolean open(java.io.File f)
Description copied from interface: JSynopticInterface
Open a file. The file is open according to available plugins. For instance, if one shape has a link the link action will call this method and if the file is a .syn then the related synoptic will be loaded.

Specified by:
open in interface JSynopticInterface
Parameters:
f - the file to load
Returns:
true if file was sucessfully opened

print

protected void print(DiagramComponent d)
Print a DiagramComponent Open a print dilaog to allow user to specify print parameters

Parameters:
d -

saveAll

protected boolean saveAll()
Save all sheets

Returns:
true if all sheets can be saved, false overwise

save

protected boolean save()
Save current component

Returns:
true if component can be saved, false overwise

export

protected boolean export()
Save current component

Returns:
true if component can be saved, false overwise

saveAs

protected boolean saveAs()
Choose a file and save current component. A file chooser dialog box is opened to specify a file name

Returns:
true if file is saved and false overwise

saveFile

protected boolean saveFile(java.io.File f)

exportFile

protected boolean exportFile(java.io.File f)

selectionChanged

public void selectionChanged(DiagramSelection sel)
Description copied from interface: DiagramSelectionListener
The selection calls each listener when the selection changes

Specified by:
selectionChanged in interface DiagramSelectionListener
Parameters:
sel - the selection

clipboardChanged

public void clipboardChanged(DiagramClipboard sel)
Description copied from interface: DiagramClipboardListener
The clipboard calls each listener when its content changes

Specified by:
clipboardChanged in interface DiagramClipboardListener
Parameters:
sel - the current clipboard

componentSelected

public void componentSelected(javax.swing.JComponent d)
Description copied from interface: DesktopCardPanelListener
The desktop card panel calls each listener when the selection changes and provides the new selected component

Specified by:
componentSelected in interface DesktopCardPanelListener
Parameters:
d - the new selected component

newComponent

public void newComponent()
Description copied from interface: JSynopticInterface
Create a new active synoptic

Specified by:
newComponent in interface JSynopticInterface

newComponentAs

public void newComponentAs()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

addLongActions

public void addLongActions(long actionMask,
                           java.lang.Object target)
Description copied from interface: JSynopticInterface
Add a long action If the action is related to a shape, then the shape can be locked until action completion

Specified by:
addLongActions in interface JSynopticInterface
See Also:
LongAction

removeLongActions

public void removeLongActions(long actionMask,
                              java.lang.Object target)
Description copied from interface: JSynopticInterface
Remove a long action If the action was related to a shape and the shape was loacked then it becomes unlocked

Specified by:
removeLongActions in interface JSynopticInterface
See Also:
LongAction

setPath

public void setPath(java.io.File f)
Changes the current path

Specified by:
setPath in interface JSynopticInterface
Parameters:
f - the directory

getPath

public java.io.File getPath()
Gets the current path

Specified by:
getPath in interface JSynopticInterface
Returns:
the current directory

getFileChooser

public javax.swing.JFileChooser getFileChooser()
Specified by:
getFileChooser in interface JSynopticInterface
Returns:
the frame to be used for dialogs creation

getIsOpenProcessCancelled

public boolean getIsOpenProcessCancelled()
Specified by:
getIsOpenProcessCancelled in interface JSynopticInterface
Returns:
true if open process has been cancelled

setIsOpenProcessCancelled

public void setIsOpenProcessCancelled(boolean b)
Specified by:
setIsOpenProcessCancelled in interface JSynopticInterface

getSourceTree

public SourceTree getSourceTree()
Description copied from interface: JSynopticInterface
Get the source tree which provides all the sources currently available

Specified by:
getSourceTree in interface JSynopticInterface
Returns:
the source tree

getSelectionList

public java.util.AbstractList getSelectionList()
Description copied from interface: JSynopticInterface
Get the selection, i.e. an element to interract with the current synoptic That can be, for instance, a ShapeCreator to generate a new shape in the current synoptic or a DataSource to be used as the source of the selected shape in the current synoptic

Specified by:
getSelectionList in interface JSynopticInterface
Returns:
the selected objects list

getLockedShapes

public java.util.AbstractList getLockedShapes()
Description copied from interface: JSynopticInterface
Get the list of locked shapes

Specified by:
getLockedShapes in interface JSynopticInterface
Returns:
the list

setStatus

public void setStatus(java.lang.String message)
Description copied from interface: JSynopticInterface
Displays a status message

Specified by:
setStatus in interface JSynopticInterface

updateUndoActions

protected void updateUndoActions()
Update the actions associated to the Undo/Redo buttons. Typically called when the active document changes.


propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

updateUndoEnabled

protected void updateUndoEnabled()

getTemplateChooser

public TemplateChooser getTemplateChooser()