mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +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.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;
|
||||||
}
|
}
|
||||||
|
|||||||
-8
@@ -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;
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -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() {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user