org.mlc.swing.layout
Class FormEditor

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.mlc.swing.layout.FormEditor
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class FormEditor
extends javax.swing.JPanel

This is the main panel that is used in LayoutFrame serving as the user interface for the builder. This is a pretty juicy file because there is a lot going on here. Better docs to come...

Since:
Ptolemy II 8.0
Version:
$Id: FormEditor.java 57046 2010-01-27 23:35:53Z cxh $
Author:
Michael Connor mlconnor@yahoo.com
See Also:
Serialized Form

Nested Class Summary
private  class FormEditor.ColSpanSpinnerModel
           
(package private)  class FormEditor.ComponentListCellRenderer
           
(package private)  class FormEditor.ComponentPaletteListModel
           
(package private)  class FormEditor.ComponentPaletteListRenderer
           
private  class FormEditor.ComponentSelectionListModel
           
private  class FormEditor.ConstraintTableCellRenderer
           
private  class FormEditor.DeleteColumnAction
           
private  class FormEditor.DeleteRowAction
           
private  class FormEditor.GridTableModel
           
private  class FormEditor.InsertColumnAfterAction
           
private  class FormEditor.InsertColumnBeforeAction
           
private  class FormEditor.InsertRowAfterAction
           
private  class FormEditor.InsertRowBeforeAction
           
private  class FormEditor.NewComponentAction
           
private  class FormEditor.NewComponentDialog0
           
private  class FormEditor.RemoveComponentAction
           
private  class FormEditor.RowSpanSpinnerModel
           
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
(package private)  javax.swing.JSpinner bottomInsetSpinner
           
(package private)  javax.swing.SpinnerNumberModel bottomInsetSpinnerModel
           
(package private)  javax.swing.JTextField colSpecField
           
(package private)  FormEditor.ColSpanSpinnerModel colSpinnerModel
           
(package private)  javax.swing.JButton columnDeleteButton
           
(package private)  javax.swing.JButton columnInsertAfterButton
           
(package private)  javax.swing.JButton columnInsertBeforeButton
           
(package private)  javax.swing.JLabel columnSpanLabel
           
(package private)  javax.swing.JSpinner columnSpanSpinner
           
(package private)  DndList componentList
           
(package private)  FormEditor.ComponentListCellRenderer componentListCellRenderer
           
(package private)  javax.swing.JScrollPane componentListScrollPane
           
(package private)  DndList componentPalette
           
(package private)  javax.swing.JLabel componentPaletteLabel
           
(package private)  FormEditor.ComponentPaletteListModel componentPaletteListModel
           
(package private)  javax.swing.JScrollPane componentPaletteScrollPane
           
(package private)  FormEditor.ComponentSelectionListModel componentSelectionListModel
           
(package private)  javax.swing.JLabel componentsLabel
           
(package private)  javax.swing.JPanel componentsPanel
           
(package private)  javax.swing.JSplitPane componentsSplitPane
           
(package private)  java.awt.Component constraintsSeparator
           
(package private)  javax.swing.JSplitPane constraintsSplitPane
           
(package private)  java.awt.Container container
           
(package private)  ContainerLayout containerLayout
           
(package private)  javax.swing.JPanel contentPanel
           
(package private)  javax.swing.Action deleteColumnAction
           
(package private)  javax.swing.Action deleteRowAction
           
(package private)  java.awt.Component formComponent
           
(package private)  javax.swing.JComboBox horizontalAlignmentCombo
           
(package private)  javax.swing.JLabel horizontalAlignmentLabel
           
(package private)  java.lang.String[] horizontalAlignmentList
           
(package private)  javax.swing.Action insertColumnAfterAction
           
(package private)  javax.swing.Action insertColumnBeforeAction
           
(package private)  javax.swing.Action insertRowAfterAction
           
(package private)  javax.swing.Action insertRowBeforeAction
           
(package private)  javax.swing.JLabel insetsLabel
           
(package private)  javax.swing.JPanel insetsPanel
           
(package private)  LayoutConstraintsManager layoutConstraintsManager
           
(package private)  MultiContainerFrame layoutFrame
           
(package private)  javax.swing.JSpinner leftInsetSpinner
           
(package private)  javax.swing.SpinnerNumberModel leftInsetSpinnerModel
           
(package private)  javax.swing.Action newComponentAction
           
(package private)  javax.swing.JButton newComponentButton
           
(package private)  java.util.Set<java.awt.Component> newComponents
           
(package private)  java.awt.Component positionsSeparator
           
(package private)  javax.swing.JPanel propertiesPanel
           
(package private)  javax.swing.Action removeComponentAction
           
(package private)  javax.swing.JButton removeComponentButton
           
(package private)  javax.swing.JSpinner rightInsetSpinner
           
(package private)  javax.swing.SpinnerNumberModel rightInsetSpinnerModel
           
(package private)  javax.swing.JButton rowDeleteButton
           
(package private)  javax.swing.JButton rowInsertAfterButton
           
(package private)  javax.swing.JButton rowInsertBeforeButton
           
(package private)  javax.swing.JLabel rowSpanLabel
           
(package private)  javax.swing.JSpinner rowSpanSpinner
           
(package private)  javax.swing.JTextField rowSpecField
           
(package private)  FormEditor.RowSpanSpinnerModel rowSpinnerModel
           
(package private)  boolean suspendConstraintControlUpdates
           
(package private)  DnDTable table
           
(package private)  FormEditor.GridTableModel tableModel
           
(package private)  javax.swing.JScrollPane tableScrollPane
           
(package private)  javax.swing.JToolBar toolbar
           
(package private)  java.awt.Component topComponent
           
(package private)  javax.swing.JSpinner topInsetSpinner
           
(package private)  javax.swing.SpinnerNumberModel topInsetSpinnerModel
           
(package private)  javax.swing.JComboBox verticalAlignmentCombo
           
(package private)  javax.swing.JLabel verticalAlignmentLabel
           
(package private)  java.lang.String[] verticalAlignmentList
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
FormEditor(MultiContainerFrame layoutFrame, ContainerLayout layout, java.awt.Container container)
           
 
Method Summary
 boolean editComponent(ComponentDef componentDef, java.awt.Component component, CellConstraints cellConstraints)
           
(package private)  CellConstraints getComponentConstraints(java.awt.Component component)
           
(package private)  java.lang.String getComponentName(java.awt.Component control)
           
private  void insertColumn(int column)
           
private  void insertRow(int rowIndex)
           
 boolean isNewComponent(java.awt.Component component)
          Returns true if the named component was created by hand in this session
(package private)  void setContainer(java.awt.Container container)
           
 void setFormComponent(java.awt.Component component)
           
private  void setSelectedCell(int columnIndex, int rowIndex, boolean forceVisible)
           
private  void setupListeners()
           
private  void specsChanged()
           
 java.lang.String uniqueName(java.lang.String name, java.awt.Component comp)
           
 void updateLayout(java.awt.Component component)
           
(package private)  void updateLayouts()
           
 void updateList()
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

verticalAlignmentList

java.lang.String[] verticalAlignmentList

horizontalAlignmentList

java.lang.String[] horizontalAlignmentList

colSpinnerModel

FormEditor.ColSpanSpinnerModel colSpinnerModel

rowSpinnerModel

FormEditor.RowSpanSpinnerModel rowSpinnerModel

newComponentAction

javax.swing.Action newComponentAction

removeComponentAction

javax.swing.Action removeComponentAction

insertRowBeforeAction

javax.swing.Action insertRowBeforeAction

insertRowAfterAction

javax.swing.Action insertRowAfterAction

deleteRowAction

javax.swing.Action deleteRowAction

insertColumnBeforeAction

javax.swing.Action insertColumnBeforeAction

insertColumnAfterAction

javax.swing.Action insertColumnAfterAction

deleteColumnAction

javax.swing.Action deleteColumnAction

verticalAlignmentCombo

javax.swing.JComboBox verticalAlignmentCombo

horizontalAlignmentCombo

javax.swing.JComboBox horizontalAlignmentCombo

rowSpanSpinner

javax.swing.JSpinner rowSpanSpinner

columnSpanSpinner

javax.swing.JSpinner columnSpanSpinner

columnSpanLabel

javax.swing.JLabel columnSpanLabel

horizontalAlignmentLabel

javax.swing.JLabel horizontalAlignmentLabel

rowSpanLabel

javax.swing.JLabel rowSpanLabel

verticalAlignmentLabel

javax.swing.JLabel verticalAlignmentLabel

contentPanel

javax.swing.JPanel contentPanel

insetsPanel

javax.swing.JPanel insetsPanel

rightInsetSpinnerModel

javax.swing.SpinnerNumberModel rightInsetSpinnerModel

topInsetSpinnerModel

javax.swing.SpinnerNumberModel topInsetSpinnerModel

bottomInsetSpinnerModel

javax.swing.SpinnerNumberModel bottomInsetSpinnerModel

leftInsetSpinnerModel

javax.swing.SpinnerNumberModel leftInsetSpinnerModel

rightInsetSpinner

javax.swing.JSpinner rightInsetSpinner

bottomInsetSpinner

javax.swing.JSpinner bottomInsetSpinner

leftInsetSpinner

javax.swing.JSpinner leftInsetSpinner

topInsetSpinner

javax.swing.JSpinner topInsetSpinner

tableModel

FormEditor.GridTableModel tableModel

insetsLabel

javax.swing.JLabel insetsLabel

componentsLabel

javax.swing.JLabel componentsLabel

componentPaletteLabel

javax.swing.JLabel componentPaletteLabel

componentPaletteListModel

FormEditor.ComponentPaletteListModel componentPaletteListModel

componentPalette

DndList componentPalette

componentPaletteScrollPane

javax.swing.JScrollPane componentPaletteScrollPane

componentSelectionListModel

FormEditor.ComponentSelectionListModel componentSelectionListModel

componentList

DndList componentList

componentListScrollPane

javax.swing.JScrollPane componentListScrollPane

componentListCellRenderer

FormEditor.ComponentListCellRenderer componentListCellRenderer

constraintsSeparator

java.awt.Component constraintsSeparator

positionsSeparator

java.awt.Component positionsSeparator

componentsPanel

javax.swing.JPanel componentsPanel

propertiesPanel

javax.swing.JPanel propertiesPanel

componentsSplitPane

javax.swing.JSplitPane componentsSplitPane

colSpecField

javax.swing.JTextField colSpecField

rowSpecField

javax.swing.JTextField rowSpecField

newComponents

java.util.Set<java.awt.Component> newComponents

layoutConstraintsManager

LayoutConstraintsManager layoutConstraintsManager

toolbar

javax.swing.JToolBar toolbar

newComponentButton

javax.swing.JButton newComponentButton

removeComponentButton

javax.swing.JButton removeComponentButton

columnDeleteButton

javax.swing.JButton columnDeleteButton

columnInsertAfterButton

javax.swing.JButton columnInsertAfterButton

columnInsertBeforeButton

javax.swing.JButton columnInsertBeforeButton

rowDeleteButton

javax.swing.JButton rowDeleteButton

rowInsertBeforeButton

javax.swing.JButton rowInsertBeforeButton

rowInsertAfterButton

javax.swing.JButton rowInsertAfterButton

container

java.awt.Container container

containerLayout

ContainerLayout containerLayout

layoutFrame

MultiContainerFrame layoutFrame

table

DnDTable table

tableScrollPane

javax.swing.JScrollPane tableScrollPane

constraintsSplitPane

javax.swing.JSplitPane constraintsSplitPane

topComponent

java.awt.Component topComponent

suspendConstraintControlUpdates

boolean suspendConstraintControlUpdates

formComponent

java.awt.Component formComponent
Constructor Detail

FormEditor

public FormEditor(MultiContainerFrame layoutFrame,
                  ContainerLayout layout,
                  java.awt.Container container)
Method Detail

setContainer

void setContainer(java.awt.Container container)

setupListeners

private void setupListeners()

getComponentName

java.lang.String getComponentName(java.awt.Component control)

getComponentConstraints

CellConstraints getComponentConstraints(java.awt.Component component)

specsChanged

private void specsChanged()

updateLayouts

void updateLayouts()

setSelectedCell

private void setSelectedCell(int columnIndex,
                             int rowIndex,
                             boolean forceVisible)

insertColumn

private void insertColumn(int column)

insertRow

private void insertRow(int rowIndex)

setFormComponent

public void setFormComponent(java.awt.Component component)

updateLayout

public void updateLayout(java.awt.Component component)

isNewComponent

public boolean isNewComponent(java.awt.Component component)
Returns true if the named component was created by hand in this session


updateList

public void updateList()

uniqueName

public java.lang.String uniqueName(java.lang.String name,
                                   java.awt.Component comp)

editComponent

public boolean editComponent(ComponentDef componentDef,
                             java.awt.Component component,
                             CellConstraints cellConstraints)