This commit is contained in:
bancika
2011-01-04 22:29:10 +00:00
parent cb5c95478f
commit 872293ea0e
9 changed files with 23 additions and 12 deletions
@@ -3,7 +3,6 @@ package org.diylc.common;
import java.awt.Rectangle;
import org.diylc.core.Project;
import org.diylc.presenter.ComponentType;
/**
@@ -17,7 +17,6 @@ import javax.swing.JPopupMenu.Separator;
import org.diylc.core.ComponentLayer;
import org.diylc.core.IDIYComponent;
import org.diylc.core.Project;
import org.diylc.presenter.ComponentType;
import com.diyfever.gui.simplemq.IMessageListener;
import com.diyfever.gui.simplemq.MessageDispatcher;
@@ -3,18 +3,31 @@ package org.diylc.core;
import java.awt.Graphics2D;
import java.io.Serializable;
import org.diylc.presenter.ComponentType;
import org.diylc.core.annotations.ComponentDescriptor;
import org.diylc.core.annotations.ComponentName;
import org.diylc.core.annotations.ComponentValue;
import org.diylc.core.annotations.ControlPoint;
import org.diylc.core.annotations.EditableProperty;
/**
* Interface for component instance. Implementation classes of this interface
* will be instantiated by the application when component is added to the
* canvas. <br>
* <br>
* <b>Note: </b>Implementing classes must have an empty constructor.
* <b>Implementing classes should meet the following: </b>
* <ul>
* <li>Must have an empty constructor.</li>
* <li>Class should be annotated with {@link ComponentDescriptor}.</li>
* <li>Exactly one getter should be annotated with {@link ComponentName}.</li>
* <li>Exactly one getter should be annotated with {@link ComponentValue}.</li>
* <li>Control point getters need to be annotated with {@link ControlPoint}.</li>
* <li>Getters for properties editable by users should be annotated with
* {@link EditableProperty}.</li>
* <li>Component configuration should be declared using
* <code>public static</code> fields so they can be set through config file.</li>
* </ul>
*
* @author Branislav Stojkovic
*
* @see ComponentType
*/
public interface IDIYComponent extends Serializable {
@@ -6,11 +6,10 @@ import java.lang.annotation.RetentionPolicy;
import org.diylc.core.VisibilityPolicy;
/**
* Annotation for control points. This annotation may be added fields of type
* {@link Point} only when both getters and setters exist. Annotation is added
* always on the getter.
* always on the getter and it must return {@link Point} values.
*
* @author Branislav Stojkovic
*/
@@ -17,13 +17,13 @@ import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import org.diylc.common.BadPositionException;
import org.diylc.common.ComponentType;
import org.diylc.common.ControlPointWrapper;
import org.diylc.common.EventType;
import org.diylc.common.IPlugIn;
import org.diylc.common.IPlugInPort;
import org.diylc.core.IDIYComponent;
import org.diylc.presenter.ComponentProcessor;
import org.diylc.presenter.ComponentType;
import com.diyfever.gui.MemoryBar;
import com.diyfever.gui.miscutils.PercentageListCellRenderer;
@@ -7,8 +7,8 @@ import java.awt.event.ActionListener;
import javax.swing.JButton;
import org.diylc.common.ComponentType;
import org.diylc.common.IPlugInPort;
import org.diylc.presenter.ComponentType;
/**
* {@link JButton} that displays component type icon and instantiates the
@@ -8,8 +8,8 @@ import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JTabbedPane;
import org.diylc.common.ComponentType;
import org.diylc.common.IPlugInPort;
import org.diylc.presenter.ComponentType;
class ComponentTabbedPane extends JTabbedPane {
@@ -32,6 +32,7 @@ import javax.swing.JComponent;
import org.apache.log4j.Logger;
import org.diylc.common.BadPositionException;
import org.diylc.common.ComponentSelection;
import org.diylc.common.ComponentType;
import org.diylc.common.ControlPointWrapper;
import org.diylc.common.DrawOption;
import org.diylc.common.EventType;