@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="src" path="src"/>
|
||||||
|
<classpathentry kind="src" path="test"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||||
|
<classpathentry kind="lib" path="lib/log4j-1.2.15.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/xstream-1.3.1.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/junit-4.7.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/iText-2.1.7.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/cloning-1.5.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/objenesis-1.1.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/jettison-1.0.1.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/poi-3.5-FINAL-20090928.jar"/>
|
||||||
|
<classpathentry kind="lib" path="library/main.jar" sourcepath="/diylc-library"/>
|
||||||
|
<classpathentry combineaccessrules="false" kind="src" path="/diylc-core"/>
|
||||||
|
<classpathentry kind="lib" path="lib/app-framework.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/swing-framework.jar"/>
|
||||||
|
<classpathentry kind="output" path="bin"/>
|
||||||
|
</classpath>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>diylc-swing</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||||
|
<stringAttribute key="bad_container_name" value="\DIYLC\r"/>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||||
|
<listEntry value="/diylc-swing/src/org/diylc/DIYLCStarter.java"/>
|
||||||
|
</listAttribute>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||||
|
<listEntry value="1"/>
|
||||||
|
</listAttribute>
|
||||||
|
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
|
||||||
|
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;Library&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;DIYLC&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> </sourceContainers> </sourceLookupDirector> "/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.diylc.DIYLCStarter"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value=""C:\Documents and Settings\bancika\My Documents\deacy.diy""/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="diylc-swing"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms256m -Xmx512m"/>
|
||||||
|
</launchConfiguration>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
ftype diyfile="%CD%\diylc.exe" "%%1"
|
||||||
|
assoc .diy=diyfile
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
<project name="diylc-swing" basedir="." default="jar">
|
||||||
|
<property name="src.dir" value="src" />
|
||||||
|
|
||||||
|
<property name="lib.dir" value="${basedir}/lib" />
|
||||||
|
<property name="build.dir" value="${basedir}/build" />
|
||||||
|
<property name="jar.dir" value="${build.dir}/jar" />
|
||||||
|
<property name="report.dir" value="${build.dir}/junitreport" />
|
||||||
|
<property name="main.class" value="org.diylc.DIYLCStarter" />
|
||||||
|
|
||||||
|
<property name="classes.dir" value="${build.dir}/temp/${ant.project.name}/classes" />
|
||||||
|
<property name="test.classes.dir" value="${build.dir}/temp/${ant.project.name}/test.classes" />
|
||||||
|
|
||||||
|
<target name="clean">
|
||||||
|
<delete dir="${build.dir}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!--change src dir-->
|
||||||
|
<target name="compile">
|
||||||
|
<mkdir dir="${classes.dir}" />
|
||||||
|
<echo>Compile with JDK ${java.runtime.version}</echo>
|
||||||
|
<javac encoding="8859_1" srcdir="${src.dir}" destdir="${classes.dir}" classpathref="class.path" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="resource.copy">
|
||||||
|
<copy todir="${classes.dir}">
|
||||||
|
<fileset dir="${src.dir}">
|
||||||
|
<exclude name="**/*.java" />
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="lib.copy">
|
||||||
|
<copy todir="${jar.dir}/lib" overwrite="true">
|
||||||
|
<fileset dir="${basedir}/lib">
|
||||||
|
<exclude name="**/*dll" />
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
<copy todir="${jar.dir}/library" overwrite="true">
|
||||||
|
<fileset dir="${basedir}/library">
|
||||||
|
<exclude name="**/*dll" />
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
<copy todir="${jar.dir}" overwrite="true">
|
||||||
|
<fileset dir="${basedir}/lib/" includes="**/*.dll" />
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<path id="class.path">
|
||||||
|
<fileset dir="${basedir}">
|
||||||
|
<include name="lib/**/*.jar" />
|
||||||
|
<include name="library/**/*.jar" />
|
||||||
|
</fileset>
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<manifestclasspath jarfile="${ant.project.name}.jar" property="manifest.class.path">
|
||||||
|
<classpath refid="class.path" />
|
||||||
|
</manifestclasspath>
|
||||||
|
|
||||||
|
<target name="jar" depends="clean, lib.copy, resource.copy, compile">
|
||||||
|
<jar destfile="${jar.dir}/diylc.jar" basedir="${classes.dir}">
|
||||||
|
<manifest>
|
||||||
|
<attribute name="Built-By" value="${user.name}" />
|
||||||
|
<attribute name="Main-Class" value="${main.class}" />
|
||||||
|
<attribute name="Class-Path" value="${manifest.class.path}" />
|
||||||
|
</manifest>
|
||||||
|
</jar>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="javadoc">
|
||||||
|
<javadoc access="public" author="true" classpathref="class.path" destdir="doc" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" source="1.6" splitindex="true" use="true" version="true">
|
||||||
|
<fileset dir="${src.dir}">
|
||||||
|
<exclude name="**\.svn\**" />
|
||||||
|
<include name="**/*.java" />
|
||||||
|
</fileset>
|
||||||
|
</javadoc>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Uncomment lines you want to edit and change the part after the "=" sign.
|
||||||
|
#org.diylc.presenter.InstantiationManager.MAX_RECENT_COMPONENTS=20
|
||||||
|
#org.diylc.swing.plugins.canvas.CanvasPanel.USE_HARDWARE_ACCELLERATION=true
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package org.diylc;
|
||||||
|
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import javax.swing.UIManager;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.apache.log4j.PropertyConfigurator;
|
||||||
|
import org.diylc.appframework.miscutils.ConfigurationManager;
|
||||||
|
import org.diylc.appframework.miscutils.PropertyInjector;
|
||||||
|
import org.diylc.presenter.Presenter;
|
||||||
|
import org.diylc.swing.gui.MainFrame;
|
||||||
|
import org.diylc.swing.gui.TemplateDialog;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main class that runs DIYLC.
|
||||||
|
*
|
||||||
|
* @author Branislav Stojkovic
|
||||||
|
*
|
||||||
|
* @see Presenter
|
||||||
|
* @see MainFrame
|
||||||
|
*/
|
||||||
|
public class DIYLCStarter {
|
||||||
|
|
||||||
|
private static final Logger LOG = Logger.getLogger(DIYLCStarter.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param args
|
||||||
|
*/
|
||||||
|
public static void main(String[] args) {
|
||||||
|
URL url = DIYLCStarter.class.getResource("log4j.properties");
|
||||||
|
Properties properties = new Properties();
|
||||||
|
try {
|
||||||
|
properties.load(url.openStream());
|
||||||
|
PropertyConfigurator.configure(properties);
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOG.error("Could not initialize log4j configuration", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG.debug("Java version: " + System.getProperty("java.runtime.version")
|
||||||
|
+ " by " + System.getProperty("java.vm.vendor"));
|
||||||
|
LOG.debug("OS: " + System.getProperty("os.name") + " "
|
||||||
|
+ System.getProperty("os.version"));
|
||||||
|
|
||||||
|
LOG.info("Starting DIYLC with working directory "
|
||||||
|
+ System.getProperty("user.dir"));
|
||||||
|
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOG.error("Could not set Look&Feel", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
MainFrame mainFrame = new MainFrame();
|
||||||
|
mainFrame.setLocationRelativeTo(null);
|
||||||
|
mainFrame.setVisible(true);
|
||||||
|
if (args.length > 0) {
|
||||||
|
mainFrame.getPresenter().loadProjectFromFile(args[0]);
|
||||||
|
} else {
|
||||||
|
boolean showTemplates = ConfigurationManager.getInstance()
|
||||||
|
.readBoolean(TemplateDialog.SHOW_TEMPLATES_KEY, true);
|
||||||
|
if (showTemplates) {
|
||||||
|
TemplateDialog templateDialog = new TemplateDialog(mainFrame,
|
||||||
|
mainFrame.getPresenter());
|
||||||
|
if (!templateDialog.getFiles().isEmpty()) {
|
||||||
|
templateDialog.setVisible(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
properties = new Properties();
|
||||||
|
try {
|
||||||
|
LOG.info("Injecting default properties.");
|
||||||
|
properties.load(new FileInputStream("config.properties"));
|
||||||
|
PropertyInjector.injectProperties(properties);
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOG.error("Could not read config.properties file", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package org.diylc.images;
|
||||||
|
|
||||||
|
import java.awt.Image;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
import javax.swing.Icon;
|
||||||
|
import javax.swing.ImageIcon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads image resources as Icons.
|
||||||
|
*
|
||||||
|
* @author Branislav Stojkovic
|
||||||
|
*/
|
||||||
|
public enum IconLoader {
|
||||||
|
|
||||||
|
Delete("delete.png"), Add("add.png"), FolderOut("folder_out.png"), Garbage("garbage.png"), DiskBlue(
|
||||||
|
"disk_blue.png"), SaveAs("save_as.png"), Exit("exit.png"), DocumentPlainYellow(
|
||||||
|
"document_plain_yellow.png"), PhotoScenery("photo_scenery.png"), LightBulbOn(
|
||||||
|
"lightbulb_on.png"), LightBulbOff("lightbulb_off.png"), NotebookAdd("notebook_add.png"), FormGreen(
|
||||||
|
"form_green.png"), Gears("gears.png"), About("about.png"), WindowColors(
|
||||||
|
"window_colors.png"), WindowGear("window_gear.png"), NavigateCheck("navigate_check.png"), Undo(
|
||||||
|
"undo.png"), Error("error.png"), Warning("warning.png"), ZoomSmall("zoom_small.png"), MoveSmall(
|
||||||
|
"move_small.png"), Print("print.png"), PDF("pdf.png"), Excel("excel.png"), CSV(
|
||||||
|
"csv.png"), HTML("html.png"), Image("image.png"), Cut("cut.png"), Copy("copy.png"), Paste(
|
||||||
|
"paste.png"), Selection("selection.png"), BOM("bom.png"), BlackBoard("blackboard.png"), IdCard(
|
||||||
|
"id_card.png"), IdCardAdd("id_card_add.png"), Chest("chest.png"), Upload("upload.png"), Wrench(
|
||||||
|
"wrench.png"), Group("group.png"), Ungroup("ungroup.png"), TraceMask("trace_mask.png"), Faq(
|
||||||
|
"faq.png"), Component("component.png"), Plugin("plugin.png"), Manual("manual.png"), Donate(
|
||||||
|
"donate.png"), Bug("bug.png"), IconLarge("icon_large.png"), IconMedium(
|
||||||
|
"icon_medium.png"), IconSmall("icon_small.png"), DocumentEdit("document_edit.png"), EditComponent(
|
||||||
|
"edit_component.png"), Size("size.png"), Front("front.png"), Back("back.png"), Pens(
|
||||||
|
"pens.png"), Sort("sort.png"), ElementsSelection("elements_selection.png"), BranchAdd(
|
||||||
|
"branch_add.png");
|
||||||
|
|
||||||
|
protected String name;
|
||||||
|
|
||||||
|
private IconLoader(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Icon getIcon() {
|
||||||
|
java.net.URL imgURL = getClass().getResource(name);
|
||||||
|
if (imgURL != null) {
|
||||||
|
return new ImageIcon(imgURL, name);
|
||||||
|
} else {
|
||||||
|
System.err.println("Couldn't find file: " + name);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Image getImage() {
|
||||||
|
BufferedImage img = null;
|
||||||
|
try {
|
||||||
|
img = ImageIO.read(getClass().getResourceAsStream(name));
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.err.println("Couldn't find file: " + name);
|
||||||
|
}
|
||||||
|
return img;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 875 B |
|
After Width: | Height: | Size: 729 B |
|
After Width: | Height: | Size: 749 B |
|
After Width: | Height: | Size: 736 B |
|
After Width: | Height: | Size: 707 B |
|
After Width: | Height: | Size: 714 B |
|
After Width: | Height: | Size: 993 B |
|
After Width: | Height: | Size: 537 B |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 863 B |
|
After Width: | Height: | Size: 867 B |
|
After Width: | Height: | Size: 850 B |
|
After Width: | Height: | Size: 708 B |
|
After Width: | Height: | Size: 960 B |
|
After Width: | Height: | Size: 901 B |
|
After Width: | Height: | Size: 728 B |
|
After Width: | Height: | Size: 595 B |
|
After Width: | Height: | Size: 781 B |
|
After Width: | Height: | Size: 914 B |
|
After Width: | Height: | Size: 876 B |
|
After Width: | Height: | Size: 853 B |
|
After Width: | Height: | Size: 596 B |
|
After Width: | Height: | Size: 765 B |
|
After Width: | Height: | Size: 696 B |
|
After Width: | Height: | Size: 597 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 845 B |
|
After Width: | Height: | Size: 928 B |
|
After Width: | Height: | Size: 697 B |
|
After Width: | Height: | Size: 771 B |
|
After Width: | Height: | Size: 892 B |
|
After Width: | Height: | Size: 751 B |
|
After Width: | Height: | Size: 834 B |
|
After Width: | Height: | Size: 857 B |
|
After Width: | Height: | Size: 990 B |
|
After Width: | Height: | Size: 842 B |
|
After Width: | Height: | Size: 910 B |
|
After Width: | Height: | Size: 875 B |
|
After Width: | Height: | Size: 694 B |
|
After Width: | Height: | Size: 773 B |
|
After Width: | Height: | Size: 535 B |
|
After Width: | Height: | Size: 1004 B |
|
After Width: | Height: | Size: 995 B |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 656 B |
|
After Width: | Height: | Size: 675 B |
|
After Width: | Height: | Size: 708 B |
|
After Width: | Height: | Size: 771 B |
|
After Width: | Height: | Size: 832 B |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 898 B |
|
After Width: | Height: | Size: 852 B |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 728 B |
|
After Width: | Height: | Size: 789 B |
|
After Width: | Height: | Size: 785 B |
|
After Width: | Height: | Size: 833 B |
|
After Width: | Height: | Size: 798 B |
|
After Width: | Height: | Size: 733 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 747 B |
|
After Width: | Height: | Size: 709 B |
|
After Width: | Height: | Size: 816 B |
|
After Width: | Height: | Size: 783 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 922 B |
|
After Width: | Height: | Size: 728 B |
|
After Width: | Height: | Size: 838 B |
|
After Width: | Height: | Size: 835 B |
|
After Width: | Height: | Size: 895 B |
|
After Width: | Height: | Size: 947 B |
|
After Width: | Height: | Size: 766 B |
|
After Width: | Height: | Size: 376 B |
|
After Width: | Height: | Size: 550 B |
|
After Width: | Height: | Size: 826 B |
|
After Width: | Height: | Size: 388 B |
|
After Width: | Height: | Size: 879 B |
|
After Width: | Height: | Size: 883 B |
|
After Width: | Height: | Size: 857 B |
|
After Width: | Height: | Size: 844 B |