cz.cuni.jagrlib.gui
Class CompositionGUIBasic

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by cz.cuni.jagrlib.gui.CompositionGUI
                      extended by cz.cuni.jagrlib.gui.CompositionGUIBasic
All Implemented Interfaces:
Undo, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class CompositionGUIBasic
extends CompositionGUI

Basic class that cares about visual representation of a composition.

Since:
0.24
See Also:
CompositionGUIBasic.java, Serialized Form

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_CHANNEL_ADD
           
static int ACTION_MODULE_ADD
          Undo/Redo constants.
 
Fields inherited from class cz.cuni.jagrlib.gui.CompositionGUI
ACTION_CHANNEL_REMOVE, ACTION_MODULE_REMOVE, canDelete, countSelected, idChannel, idModules, info, plugFrom, plugTo, undoReg, zoom
 
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
CompositionGUIBasic()
          Default constructor.
CompositionGUIBasic(java.lang.Integer _key)
          Creates new CompositionGUIBasic.
 
Method Summary
 void connectWithOther(InfoModule infoM)
          Connects the given module with others..
 void delete()
          Delete all selected modules.
 InfoChannel findChannel(InfoPlug _plug1, InfoPlug _plug2)
          Looking for channel connecting two given plugs.
 InfoModule findModule(java.lang.String _name)
          Finds module with field Name equals _name.
static InfoPlug findOpposite(InfoPlug _find, InfoModule _module)
          Looking for opposite plug in the given module.
 void moveSelected(java.lang.Integer id, int nx, int ny)
          Moves all selected items.
 void newGroup(InfoGroup _info)
          Adds a new group.
 void newGroup(int x, int y, InfoGroup _info)
          Adds a new group at position [ x, y ].
 void newChannel()
          Creates new channel connecting idModuleFrom and idModuleTo.
 void newChannel(InfoChannel _info)
          Adds a new channel.
 InfoChannel newChannelTemp()
          Creates new temporary channel.
 void newModule(InfoModule _info)
          Adds a new module.
 void newModule(int x, int y)
          Adds a new module at the given position.
 void newModule(int x, int y, InfoModule _info)
          Adds a new module at position [ x, y ].
 void paintChannels(java.awt.Graphics g)
          Paint bonus items of Channels.
 void paintItem(java.awt.Graphics g)
          Paints bonus graphics on panel - Modules, Channels.
 void paintLinks(java.awt.Graphics g)
          Paints links between modules-plugs composition-plugs.
 void redo(ActionsUndoReg action)
          Redo last undoed action.
 void renameNewModule(InfoModule _newModule)
          If the new module has the same name as any other in composition, rename it!
 void replaceModule(InfoModule infoOld)
          Replace module with new one.
 void setGroup()
          Creates a new group from all selected modules.
 void undo(ActionsUndoReg action)
          Undo last action.
 void unsetGroup(InfoGroup ig)
          Dismisses the given group
 
Methods inherited from class cz.cuni.jagrlib.gui.CompositionGUI
getChannelAtPoint, moveToBack, moveToFront, paintComponent, readInfo, removeChannel, removeChannels, removeModule, repaintParent, selectAll, setCompositionSize, setIDModule, setIDModuleFrom, setIDModuleTo, setSelectModule, ungroup
 
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, 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

ACTION_MODULE_ADD

public static final int ACTION_MODULE_ADD
Undo/Redo constants.

See Also:
Constant Field Values

ACTION_CHANNEL_ADD

public static final int ACTION_CHANNEL_ADD
See Also:
Constant Field Values
Constructor Detail

CompositionGUIBasic

public CompositionGUIBasic()
Default constructor.


CompositionGUIBasic

public CompositionGUIBasic(java.lang.Integer _key)
Creates new CompositionGUIBasic.

Method Detail

connectWithOther

public void connectWithOther(InfoModule infoM)
Connects the given module with others..

Specified by:
connectWithOther in class CompositionGUI

findModule

public InfoModule findModule(java.lang.String _name)
Finds module with field Name equals _name.

Parameters:
_name - Module name to find.
Returns:
Module named _name or null.

renameNewModule

public void renameNewModule(InfoModule _newModule)
If the new module has the same name as any other in composition, rename it! (use number extensions 2, 3, ..).

Parameters:
_newModule - New module to add.

delete

public void delete()
Delete all selected modules.

Specified by:
delete in class CompositionGUI

replaceModule

public void replaceModule(InfoModule infoOld)
Replace module with new one.

Specified by:
replaceModule in class CompositionGUI
Parameters:
infoOld - Information about old module.

newModule

public void newModule(int x,
                      int y)
Adds a new module at the given position. Module type will be specified by the user (registry browser).

Parameters:
x - X-coordinate of the insertion point.
y - Y-coordinate of the insertion point.

newModule

public void newModule(InfoModule _info)
Adds a new module.

Specified by:
newModule in class CompositionGUI
Parameters:
_info - Information about module.

newChannel

public void newChannel(InfoChannel _info)
Adds a new channel.

Specified by:
newChannel in class CompositionGUI
Parameters:
_info - Information about channel.

newGroup

public void newGroup(InfoGroup _info)
Adds a new group.

Specified by:
newGroup in class CompositionGUI
Parameters:
_info - Information about group.

setGroup

public void setGroup()
Creates a new group from all selected modules.

Overrides:
setGroup in class CompositionGUI

unsetGroup

public void unsetGroup(InfoGroup ig)
Dismisses the given group

Overrides:
unsetGroup in class CompositionGUI

newChannel

public void newChannel()
Creates new channel connecting idModuleFrom and idModuleTo.


newChannelTemp

public InfoChannel newChannelTemp()
Creates new temporary channel.

Specified by:
newChannelTemp in class CompositionGUI
Returns:
new temporary channel.

findOpposite

public static InfoPlug findOpposite(InfoPlug _find,
                                    InfoModule _module)
Looking for opposite plug in the given module.

Parameters:
_find - Plug to look for.
_module - Module to be searched.
Returns:
Opposite plug or null.

findChannel

public InfoChannel findChannel(InfoPlug _plug1,
                               InfoPlug _plug2)
Looking for channel connecting two given plugs.

Parameters:
_plug1 - Plug #1.
_plug2 - Plug #2.
Returns:
Channel connecting the two plugs or null.

newModule

public void newModule(int x,
                      int y,
                      InfoModule _info)
Adds a new module at position [ x, y ].

Parameters:
x - X-coordinate.
y - Y-coordinate.
_info - Module.

newGroup

public void newGroup(int x,
                     int y,
                     InfoGroup _info)
Adds a new group at position [ x, y ].

Parameters:
x - X-axis.
y - Y-axis.
_info - Group.

moveSelected

public void moveSelected(java.lang.Integer id,
                         int nx,
                         int ny)
Moves all selected items.

Specified by:
moveSelected in class CompositionGUI
Parameters:
id - Key of item.
nx - Relative x coordinate.
ny - Relative y coordinate.

paintChannels

public void paintChannels(java.awt.Graphics g)
Paint bonus items of Channels.

Parameters:
g - Graphics to paint to.

paintLinks

public void paintLinks(java.awt.Graphics g)
Paints links between modules-plugs composition-plugs.

Overrides:
paintLinks in class CompositionGUI
Parameters:
g - Graphics to paint to.

paintItem

public void paintItem(java.awt.Graphics g)
Paints bonus graphics on panel - Modules, Channels.

Specified by:
paintItem in class CompositionGUI

undo

public void undo(ActionsUndoReg action)
Undo last action.

Specified by:
undo in interface Undo
Overrides:
undo in class CompositionGUI
Parameters:
action - Action to be done.

redo

public void redo(ActionsUndoReg action)
Redo last undoed action.

Specified by:
redo in interface Undo
Overrides:
redo in class CompositionGUI
Parameters:
action - Action to be re-done.