mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
doc
This commit is contained in:
+43
-7
@@ -5,7 +5,6 @@ import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import org.diylc.core.ComponentLayer;
|
||||
import org.diylc.core.IDIYComponent;
|
||||
import org.diylc.core.VisibilityPolicy;
|
||||
|
||||
/**
|
||||
* Annotation for {@link IDIYComponent} implementation. Describes component
|
||||
@@ -15,18 +14,55 @@ import org.diylc.core.VisibilityPolicy;
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface ComponentDescriptor {
|
||||
|
||||
|
||||
/**
|
||||
* Component type name.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String name();
|
||||
|
||||
|
||||
/**
|
||||
* Component type description.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String desciption();
|
||||
|
||||
|
||||
/**
|
||||
* Component category, e.g. "Passive" or "Semiconductors".
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String category();
|
||||
|
||||
|
||||
/**
|
||||
* Component author name.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String author();
|
||||
|
||||
|
||||
/**
|
||||
* Prefix that will be used to generate component instance names, e.g. "R"
|
||||
* for resistors or "Q" for transistors.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String instanceNamePrefix();
|
||||
|
||||
|
||||
/**
|
||||
* Z-order of the component.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
-8
@@ -38,12 +38,4 @@ public @interface ControlPoint {
|
||||
* @return
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
+3
-2
@@ -28,8 +28,9 @@ class ComponentButton extends JButton {
|
||||
this.plugInPort = plugInPort;
|
||||
this.componentType = componentType;
|
||||
|
||||
setToolTipText("<html><b>" + componentType.getName() + "</b><br><br>"
|
||||
+ componentType.getDescription() + "</html>");
|
||||
setToolTipText("<html><b>" + componentType.getName() + "</b><br>"
|
||||
+ componentType.getDescription() + "<br>Author: " + componentType.getAuthor()
|
||||
+ "</html>");
|
||||
// initializeDnD();
|
||||
addActionListener(new ActionListener() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user