Class Cell
java.lang.Object
|
+----java.awt.Component
|
+----Cell
- public class Cell
- extends Component
- implements ToolTips
This class implements one cell of matrix (worksheet)
It can contain the electrical component and it deals with all it's graphics
-
clearImage(boolean)
-
-
commandEnabled(String)
-
-
getContact(Point)
-
-
getCoords()
-
-
getElementInfo()
-
-
getImage()
-
-
getMinimumSize()
- Gets the mininimum size of this component.
-
getPreferredSize()
-
Gets the preferred size of this component.
-
getTip(int)
- Returns tool tip for the cell.
-
getTipLocation(Container)
- Returns tool tip location for the cell.
-
haveContact(int)
-
-
highlightContact(int)
-
-
initBFS()
-
-
isAble(int)
-
-
isEmpty()
-
-
isSelected()
-
-
paint(Graphics)
- This method is called to draw this component.
-
parseString(String)
- This method is called to load new values to element from string.
-
prepareForGraphBuilder()
-
-
resetAbility(int)
-
-
Rotate()
-
-
Rotate(int)
-
-
setAbility(int)
-
-
setCoords(Point)
-
-
setElement(Applet, Element)
-
-
setElement(Applet, String)
-
-
setSelected(boolean)
-
-
setWire(int, int)
-
-
toString()
- Returns a string representation of the object.
-
translateContact(int)
-
-
update(Graphics)
-
Updates this component.
clearImage
public void clearImage(boolean doRepaint)
setSelected
public void setSelected(boolean s)
update
public void update(Graphics g)
- Updates this component.
- Parameters:
- g - the specified context to use for updating.
- Overrides:
- update in class Component
paint
public void paint(Graphics g)
- This method is called to draw this component.
- Parameters:
- g - the graphics context.
- Overrides:
- paint in class Component
- See Also:
- Graphics
setElement
public void setElement(Applet theApplet,
String element)
setElement
public void setElement(Applet theApplet,
Element toolbarElement)
setWire
public void setWire(int dir1,
int dir2)
Rotate
public void Rotate()
Rotate
public void Rotate(int newAngle)
commandEnabled
public boolean commandEnabled(String command)
toString
public String toString()
- Returns a string representation of the object.
- Returns:
- a string representation of the object.
- Overrides:
- toString in class Component
haveContact
public boolean haveContact(int direction)
translateContact
public int translateContact(int direction)
getContact
public int getContact(Point p)
highlightContact
public void highlightContact(int contact)
getMinimumSize
public Dimension getMinimumSize()
- Gets the mininimum size of this component.
- Returns:
- A dimension object indicating this component's minimum size.
- Overrides:
- getMinimumSize in class Component
getPreferredSize
public Dimension getPreferredSize()
- Gets the preferred size of this component.
- Returns:
- A dimension object indicating this component's preferred size.
- Overrides:
- getPreferredSize in class Component
getCoords
public Point getCoords()
setAbility
public void setAbility(int ability)
setCoords
public void setCoords(Point coords)
resetAbility
public void resetAbility(int ability)
isEmpty
public boolean isEmpty()
isSelected
public boolean isSelected()
isAble
public boolean isAble(int feature)
initBFS
public void initBFS()
prepareForGraphBuilder
public void prepareForGraphBuilder()
parseString
public void parseString(String line) throws ParseException
- This method is called to load new values to element from string.
String should be like "[x=0,y=0,angle=0];Element[elementParams]".
- Parameters:
- values - new values for element in string in format given above.
- Throws: ParseException
- if string format is incorrect.
getImage
public Image getImage()
getElementInfo
public String[] getElementInfo()
getTip
public String getTip(int type)
- Returns tool tip for the cell. Tip is from cell's element.
- Returns:
- tool tip.
getTipLocation
public Point getTipLocation(Container painter)
- Returns tool tip location for the cell.
- Parameters:
- painter - container which paints the tip.
- Returns:
- desired location for tool tip.