mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
added PropertyInjector
This commit is contained in:
Binary file not shown.
+11
@@ -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;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -29,6 +30,16 @@ public class DIYLCStarter {
|
||||
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());
|
||||
} catch (Exception e1) {
|
||||
|
||||
+6
@@ -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;
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
Test=XYZ
|
||||
+6
@@ -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 {
|
||||
|
||||
|
||||
+6
@@ -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 {
|
||||
|
||||
|
||||
+3
-3
@@ -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
|
||||
*/
|
||||
|
||||
+6
-2
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user