lib
Class JEditorWindow

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JInternalFrame
                  extended by lib.JEditorWindow
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class JEditorWindow
extends javax.swing.JInternalFrame

The JEditorWindow is where we edit files.

Version:
1.0
Author:
CobaltSoftware (abode.devteam@cobaltsoftware.net)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JInternalFrame
javax.swing.JInternalFrame.AccessibleJInternalFrame, javax.swing.JInternalFrame.JDesktopIcon
 
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
private  javax.swing.JScrollPane actionPatternScrollPane
           
private  javax.swing.JButton bttnExport
           
private  javax.swing.JButton bttnListPrims
           
private  javax.swing.JButton bttnPrint
           
private  javax.swing.JButton bttnValidate
           
private  javax.swing.JButton bttnZoomIn
           
private  javax.swing.JButton bttnZoomOut
           
private  javax.swing.JPanel buttonPanel
           
private  javax.swing.JScrollPane commentsPane
           
private  javax.swing.JScrollPane competencesScrollPane
           
private  javax.swing.JTextArea countArea
           
private  JDiagram diagramActionPatterns
           
private  JDiagram diagramCompetences
           
private  JDiagram diagramDriveCollections
           
private  JDiagram diagramOverview
           
private  javax.swing.JScrollPane driveScrollPane
           
private static int errorCount
           
private static int iNewFiles
           
private  javax.swing.JTabbedPane internalTabs
           
private  javax.swing.JCheckBox jCheckBox1
           
private  javax.swing.JLabel jLabel1
           
private  javax.swing.JLabel jLabel2
           
private  javax.swing.JLabel jLabel3
           
private  javax.swing.JMenu jMenu1
           
private  javax.swing.JMenuBar jMenuBar1
           
private  javax.swing.JPanel jPanel1
           
private  javax.swing.JPanel jPanel2
           
private  javax.swing.JPanel jPanel3
           
private  javax.swing.JToolBar jToolBar1
           
private  LearnableActionPattern lapCurrent
           
private  JDiagram logicDiagram
           
private  javax.swing.JScrollPane logicPane
           
private  JAbode mainFrame
           
private  javax.swing.JEditorPane output
           
private  java.lang.String outputBuffer
           
private  javax.swing.JScrollPane outputScroll
           
private  javax.swing.JScrollPane overviewPane
           
private  java.util.ArrayList primitiveActions
           
private  java.util.ArrayList primitiveSenses
           
private  JDiagram printDiagram
           
private  javax.swing.JScrollPane printScrollPane
           
static long serialVersionUID
           
private  javax.swing.JTextArea sourceArea
           
private  javax.swing.JPanel sourcePanel
           
private  javax.swing.JScrollPane sourceScrollPane
           
private  java.lang.String strFileName
           
private  javax.swing.JTextField txtAuthor
           
private  javax.swing.JTextPane txtMemo
           
private  javax.swing.JTextField txtTitle
           
 
Fields inherited from class javax.swing.JInternalFrame
closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY
 
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 javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JEditorWindow(JAbode main, java.lang.String fileName, LearnableActionPattern pattern)
          Creates new form guiInternal
 
Method Summary
private  void actionPatternScrollPaneComponentShown(java.awt.event.ComponentEvent evt)
           
private  void addDiagrams()
          Simple thunk for populating the diagram panels and tracking the instances as local class variables.
 void addError()
          Keep track when an error occurs
 void addOutputBuffer(java.lang.String text)
          Add some text to the console output
private  void bttnExportActionPerformed(java.awt.event.ActionEvent evt)
           
private  void bttnListPrimsActionPerformed(java.awt.event.ActionEvent evt)
           
private  void bttnPrintActionPerformed(java.awt.event.ActionEvent evt)
           
private  void bttnValidateActionPerformed(java.awt.event.ActionEvent evt)
           
private  void bttnZoomInActionPerformed(java.awt.event.ActionEvent evt)
           
private  void bttnZoomOutActionPerformed(java.awt.event.ActionEvent evt)
           
 void clearOutputBuffer()
          Clear the console output buffer
private  void commentsPaneComponentHidden(java.awt.event.ComponentEvent evt)
           
private  void commentsPaneComponentShown(java.awt.event.ComponentEvent evt)
           
private  void competencesScrollPaneComponentShown(java.awt.event.ComponentEvent evt)
           
 void countLines()
          Update the line counter on the left of the source pane by adding numbers for each line along with a line feed.
private  void driveScrollPaneComponentShown(java.awt.event.ComponentEvent evt)
           
 java.lang.String fileName()
          Get the name of the file we're saved as.
private  void formInternalFrameActivated(javax.swing.event.InternalFrameEvent evt)
           
private  void formInternalFrameClosed(javax.swing.event.InternalFrameEvent evt)
           
 LearnableActionPattern getLearnableActionPattern()
          Get the LAP object for this frame
 JAbode getMainFrame()
          Get the instance of the frame that hosts us
 javax.swing.JEditorPane getOutput()
           
 java.lang.String getOutputBuffer()
          Get the current contents of the console output buffer
private  void initComponents()
          This method is called from within the constructor to initialize the form.
private  void logicPaneComponentShown(java.awt.event.ComponentEvent evt)
           
private  void overviewPaneComponentShown(java.awt.event.ComponentEvent evt)
           
private  void printScrollPaneComponentShown(java.awt.event.ComponentEvent evt)
           
 void resetDiagrams()
           
 void saveAs()
          Save a file.
 void saveFile()
          Save the file
private  void sourceScrollPaneComponentHidden(java.awt.event.ComponentEvent evt)
           
private  void sourceScrollPaneComponentShown(java.awt.event.ComponentEvent evt)
           
private  void txtAuthorActionPerformed(java.awt.event.ActionEvent evt)
           
private  void txtMemoKeyTyped(java.awt.event.KeyEvent evt)
           
private  void txtTitleActionPerformed(java.awt.event.ActionEvent evt)
           
 void updateDiagrams(JDiagram focusedDiagram, IEditableElement showItem)
          Re-render all of the diagrams and make sure the current diagram and the selected object are focused once more.
 
Methods inherited from class javax.swing.JInternalFrame
addImpl, addInternalFrameListener, createRootPane, dispose, doDefaultCloseAction, fireInternalFrameEvent, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFocusCycleRootAncestor, getFocusOwner, getFrameIcon, getGlassPane, getInternalFrameListeners, getJMenuBar, getLayer, getLayeredPane, getMenuBar, getMostRecentFocusOwner, getNormalBounds, getRootPane, getTitle, getUI, getUIClassID, getWarningString, hide, isClosable, isClosed, isFocusCycleRoot, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isRootPaneCheckingEnabled, isSelected, moveToBack, moveToFront, pack, paintComponent, paramString, remove, removeInternalFrameListener, reshape, restoreSubcomponentFocus, setClosable, setClosed, setContentPane, setDefaultCloseOperation, setDesktopIcon, setFocusCycleRoot, setFrameIcon, setGlassPane, setIcon, setIconifiable, setJMenuBar, setLayer, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setNormalBounds, setResizable, setRootPane, setRootPaneCheckingEnabled, setSelected, setTitle, setUI, show, toBack, toFront, 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, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, 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, 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, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

errorCount

private static int errorCount

iNewFiles

private static int iNewFiles

lapCurrent

private LearnableActionPattern lapCurrent

strFileName

private java.lang.String strFileName

outputScroll

private javax.swing.JScrollPane outputScroll

output

private javax.swing.JEditorPane output

outputBuffer

private java.lang.String outputBuffer

diagramOverview

private JDiagram diagramOverview

diagramActionPatterns

private JDiagram diagramActionPatterns

diagramCompetences

private JDiagram diagramCompetences

diagramDriveCollections

private JDiagram diagramDriveCollections

printDiagram

private JDiagram printDiagram

logicDiagram

private JDiagram logicDiagram

primitiveSenses

private java.util.ArrayList primitiveSenses

primitiveActions

private java.util.ArrayList primitiveActions

mainFrame

private JAbode mainFrame

actionPatternScrollPane

private javax.swing.JScrollPane actionPatternScrollPane

bttnExport

private javax.swing.JButton bttnExport

bttnListPrims

private javax.swing.JButton bttnListPrims

bttnPrint

private javax.swing.JButton bttnPrint

bttnValidate

private javax.swing.JButton bttnValidate

bttnZoomIn

private javax.swing.JButton bttnZoomIn

bttnZoomOut

private javax.swing.JButton bttnZoomOut

buttonPanel

private javax.swing.JPanel buttonPanel

commentsPane

private javax.swing.JScrollPane commentsPane

competencesScrollPane

private javax.swing.JScrollPane competencesScrollPane

countArea

private javax.swing.JTextArea countArea

driveScrollPane

private javax.swing.JScrollPane driveScrollPane

internalTabs

private javax.swing.JTabbedPane internalTabs

jCheckBox1

private javax.swing.JCheckBox jCheckBox1

jLabel1

private javax.swing.JLabel jLabel1

jLabel2

private javax.swing.JLabel jLabel2

jLabel3

private javax.swing.JLabel jLabel3

jMenu1

private javax.swing.JMenu jMenu1

jMenuBar1

private javax.swing.JMenuBar jMenuBar1

jPanel1

private javax.swing.JPanel jPanel1

jPanel2

private javax.swing.JPanel jPanel2

jPanel3

private javax.swing.JPanel jPanel3

jToolBar1

private javax.swing.JToolBar jToolBar1

logicPane

private javax.swing.JScrollPane logicPane

overviewPane

private javax.swing.JScrollPane overviewPane

printScrollPane

private javax.swing.JScrollPane printScrollPane

sourceArea

private javax.swing.JTextArea sourceArea

sourcePanel

private javax.swing.JPanel sourcePanel

sourceScrollPane

private javax.swing.JScrollPane sourceScrollPane

txtAuthor

private javax.swing.JTextField txtAuthor

txtMemo

private javax.swing.JTextPane txtMemo

txtTitle

private javax.swing.JTextField txtTitle
Constructor Detail

JEditorWindow

public JEditorWindow(JAbode main,
                     java.lang.String fileName,
                     LearnableActionPattern pattern)
Creates new form guiInternal

Method Detail

saveFile

public void saveFile()
Save the file


fileName

public java.lang.String fileName()
Get the name of the file we're saved as.


saveAs

public void saveAs()
Save a file. This code isnt modular, and really should be in order to support new I/O formats for LAP files.


getMainFrame

public JAbode getMainFrame()
Get the instance of the frame that hosts us

Returns:
Outer frame housing this editor window

getLearnableActionPattern

public LearnableActionPattern getLearnableActionPattern()
Get the LAP object for this frame

Returns:
Current object model

addOutputBuffer

public void addOutputBuffer(java.lang.String text)
Add some text to the console output

Parameters:
text - Text to add

getOutputBuffer

public java.lang.String getOutputBuffer()
Get the current contents of the console output buffer

Returns:
Console output buffer contents

clearOutputBuffer

public void clearOutputBuffer()
Clear the console output buffer


addDiagrams

private void addDiagrams()
Simple thunk for populating the diagram panels and tracking the instances as local class variables.


countLines

public void countLines()
Update the line counter on the left of the source pane by adding numbers for each line along with a line feed. Updates on every keypress, but appears to be fast enough.


getOutput

public javax.swing.JEditorPane getOutput()

initComponents

private void initComponents()
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.


bttnListPrimsActionPerformed

private void bttnListPrimsActionPerformed(java.awt.event.ActionEvent evt)

logicPaneComponentShown

private void logicPaneComponentShown(java.awt.event.ComponentEvent evt)

commentsPaneComponentShown

private void commentsPaneComponentShown(java.awt.event.ComponentEvent evt)

commentsPaneComponentHidden

private void commentsPaneComponentHidden(java.awt.event.ComponentEvent evt)

sourceScrollPaneComponentHidden

private void sourceScrollPaneComponentHidden(java.awt.event.ComponentEvent evt)

sourceScrollPaneComponentShown

private void sourceScrollPaneComponentShown(java.awt.event.ComponentEvent evt)

bttnExportActionPerformed

private void bttnExportActionPerformed(java.awt.event.ActionEvent evt)

overviewPaneComponentShown

private void overviewPaneComponentShown(java.awt.event.ComponentEvent evt)

actionPatternScrollPaneComponentShown

private void actionPatternScrollPaneComponentShown(java.awt.event.ComponentEvent evt)

competencesScrollPaneComponentShown

private void competencesScrollPaneComponentShown(java.awt.event.ComponentEvent evt)

driveScrollPaneComponentShown

private void driveScrollPaneComponentShown(java.awt.event.ComponentEvent evt)

printScrollPaneComponentShown

private void printScrollPaneComponentShown(java.awt.event.ComponentEvent evt)

formInternalFrameActivated

private void formInternalFrameActivated(javax.swing.event.InternalFrameEvent evt)

formInternalFrameClosed

private void formInternalFrameClosed(javax.swing.event.InternalFrameEvent evt)

bttnValidateActionPerformed

private void bttnValidateActionPerformed(java.awt.event.ActionEvent evt)

addError

public void addError()
Keep track when an error occurs


bttnPrintActionPerformed

private void bttnPrintActionPerformed(java.awt.event.ActionEvent evt)

txtMemoKeyTyped

private void txtMemoKeyTyped(java.awt.event.KeyEvent evt)

txtAuthorActionPerformed

private void txtAuthorActionPerformed(java.awt.event.ActionEvent evt)

txtTitleActionPerformed

private void txtTitleActionPerformed(java.awt.event.ActionEvent evt)

bttnZoomOutActionPerformed

private void bttnZoomOutActionPerformed(java.awt.event.ActionEvent evt)

bttnZoomInActionPerformed

private void bttnZoomInActionPerformed(java.awt.event.ActionEvent evt)

resetDiagrams

public void resetDiagrams()

updateDiagrams

public void updateDiagrams(JDiagram focusedDiagram,
                           IEditableElement showItem)
Re-render all of the diagrams and make sure the current diagram and the selected object are focused once more.