#! /bin/sed -f
# updateAWT:  Update from deprecated 1.0 AWT method names to new 1.1 names
#
# Usage:  updateAWT old-file > new-file
#
# Example:  updateAWT MyClass.java > tmp.java
#   In this example, tmp.java should eventually be renamed to
#   MyClass.java once the conversion has been looked over for accuracy.


# Bug fixes (1/7/97):
#   - fixed erroneous double left paren that prevented enable,
#     disable, show, and hide from being changed
#   - added  show(<expression>)  -->  setVisible(<expression>)
#   - added  enable(<expression>)  -->  setEnabled(<expression>)
#   - added  getBoundingBox  -->  getBounds  for Polygon class
#   - added  getClipRect  -->  getClipBounds  for Graphics class
#   - removed  size  -->  getSize  because of conflict with Vector class


# Component:
#   - The ordering of the two "enable" lines should not be switched.
#   - The ordering of the two "show" lines should not be switched.
#   - Don't change size to getSize because of the same name occurs in
#     Vector and possibly other classes:
#         s/\<size\([ 	]*(\)/getSize\1/g
#
s/\<bounds\([ 	]*(\)/getBounds\1/g
s/\<enable[ 	]*([ 	]*)/setEnabled(true)/g
s/\<enable\([ 	]*(\)/setEnabled\1/g
s/\<disable[ 	]*([ 	]*)/setEnabled(false)/g
s/\<show[ 	]*([ 	]*)/setVisible(true)/g
s/\<show\([ 	]*(\)/setVisible\1/g
s/\<hide[ 	]*([ 	]*)/setVisible(false)/g
s/\<layout\([ 	]*(\)/doLayout\1/g
s/\<inside\([ 	]*(\)/contains\1/g
s/\<locate\([ 	]*(\)/getComponentAt\1/g
s/\<location\([ 	]*(\)/getLocation\1/g
s/\<minimumSize\([ 	]*(\)/getMinimumSize\1/g
s/\<preferredSize\([ 	]*(\)/getPreferredSize\1/g
s/\<move\([ 	]*(\)/setLocation\1/g
s/\<nextFocus\([ 	]*(\)/transferFocus\1/g
s/\<reshape\([ 	]*(\)/setBounds\1/g
s/\<resize\([ 	]*(\)/setSize\1/g

# CheckboxGroup
s/\<getCurrent\([ 	]*(\)/getSelectedCheckbox\1/g
s/\<setCurrent\([ 	]*(\)/setSelectedCheckbox\1/g

# Choice, List
s/\<addItem\([ 	]*(\)/add\1/g
s/\<allowsMultipleSelections\([ 	]*(\)/isMultipleMode\1/g
s/\<clear\([ 	]*(\)/removeAll\1/g
s/\<countItems\([ 	]*(\)/getItemCount\1/g
s/\<delItem\([ 	]*(\)/remove\1/g
s/\<isSelected\([ 	]*(\)/isIndexSelected\1/g
s/\<setMultipleSelections\([ 	]*(\)/setMultipleMode\1/g

# Scrollbar
s/\<getLineIncrement\([ 	]*(\)/getUnitIncrement\1/g
s/\<setLineIncrement\([ 	]*(\)/setUnitIncrement\1/g
s/\<getPageIncrement\([ 	]*(\)/getBlockIncrement\1/g
s/\<setPageIncrement\([ 	]*(\)/setBlockIncrement\1/g
s/\<getVisible\([ 	]*(\)/getVisibleAmount\1/g

# TextArea, TextField
s/\<appendText\([ 	]*(\)/append\1/g
s/\<insertText\([ 	]*(\)/insert\1/g
s/\<replaceText\([ 	]*(\)/replaceRange\1/g
s/\<setEchoCharacter\([ 	]*(\)/setEchoChar\1/g

# Container
s/\<countComponents\([ 	]*(\)/getComponentCount\1/g
s/\<insets\([ 	]*(\)/getInsets\1/g

# MenuBar
s/\<countMenus\([ 	]*(\)/getMenuCount\1/g

# Polygon
s/\<getBoundingBox\([ 	]*(\)/getBounds\1/g

#Graphics
s/\<getClipRect\([ 	]*(\)/getClipBounds\1/g
