de.uni_paderborn.fujaba.fsa.swing
Class JGrab

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

public class JGrab
extends JBend

A JGrab is a JBend that is attached to a JComponent. It has a GrabManager that acts as a association object to the JComponent and manages the updating of the grab position when the Component changes or other grabs are added

Associations

        N                      0..1
 JGrab ----------------------------- GrabManager
        grabs               manager
 

Version:
$Revision: 1.20.2.1 $
Author:
$Author: fklar $
See Also:
JBend, JBendLine, GrabManager, 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
static int BOTTOM
          Deprecated.  
static int LEFT
          Deprecated.  
static int RIGHT
          Deprecated.  
static int TOP
          Deprecated.  
 
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
JGrab()
          Constructor for class JGrab
JGrab(GrabManager manager)
          Constructor for class JGrab
JGrab(javax.swing.JComponent target)
          Constructor for class JGrab
 
Method Summary
protected  java.awt.Point calculatePoint()
          Default is the center of that side of the bounds that is defined by getOrientation()
 double getAlignment()
           
 int getAlignmentOffset()
          Get the alignmentOffset attribute of the JGrab object
 GrabManager getManager()
          Get the manager attribute of the JGrab object
 Direction getOrientation()
           
 int getPadOffset()
          Get the padOffset attribute of the JGrab object
 javax.swing.JComponent getTarget()
           
 int getTouchLength()
          Get the touchLength attribute of the JGrab object
 int getTouchOffset()
          Get the touchOffset attribute of the JGrab object
 boolean isAutoAlignment()
          get the autoAlignment property
 boolean isAutoOrientation()
          get the autoOrientation property
 void setAlignment(double align)
          Set the alignment of the Grab at its target component.
 void setAutoAlignment(boolean auto)
          set the autoOrientation property if set to true the orientation is determined by the GrabLayouter otherwise the value of getOrientation() is used
 void setAutoOrientation(boolean auto)
          set the autoOrientation property if set to true the orientation is determined by the GrabLayouter otherwise the value of getOrientation() is used
 void setBounds(int x, int y, int width, int height)
          Sets the bounds attribute of the JGrab object
 void setLayoutAlignment(double align)
          Set the Alignment without notifying the GrabManager or resetting the autoAlignment property
 void setLayoutOrientation(Direction orientation)
          Set the Orientation without notifying the GrabManager or resetting the autoOrientation property
 boolean setManager(GrabManager value)
          Sets the manager attribute of the JGrab object
 void setOrientation(Direction orientation)
          Set the orientation of the Grab at its target component.
 void setPoint(int x, int y)
          Does nothing.
 void setTarget(javax.swing.JComponent target)
          Only a Comfort Operation.
 
Methods inherited from class de.uni_paderborn.fujaba.fsa.swing.JBend
addToIncomingLines, addToOutgoingLines, firePropertyChange, getFirstFromLines, getMaximumSize, getMinimumSize, getPoint, getPoint, getPreferredSize, getUI, hasInIncomingLines, hasInLines, hasInOutgoingLines, iteratorOfIncomingLines, iteratorOfLines, iteratorOfOutgoingLines, removeAllFromIncomingLines, removeAllFromLines, removeAllFromOutgoingLines, removeFromIncomingLines, removeFromLines, removeFromOutgoingLines, resetPoint, setPoint, setUI, sizeOfIncomingLines, sizeOfLines, sizeOfOutgoingLines
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, 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, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, 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, paint, 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, doLayout, 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, 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

TOP

public static final int TOP
Deprecated.  

No comment provided by developer, please add a comment to improve documentation.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Deprecated.  

No comment provided by developer, please add a comment to improve documentation.

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
Deprecated.  

No comment provided by developer, please add a comment to improve documentation.

See Also:
Constant Field Values

LEFT

public static final int LEFT
Deprecated.  

No comment provided by developer, please add a comment to improve documentation.

See Also:
Constant Field Values
Constructor Detail

JGrab

public JGrab()
Constructor for class JGrab


JGrab

public JGrab(GrabManager manager)
Constructor for class JGrab

Parameters:
manager - No description provided

JGrab

public JGrab(javax.swing.JComponent target)
Constructor for class JGrab

Parameters:
target - No description provided
Method Detail

setOrientation

public void setOrientation(Direction orientation)
Set the orientation of the Grab at its target component. Calls setLayoutOrientation to set the orientation and then calls the GrabManager to revalidate the Grabs.

Resets the autoOrientation property if set.

Parameters:
orientation - one of
JGrab.TOP
,
JGrab.BOTTOM
,
JGrab.LEFT
or >pre>JGrab.RIGHT
See Also:
setLayoutOrientation(de.uni_paderborn.fujaba.fsa.swing.Direction), getOrientation(), setAutoOrientation(boolean), setAlignment(double), TOP, BOTTOM, LEFT, RIGHT

getOrientation

public Direction getOrientation()
Returns:
the Orientation of the Grab
See Also:
setOrientation(de.uni_paderborn.fujaba.fsa.swing.Direction), setLayoutOrientation(de.uni_paderborn.fujaba.fsa.swing.Direction), setAutoOrientation(boolean), isAutoOrientation(), TOP, BOTTOM, LEFT, RIGHT

setLayoutOrientation

public void setLayoutOrientation(Direction orientation)
Set the Orientation without notifying the GrabManager or resetting the autoOrientation property

Parameters:
orientation -
See Also:
setOrientation(de.uni_paderborn.fujaba.fsa.swing.Direction)

setAutoOrientation

public void setAutoOrientation(boolean auto)
set the autoOrientation property

if set to true the orientation is determined by the GrabLayouter otherwise the value of

getOrientation()
is used

Parameters:
auto - The new autoOrientation value
See Also:
setOrientation(de.uni_paderborn.fujaba.fsa.swing.Direction), setLayoutOrientation(de.uni_paderborn.fujaba.fsa.swing.Direction), getOrientation(), GrabLayouter

isAutoOrientation

public boolean isAutoOrientation()
get the autoOrientation property

Returns:
true if the orientation is determined by the GrabLayouter, false otherwise
See Also:
setAutoOrientation(boolean), setOrientation(de.uni_paderborn.fujaba.fsa.swing.Direction), setLayoutOrientation(de.uni_paderborn.fujaba.fsa.swing.Direction), getOrientation(), GrabLayouter

setAlignment

public void setAlignment(double align)
Set the alignment of the Grab at its target component.

Calls setLayoutAlignment to set the orientation and then calls the GrabManager to revalidate the Grabs. Resets the autoAlignment property if set.

Parameters:
align - The new alignment value
See Also:
setLayoutAlignment(double), getAlignment(), setAutoAlignment(boolean), setOrientation(de.uni_paderborn.fujaba.fsa.swing.Direction)

setLayoutAlignment

public void setLayoutAlignment(double align)
Set the Alignment without notifying the GrabManager or resetting the autoAlignment property

Parameters:
align - The new layoutAlignment value
See Also:
setOrientation(de.uni_paderborn.fujaba.fsa.swing.Direction)

getAlignment

public double getAlignment()
Returns:
the alignment of the Grab
See Also:
setAlignment(double), setLayoutAlignment(double), setAutoAlignment(boolean), isAutoAlignment()

setAutoAlignment

public void setAutoAlignment(boolean auto)
set the autoOrientation property

if set to true the orientation is determined by the GrabLayouter otherwise the value of

getOrientation()
is used

Parameters:
auto - The new autoAlignment value
See Also:
setOrientation(de.uni_paderborn.fujaba.fsa.swing.Direction), setLayoutOrientation(de.uni_paderborn.fujaba.fsa.swing.Direction), getOrientation(), GrabLayouter

isAutoAlignment

public boolean isAutoAlignment()
get the autoAlignment property

Returns:
true if the alignment is determined by the GrabLayouter, false otherwise
See Also:
setAutoAlignment(boolean), setAlignment(double), setLayoutAlignment(double), getAlignment(), GrabLayouter

getTouchOffset

public int getTouchOffset()
Get the touchOffset attribute of the JGrab object

Returns:
The touchOffset value

getTouchLength

public int getTouchLength()
Get the touchLength attribute of the JGrab object

Returns:
The touchLength value

getAlignmentOffset

public int getAlignmentOffset()
Get the alignmentOffset attribute of the JGrab object

Returns:
The alignmentOffset value

getPadOffset

public int getPadOffset()
Get the padOffset attribute of the JGrab object

Returns:
The padOffset value

setPoint

public void setPoint(int x,
                     int y)
Does nothing.

Positioning is done by

setOrientation
and
setAlignment

Overrides:
setPoint in class JBend
Parameters:
x -
y -
See Also:
setOrientation(de.uni_paderborn.fujaba.fsa.swing.Direction), setAlignment(double)

calculatePoint

protected java.awt.Point calculatePoint()
Default is the center of that side of the bounds that is defined by
getOrientation()

Overrides:
calculatePoint in class JBend
Returns:
No description provided
See Also:
getOrientation()

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Sets the bounds attribute of the JGrab object

Overrides:
setBounds in class JBend
Parameters:
x - The new bounds value
y - The new bounds value
width - The new bounds value
height - The new bounds value
See Also:
JBend.setPoint(java.awt.Point), JBend.setPoint(int, int), JBend.resetPoint()

setManager

public boolean setManager(GrabManager value)
Sets the manager attribute of the JGrab object

Parameters:
value - The new manager value
Returns:
No description provided

getManager

public GrabManager getManager()
Get the manager attribute of the JGrab object

Returns:
The manager value

setTarget

public void setTarget(javax.swing.JComponent target)
Only a Comfort Operation.

The association to the target JComponent is implemented by the GrabManager.
So if the target does not have a GrabManager yet, a new one is added. Then this grab is added to the GrabManager.

Parameters:
target - The JComponent to connect to
See Also:
getTarget(), setManager(de.uni_paderborn.fujaba.fsa.swing.GrabManager), GrabManager

getTarget

public javax.swing.JComponent getTarget()
Returns:
null if the GrabManager is null, the target of the GrabManager otherwise
See Also:
setTarget(javax.swing.JComponent), getManager(), GrabManager.getTarget()