|
||||||||||
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 |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
ACTION_MODULE_MOVE
|
static int |
ACTION_MODULE_RESIZE
|
protected InfoPlug |
actualPlug
Actual plug. |
protected Rectangle |
drawRegion
|
InfoModule |
info
Information about module. |
protected 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. |
MouseAdapter |
mouseClick
|
MouseMotionAdapter |
mouseMove
|
protected int |
oldMouseX
Old mouse position (X-coordinate). |
protected int |
oldMouseY
Old mouse position (Y-coordinate). |
protected Point |
oldPosition
|
protected 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 | |
---|---|
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(AncestorEvent e)
Deleting of composition. |
protected void |
this_componentMoved(ComponentEvent e)
Module moved. |
protected void |
this_componentResized(ComponentEvent e)
Module was resized: Plugs' positions need to be recomputed. |
protected void |
this_mouseClicked(MouseEvent e)
Mouse click. |
protected void |
this_mouseDragged(MouseEvent e)
Mouse drag: mode MM_MOVE - move module. |
protected void |
this_mouseMoved(MouseEvent e)
Mouse move: mode MM_DEFAULT - sets cursor on normal cursor. |
protected void |
this_mousePressed(MouseEvent e)
Mouse pressed. |
protected void |
this_mouseReleased(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 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 Point oldPosition
protected Dimension oldSize
protected 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 JPopupMenu jPopupMenuActions
public MouseAdapter mouseClick
public 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(MouseEvent e)
MM_MOVE
- move module.
MM_RESIZEE
- resize East.
MM_RESIZES
- resize South.
MM_RESIZESE
- resize SouthEast.
protected void this_mousePressed(MouseEvent e)
protected void this_mouseReleased(MouseEvent e)
protected void this_mouseClicked(MouseEvent e)
protected void this_mouseMoved(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(ComponentEvent e)
protected void this_componentMoved(ComponentEvent e)
protected void this_ancestorRemoved(AncestorEvent e)
public void moveModule(int nx, int ny)
nx
- Relative x coordinate.ny
- Relative y coordainte.public 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 |