proyecto.editor
Class Editor

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 proyecto.editor.Editor
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, InterfazVentEditor

public class Editor
extends JFrame
implements InterfazVentEditor

Es nuestro frame principal, la encargada de diversas actividades sobre la aplicación. Las actividades de nuestra aplicación las vamos a separar en dos grupos: Acciones sobre el editor y creación de elementos.

  1. Creación de elementos:
  2. Acciones sobre el editor:

Author:
Parras
See Also:
PanelEdicion, JMenuBar, JFrame, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static PrintStream iSalidaStandarErr
          salida standar err.
static PrintStream iSalidaStandarOut
          salida standar out.
(package private)  Icon ledrojo
          Imagenes para las pestañas.
(package private)  Icon ledverde
          Imagenes para las pestañas.
 
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
Editor()
          Constructor editor.
 
Method Summary
 void abrirFichero(String nombreArchivo)
          Abrir fichero.
 void addProyecto(File aFileProyecto)
          addProyecto añade nuestro proyecto a nuestro array si no lo contiene.
 void buscarFichero()
          ******************************Manejos de Fichero Para el JTextPane ************INICIO*****************.
 void crearWorkSpace()
          Crea el workSpace, es decir la carpeta de trabajo donde iremos guardando nuestro proyectos.
static Editor get()
           Obtenemos nuestra ventana principal, para tener acceso a caulquier propiedad creada.
 PanelEdicion getPanel()
          Inicializacion de nuestro panel
 void getPreferecuasUsuarioXML()
          getPreferecuasUsuario Método que obtine la preferencias del Usuario
 PreferenciasCompilacion getPreferenciasCompilacion()
          Obtener el preferencias compilacion.
 PreferenciasUsuario getPreferenciasUsuario()
          Obtener las preferencias usuario.
 File getPrimerProyecto()
          Obtener el primer proyecto.
 File getProyecto(int aPosicion)
          Obtener proyecto.
 ArrayList<File> getProyectos()
          Devolvemos el array de proyectos.
 File[] getProyectosActivos()
          Proyectos cargados en nuestro Fichero WorkSpace.xml
 void getProyectoXML(SplashPrincipal splash)
          getProyectosXML Método que obtine el workspace y sus proyectos.
 String getRutaArchivo()
          Obtener el ruta archivo.
 File getWorkspace()
          Obtener el workspace.
 boolean guardarComo()
          Guarda el fichero asignando un direccion.
 boolean guardarComo(File archivo)
          Guardar como.
 boolean guardarEnFichero()
          Guardar los datos en un fichero.
 void guardarWorkSpaceXML()
           Guarda el espacio de trabajo que lo tenemos en nuestro fichero en una estructura XML.
 boolean okAbandonar()
          Para Saber si ha salido el programador.
 void salir()
          Crea La ventana Principal.
 boolean setBorrarProyecto(File proyecto)
          borrar un proyecto pasado como paramentro proyecto.
 boolean setBorrarProyecto(String proyecto)
          borrar un proyecto pasado como paramentro proyecto, solo el nombre.
 void setControlador(ControlVentEditor c)
           Los elementos que están definidos mediante ActionCommand para los JMenuItem son: SALIR: Abandona la aplicación NUEVO : Abre la ventana que gestiona nuevo elementos en nuestra aplicación PROYECTO: Crear un proyecto ABRIR_PROYECTO: Abrir un proyecto existente ABRIR: Abre un fichero en modo texto CERRAR: Cierra la ventana activa, gestionado su estado de modificado CERRARTODO: Cierra todas las ventanas, gestionado su estado de modificado GUARDAR: Guarda un fichero abierto en un tab GUARDAR_C: Guarda todos los ficheros que tengamos con modificaciones en los tab.
 void setPreferenciasCompilacion(PreferenciasCompilacion prefCompilacion)
          Modificar la propiedad preferencias compilacion.
 void setPreferenciasUsuario(PreferenciasUsuario prefUsuario)
          Modificar la propiedad preferencias usuario.
 void setProyectosActivas(ArrayList<File> ilproyectos)
          Devuelve Proyectos cargados en nuestro Fichero WorkSpace
 void setWorkspace(File aWorkspace)
          Modificar la propiedad workspace.
 JMenu subMenuProyectosRecientes()
          Sub menu proyectos recientes.
 void tratarCancelar()
          Tratar cancelar.
 void updateCaption(String texto)
          Cambiar el Camption en la parte de arriba de la ventana con el nombre de la ruta.
 
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, 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, paint, 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

iSalidaStandarOut

public static PrintStream iSalidaStandarOut
salida standar out.


iSalidaStandarErr

public static PrintStream iSalidaStandarErr
salida standar err.


ledverde

Icon ledverde
Imagenes para las pestañas. Ok


ledrojo

Icon ledrojo
Imagenes para las pestañas. No Ok

Constructor Detail

Editor

public Editor()
Constructor editor. Creado : Parras, 07-jun-2009

Method Detail

salir

public void salir()
Description copied from interface: InterfazVentEditor
Crea La ventana Principal.

Specified by:
salir in interface InterfazVentEditor

get

public static Editor get()

Obtenemos nuestra ventana principal, para tener acceso a caulquier propiedad creada.

Patrón singleton.

Returns:
editor Creado : Parras, 07-jun-2009

getPreferecuasUsuarioXML

public void getPreferecuasUsuarioXML()
getPreferecuasUsuario

Método que obtine la preferencias del Usuario


getProyectoXML

public void getProyectoXML(SplashPrincipal splash)
getProyectosXML

Método que obtine el workspace y sus proyectos.

Pasamas el spash como argumento por si lo tenemos que cerrar para la definición del workSpace

Parameters:
splash - splash

guardarWorkSpaceXML

public void guardarWorkSpaceXML()

Guarda el espacio de trabajo que lo tenemos en nuestro fichero en una estructura XML.

También guardamos las preferencias de usuario

La ruta donde podemos encontrar el fichero XML es Ruta: /PFC/proyecto/configuracion/workspace.xml


crearWorkSpace

public void crearWorkSpace()
Crea el workSpace, es decir la carpeta de trabajo donde iremos guardando nuestro proyectos.


tratarCancelar

public void tratarCancelar()
Tratar cancelar. Creado : Parras, 07-jun-2009


getPanel

public PanelEdicion getPanel()
Inicializacion de nuestro panel

Specified by:
getPanel in interface InterfazVentEditor
Returns:
the panel
See Also:
PanelEdicion

subMenuProyectosRecientes

public JMenu subMenuProyectosRecientes()
Sub menu proyectos recientes.

Returns:
jmenu Creado : Parras, 07-jun-2009

setControlador

public void setControlador(ControlVentEditor c)

Los elementos que están definidos mediante ActionCommand para los JMenuItem son:

Serán implementados en la clase ControlVentEditor.

Specified by:
setControlador in interface InterfazVentEditor
Parameters:
c - Sera el oyente
See Also:
ControlVentEditor.actionPerformed(java.awt.event.ActionEvent)

buscarFichero

public void buscarFichero()
                   throws IOException
******************************Manejos de Fichero Para el JTextPane ************INICIO*****************.

Specified by:
buscarFichero in interface InterfazVentEditor
Throws:
BadLocationException - *
IOException - Signals that an I/O exception has occurred.

abrirFichero

public void abrirFichero(String nombreArchivo)
                  throws BadLocationException
Description copied from interface: InterfazVentEditor
Abrir fichero.

Specified by:
abrirFichero in interface InterfazVentEditor
Parameters:
nombreArchivo - the nombre archivo
Throws:
BadLocationException - the bad location exception Creado : Parras, 13-oct-2009

guardarComo

public boolean guardarComo()
                    throws Excepciones,
                           IOException
Description copied from interface: InterfazVentEditor
Guarda el fichero asignando un direccion.

Specified by:
guardarComo in interface InterfazVentEditor
Returns:
true, if guardar como
Throws:
Excepciones - the excepciones
IOException - Signals that an I/O exception has occurred.

guardarComo

public boolean guardarComo(File archivo)
                    throws Excepciones,
                           IOException
Description copied from interface: InterfazVentEditor
Guardar como.

Specified by:
guardarComo in interface InterfazVentEditor
Parameters:
archivo - the archivo
Returns:
true, si es correcto Creado : Parras, 13-oct-2009
Throws:
Excepciones - the excepciones
IOException - Signals that an I/O exception has occurred.

guardarEnFichero

public boolean guardarEnFichero()
                         throws IOException
Description copied from interface: InterfazVentEditor
Guardar los datos en un fichero.

Specified by:
guardarEnFichero in interface InterfazVentEditor
Returns:
true, if guardar en fichero
Throws:
IOException - Signals that an I/O exception has occurred.

getRutaArchivo

public String getRutaArchivo()
Obtener el ruta archivo.

Returns:
el ruta archivo Creado : Parras, 07-jun-2009

updateCaption

public void updateCaption(String texto)
Cambiar el Camption en la parte de arriba de la ventana con el nombre de la ruta.

Specified by:
updateCaption in interface InterfazVentEditor
Parameters:
texto - texto

okAbandonar

public boolean okAbandonar()
                    throws Excepciones,
                           IOException
Description copied from interface: InterfazVentEditor
Para Saber si ha salido el programador.

Specified by:
okAbandonar in interface InterfazVentEditor
Returns:
true, if ok abandonar
Throws:
Excepciones - the excepciones
IOException - Signals that an I/O exception has occurred.

getWorkspace

public File getWorkspace()
Obtener el workspace.

Returns:
el workspace Creado : Parras, 07-jun-2009

setWorkspace

public void setWorkspace(File aWorkspace)
Modificar la propiedad workspace.

Parameters:
aWorkspace - La propiedad workspace

getProyecto

public File getProyecto(int aPosicion)
Obtener proyecto.

Parameters:
aPosicion - a posicion
Returns:
File proyecto

getPrimerProyecto

public File getPrimerProyecto()
Obtener el primer proyecto.

Returns:
el primer proyecto Creado : Parras, 07-jun-2009

setBorrarProyecto

public boolean setBorrarProyecto(String proyecto)
borrar un proyecto pasado como paramentro proyecto, solo el nombre.

Parameters:
proyecto - String
Returns:
true, si es correcto Creado : Parras, 07-jun-2009

setBorrarProyecto

public boolean setBorrarProyecto(File proyecto)
borrar un proyecto pasado como paramentro proyecto. Pasamos toda la ruta

Parameters:
proyecto - File
Returns:
true, si es correcto Creado : Parras, 07-jun-2009

addProyecto

public void addProyecto(File aFileProyecto)
addProyecto añade nuestro proyecto a nuestro array si no lo contiene.

Parameters:
aFileProyecto - a file proyecto

getProyectos

public ArrayList<File> getProyectos()
Devolvemos el array de proyectos.

Returns:
ArrayList

getPreferenciasCompilacion

public PreferenciasCompilacion getPreferenciasCompilacion()
Obtener el preferencias compilacion.

Returns:
el preferencias compilacion Creado : Parras, 07-jun-2009

setPreferenciasCompilacion

public void setPreferenciasCompilacion(PreferenciasCompilacion prefCompilacion)
Modificar la propiedad preferencias compilacion.

Parameters:
prefCompilacion - La propiedad preferencias compilacion

setPreferenciasUsuario

public void setPreferenciasUsuario(PreferenciasUsuario prefUsuario)
Modificar la propiedad preferencias usuario.

Parameters:
prefUsuario - La propiedad preferencias usuario

getPreferenciasUsuario

public PreferenciasUsuario getPreferenciasUsuario()
Obtener las preferencias usuario.

Returns:
el preferencias usuario Creado : Parras, 25-nov-2009

getProyectosActivos

public File[] getProyectosActivos()
Proyectos cargados en nuestro Fichero WorkSpace.xml

Specified by:
getProyectosActivos in interface InterfazVentEditor
Returns:
the proyectos activos
See Also:
InterfazVentEditor.getProyectosActivos()

setProyectosActivas

public void setProyectosActivas(ArrayList<File> ilproyectos)
Devuelve Proyectos cargados en nuestro Fichero WorkSpace

Parameters:
ilproyectos -