This commit is contained in:
bancika
2011-01-04 21:01:46 +00:00
parent a88f0d0a45
commit 32409b186f
3 changed files with 46 additions and 17 deletions
@@ -5,7 +5,6 @@ import java.lang.annotation.RetentionPolicy;
import org.diylc.core.ComponentLayer; import org.diylc.core.ComponentLayer;
import org.diylc.core.IDIYComponent; import org.diylc.core.IDIYComponent;
import org.diylc.core.VisibilityPolicy;
/** /**
* Annotation for {@link IDIYComponent} implementation. Describes component * Annotation for {@link IDIYComponent} implementation. Describes component
@@ -15,18 +14,55 @@ import org.diylc.core.VisibilityPolicy;
*/ */
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public @interface ComponentDescriptor { public @interface ComponentDescriptor {
/**
* Component type name.
*
* @return
*/
String name(); String name();
/**
* Component type description.
*
* @return
*/
String desciption(); String desciption();
/**
* Component category, e.g. "Passive" or "Semiconductors".
*
* @return
*/
String category(); String category();
/**
* Component author name.
*
* @return
*/
String author(); String author();
/**
* Prefix that will be used to generate component instance names, e.g. "R"
* for resistors or "Q" for transistors.
*
* @return
*/
String instanceNamePrefix(); String instanceNamePrefix();
/**
* Z-order of the component.
*
* @return
*/
ComponentLayer componentLayer() default ComponentLayer.COMPONENT; ComponentLayer componentLayer() default ComponentLayer.COMPONENT;
/**
* When false, moving one control point will cause all the others to move
* together with it.
*
* @return
*/
boolean stretchable() default true; boolean stretchable() default true;
} }
@@ -38,12 +38,4 @@ public @interface ControlPoint {
* @return * @return
*/ */
boolean sticky() default true; boolean sticky() default true;
// /**
// * If true, the control point is the main control point for the component.
// * There cannot be more than one control point for a single component.
// *
// * @return
// */
// boolean main() default false;
} }
@@ -28,8 +28,9 @@ class ComponentButton extends JButton {
this.plugInPort = plugInPort; this.plugInPort = plugInPort;
this.componentType = componentType; this.componentType = componentType;
setToolTipText("<html><b>" + componentType.getName() + "</b><br><br>" setToolTipText("<html><b>" + componentType.getName() + "</b><br>"
+ componentType.getDescription() + "</html>"); + componentType.getDescription() + "<br>Author: " + componentType.getAuthor()
+ "</html>");
// initializeDnD(); // initializeDnD();
addActionListener(new ActionListener() { addActionListener(new ActionListener() {