com.tensegrity.gui.swing.repository
Class AbstractRepositoryItem

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JLabel
                  extended bycom.tensegrity.gui.swing.repository.AbstractRepositoryItem
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.io.Serializable, javax.swing.SwingConstants
Direct Known Subclasses:
ActionRepositoryItem, CompositeRepositoryItem, VisualGraphObjectRepositoryItem

public abstract class AbstractRepositoryItem
extends javax.swing.JLabel
implements java.awt.event.MouseListener

AbstractRepositoryItem implements a abstract label consisting of a Tensegrity Composite.

Version:
$Id: AbstractRepositoryItem.java,v 1.22 2005/10/10 12:50:37 BurkhardWick Exp $
Author:
Gilles Iachelini, Burkhard Wick
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JLabel
javax.swing.JLabel.AccessibleJLabel
 
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 javax.swing.JLabel
labelFor
 
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 javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AbstractRepositoryItem()
          Creates an empty RepositoryItem with no text.
 
Method Summary
 java.awt.Color getDefaultBackground()
          Returns the default background color for this item
 javax.swing.border.Border getDefaultBorder()
          Returns the defaultBorder.
 java.awt.Insets getDefaultInsets()
          Returns the defaultInsets.
 java.awt.Color getHighlightColor()
          Returns the color that is used as background color when the item is highlighted
 javax.swing.border.Border getHoveredBorder()
          Returns the hoveredBorder.
 java.awt.Insets getHoveredInsets()
          Returns the hoveredInsets.
 java.awt.Insets getInsets()
           
 java.awt.Insets getInsets(java.awt.Insets insets)
           
 java.awt.Color getPressedBackground()
          Returns the background color for this item for the pressed state
 java.awt.Color getPressedColor()
          Returns the color that is used as background color when the mouse button is pressed on this item
 java.awt.Color getUnpressedColor()
          Returns the color that is used as background color when the mouse button is not pressed on this item
 boolean isHighlighted()
          Returns true, if the item is currently highlighted
 void mouseClicked(java.awt.event.MouseEvent e)
          Ignored.
 void mouseEntered(java.awt.event.MouseEvent e)
          Sets the mouseIn flag to true and redraws the icon.
 void mouseExited(java.awt.event.MouseEvent e)
          Sets the mouseIn- and mousePressed-flag to false and redraws the icon.
 void mousePressed(java.awt.event.MouseEvent e)
          Sets the mousePressed flag to true and redraws the icon.
 void mouseReleased(java.awt.event.MouseEvent e)
          Sets the mousePressed flag to false and redraws the icon.
protected  void paintBorder(java.awt.Graphics g)
           
 void setDefaultBackground(java.awt.Color bgColor)
          Sets the default background color for this item
 void setDefaultBorder(javax.swing.border.Border defaultBorder)
          Sets the value of defaultBorder
 void setDefaultInsets(java.awt.Insets defaultInsets)
          Sets the value of defaultInsets
 void setHighlightColor(java.awt.Color color)
          Sets the color that should be used as background color when the item is highlighted
 void setHighlighted(boolean highlighted)
          Sets the highlighted state
 void setHoveredBorder(javax.swing.border.Border hoveredBorder)
          Sets the value of hoveredBorder
 void setHoveredInsets(java.awt.Insets hoveredInsets)
          Sets the value of hoveredInsets
 void setPressedBackground(java.awt.Color bgColor)
          Sets the background color for this item for the pressed state
 
Methods inherited from class javax.swing.JLabel
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, 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, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, 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, 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, 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

AbstractRepositoryItem

public AbstractRepositoryItem()
Creates an empty RepositoryItem with no text. Adds itself as MouseListener to reflect MouseOver and -clicked events.

Method Detail

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Ignored.

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Sets the mouseIn flag to true and redraws the icon.

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Sets the mouseIn- and mousePressed-flag to false and redraws the icon.

Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Sets the mousePressed flag to true and redraws the icon.

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Sets the mousePressed flag to false and redraws the icon.

Specified by:
mouseReleased in interface java.awt.event.MouseListener

getPressedColor

public java.awt.Color getPressedColor()
Returns the color that is used as background color when the mouse button is pressed on this item

Returns:
the color that is used as background color when the mouse button is pressed on this item

getUnpressedColor

public java.awt.Color getUnpressedColor()
Returns the color that is used as background color when the mouse button is not pressed on this item

Returns:
the color that is used as background color when the mouse button is not pressed on this item

getHighlightColor

public java.awt.Color getHighlightColor()
Returns the color that is used as background color when the item is highlighted

Returns:
the color that is used as background color when the item is highlighted

setHighlightColor

public void setHighlightColor(java.awt.Color color)
Sets the color that should be used as background color when the item is highlighted

Parameters:
color - the color that should be used as background color when the item is highlighted

getDefaultBackground

public java.awt.Color getDefaultBackground()
Returns the default background color for this item

Returns:
the default background color for this item

setDefaultBackground

public void setDefaultBackground(java.awt.Color bgColor)
Sets the default background color for this item

Parameters:
bgColor - The color to set, null means transparent

getPressedBackground

public java.awt.Color getPressedBackground()
Returns the background color for this item for the pressed state

Returns:
the background color for this item for the pressed state

setPressedBackground

public void setPressedBackground(java.awt.Color bgColor)
Sets the background color for this item for the pressed state

Parameters:
bgColor - The color to set, null means transparent

isHighlighted

public boolean isHighlighted()
Returns true, if the item is currently highlighted

Returns:
true, if the item is currently highlighted

setHighlighted

public void setHighlighted(boolean highlighted)
Sets the highlighted state

Parameters:
highlighted - true, to set the state to highlighted

getDefaultBorder

public javax.swing.border.Border getDefaultBorder()
Returns the defaultBorder.

Returns:
the defaultBorder.

setDefaultBorder

public void setDefaultBorder(javax.swing.border.Border defaultBorder)
Sets the value of defaultBorder

Parameters:
defaultBorder - The new value to set.

getHoveredBorder

public javax.swing.border.Border getHoveredBorder()
Returns the hoveredBorder.

Returns:
the hoveredBorder.

setHoveredBorder

public void setHoveredBorder(javax.swing.border.Border hoveredBorder)
Sets the value of hoveredBorder

Parameters:
hoveredBorder - The new value to set.

getHoveredInsets

public java.awt.Insets getHoveredInsets()
Returns the hoveredInsets.

Returns:
the hoveredInsets.

setHoveredInsets

public void setHoveredInsets(java.awt.Insets hoveredInsets)
Sets the value of hoveredInsets

Parameters:
hoveredInsets - The new value to set.

setDefaultInsets

public void setDefaultInsets(java.awt.Insets defaultInsets)
Sets the value of defaultInsets

Parameters:
defaultInsets - The new value to set.

getDefaultInsets

public java.awt.Insets getDefaultInsets()
Returns the defaultInsets.

Returns:
the defaultInsets.

getInsets

public java.awt.Insets getInsets(java.awt.Insets insets)

getInsets

public java.awt.Insets getInsets()

paintBorder

protected void paintBorder(java.awt.Graphics g)


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.