org.game.Juzzle
Class JuzzlePanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JLayeredPane
                          |
                          +--javax.swing.JDesktopPane
                                |
                                +--org.game.Juzzle.JuzzlePanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class JuzzlePanel
extends javax.swing.JDesktopPane

the main panel for Juzzle, it containt the ControlPanel and the PuzzlePanel

See Also:
ControlPanel, PuzzlePanel, Serialized Form

Inner Class Summary
 class JuzzlePanel.ImageFileFilter
          file filter for image loading.
 class JuzzlePanel.JuzzlePanelResizer
          needed to resize the puzzle panel scroller, because the layout for the JDesktopPane is null.
 class JuzzlePanel.MenuListener
          callback function for the menu items
 
Inner classes inherited from class javax.swing.JDesktopPane
javax.swing.JDesktopPane.AccessibleJDesktopPane
 
Inner classes inherited from class javax.swing.JLayeredPane
javax.swing.JLayeredPane.AccessibleJLayeredPane
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static java.lang.String ABOUT_TEXT
          text as HTML for the about dialog
protected  javax.swing.JInternalFrame controlFrame
          reference to the Frame of the ControlPanel
protected  ControlPanel controlPanel
          reference to the ControlPanel
protected  javax.swing.JFileChooser jfc
          reference to file chooser to load user images
protected  JuzzlePanel.MenuListener menuListener
          reference to the callback function for the menu
protected  PuzzlePanel pzp
          reference to the PuzzlePanel
protected  javax.swing.JScrollPane pzp_jsp
          reference to the ScrollPanel of the PuzzlePanel
protected  StartDialog startDialog
          reference to the StartDialog
protected static int userImage
          counter for the user images.
static java.lang.String version
          current verion of the program
 
Fields inherited from class javax.swing.JDesktopPane
LIVE_DRAG_MODE, OUTLINE_DRAG_MODE
 
Fields inherited from class javax.swing.JLayeredPane
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER
 
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
JuzzlePanel()
          simply constructor
 
Method Summary
protected  javax.swing.JMenuItem createMenuItem(java.lang.String name, java.lang.String icon)
          help function.
protected  javax.swing.JCheckBoxMenuItem createMenuItem2(java.lang.String name, boolean set)
          help function.
 void loadImageForGame()
          load the use image and add it to the StartDialog list
 void startGame()
          starts a new game and reset the system with new parameters
 
Methods inherited from class javax.swing.JDesktopPane
getAccessibleContext, getAllFrames, getAllFramesInLayer, getDesktopManager, getDragMode, getSelectedFrame, getUI, getUIClassID, isOpaque, paramString, setDesktopManager, setDragMode, setSelectedFrame, setUI, updateUI
 
Methods inherited from class javax.swing.JLayeredPane
addImpl, getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, putLayer, remove, setLayer, setLayer, setPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

version

public static final java.lang.String version
current verion of the program

ABOUT_TEXT

public static final java.lang.String ABOUT_TEXT
text as HTML for the about dialog

userImage

protected static int userImage
counter for the user images. Used for names of the images:

user image 1
user image 2
user image 3
...

pzp_jsp

protected javax.swing.JScrollPane pzp_jsp
reference to the ScrollPanel of the PuzzlePanel

pzp

protected PuzzlePanel pzp
reference to the PuzzlePanel

controlFrame

protected javax.swing.JInternalFrame controlFrame
reference to the Frame of the ControlPanel

controlPanel

protected ControlPanel controlPanel
reference to the ControlPanel

startDialog

protected StartDialog startDialog
reference to the StartDialog

menuListener

protected JuzzlePanel.MenuListener menuListener
reference to the callback function for the menu

jfc

protected javax.swing.JFileChooser jfc
reference to file chooser to load user images
Constructor Detail

JuzzlePanel

public JuzzlePanel()
simply constructor
Method Detail

createMenuItem

protected javax.swing.JMenuItem createMenuItem(java.lang.String name,
                                               java.lang.String icon)
help function. Creates a menu item and adds the callback function to it.
Parameters:
name - label for menu item
icon - icon for menu item
Returns:
the menu item

createMenuItem2

protected javax.swing.JCheckBoxMenuItem createMenuItem2(java.lang.String name,
                                                        boolean set)
help function. Creates a checked menu item and adds the callback function to it.
Parameters:
name - label for menu item
set - checked or not
Returns:
the checked menu item

loadImageForGame

public void loadImageForGame()
load the use image and add it to the StartDialog list

startGame

public void startGame()
starts a new game and reset the system with new parameters