mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
added docs
This commit is contained in:
+7
@@ -10,6 +10,13 @@ import java.util.List;
|
||||
|
||||
import com.diyfever.diylc.model.IComponentInstance;
|
||||
|
||||
/**
|
||||
* Represents component selection as a {@link List} of
|
||||
* {@link IComponentInstance} objects. Implements {@link Transferable}, so it is
|
||||
* suitable for clipboard usage.
|
||||
*
|
||||
* @author Branislav Stojkovic
|
||||
*/
|
||||
public class ComponentSelection extends ArrayList<IComponentInstance> implements Transferable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
+24
@@ -7,6 +7,12 @@ import java.lang.reflect.Method;
|
||||
import com.diyfever.diylc.model.IComponentInstance;
|
||||
import com.diyfever.diylc.model.VisibilityPolicy;
|
||||
|
||||
/**
|
||||
* Entity bean that represents a control point. Has methods for reading/writing
|
||||
* {@link Point} value from/to a component.
|
||||
*
|
||||
* @author Branislav Stojkovic
|
||||
*/
|
||||
public class ControlPointWrapper {
|
||||
|
||||
private String name;
|
||||
@@ -28,11 +34,29 @@ public class ControlPointWrapper {
|
||||
this.visibilityPolicy = visibilityPolicy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads value from the specified component by invoking it's
|
||||
* <code>getter</code> method.
|
||||
*
|
||||
* @param component
|
||||
* @throws IllegalArgumentException
|
||||
* @throws IllegalAccessException
|
||||
* @throws InvocationTargetException
|
||||
*/
|
||||
public void readFrom(IComponentInstance component) throws IllegalArgumentException,
|
||||
IllegalAccessException, InvocationTargetException {
|
||||
value = (Point) getter.invoke(component);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the value into the specified component by invoking it's
|
||||
* <code>setter</code> method.
|
||||
*
|
||||
* @param component
|
||||
* @throws IllegalArgumentException
|
||||
* @throws IllegalAccessException
|
||||
* @throws InvocationTargetException
|
||||
*/
|
||||
public void writeTo(IComponentInstance component) throws IllegalArgumentException,
|
||||
IllegalAccessException, InvocationTargetException {
|
||||
setter.invoke(component, value);
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Point;
|
||||
import java.awt.geom.Area;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.swing.Action;
|
||||
import javax.swing.JComponent;
|
||||
@@ -88,7 +88,7 @@ public interface IPlugInPort {
|
||||
*
|
||||
* @param g2d
|
||||
*/
|
||||
void draw(Graphics2D g2d, EnumSet<DrawOption> drawProperties);
|
||||
void draw(Graphics2D g2d, Set<DrawOption> drawProperties);
|
||||
|
||||
/**
|
||||
* Injects a custom GUI panels provided by the plug-in and desired position
|
||||
|
||||
+1
-1
@@ -167,7 +167,7 @@ public class ClipboardManager implements IPlugIn, ClipboardOwner {
|
||||
.getData(ComponentSelection.listFlavor);
|
||||
plugInPort.addComponents(cloner.deepClone(components), null);
|
||||
} catch (Exception ex) {
|
||||
LOG.error(ex.getMessage());
|
||||
LOG.error("Coule not paste.", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -196,7 +196,7 @@ public class Presenter implements IPlugInPort {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Graphics2D g2d, EnumSet<DrawOption> drawOptions) {
|
||||
public void draw(Graphics2D g2d, Set<DrawOption> drawOptions) {
|
||||
if (currentProject == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user