utilities
Class NodePanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--utilities.NodePanel
All Implemented Interfaces:
javax.accessibility.Accessible, ConfiguredObject, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
ContainerNodePanel, EdgeNodePanel

public class NodePanel
extends javax.swing.JPanel
implements ConfiguredObject

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static int H_MARGIN
           
static java.awt.Font normalFont
           
static java.awt.Font smallFont
           
static int V_MARGIN
           
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
NodePanel(GraphNode n, java.lang.String l)
           
 
Method Summary
 int calculateHeight(java.awt.FontMetrics fm)
           
 java.awt.Dimension calculateSize(java.awt.FontMetrics fm)
           
 int calculateWidth(java.awt.FontMetrics fm)
           
 java.awt.Color getBackground()
          Get the background colour.
 ImageComponent getBackImage()
           
 java.net.URL getBackImageURL()
           
 java.awt.Color getForeground()
           
 java.lang.String getLabel()
           
 java.awt.Point getLocationForLine()
           
 java.awt.Point getLocationForLine(GraphNode src)
           
 java.awt.Dimension getMinimumSize()
           
 GraphNode getNode()
           
 java.awt.Dimension getPreferredSize()
           
 int getRectRoundness()
           
 java.awt.Shape getShape()
           
 boolean isMoveable()
           
 boolean isNodeFilled()
           
 boolean isSelected()
           
 void paintBackImage(java.awt.Graphics g)
           
 void paintComponent(java.awt.Graphics g)
           
 void saveCfg()
          saves the information in this object to the proper location in the CfgManager.
 void setBackImage(ImageComponent i)
           
 void setBackImage(java.net.URL u)
           
 void setLabel(java.lang.String s)
           
 void setMoveable(boolean b)
           
 void setNodeFilled(boolean b)
           
 void setSelected(boolean b)
           
 void setShape(java.awt.Shape s)
           
 void updateCfg()
          updates the information in this object with information currently in the CfgManager.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, 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, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setLayout, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, contains, createImage, createImage, dispatchEvent, enable, enableInputMethods, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

H_MARGIN

public static int H_MARGIN

V_MARGIN

public static int V_MARGIN

normalFont

public static java.awt.Font normalFont

smallFont

public static java.awt.Font smallFont
Constructor Detail

NodePanel

public NodePanel(GraphNode n,
                 java.lang.String l)
Method Detail

getNode

public GraphNode getNode()

isSelected

public boolean isSelected()

setSelected

public void setSelected(boolean b)

isNodeFilled

public boolean isNodeFilled()

setNodeFilled

public void setNodeFilled(boolean b)

isMoveable

public boolean isMoveable()

setMoveable

public void setMoveable(boolean b)

getLabel

public java.lang.String getLabel()

setLabel

public void setLabel(java.lang.String s)

paintComponent

public void paintComponent(java.awt.Graphics g)

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class javax.swing.JComponent

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class javax.swing.JComponent

setBackImage

public void setBackImage(ImageComponent i)

setBackImage

public void setBackImage(java.net.URL u)

getBackImageURL

public java.net.URL getBackImageURL()

getBackImage

public ImageComponent getBackImage()

paintBackImage

public void paintBackImage(java.awt.Graphics g)

getShape

public java.awt.Shape getShape()

setShape

public void setShape(java.awt.Shape s)

calculateHeight

public int calculateHeight(java.awt.FontMetrics fm)

calculateWidth

public int calculateWidth(java.awt.FontMetrics fm)

calculateSize

public java.awt.Dimension calculateSize(java.awt.FontMetrics fm)

getBackground

public java.awt.Color getBackground()
Get the background colour.
Overrides:
getBackground in class java.awt.Component

getForeground

public java.awt.Color getForeground()
Overrides:
getForeground in class java.awt.Component

getRectRoundness

public int getRectRoundness()

getLocationForLine

public java.awt.Point getLocationForLine()

getLocationForLine

public java.awt.Point getLocationForLine(GraphNode src)

updateCfg

public void updateCfg()
Description copied from interface: ConfiguredObject
updates the information in this object with information currently in the CfgManager.
Specified by:
updateCfg in interface ConfiguredObject

saveCfg

public void saveCfg()
Description copied from interface: ConfiguredObject
saves the information in this object to the proper location in the CfgManager.
Specified by:
saveCfg in interface ConfiguredObject