org.game.Juzzle
Class StartDialog

java.lang.Object
  |
  +--org.game.Juzzle.StartDialog

public class StartDialog
extends java.lang.Object

StartDialog shows a select dialog for the image choose. It is called for every game start.

See Also:
JuzzlePanel

Inner Class Summary
protected  class StartDialog.ImageListRenderer
          this class renders the image with text line in the selection dialog
 
Field Summary
protected  java.util.Vector imagesList
          array with ImageDescription's, from JuzzleImages
protected  javax.swing.JList list
          the list with images
protected  javax.swing.JPanel panel
          the panel that contains the list and the divide text fields
protected  javax.swing.JTextField x_div
          value field for x division
protected  javax.swing.JTextField y_div
          value field for y division
 
Constructor Summary
StartDialog()
          creates the panel only, but don't show it.
 
Method Summary
 void addToImageList(ImageDescription id)
          add new images to list
 java.awt.Dimension getSelectedDivision()
          after the dialog is closed return deivision of the image, it is always x > 1 and y > 1
 ImageDescription getSelectedImage()
          after the dialog is closed return the selected image
 boolean showDialog(java.awt.Component parent)
          create a modal dialog and show the panel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

panel

protected javax.swing.JPanel panel
the panel that contains the list and the divide text fields

list

protected javax.swing.JList list
the list with images

x_div

protected javax.swing.JTextField x_div
value field for x division

y_div

protected javax.swing.JTextField y_div
value field for y division

imagesList

protected java.util.Vector imagesList
array with ImageDescription's, from JuzzleImages
See Also:
ImageDescription, JuzzleImages
Constructor Detail

StartDialog

public StartDialog()
creates the panel only, but don't show it.
Method Detail

addToImageList

public void addToImageList(ImageDescription id)
add new images to list
Parameters:
id - image to add
See Also:
ImageDescription

showDialog

public boolean showDialog(java.awt.Component parent)
create a modal dialog and show the panel
Parameters:
parent - the parent Component of this dialog
Returns:
true if user select ok or false if cancel

getSelectedImage

public ImageDescription getSelectedImage()
after the dialog is closed return the selected image
Returns:
the selected image
See Also:
ImageDescription

getSelectedDivision

public java.awt.Dimension getSelectedDivision()
after the dialog is closed return deivision of the image, it is always x > 1 and y > 1
Returns:
the division of the selected image
See Also:
ImageDescription