Class GUIFramework

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 GUIFramework
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class GUIFramework
extends javax.swing.JFrame

Contains the GUI component for the application

Constructs the visual GUI for the user to interact with.

The Boolean variable "VERBOSE_DEBUG" displays debugging information for this class. Set value to "true" to display messages.


version 0.3 - Initial Release


v0.4 - UPDATE:
Modified the"Save File" method, updating so the file is saved to the correct directory, rather than simply relative to the program. Corresponding alterations made to DataRecordOperations Class's "writeFile" method.

v0.5 - UPDATE:
Modified the "Generate File" code to include only *basic* error checking. AI Builder still doesn't handle input sanitization - maybe in a future release... ;)

v0.6 - UPDATE:
Implemented feedback suggestions of retaining text-area input values, rather than clearing them (a pain if you accidentally de-select a "Use?" checkbox. Don't really know why I made the decision to do that the first time around...).

Made some typing error adjustments.

Added a static method to allow update versioning easier to manage and maintain.

Still no input sanitization - then again, I've made no promises as to this feature being included...

Version:
0.6 - Added in static method for versioning information and implemented Darth Slaw's suggestions for not deleting input values when you de-select the "Use?" checkbox.
Author:
Richard John Sproston [ richard.sproston@gmail.com || lucky_jackpot@hotmail.com ]
See Also:
Serialized Form

Nested Class Summary
protected  class GUIFramework.ButtonProcessor
          This Inner-Class handles all button-click processes.
protected  class GUIFramework.CheckBoxListener
          Ever wonder what happens when you click on a checkbox - well it's all contained here...
 
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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
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
GUIFramework()
          Default Constructor For Class with no parameters.
 
Method Summary
 javax.swing.JPanel buildCodeWindowAndOperations()
          This builds the "right-hand-side" components of AI Builder, including the code window and accompanying buttons and their various operations.
 javax.swing.JPanel buildCoreInterface()
          This is the central "builder" part of the program (that branches off to build other parts) but every other "build_[part]" method stems from this root method (such as "buildCodeWindowAndOperations and "buildTabsInterface" methods).
 javax.swing.JPanel buildTabsInterface()
          This monster method builds the tabbed interface with all their accompanying components, such as scrollbars, checkboxes and the actual tabs themselves.
 javax.swing.JPanel getBottomPanel()
          Build the bottom panel and set various applicable attributes.
 void setAlignment(java.lang.String alignment)
          Sets the alignment of the AI for participation in-game.
 void setDifficultyFileNameExtension(java.lang.String difficultyFileNameExtension)
          Sets the difficulty (and appropriate filename extension) for the AI file's character.
 void setFileName(java.lang.String fileName)
          Sets the intended name of the AI file (ready for saving + displaying in preview window).
 void setGameType(java.lang.String gameType)
          Sets the game-type for the intended AI file.
 void setMiscTraits(java.lang.String miscTraits)
          Sets the miscellaneous traits of the AI character (those that comprise the "AI setup line").
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, 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, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, 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, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, 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, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Constructor Detail

GUIFramework

public GUIFramework()
Default Constructor For Class with no parameters.

Method Detail

setGameType

public void setGameType(java.lang.String gameType)
Sets the game-type for the intended AI file.

Parameters:
gameType - The game-type for the AI (either JK or MotS).

setAlignment

public void setAlignment(java.lang.String alignment)
Sets the alignment of the AI for participation in-game.

Parameters:
alignment - The alignment to use for the AI character.

setDifficultyFileNameExtension

public void setDifficultyFileNameExtension(java.lang.String difficultyFileNameExtension)
Sets the difficulty (and appropriate filename extension) for the AI file's character.

Parameters:
difficultyFileNameExtension - The difficulty level (and therefore the appropriate extension as well).

setMiscTraits

public void setMiscTraits(java.lang.String miscTraits)
Sets the miscellaneous traits of the AI character (those that comprise the "AI setup line").

Parameters:
miscTraits - The (mandatory) String of miscellanous AI traits that form the AI Setup line.

setFileName

public void setFileName(java.lang.String fileName)
Sets the intended name of the AI file (ready for saving + displaying in preview window).

Parameters:
fileName - The name of the intended AI file.

getBottomPanel

public javax.swing.JPanel getBottomPanel()
Build the bottom panel and set various applicable attributes. This includes the status bar and the "expanded info" sections of the program.

Returns:
The bottom panel for the AI Builder program.

buildCoreInterface

public javax.swing.JPanel buildCoreInterface()
This is the central "builder" part of the program (that branches off to build other parts) but every other "build_[part]" method stems from this root method (such as "buildCodeWindowAndOperations and "buildTabsInterface" methods).

Returns:
The core interface JPanel for display.

buildCodeWindowAndOperations

public javax.swing.JPanel buildCodeWindowAndOperations()
This builds the "right-hand-side" components of AI Builder, including the code window and accompanying buttons and their various operations.

Returns:
The code panel, including buttons (and the different action results of clicking on them).

buildTabsInterface

public javax.swing.JPanel buildTabsInterface()
This monster method builds the tabbed interface with all their accompanying components, such as scrollbars, checkboxes and the actual tabs themselves. Also sets up checkbox listeners to register actions and respond accordingly.

Returns:
The tabbed panel visual components for display on-screen.