|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
com.act365.awt.Container
com.act365.sudoku.GridContainer
The GridContainer class displays a Su Doku grid.
Field Summary |
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 | |
GridContainer(Grid grid)
Creates a new GridContainer instance. |
Method Summary | |
int |
evaluate()
Evaluates the complexity of the grid. |
java.awt.Dimension |
getBestSize()
A GridContainer should display each square as 40x40 pixels. |
int |
getBoxesAcross()
Returns number of boxes across one row of the Su Doku grid. |
int |
getBoxesDown()
Returns number of boxes down one column of the Su Doku grid. |
int |
getComplexity()
Returns the number of unwinds used to solve the grid as a measure of its complexity. |
int |
getHintValue()
Returns hint value in the range [1,cellsInRow]. |
int |
getHintX()
Returns hint x-coordinate in the range [1,cellsInRow]. |
int |
getHintY()
Returns hint y-coordinate in the range [1,cellsInRow]. |
double |
getSolveTime()
Returns the time (in milliseconds) taken to complete the most recent solve. |
IStrategy |
getStrategy()
Returns the currently selected stratey object. |
boolean |
hint()
Solves the grid and returns the first step of the solution. |
void |
paste(java.lang.String s)
Pastes data onto the grid. |
void |
reset()
Resets the grid. |
void |
setBoxes(int boxesAcross,
int boxesDown)
Resizes the grid. |
void |
setGrid(Grid grid)
Sets the underlying grid to be a clone of the given grid. |
void |
setStrategy(int strategyCode)
Sets the strategy to be used to solve the grid. |
void |
shuffle()
Shuffles the grid. |
void |
solve()
Solves the grid. |
void |
startComposer(int filledCells)
Composes a puzzle, with rotational symmetry and a unique solution, based upon the initial values in the grid. |
void |
stopComposer()
Interrupts any ComposerThread that might have been started by startComposer(). |
java.lang.String |
toString()
A GridContainer returns a string representation of the underlying grid. |
void |
unsolve()
Unsolves the grid (reverts its state to that prior to the most recent solve). |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public GridContainer(Grid grid)
Method Detail |
public java.awt.Dimension getBestSize()
public void solve()
public int evaluate()
public boolean hint()
public void unsolve()
public void reset()
public void shuffle()
public void setGrid(Grid grid)
grid
- new gridpublic void setBoxes(int boxesAcross, int boxesDown)
boxesAcross
- - number of boxes across one row of the Su Doku gridboxesDown
- - number of boxes down one column of the Su Doku gridpublic void paste(java.lang.String s)
s
- data to be pasted, which should be in the form created by Copypublic void startComposer(int filledCells)
filledCells
- - number of filled cells to appear in the puzzlepublic void stopComposer()
public int getBoxesAcross()
public int getBoxesDown()
public int getComplexity()
public double getSolveTime()
public int getHintX()
public int getHintY()
public int getHintValue()
public void setStrategy(int strategyCode)
strategyCode
- - strategy code as defined in Strategy classStrategy
public IStrategy getStrategy()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |