org.diylc.components
Class AbstractComponent<T>
java.lang.Object
org.diylc.components.AbstractComponent<T>
- Type Parameters:
T -
- All Implemented Interfaces:
- java.io.Serializable, IDIYComponent<T>
- Direct Known Subclasses:
- AbstractTransparentComponent
public abstract class AbstractComponent<T>
- extends java.lang.Object
- implements IDIYComponent<T>
Abstract implementation of IDIYComponent that contains component name and toString.
IMPORTANT: to improve performance, all fields except for Point and
Point arrays should be immutable. Failing to comply with this can result in annoying
and hard to trace bugs.
- Author:
- Branislav Stojkovic
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SELECTION_COLOR
public static java.awt.Color SELECTION_COLOR
LABEL_COLOR
public static java.awt.Color LABEL_COLOR
LABEL_COLOR_SELECTED
public static java.awt.Color LABEL_COLOR_SELECTED
LABEL_FONT
public static java.awt.Font LABEL_FONT
METAL_COLOR
public static java.awt.Color METAL_COLOR
AbstractComponent
public AbstractComponent()
getName
public java.lang.String getName()
- Specified by:
getName in interface IDIYComponent<T>
- Returns:
- component instance name.
setName
public void setName(java.lang.String name)
- Description copied from interface:
IDIYComponent
- Updates component instance name.
- Specified by:
setName in interface IDIYComponent<T>
canControlPointOverlap
public boolean canControlPointOverlap(int index)
- Specified by:
canControlPointOverlap in interface IDIYComponent<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.
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
getValueForDisplay
public java.lang.String getValueForDisplay()
- Specified by:
getValueForDisplay in interface IDIYComponent<T>
- Returns:
- full value for BOM.
clone
public IDIYComponent<T> clone()
throws java.lang.CloneNotSupportedException
- Description copied from interface:
IDIYComponent
- Clones the component.
- Specified by:
clone in interface IDIYComponent<T>- Overrides:
clone in class java.lang.Object
- Returns:
-
- Throws:
java.lang.CloneNotSupportedException
equalsTo
public boolean equalsTo(IDIYComponent<?> other)
- Description copied from interface:
IDIYComponent
- Checks if two components are equal.
- Specified by:
equalsTo in interface IDIYComponent<T>
- Returns: