de.uni_paderborn.fujaba.gui
Class PERolePanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byde.uni_paderborn.fujaba.gui.PEBaseComponent
                      extended byde.uni_paderborn.fujaba.gui.PERolePanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, PEResizable, java.io.Serializable

public class PERolePanel
extends PEBaseComponent

The panel displays two rectangles with either containing a combobox and a swap button in the middle under the connecting line. The panel can be used to select connecting elements for different types of lines e.g. links, and transitions. The combo boxes have to be filled with objects of type PEListEntry, which encapsulates an Object and provides a toString method for displaying in the combo box.

Version:
$Revision: 1.21 $
Author:
$Author: lowende $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class de.uni_paderborn.fujaba.gui.PEBaseComponent
parent
 
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
PERolePanel()
          Constructor for class PERolePanel
 
Method Summary
protected  void addComponents()
          Access method for an one to n association.
 void addItemListener(java.awt.event.ItemListener listener)
          Adds a ItemListener to the left and right combo box.
 void addItemToLeftComboBox(PEListEntry item)
          Delegates the call to the left combo box
 void addItemToRightComboBox(PEListEntry item)
          Delegates the call to the right combo box.
 void doLayout()
          No comment provided by developer, please add a comment to improve documentation.
 int getGapHorz()
          Read access method for horizontal gap.
 int getGapLine()
          Read access method for line gap.
 int getGapVert()
          Read access method for vertical gap.
 PEListEntry getLeftComboSelectedItem()
          Returns the selected item in the left combo box.
 java.awt.Dimension getMinimumSize()
          Calculates the minimal size of the component, which is the preferred size.
 java.awt.Dimension getPreferredSize()
          Calculates the preferred size of the component, which includes also an inset.
 PEListEntry getRightComboSelectedItem()
          Returns the selected item in the right combo box.
 boolean isCombosEnabled()
          Get the combosEnabled attribute of the PERolePanel object
 boolean isHorzResizable()
          Get the horzResizable attribute of the PERolePanel object
 boolean isVertResizable()
          Get the vertResizable attribute of the PERolePanel object
 void paint(java.awt.Graphics g)
          Repaints the whole component.
 void removeItemListener(java.awt.event.ItemListener listener)
          Removes a ItemListener from the left and right combo box.
 void setCombosEnabled(boolean value)
          Sets the combosEnabled attribute of the PERolePanel object
 void setGapHorz(int newGapHorz)
          Write access method for horizontal gap.
 void setGapLine(int newGapLine)
          Write access method for line gap.
 void setGapVert(int newGapVert)
          Write access method for vertical gap.
 void setLeftComboSelectedItem(PEListEntry item)
          Sets the selected item in the left combo box.
 void setReadOnly(boolean b)
          Sets the readOnly attribute of the PERolePanel object
 void setRightComboSelectedItem(PEListEntry item)
          Sets the selected item in the right combo box.
 void swapEntries()
          Swaps the Entries in the left and right combo box if possible.
 
Methods inherited from class de.uni_paderborn.fujaba.gui.PEBaseComponent
buttonActionPerformed, focusGained, focusLost, getComponentByName, getComponentName, getInsets, getLayoutManager, getStatus, setComponentName, setInsets, setParent, setStatus
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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
 

Constructor Detail

PERolePanel

public PERolePanel()
Constructor for class PERolePanel

Method Detail

getGapHorz

public int getGapHorz()
Read access method for horizontal gap.

Returns:
The gapHorz value

setGapHorz

public void setGapHorz(int newGapHorz)
Write access method for horizontal gap.

Parameters:
newGapHorz - The new gapHorz value

getGapVert

public int getGapVert()
Read access method for vertical gap.

Returns:
The gapVert value

setGapVert

public void setGapVert(int newGapVert)
Write access method for vertical gap.

Parameters:
newGapVert - The new gapVert value

getGapLine

public int getGapLine()
Read access method for line gap.

Returns:
The gapLine value

setGapLine

public void setGapLine(int newGapLine)
Write access method for line gap.

Parameters:
newGapLine - The new gapLine value

getPreferredSize

public java.awt.Dimension getPreferredSize()
Calculates the preferred size of the component, which includes also an inset.

Returns:
The preferredSize value

getMinimumSize

public java.awt.Dimension getMinimumSize()
Calculates the minimal size of the component, which is the preferred size.

Returns:
The minimumSize value

addItemToLeftComboBox

public void addItemToLeftComboBox(PEListEntry item)
Delegates the call to the left combo box

Parameters:
item - The object added.

addItemToRightComboBox

public void addItemToRightComboBox(PEListEntry item)
Delegates the call to the right combo box.

Parameters:
item - The object added.

getLeftComboSelectedItem

public PEListEntry getLeftComboSelectedItem()
Returns the selected item in the left combo box.

Returns:
The leftComboSelectedItem value

setLeftComboSelectedItem

public void setLeftComboSelectedItem(PEListEntry item)
Sets the selected item in the left combo box.

Parameters:
item - The new leftComboSelectedItem value

getRightComboSelectedItem

public PEListEntry getRightComboSelectedItem()
Returns the selected item in the right combo box.

Returns:
The rightComboSelectedItem value

setRightComboSelectedItem

public void setRightComboSelectedItem(PEListEntry item)
Sets the selected item in the right combo box.

Parameters:
item - The new rightComboSelectedItem value

swapEntries

public void swapEntries()
Swaps the Entries in the left and right combo box if possible. If not, does nothing.


addItemListener

public void addItemListener(java.awt.event.ItemListener listener)
Adds a ItemListener to the left and right combo box.

Parameters:
listener - The object added.

removeItemListener

public void removeItemListener(java.awt.event.ItemListener listener)
Removes a ItemListener from the left and right combo box.

Parameters:
listener - No description provided

paint

public void paint(java.awt.Graphics g)
Repaints the whole component.

Parameters:
g - No description provided

doLayout

public void doLayout()
No comment provided by developer, please add a comment to improve documentation.


addComponents

protected void addComponents()
Access method for an one to n association.

Specified by:
addComponents in class PEBaseComponent

setReadOnly

public void setReadOnly(boolean b)
Sets the readOnly attribute of the PERolePanel object

Specified by:
setReadOnly in class PEBaseComponent
Parameters:
b - The new readOnly value

isHorzResizable

public boolean isHorzResizable()
Get the horzResizable attribute of the PERolePanel object

Returns:
The horzResizable value

isVertResizable

public boolean isVertResizable()
Get the vertResizable attribute of the PERolePanel object

Returns:
The vertResizable value

setCombosEnabled

public void setCombosEnabled(boolean value)
Sets the combosEnabled attribute of the PERolePanel object

Parameters:
value - The new combosEnabled value

isCombosEnabled

public boolean isCombosEnabled()
Get the combosEnabled attribute of the PERolePanel object

Returns:
The combosEnabled value