public class EditorGraphicsWorld2D extends JPanel implements MouseListener, MouseMotionListener
Tato trida definuje plochu (panel) pro vytvareni grafickych objektu herniho sveta.
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
EditorGraphicsWorld2D()
Konstruktor - Nastavi barvu pozadi,
registruje posluchace mysi,
vytvori texturu pro zobrazovane objekty.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getConnectRoom()
Oznamuje, zda-li se budou propojovat mistnosti.
|
boolean |
getDisconnectRoom()
Oznamuje, zda-li se budou rozpojovat mistnosti.
|
int |
getNewAreaX()
Vrati velikost plochy ve smeru X, o kterou se ma zvetsit kreslici plocha.
|
int |
getNewAreaY()
Vrati velikost plochy ve smeru X, o kterou se ma zvetsit kreslici plocha.
|
boolean |
getRemoveRoom()
Oznamuje, zda-li se bude mazat mistnost.
|
int |
getScrollbarGrowingAreaX()
Vraci hodnotu oblasti, ktera pomaha zjistit, zda-li je treba zvetsit kreslici oblast.
|
int |
getScrollbarGrowingAreaY()
Vraci hodnotu oblasti, ktera pomaha zjistit, zda-li je treba zvetsit kreslici oblast.
|
boolean |
getSelectedObject()
Oznamuje, zda-li je nejaky objekt vybran nebo ne.
|
void |
mouseClicked(MouseEvent e)
Tato metoda je vyzadovana diky rozhrani MouseMotionListener.
|
void |
mouseDragged(MouseEvent e)
Spojita udalost mysi - Zachytava pohyb mysi behem stisknuteho tlacitka.
|
void |
mouseEntered(MouseEvent e)
Tato metoda je vyzadovana diky rozhrani MouseMotionListener.
|
void |
mouseExited(MouseEvent e)
Tato metoda je vyzadovana diky rozhrani MouseMotionListener.
|
void |
mouseMoved(MouseEvent e)
Tato metoda je vyzadovana diky rozhrani MouseListener.
|
void |
mousePressed(MouseEvent e)
Jednorazova udalost mysi - Stisknuti tlacitka mysi.
|
void |
mouseReleased(MouseEvent e)
Jednorazova udalost mysi - Uvolneni tlacitka mysi.
|
void |
paintComponent(Graphics g)
Vykreslovani grafickeh obsahu.
|
void |
setConnectRoom(boolean b)
Oznamuje, zda se budou propojovat mistnosti.
|
void |
setDisconnectRoom(boolean b)
Oznamuje, zda se budou rozpojovat mistnosti.
|
void |
setRemoveRoom(boolean b)
Oznamuje, zda-li se bude mazat mistnost.
|
void |
update(Graphics g)
Vlastni vykreslovani grafickeho obsahu.
|
void |
updateLocation(GameEntity ge,
MouseEvent e)
Aktualizace umisteni daneho grafickeho objektu, se kterym bylo pohybovano.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public EditorGraphicsWorld2D()
public final boolean getSelectedObject()
public final boolean getConnectRoom()
public final boolean getDisconnectRoom()
public final int getNewAreaX()
public final int getNewAreaY()
public final boolean getRemoveRoom()
public final int getScrollbarGrowingAreaX()
public final int getScrollbarGrowingAreaY()
public final void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
e
- MouseEventpublic final void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
e
- MouseEventpublic final void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
e
- MouseEventpublic final void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
e
- MouseEventpublic final void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
e
- MouseEventpublic final void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
e
- MouseEventpublic final void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
e
- MouseEventpublic final void setConnectRoom(boolean b)
b
- boolean : True - Budou s propojovat mistnosti.
False - Nic se propojovat nebude.public final void setDisconnectRoom(boolean b)
b
- boolean : True - Budou s rozpojovat mistnosti.
False - Nic se rozpojovat nebude.public final void setRemoveRoom(boolean b)
b
- boolean : True - Bude se mazat mistnost,
False - Nic se mazat nebude.public final void updateLocation(GameEntity ge, MouseEvent e)
ge
- GameEntity : Herni objekt, ktery budeme aktualizovat.e
- MouseEventpublic final void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- Graphicspublic final void update(Graphics g)
update
in class JComponent
g
- GraphicsCopyright © 2008–2014. All rights reserved.