added PropertyInjector

This commit is contained in:
bancika
2011-01-02 13:16:56 +00:00
parent 6e0bcaa878
commit d4e42566a7
8 changed files with 39 additions and 5 deletions
@@ -9,6 +9,7 @@ import javax.swing.UIManager;
import org.apache.log4j.PropertyConfigurator;
import com.diyfever.diylc.gui.MainFrame;
import com.diyfever.gui.miscutils.PropertyInjector;
/**
*
@@ -28,6 +29,16 @@ public class DIYLCStarter {
} catch (IOException e) {
e.printStackTrace();
}
url = DIYLCStarter.class.getResource("config.properties");
properties = new Properties();
try {
properties.load(url.openStream());
PropertyInjector.injectProperties(properties);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
@@ -5,6 +5,12 @@ import java.lang.reflect.Method;
import com.diyfever.diylc.model.IComponentInstance;
/**
* Entity class for editable properties extracted from component objects.
* Represents a single editable property together with it's current value.
*
* @author Branislav Stojkovic
*/
public class PropertyWrapper implements Cloneable {
private String name;
@@ -3,6 +3,12 @@ package com.diyfever.diylc.model.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Annotates getter for the component name that will be shown in the BOM. Only
* one getter per class may be tagged with this annotation.
*
* @author Branislav Stojkovic
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface BomName {
@@ -3,6 +3,12 @@ package com.diyfever.diylc.model.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Annotates getter for the component value that will be shown in the BOM. Only
* one getter per class may be tagged with this annotation.
*
* @author Branislav Stojkovic
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface BomValue {
@@ -7,9 +7,9 @@ import java.lang.annotation.RetentionPolicy;
import com.diyfever.diylc.model.VisibilityPolicy;
/**
* Annotation for control points. This annotation may be added to a field XYZ of
* type {@link Point} only when both getters and setters for that property
* exist. Annotation is added always on the getter.
* 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.
*
* @author Branislav Stojkovic
*/
@@ -32,7 +32,10 @@ import java.util.Map;
/**
* {@link Graphics2D} wrapper that keeps track of all drawing actions and
* creates an {@link Area} that corresponds to drawn objects.
* creates an {@link Area} that corresponds to drawn objects. Before each
* component is drawn, {@link #startedDrawingComponent()} should be called.
* After the component is drawn, area may be retrieved using
* {@link #finishedDrawingComponent()}.
*
* @author Branislav Stojkovic
*/
@@ -71,7 +74,8 @@ class G2DWrapper extends Graphics2D {
}
/**
* Resets transformation to identity.
* Resets transformation to identity. Should be called only once before any
* drawing is done.
*/
public void resetTx() {
currentTx = new AffineTransform();