scphEditor
Class AtomView

java.lang.Object
  extended by java.awt.Component
      extended by scphEditor.AtomView
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
IdentifierView, NullView

public class AtomView
extends java.awt.Component

This AWT component is the view of a simple string, e.g., the name of an Identifier, a part of an operator. The string is considered immutable, therefore this class is not an observer. However, protected methods are provided to access this string, so subclasses can be written to be observers.

The default font is null; i.e., follows the parent container dynamically.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
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
AtomView(java.lang.String textOf)
          Creates an AtomView object that displays the given string.
 
Method Summary
 java.awt.Dimension getMinimumSize()
          Returns the display size of this AWT component.
 java.awt.Dimension getPreferredSize()
          Returns the display size of this AWT component.
protected  java.lang.String getText()
          Gives the string displayed by this view.
 void paint(java.awt.Graphics g)
          Redraws this AWT component.
 void print(java.awt.Graphics g)
           
protected  void setText(java.lang.String newText)
          Changes the string displayed by this view.
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AtomView

public AtomView(java.lang.String textOf)
Creates an AtomView object that displays the given string.

Parameters:
textOf - the given string to be displayed.
Method Detail

getText

protected java.lang.String getText()
Gives the string displayed by this view.


setText

protected void setText(java.lang.String newText)
Changes the string displayed by this view. And redraws itself, of course.

Parameters:
newText - the new string.

getMinimumSize

public java.awt.Dimension getMinimumSize()
Returns the display size of this AWT component. Both getMinimumSize() and getPreferredSize() return the same thing.

Overrides:
getMinimumSize in class java.awt.Component
Returns:
display size of this component.
See Also:
getPreferredSize()

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the display size of this AWT component. Both getMinimumSize() and getPreferredSize() return the same thing.

Overrides:
getPreferredSize in class java.awt.Component
Returns:
display size of this component.
See Also:
getMinimumSize()

print

public void print(java.awt.Graphics g)
Overrides:
print in class java.awt.Component

paint

public void paint(java.awt.Graphics g)
Redraws this AWT component.

Overrides:
paint in class java.awt.Component
Parameters:
g - the graphics context in which the drawing is done.