org.diylc.components
Class AbstractLeadedComponent<T>
java.lang.Object
org.diylc.components.AbstractComponent<T>
org.diylc.components.AbstractTransparentComponent<T>
org.diylc.components.AbstractLeadedComponent<T>
- All Implemented Interfaces:
- java.io.Serializable, IDIYComponent<T>
- Direct Known Subclasses:
- AbstractRadialComponent, AbstractSchematicLeadedSymbol
public abstract class AbstractLeadedComponent<T>
- extends AbstractTransparentComponent<T>
Base class for all leaded components such as resistors or capacitors. Has two control points and
draws leads between them. Also, it positions and draws the shape of the component as specified by
a child class.
- Author:
- Branislav Stojkovic
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
LEAD_COLOR
public static java.awt.Color LEAD_COLOR
LEAD_COLOR_ICON
public static java.awt.Color LEAD_COLOR_ICON
LEAD_THICKNESS
public static Size LEAD_THICKNESS
DEFAULT_SIZE
public static Size DEFAULT_SIZE
draw
public void draw(java.awt.Graphics2D g2d,
ComponentState componentState,
boolean outlineMode,
Project project,
IDrawingObserver drawingObserver)
- Description copied from interface:
IDIYComponent
- Draws the component onto the
Graphics2D.
getLeadColor
public java.awt.Color getLeadColor()
setLeadColor
public void setLeadColor(java.awt.Color leadColor)
getControlPointCount
public int getControlPointCount()
- Returns:
- number of control points for this component instance. May vary between two instances of
the same type, e.g. DIL IC with 8 and 16 pins will have 8 or 16 pins although they are
of the same type.
getControlPoint
public java.awt.Point getControlPoint(int index)
- Returns:
- control point at the specified index.
isControlPointSticky
public boolean isControlPointSticky(int index)
- Returns:
- true, if the specified control point may stick to control points of other components.
getControlPointVisibilityPolicy
public VisibilityPolicy getControlPointVisibilityPolicy(int index)
setControlPoint
public void setControlPoint(java.awt.Point point,
int index)
- Description copied from interface:
IDIYComponent
- Updates the control point at the specified index.
getBodyColor
public java.awt.Color getBodyColor()
setBodyColor
public void setBodyColor(java.awt.Color bodyColor)
getStandingBodyColor
public java.awt.Color getStandingBodyColor()
getBorderColor
public java.awt.Color getBorderColor()
setBorderColor
public void setBorderColor(java.awt.Color borderColor)
getLength
public Size getLength()
setLength
public void setLength(Size length)
getWidth
public Size getWidth()
setWidth
public void setWidth(Size width)
getDisplay
public Display getDisplay()
setDisplay
public void setDisplay(Display display)
getLabelColor
public java.awt.Color getLabelColor()
setLabelColor
public void setLabelColor(java.awt.Color labelColor)
getFlipStanding
public boolean getFlipStanding()
- Override this method with @EditableProperty annotation in child classes where standing mode is
supported
- Returns:
setFlipStanding
public void setFlipStanding(boolean flipStanding)