code format

This commit is contained in:
bancika
2011-01-02 12:15:31 +00:00
parent 9fecfe947c
commit 4da06d79b0
55 changed files with 1093 additions and 1289 deletions
@@ -24,22 +24,16 @@ public class TableTest {
BasicConfigurator.configure();
List<ProjectEntity> projects = new ArrayList<ProjectEntity>();
projects
.add(new ProjectEntity(1, "first", "some text", "bane", "none"));
projects.add(new ProjectEntity(2, "second", "anoter text", "bisera",
"none"));
projects.add(new ProjectEntity(1, "first", "some text", "bane", "none"));
projects.add(new ProjectEntity(2, "second", "anoter text", "bisera", "none"));
ObjectListTable<ProjectEntity> t = new ObjectListTable<ProjectEntity>(
ProjectEntity.class, new String[] { "getName",
"getDescription", "getCategory", "getOwner",
"action:Download" },
new IActionProcessor<ProjectEntity>() {
ObjectListTable<ProjectEntity> t = new ObjectListTable<ProjectEntity>(ProjectEntity.class,
new String[] { "getName", "getDescription", "getCategory", "getOwner",
"action:Download" }, new IActionProcessor<ProjectEntity>() {
@Override
public void actionExecuted(ProjectEntity value,
String actionColumnName) {
System.out.println("row clicked: " + actionColumnName
+ " - " + value);
public void actionExecuted(ProjectEntity value, String actionColumnName) {
System.out.println("row clicked: " + actionColumnName + " - " + value);
}
@Override
@@ -18,20 +18,19 @@ public class Test {
* @param args
*/
public static void main(String[] args) {
// XStream xstream = new XStream(new JettisonMappedXmlDriver());
// xstream.setMode(XStream.NO_REFERENCES);
//
// List<ProjectEntity> projects = new ArrayList<ProjectEntity>();
//// projects.add(new ProjectEntity(1, "first project", "some text",
//// "bancika", "some category"));
//// projects.add(new ProjectEntity(2, "second project", "some text",
//// "bancika", "some category"));
// System.out.println(xstream.toXML(projects));
// XStream xstream = new XStream(new JettisonMappedXmlDriver());
// xstream.setMode(XStream.NO_REFERENCES);
//
// List<ProjectEntity> projects = new ArrayList<ProjectEntity>();
// // projects.add(new ProjectEntity(1, "first project", "some text",
// // "bancika", "some category"));
// // projects.add(new ProjectEntity(2, "second project", "some text",
// // "bancika", "some category"));
// System.out.println(xstream.toXML(projects));
BasicConfigurator.configure();
ProjectSearch search = new ProxyFactory(new PhpFlatProxy())
.createProxy(ProjectSearch.class,
"http://host07.dwhost.net/~diyfever/diylc/db/");
ProjectSearch search = new ProxyFactory(new PhpFlatProxy()).createProxy(
ProjectSearch.class, "http://host07.dwhost.net/~diyfever/diylc/db/");
List<ProjectEntity> results = search.project_search("TestProject");
System.out.println(results);
}
@@ -30,8 +30,8 @@ public class MockComponentInstance implements IComponentInstance {
private Point leftTopCorner = new Point(0, 0);
private String name = "something";
public MockComponentInstance(String testField, Capacitance c, Resistance r,
Size s, Color color, Point leftTopCorner) {
public MockComponentInstance(String testField, Capacitance c, Resistance r, Size s,
Color color, Point leftTopCorner) {
super();
this.testField = testField;
this.c = c;
@@ -113,16 +113,14 @@ public class MockComponentInstance implements IComponentInstance {
@Override
public void draw(Graphics2D g2d, ComponentState componentState) {
g2d.setColor(componentState.equals(ComponentState.SELECTED) ? color
: color.darker());
g2d.setColor(componentState.equals(ComponentState.SELECTED) ? color : color.darker());
g2d.fillRect(leftTopCorner.x, leftTopCorner.y, 200, 50);
}
@Override
public MockComponentInstance clone() throws CloneNotSupportedException {
MockComponentInstance newInstance = new MockComponentInstance(
testField, c.clone(), r.clone(), s.clone(), color,
(Point) leftTopCorner.clone());
MockComponentInstance newInstance = new MockComponentInstance(testField, c.clone(), r
.clone(), s.clone(), color, (Point) leftTopCorner.clone());
return newInstance;
}
}
@@ -15,16 +15,15 @@ public class ClassProcessorTest {
@Test
public void testExtractProperties() {
List<PropertyWrapper> properties = ComponentProcessor.getInstance()
.extractProperties(MockComponentInstance.class);
List<PropertyWrapper> properties = ComponentProcessor.getInstance().extractProperties(
MockComponentInstance.class);
assertNotNull(properties);
assertEquals(4, properties.size());
};
@Test
public void testExtractControlPoints() {
List<ControlPointWrapper> controlPoints = ComponentProcessor
.getInstance()
List<ControlPointWrapper> controlPoints = ComponentProcessor.getInstance()
.extractControlPoints(MockComponentInstance.class);
assertNotNull(controlPoints);
assertEquals(1, controlPoints.size());