|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--org.game.Juzzle.PuzzlePanel
this panel paints the pieces of the puzzle
PuzzlePanel,
PuzzlePartList, Serialized Form| Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| 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 | |
protected boolean |
antialiasing
antialiasing on/off |
protected java.awt.image.BufferedImage |
bimage
reference to the image |
protected ControlPanel |
controlPanel
reference to the ControlPanel to set sthe solved pieces count |
protected static java.awt.Cursor |
CURSOR_DEFAULT
cursor normal |
protected static java.awt.Cursor |
CURSOR_HAND
cursor while dragging |
protected boolean |
dragModus1
drag modus 1 mean that the user clicks the mouse button and then move the piece and clicks again to release. drag modus 2 mean that the user press the mouse button and then drag the piece and release the button. |
protected boolean |
dragModus2
drag modus 1 mean that the user clicks the mouse button and then move the piece and clicks again to release. drag modus 2 mean that the user press the mouse button and then drag the piece and release the button. |
protected boolean |
endMessagePrinted
needed to show only one time per game the win message |
protected java.awt.Point |
lastDragLocation
last drag location for difference calculation |
protected boolean |
outline
outline on/off |
protected static java.awt.Color |
outlineColor
outline color |
protected static int |
PAINT_EXTEND
thicknes of the outline for the piece for repaint rect |
protected static int |
PAINT_SHADOW
thicknes of the shadow while dragging and for repaint rect |
protected IPuzzlePartList |
puzzlePartList
reference to the pieces list model |
protected java.awt.Rectangle |
repaintRect1
source rect to repaint |
protected java.awt.Rectangle |
repaintRect2
target rect to repaint |
protected boolean |
shadow
shadow on/off |
protected static java.awt.Color |
shadowColor
shadow color |
protected int |
x_parts
x division |
protected int |
y_parts
y division |
| 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 | |
PuzzlePanel(ControlPanel controlPanel)
simply constructor |
|
| Method Summary | |
void |
emptyGame()
clear all variables |
void |
mouseClicked(java.awt.event.MouseEvent e)
from MouseListener |
void |
mouseDragged(java.awt.event.MouseEvent e)
from MouseMotionListener |
void |
mouseEntered(java.awt.event.MouseEvent e)
from MouseListener, not used |
void |
mouseExited(java.awt.event.MouseEvent e)
from MouseListener, not used |
void |
mouseMoved(java.awt.event.MouseEvent e)
from MouseMotionListener |
void |
mousePressed(java.awt.event.MouseEvent e)
from MouseListener |
void |
mouseReleased(java.awt.event.MouseEvent e)
from MouseListener |
void |
paintComponent(java.awt.Graphics g)
overwrite paintComponent to paint the pieces |
void |
resetGame()
reset the current game |
void |
setAntialiasing(boolean b)
set antialiasing on/off |
void |
setGame(java.awt.image.BufferedImage bimage,
int x_parts,
int y_parts)
set the new parameters to play the game |
void |
setOutline(boolean b)
set outline on/off |
void |
setShadow(boolean b)
set shadow on/off |
protected void |
startDragging(java.awt.event.MouseEvent e)
if the user clicks one of the parts, start dragging |
protected void |
stopDragging(java.awt.event.MouseEvent e)
the user put the piece on the desctop back |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUIClassID, paramString, updateUI |
| 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, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, addImpl, 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, 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 |
protected static final int PAINT_EXTEND
protected static final int PAINT_SHADOW
protected static final java.awt.Cursor CURSOR_HAND
protected static final java.awt.Cursor CURSOR_DEFAULT
protected static final java.awt.Color outlineColor
protected static final java.awt.Color shadowColor
protected java.awt.image.BufferedImage bimage
protected int x_parts
protected int y_parts
protected ControlPanel controlPanel
ControlPanelprotected boolean dragModus1
protected boolean dragModus2
protected java.awt.Point lastDragLocation
protected java.awt.Rectangle repaintRect1
protected java.awt.Rectangle repaintRect2
protected boolean endMessagePrinted
protected IPuzzlePartList puzzlePartList
IPuzzlePartListprotected boolean antialiasing
protected boolean outline
protected boolean shadow
| Constructor Detail |
public PuzzlePanel(ControlPanel controlPanel)
controlPanel - the reference to the ControlPanel| Method Detail |
public void resetGame()
public void emptyGame()
public void setGame(java.awt.image.BufferedImage bimage,
int x_parts,
int y_parts)
public void setAntialiasing(boolean b)
public void setOutline(boolean b)
public void setShadow(boolean b)
public void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponentprotected void startDragging(java.awt.event.MouseEvent e)
protected void stopDragging(java.awt.event.MouseEvent e)
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||