added docs

This commit is contained in:
bancika
2011-01-02 12:37:57 +00:00
parent 4da06d79b0
commit 6e0bcaa878
8 changed files with 54 additions and 10 deletions
@@ -1,6 +1,11 @@
package com.diyfever.diylc.model;
/**
* Enumerates all drawing layers.
*
* @author Branislav Stojkovic
*/
public enum ComponentLayer {
BELOW_CHASSIS, CHASSIS, BELOW_BOARD, BOARD, TRACE, COMPONENT, ABOVE_COMPONENT;
BELOW_CHASSIS, CHASSIS, ABOVE_CHASSIS, BELOW_BOARD, BOARD, TRACE, COMPONENT, ABOVE_COMPONENT;
}
@@ -1,5 +1,10 @@
package com.diyfever.diylc.model;
/**
* Enumerates all possible states that a component can be in.
*
* @author Branislav Stojkovic
*/
public enum ComponentState {
NORMAL, SELECTED, LOCKED
@@ -23,6 +23,4 @@ public interface IComponentInstance extends Serializable {
* @param componentState
*/
void draw(Graphics2D g2d, ComponentState componentState);
// IComponentInstance clone() throws CloneNotSupportedException;
}
@@ -8,10 +8,21 @@ import com.diyfever.diylc.model.annotations.EditableProperty;
import com.diyfever.diylc.model.measures.Size;
import com.diyfever.diylc.model.measures.SizeUnit;
/**
* Entity class that defines a project. Contains project properties and a
* collection of components.This class is serialized to file. Some filed getters
* are tagged with {@link EditableProperty} to enable for user to edit them.
*
* @author Branislav Stojkovic
*/
public class Project implements Serializable {
private static final long serialVersionUID = 1L;
public static String DEFAULT_TITLE = "New Project";
public static Size DEFAULT_WIDTH = new Size(29d, SizeUnit.cm);
public static Size DEFAULT_HEIGHT = new Size(21d, SizeUnit.cm);
private String title;
private String author;
private String description;
@@ -21,10 +32,10 @@ public class Project implements Serializable {
public Project() {
components = new ArrayList<IComponentInstance>();
title = "New Project";
title = DEFAULT_TITLE;
author = System.getProperty("user.name");
width = new Size(29d, SizeUnit.cm);
height = new Size(21d, SizeUnit.cm);
width = DEFAULT_WIDTH;
height = DEFAULT_HEIGHT;
}
public Project(String title, String author, String description, Size width, Size height,
@@ -1,6 +1,22 @@
package com.diyfever.diylc.model;
/**
* Enumerates control point visibility policies.
*
* @author Branislav Stojkovic
*/
public enum VisibilityPolicy {
ALWAYS, WHEN_SELECTED, NEVER;
/**
* Control point should be rendered all the time.
*/
ALWAYS,
/**
* Control point should be rendered only when the component is selected.
*/
WHEN_SELECTED,
/**
* Control point should not be rendered regardless of component selection.
*/
NEVER;
}
@@ -8,7 +8,7 @@ public class AbstractMeasure<T extends Enum<? extends Unit>> implements Serializ
private static final long serialVersionUID = 1L;
protected static final Format format = new DecimalFormat("0.00");
protected static final Format format = new DecimalFormat("#.00##");
protected Double value;
protected T unit;
@@ -23,6 +23,11 @@ import com.diyfever.gui.export.DrawingExporter;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
/**
* Entry point class for File management utilities.
*
* @author Branislav Stojkovic
*/
public class FileManager implements IPlugIn {
private static final Logger LOG = Logger.getLogger(FileManager.class);
@@ -253,13 +258,12 @@ public class FileManager implements IPlugIn {
@Override
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
}
@Override
public EnumSet<EventType> getSubscribedEventTypes() {
// TODO Auto-generated method stub
return null;
}
@@ -12,6 +12,11 @@ import com.diyfever.diylc.gui.DialogFactory;
import com.diyfever.diylc.images.IconLoader;
import com.diyfever.gui.AboutDialog;
/**
* Entry point class for help-related utilities.
*
* @author Branislav Stojkovic
*/
public class HelpManager implements IPlugIn {
private static final String HELP_TITLE = "Help";