org.diylc.components
Class AbstractCurvedComponent<T>

java.lang.Object
  extended by org.diylc.components.AbstractComponent<T>
      extended by org.diylc.components.AbstractTransparentComponent<T>
          extended by org.diylc.components.AbstractCurvedComponent<T>
All Implemented Interfaces:
java.io.Serializable, IDIYComponent<T>

public abstract class AbstractCurvedComponent<T>
extends AbstractTransparentComponent<T>

See Also:
Serialized Form

Field Summary
static Size DEFAULT_SIZE
           
static java.awt.Color GUIDELINE_COLOR
           
 
Fields inherited from class org.diylc.components.AbstractTransparentComponent
MAX_ALPHA
 
Fields inherited from class org.diylc.components.AbstractComponent
LABEL_COLOR, LABEL_COLOR_SELECTED, LABEL_FONT, METAL_COLOR, SELECTION_COLOR
 
Fields inherited from interface org.diylc.core.IDIYComponent
BOARD, CHASSIS, COMPONENT, TEXT, TRACE
 
Constructor Summary
AbstractCurvedComponent()
           
 
Method Summary
 boolean canControlPointOverlap(int index)
           
 void draw(java.awt.Graphics2D g2d, ComponentState componentState, boolean outlineMode, Project project, IDrawingObserver drawingObserver)
          Draws the component onto the Graphics2D.
 void drawIcon(java.awt.Graphics2D g2d, int width, int height)
          Draws icon representation of the component.
 java.awt.Color getColor()
           
 java.awt.Point getControlPoint(int index)
           
 int getControlPointCount()
           
 VisibilityPolicy getControlPointVisibilityPolicy(int index)
           
 org.diylc.components.AbstractCurvedComponent.PointCount getPointCount()
           
 boolean isControlPointSticky(int index)
           
 void setColor(java.awt.Color color)
           
 void setControlPoint(java.awt.Point point, int index)
          Updates the control point at the specified index.
 void setPointCount(org.diylc.components.AbstractCurvedComponent.PointCount pointCount)
           
 
Methods inherited from class org.diylc.components.AbstractTransparentComponent
getAlpha, setAlpha
 
Methods inherited from class org.diylc.components.AbstractComponent
clone, equalsTo, getName, getValueForDisplay, setName, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.diylc.core.IDIYComponent
getValue, setValue
 

Field Detail

GUIDELINE_COLOR

public static java.awt.Color GUIDELINE_COLOR

DEFAULT_SIZE

public static Size DEFAULT_SIZE
Constructor Detail

AbstractCurvedComponent

public AbstractCurvedComponent()
Method Detail

drawIcon

public void drawIcon(java.awt.Graphics2D g2d,
                     int width,
                     int height)
Description copied from interface: IDIYComponent
Draws icon representation of the component. This should not depend on component state, i.e. it should be treated as a static method.


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.


getPointCount

public org.diylc.components.AbstractCurvedComponent.PointCount getPointCount()

setPointCount

public void setPointCount(org.diylc.components.AbstractCurvedComponent.PointCount pointCount)

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.

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)

canControlPointOverlap

public boolean canControlPointOverlap(int index)
Specified by:
canControlPointOverlap in interface IDIYComponent<T>
Overrides:
canControlPointOverlap in class AbstractComponent<T>
Returns:
true, if the specified control point may overlap with other control points of the same component. The other control point must be able to overlap too.

getControlPoint

public java.awt.Point getControlPoint(int index)
Returns:
control point at the specified index.

setControlPoint

public void setControlPoint(java.awt.Point point,
                            int index)
Description copied from interface: IDIYComponent
Updates the control point at the specified index.


getColor

public java.awt.Color getColor()

setColor

public void setColor(java.awt.Color color)