El Patrón de Diseño Modelo-Vista-Controlador ( MVC ), o en ingles
Model-View_Controller Design Pattern, es la disposición de componentes
y la división de trabajo que conforman una Estructura de Datos.
Toda Estructura de Datos se compone de :
Patrón de Diseño
........................................................................................
. .
. .
. Presentación .
. .............................. .
. . . .
. . . .
. . *----------------* . .
. . | | . .
. . | | . . Presenta información al usuario
. +------------------------------------------>| Vista |------------------------+
. | Notifica . | | . . |
. | si contenido . | | . . |
. | cambia . *----------------* . . |
. | . A . . |
. | . | . . |
. *----------------* . | . . |
. | | . | . . +------------>
. | | . Actualiza | . .
. | Modelo | . si vista | . . Usuario
. | | . cambia | . .
. | | . | . . +-------------
. *----------------* . | . . |
. A . | . . |
. | . | . . |
. | Actualiza . *----------------* . . |
. | si contenido . | | . . |
. | cambia . | | . . |
. +-------------------------------------------| Controlador |<-----------------------+
. . | | . . Recibe entradas del usuario
. . | | . .
. . *----------------* . .
. . . .
. .............................. .
. .
. .
. .
........................................................................................
*----------------*
*--| |------------------------+
*--| | | |
| | | Vista |---------------------+ |
+-------------------------------------------------->| | | |
| +--------------------------------------------->| | |------------------+ | |
| | +---------------------------------------->| | *----------------* | | |
| | | | *----------A-----* | | |
| | | *----------A--|--* | | +------>
| | | A | | | |
| | | | | | | +--------->
*----------------* | | | |
| | | | | +------------>
| | | | |
| Modelo | | | | Usuario
| | | | |
| | | | | +-------------
*----------------* | | | |
A A A *----------------* | +----------
| | | *--| |<-----------------+ |
| | | *--| | | | +-------
| | +-----------------------------------------------| Controlador |---------------------+ |
| +----------------------------------------------| | | |
+---------------------------------------------| | | |------------------------+
| | *----------------*
| *----------------*
*----------------*
JTree()
JTree(TreeNode root)
JTree(TreeNode root, boolean asksAllowsChildren)
JTree(Object[] value)
JTree(Vector value)
JTree(Hashtable value)
JTree(TreeModel newModel)
void setRootVisible(boolean rootVisible)
void setRowHeight(int rowHeight)
void setEditable(boolean flag)
void setCellEditor(TreeCellEditor cellEditor)
void setCellRenderer(TreeCellRenderer x)
void setInvokesStopCellEditing(boolean newValue)
void setScrollsOnExpand(boolean newValue)
void setShowsRootHandles(boolean newValue)
void setToggleClickCount(int clickCount)
void setUI(TreeUI ui)
void setVisibleRowCount(int newCount)
boolean isRootVisible()
boolean isFixedRowHeight()
boolean isSelectionEmpty()
boolean isEditable()
boolean isEditing()
int getRowCount()
int getRowHeight()
int getVisibleRowCount()
int getSelectionCount()
int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
int getMinSelectionRow()
int getMaxSelectionRow()
int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
int getToggleClickCount()
int[] getSelectionRows()
boolean getInvokesStopCellEditing()
boolean getScrollableTracksViewportHeight()
boolean getScrollableTracksViewportWidth()
boolean getScrollsOnExpand()
boolean getShowsRootHandles()
TreeUI getUI()
String getToolTipText(MouseEvent event)
String getUIClassID()
TreeCellEditor getCellEditor()
TreeCellRenderer getCellRenderer()
Dimension getPreferredScrollableViewportSize()
AccessibleContext getAccessibleContext()
void startEditingAtPath(TreePath path)
void cancelEditing()
void clearSelection()
void treeDidChange()
void updateUI()
boolean stopEditing()
protected String paramString()
void setSelectionRow(int row)
void setSelectionInterval(int index0, int index1)
void setSelectionRows(int[] rows)
boolean isRowSelected(int row)
boolean isCollapsed(int row)
boolean isExpanded(int row)
void addSelectionRow(int row)
void addSelectionInterval(int index0, int index1)
void addSelectionRows(int[] rows)
void removeSelectionRow(int row)
void removeSelectionInterval(int index0, int index1)
void removeSelectionRows(int[] rows)
void collapseRow(int row)
void expandRow(int row)
void scrollRowToVisible(int row)
int getClosestRowForLocation(int x, int y)
int getLeadSelectionRow()
int getRowForLocation(int x, int y)
int getRowForPath(TreePath path)
String convertValueToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
Rectangle getRowBounds(int row)
void addSelectionPath(TreePath path)
void addSelectionPaths(TreePath[] paths)
void collapsePath(TreePath path)
void expandPath(TreePath path)
void makeVisible(TreePath path)
void removeSelectionPath(TreePath path)
void removeSelectionPaths(TreePath[] paths)
void scrollPathToVisible(TreePath path)
void setAnchorSelectionPath(TreePath newPath)
void setExpandsSelectedPaths(boolean newValue)
void setLeadSelectionPath(TreePath newPath)
void setSelectionPath(TreePath path)
void setSelectionPaths(TreePath[] paths)
protected void clearToggledPaths()
protected void setExpandedState(TreePath path, boolean state)
protected void removeDescendantToggledPaths(Enumeration toRemove)
boolean getExpandsSelectedPaths()
boolean hasBeenExpanded(TreePath path)
boolean isCollapsed(TreePath path)
boolean isExpanded(TreePath path)
boolean isPathEditable(TreePath path)
boolean isPathSelected(TreePath path)
boolean isVisible(TreePath path)
protected boolean removeDescendantSelectedPaths(TreePath path, boolean includePath)
TreePath getAnchorSelectionPath()
TreePath getClosestPathForLocation(int x, int y)
TreePath getEditingPath()
TreePath getLeadSelectionPath()
TreePath getPathForLocation(int x, int y)
TreePath getPathForRow(int row)
TreePath getSelectionPath()
TreePath[] getSelectionPaths()
protected TreePath[] getPathBetweenRows(int index0, int index1)
Enumeration getExpandedDescendants(TreePath parent)
protected Enumeration getDescendantToggledPaths(TreePath parent)
Object getLastSelectedPathComponent()
Rectangle getPathBounds(TreePath path)
void addTreeExpansionListener(TreeExpansionListener tel)
void addTreeSelectionListener(TreeSelectionListener tsl)
void addTreeWillExpandListener(TreeWillExpandListener tel)
void removeTreeExpansionListener(TreeExpansionListener tel)
void removeTreeSelectionListener(TreeSelectionListener tsl)
void removeTreeWillExpandListener(TreeWillExpandListener tel)
void fireTreeCollapsed(TreePath path)
void fireTreeExpanded(TreePath path)
void fireTreeWillCollapse(TreePath path)
void fireTreeWillExpand(TreePath path)
protected void fireValueChanged(TreeSelectionEvent e)
protected TreeModelListener createTreeModelListener()
void setLargeModel(boolean newValue)
void setModel(TreeModel newModel)
void setSelectionModel(TreeSelectionModel selectionModel)
boolean isLargeModel()
protected static TreeModel createTreeModel(Object value)
protected static TreeModel getDefaultTreeModel()
TreeModel getModel()
TreeSelectionModel getSelectionModel()