net.sf.latexdraw.ui
Class LFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by org.malai.widget.MFrame
                          extended by org.malai.ui.UI
                              extended by net.sf.latexdraw.ui.LFrame
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants, Eventable, Preferenciable, Modifiable, Reinitialisable

public class LFrame
extends UI

This class contains all the elements of the graphical user interface.

This file is part of LaTeXDraw
Copyright (c) 2005-2012 Arnaud BLOUIN

LaTeXDraw is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

LaTeXDraw is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

03/11/08

Version:
3.0
Author:
Arnaud BLOUIN
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  ShapeDeleter deleter
          The instrument that removes shapes.
protected  DrawingPropertiesCustomiser drawingPropCustomiser
          The instrument that customises the properties of the drawing.
protected  EditingSelector editingSelector
          The instrument used to select/activate the hand, the pencil, or any of the editing instruments.
protected  ExceptionsManager exceptionsManager
          The instrument allows to see exceptions.
protected  Exporter exporter
          The instrument that exports drawings as picture or code.
protected  FileLoaderSaver fileLoader
          The instrument that saves and loads SVG documents.
protected  MagneticGridCustomiser gridCustomiser
          The instrument that customises the magnetic grid.
protected  Hand hand
          The instrument used to select, move, etc. shapes.
protected  Helper helper
          The instrument that manages help features.
protected  MLayeredPane layeredPanel
          The layered panel used to display widgets upon shapes (e.g. text setters).
protected  MetaShapeCustomiser metaShapeCustomiser
          This instrument manages the instruments that customise shapes and the pencil.
protected  CopierCutterPaster paster
          The instrument that copies, cuts and pastes selected shapes.
protected  Pencil pencil
          The instrument used to draw shapes.
protected  PreferencesActivator prefActivator
          The instrument that activates the preferences setter.
protected  PreferencesSetter prefSetters
          The instrument that sets the preferences.
protected  ScaleRulersCustomiser scaleRulersCustomiser
          The instrument that (des-)activates the scale rulers.
protected  Scroller scroller
          The scroller used to scroll the canvas.
private static long serialVersionUID
           
protected  javax.swing.JLabel statusBar
          The status-bar of the frame.
protected  MTabbedPane tabbedPanel
           
protected  TabSelector tabSelector
           
protected  TextSetter textSetter
          The instrument used to add and modify texts.
protected  UndoRedoManager undoManager
          The instrument that manages undo/redo actions.
protected  XScaleRuler xScaleRuler
          The ruler used to display X-dimensions.
protected  YScaleRuler yScaleRuler
          The ruler used to display X-dimensions.
protected  Zoomer zoomer
          The instrument that zoomes in/out the canvas.
 
Fields inherited from class org.malai.ui.UI
composer, modified, presentations
 
Fields inherited from class org.malai.widget.MFrame
eventManager
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
LFrame(MProgressBar progressBar)
          Creates and initialises the frame.
 
Method Summary
private  void buildFrame(MProgressBar progressBar)
          The builder of the frame.
 LCanvas getCanvas()
           
 LCodePanel getCodePanel()
           
 ShapeDeleter getDeleter()
           
 IDrawing getDrawing()
           
 DrawingPropertiesCustomiser getDrawingPropCustomiser()
           
 EditingSelector getEditingSelector()
           
 Exporter getExporter()
           
 FileLoaderSaver getFileLoader()
           
 MagneticGridCustomiser getGridCustomiser()
           
 Hand getHand()
           
 Instrument[] getInstruments()
           
 MetaShapeCustomiser getMetaShapeCustomiser()
           
 CopierCutterPaster getPaster()
           
 Pencil getPencil()
           
 PreferencesSetter getPrefSetters()
           
 ScaleRulersCustomiser getScaleRulersCustomiser()
           
 javax.swing.JLabel getStatusBar()
           
 MTabbedPane getTabbedPanel()
           
 TextSetter getTextSetter()
           
 UndoRedoManager getUndoManager()
           
 Zoomer getZoomer()
           
 void initialisePresentations()
          Initialises the presentations of the UI.
private  void instantiateInstruments(LCanvas canvas, IDrawing drawing)
           
 void load(boolean generalPreferences, java.lang.String nsURI, org.w3c.dom.Element meta)
          Loads data save in an XML document.
 void reinit()
          Reinitialises the UI and its instruments, presentations and so on.
 void save(boolean generalPreferences, java.lang.String nsURI, org.w3c.dom.Document document, org.w3c.dom.Element root)
          Saves the parameters of the instrument into an XML tag.
 
Methods inherited from class org.malai.ui.UI
getComposer, getPresentation, getPresentations, isModified, setModified, updatePresentations
 
Methods inherited from class org.malai.widget.MFrame
getEventManager, hasEventManager
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

hand

protected Hand hand
The instrument used to select, move, etc. shapes.


pencil

protected Pencil pencil
The instrument used to draw shapes.


textSetter

protected TextSetter textSetter
The instrument used to add and modify texts.


editingSelector

protected EditingSelector editingSelector
The instrument used to select/activate the hand, the pencil, or any of the editing instruments.


metaShapeCustomiser

protected MetaShapeCustomiser metaShapeCustomiser
This instrument manages the instruments that customise shapes and the pencil.


undoManager

protected UndoRedoManager undoManager
The instrument that manages undo/redo actions.


zoomer

protected Zoomer zoomer
The instrument that zoomes in/out the canvas.


scroller

protected Scroller scroller
The scroller used to scroll the canvas.


fileLoader

protected FileLoaderSaver fileLoader
The instrument that saves and loads SVG documents.


scaleRulersCustomiser

protected ScaleRulersCustomiser scaleRulersCustomiser
The instrument that (des-)activates the scale rulers.


helper

protected Helper helper
The instrument that manages help features.


exporter

protected Exporter exporter
The instrument that exports drawings as picture or code.


exceptionsManager

protected ExceptionsManager exceptionsManager
The instrument allows to see exceptions.


prefActivator

protected PreferencesActivator prefActivator
The instrument that activates the preferences setter.


prefSetters

protected PreferencesSetter prefSetters
The instrument that sets the preferences.


deleter

protected ShapeDeleter deleter
The instrument that removes shapes.


statusBar

protected javax.swing.JLabel statusBar
The status-bar of the frame.


xScaleRuler

protected XScaleRuler xScaleRuler
The ruler used to display X-dimensions.


yScaleRuler

protected YScaleRuler yScaleRuler
The ruler used to display X-dimensions.


gridCustomiser

protected MagneticGridCustomiser gridCustomiser
The instrument that customises the magnetic grid.


drawingPropCustomiser

protected DrawingPropertiesCustomiser drawingPropCustomiser
The instrument that customises the properties of the drawing.


paster

protected CopierCutterPaster paster
The instrument that copies, cuts and pastes selected shapes.


tabSelector

protected TabSelector tabSelector

layeredPanel

protected MLayeredPane layeredPanel
The layered panel used to display widgets upon shapes (e.g. text setters).


tabbedPanel

protected MTabbedPane tabbedPanel
Constructor Detail

LFrame

public LFrame(MProgressBar progressBar)
Creates and initialises the frame.

Parameters:
progressBar - The progress bar used to show the progression of the construction of the frame. Can be null.
Since:
3.0
Method Detail

buildFrame

private void buildFrame(MProgressBar progressBar)
The builder of the frame.

Since:
3.0

instantiateInstruments

private void instantiateInstruments(LCanvas canvas,
                                    IDrawing drawing)

reinit

public void reinit()
Description copied from class: UI
Reinitialises the UI and its instruments, presentations and so on.

Specified by:
reinit in interface Reinitialisable
Overrides:
reinit in class UI

getDrawing

public IDrawing getDrawing()
Returns:
The drawing that contains the shapes.
Since:
3.0

getCanvas

public LCanvas getCanvas()
Returns:
The canvas that contains the views of the shapes.
Since:
3.0

getCodePanel

public LCodePanel getCodePanel()
Returns:
The code panel of the system.
Since:
3.0

initialisePresentations

public void initialisePresentations()
Description copied from class: UI
Initialises the presentations of the UI.

Specified by:
initialisePresentations in class UI

save

public void save(boolean generalPreferences,
                 java.lang.String nsURI,
                 org.w3c.dom.Document document,
                 org.w3c.dom.Element root)
Description copied from interface: Preferenciable
Saves the parameters of the instrument into an XML tag.

Specified by:
save in interface Preferenciable
Overrides:
save in class UI
Parameters:
generalPreferences - True: this operation is called to save the general preferences of the interactive system. Otherwise, it is called to save a presentation in a document. This parameter is useful when different information must be saved during a presentation backup or a general preferences backup.
nsURI - The namespace that must be added to tags corresponding to the instrument's parameters.
document - The XML document.
root - The root element that will contains the instrument's parameters.

load

public void load(boolean generalPreferences,
                 java.lang.String nsURI,
                 org.w3c.dom.Element meta)
Description copied from interface: Preferenciable
Loads data save in an XML document.

Specified by:
load in interface Preferenciable
Overrides:
load in class UI
Parameters:
generalPreferences - True: this operation is called to load the general preferences of the interactive system. Otherwise, it is called to load a presentation in a document. This parameter is useful when different information must be loaded during a presentation backup or a general preferences backup.
nsURI - The namespace that must be added to tags corresponding to the instrument's parameters.
meta - The meta data element.

getInstruments

public Instrument[] getInstruments()
Specified by:
getInstruments in class UI
Returns:
The instruments of the interactive system.

getFileLoader

public FileLoaderSaver getFileLoader()
Returns:
The instrument that saves and loads SVG documents.
Since:
3.0

getExporter

public Exporter getExporter()
Returns:
The instrument that exports drawings as picture or code.
Since:
3.0

getGridCustomiser

public MagneticGridCustomiser getGridCustomiser()
Returns:
The instrument that customises the magnetic grid.
Since:
3.0

getScaleRulersCustomiser

public ScaleRulersCustomiser getScaleRulersCustomiser()
Returns:
The instrument that (des-)activates the scale rulers.
Since:
3.0

getPrefSetters

public PreferencesSetter getPrefSetters()
Returns:
The instrument that manages the preferences.
Since:
3.0

getDrawingPropCustomiser

public final DrawingPropertiesCustomiser getDrawingPropCustomiser()
Returns:
The instrument that customises the drawing's properties.
Since:
3.0

getMetaShapeCustomiser

public MetaShapeCustomiser getMetaShapeCustomiser()
Returns:
the metaShapeCustomiser.
Since:
3.0

getHand

public Hand getHand()
Returns:
the hand.
Since:
3.0

getPencil

public Pencil getPencil()
Returns:
the pencil.
Since:
3.0

getTextSetter

public TextSetter getTextSetter()
Returns:
the textSetter.
Since:
3.0

getEditingSelector

public EditingSelector getEditingSelector()
Returns:
the editingSelector.
Since:
3.0

getUndoManager

public UndoRedoManager getUndoManager()
Returns:
the undoManager.
Since:
3.0

getZoomer

public Zoomer getZoomer()
Returns:
the zoomer.
Since:
3.0

getDeleter

public ShapeDeleter getDeleter()
Returns:
the deleter.
Since:
3.0

getPaster

public CopierCutterPaster getPaster()
Returns:
the paster.
Since:
3.0

getTabbedPanel

public MTabbedPane getTabbedPanel()
Returns:
the tabbedPanel.
Since:
3.0

getStatusBar

public javax.swing.JLabel getStatusBar()
Returns:
The status bar used to display some feedback information.
Since:
3.0