|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
cz.cuni.jagrlib.gui.ModuleGUI
public abstract class ModuleGUI
Abstract class that cares about visual representation of a module.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
ACTION_MODULE_MOVE
|
static int |
ACTION_MODULE_RESIZE
|
protected InfoPlug |
actualPlug
Actual plug. |
protected java.awt.Rectangle |
drawRegion
|
InfoModule |
info
Information about module. |
protected javax.swing.JPopupMenu |
jPopupMenuActions
|
static int |
minHeight
Module height in minimization mode. |
static int |
minWidth
Module width in minimization mode. |
static int |
MM_DEFAULT
No special mouse action. |
static int |
MM_MOVE
Module move. |
static int |
MM_PLUG
Plug move. |
static int |
MM_RESIZEE
Module resize - direction E (horizontal). |
static int |
MM_RESIZES
Module resize - direction S (vertical). |
static int |
MM_RESIZESE
Module resize - direction SE (upper right corner). |
protected int |
modeMove
Mode of mouse move or mouse procedure in action. |
protected static int |
moduleHeight
Initial module height. |
protected static int |
moduleWidth
Initial module width. |
java.awt.event.MouseAdapter |
mouseClick
|
java.awt.event.MouseMotionAdapter |
mouseMove
|
protected int |
oldMouseX
Old mouse position (X-coordinate). |
protected int |
oldMouseY
Old mouse position (Y-coordinate). |
protected java.awt.Point |
oldPosition
|
protected java.awt.Dimension |
oldSize
|
ActionsUndo |
undoReg
Undo/Redo object. |
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 | |
---|---|
ModuleGUI()
Default constructor. |
Method Summary | |
---|---|
java.awt.Dimension |
getMaxBounds()
Gets max axis of module. |
static int |
getModuleHeight()
Initial height of module. |
static int |
getModuleHeight(int _paramCount)
Get initial height of module with parametrs. |
static int |
getModuleWidth()
Initial width of module. |
protected abstract int |
getMouseMode(int mx,
int my)
Returns mouse's mode. |
protected InfoPlug |
getPlugAtPoint(int x,
int y)
Finds a plug at the given screen position [x,y]. |
void |
moveModule(int nx,
int ny)
Moves the module. |
protected void |
newModuleGeometry(boolean resize)
Reflect changes depending on module's geometry.. |
void |
newPlug(InfoPlug _infoP)
Adds new plug (initial orientation: South). |
void |
redo(ActionsUndoReg action)
Redo last on-done action. |
protected abstract void |
removeModule()
Deletes module. |
protected void |
resizePlug(PlugGUI p)
Resizes the window (Plug has to adapt). |
static void |
setModuleHeight(int _height)
Set initial height of a module. |
protected void |
setModuleType()
Sets plugs for the module. |
static void |
setModuleWidth(int _width)
Set initial width of a module. |
protected abstract void |
setParams()
Sets parameters of the module. |
void |
setUndoObj(ActionsUndo _undo)
Sets undo object for module and plugs. |
protected void |
this_ancestorRemoved(javax.swing.event.AncestorEvent e)
Deleting of composition. |
protected void |
this_componentMoved(java.awt.event.ComponentEvent e)
Module moved. |
protected void |
this_componentResized(java.awt.event.ComponentEvent e)
Module was resized: Plugs' positions need to be recomputed. |
protected void |
this_mouseClicked(java.awt.event.MouseEvent e)
Mouse click. |
protected void |
this_mouseDragged(java.awt.event.MouseEvent e)
Mouse drag: mode MM_MOVE - move module. |
protected void |
this_mouseMoved(java.awt.event.MouseEvent e)
Mouse move: mode MM_DEFAULT - sets cursor on normal cursor. |
protected void |
this_mousePressed(java.awt.event.MouseEvent e)
Mouse pressed. |
protected void |
this_mouseReleased(java.awt.event.MouseEvent e)
Mouse released. |
void |
undo(ActionsUndoReg action)
Undo last action. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
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, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintComponent, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printComponent, printChildren, 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, update |
Methods inherited from class java.awt.Container |
---|
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, 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, checkImage, checkImage, 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, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public InfoModule info
protected InfoPlug actualPlug
protected int oldMouseX
protected int oldMouseY
protected java.awt.Point oldPosition
protected java.awt.Dimension oldSize
protected java.awt.Rectangle drawRegion
public static final int MM_DEFAULT
public static final int MM_MOVE
public static final int MM_PLUG
public static final int MM_RESIZEE
public static final int MM_RESIZES
public static final int MM_RESIZESE
protected int modeMove
protected static int moduleWidth
protected static int moduleHeight
public static int minWidth
public static int minHeight
public ActionsUndo undoReg
public static final int ACTION_MODULE_MOVE
public static final int ACTION_MODULE_RESIZE
protected javax.swing.JPopupMenu jPopupMenuActions
public java.awt.event.MouseAdapter mouseClick
public java.awt.event.MouseMotionAdapter mouseMove
Constructor Detail |
---|
public ModuleGUI()
Method Detail |
---|
protected void setModuleType()
protected InfoPlug getPlugAtPoint(int x, int y)
x
- X-coordinate.y
- Y-coordinate.
null
.protected abstract void setParams()
public void newPlug(InfoPlug _infoP)
_infoP
- Information about plug.protected abstract int getMouseMode(int mx, int my)
mx
- X-coordinate of mouse.my
- Y-coordinate of mouse.
protected abstract void removeModule()
protected void resizePlug(PlugGUI p)
protected void this_mouseDragged(java.awt.event.MouseEvent e)
MM_MOVE
- move module.
MM_RESIZEE
- resize East.
MM_RESIZES
- resize South.
MM_RESIZESE
- resize SouthEast.
protected void this_mousePressed(java.awt.event.MouseEvent e)
protected void this_mouseReleased(java.awt.event.MouseEvent e)
protected void this_mouseClicked(java.awt.event.MouseEvent e)
protected void this_mouseMoved(java.awt.event.MouseEvent e)
MM_DEFAULT
- sets cursor on normal cursor.
MM_MOVE
- sets cursor on move cursor.
MM_PLUG
- sets cursor on hand cursor and sets ToolTip of Plug.
MM_RESIZEE
- sets cursor on resizeE cursor.
MM_RESIZES
- sets cursor on resizeS cursor.
MM_RESIZESE
- sets cursor on resizeSE cursor.
protected void newModuleGeometry(boolean resize)
resize
- Module was resized? (resize its interior)protected void this_componentResized(java.awt.event.ComponentEvent e)
protected void this_componentMoved(java.awt.event.ComponentEvent e)
protected void this_ancestorRemoved(javax.swing.event.AncestorEvent e)
public void moveModule(int nx, int ny)
nx
- Relative x coordinate.ny
- Relative y coordainte.public java.awt.Dimension getMaxBounds()
public void undo(ActionsUndoReg action)
undo
in interface Undo
action
- do this action.public void redo(ActionsUndoReg action)
redo
in interface Undo
action
- do this action.public void setUndoObj(ActionsUndo _undo)
_undo
- new ActionsUndo object.public static int getModuleWidth()
public static int getModuleHeight()
public static int getModuleHeight(int _paramCount)
_paramCount
- Number of parameters.
public static void setModuleWidth(int _width)
_width
- new value for moduleWidth.public static void setModuleHeight(int _height)
_height
- new value for moduleHeight.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |