Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
VioletProduct
  • Loading branch information
tms08012 committed Jun 7, 2012
1 parent 0c7e01c commit f58d1ea
Show file tree
Hide file tree
Showing 34 changed files with 4,720 additions and 0 deletions.
15 changes: 15 additions & 0 deletions VioletProductSwing/VioletProduct.swing/.classpath
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry excluding="src/main/java/" kind="src" path=""/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/VioletProduct.eclipse-plugin/trunk/lib/com.horstmann.violet-2.0.0-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="C:/Users/tms08012/Documents/2012FallJars/com.horstmann.violet-0.21.1.jar"/>
<classpathentry kind="lib" path="C:/Users/tms08012/Documents/2012FallJars/com.horstmann.violet.plugin.classdiagram-1.0-20110219.222952-4.jar"/>
<classpathentry kind="lib" path="C:/Users/tms08012/Documents/2012FallJars/batik-util-1.6-1.jar"/>
<classpathentry kind="lib" path="C:/Users/tms08012/Documents/2012FallJars/batik-swing-1.7.jar"/>
<classpathentry kind="lib" path="C:/Users/tms08012/Documents/2012FallJars/batik-svg-dom-1.7.jar"/>
<classpathentry kind="lib" path="C:/Users/tms08012/Documents/2012FallJars/batik-1.1.1.jar"/>
<classpathentry kind="lib" path="C:/Users/tms08012/Documents/2012FallJars/com.horstmann.violet.framework-1.0-20110219.222320-3.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 17 additions & 0 deletions VioletProductSwing/VioletProduct.swing/.project
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>VioletProduct.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>

Large diffs are not rendered by default.

129 changes: 129 additions & 0 deletions VioletProductSwing/VioletProduct.swing/pom.xml
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.horstmann.violet.product.swing</groupId>
<artifactId>com.horstmann.violet
</artifactId>
<name>Violet UML Editor</name>
<version>2.0.0-SNAPSHOT</version>
<description>The java Swing based version of Violet</description>
<dependencies>
<dependency>
<groupId>com.horstmann.violet.framework</groupId>
<artifactId>com.horstmann.violet.framework</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.horstmann.violet.plugin</groupId>
<artifactId>com.horstmann.violet.plugin.classdiagram</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.horstmann.violet.plugin</groupId>
<artifactId>com.horstmann.violet.plugin.objectdiagram</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.horstmann.violet.plugin</groupId>
<artifactId>com.horstmann.violet.plugin.activitydiagram</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.horstmann.violet.plugin</groupId>
<artifactId>com.horstmann.violet.plugin.sequencediagram</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.horstmann.violet.plugin</groupId>
<artifactId>com.horstmann.violet.plugin.statediagram</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.horstmann.violet.plugin</groupId>
<artifactId>com.horstmann.violet.plugin.usecasediagram</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.gif</include>
<include>**/*.jpg</include>
<include>**/*.png</include>
<include>**/*.txt</include>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.3.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/services/com.horstmann.violet.framework.plugin.IDiagramPlugin</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.horstmann.violet.UMLEditorApplication</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>web.sourceforge.net</id>
<name>Violet's Maven Repository</name>
<url>
sftp://web.sourceforge.net/home/groups/v/vi/violet/htdocs/maven2/repo
</url>
</repository>
</distributionManagement>
<repositories>
<repository>
<id>violet.repo</id>
<name>Violet's Maven repository (public access)</name>
<url>http://violet.sourceforge.net/maven2/repo/
</url>
</repository>
</repositories>
</project>
@@ -0,0 +1,125 @@
/*
Violet - A program for editing UML diagrams.
Copyright (C) 2002 Cay S. Horstmann (http://horstmann.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

package com.horstmann.violet;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.ArrayList;
import java.util.List;

import javax.swing.JApplet;
import javax.swing.JFrame;

import com.horstmann.violet.application.gui.MainFrame;
import com.horstmann.violet.framework.dialog.DialogFactory;
import com.horstmann.violet.framework.dialog.DialogFactoryMode;
import com.horstmann.violet.framework.file.chooser.IFileChooserService;
import com.horstmann.violet.framework.file.chooser.JFileChooserService;
import com.horstmann.violet.framework.file.persistence.IFilePersistenceService;
import com.horstmann.violet.framework.file.persistence.StandardJavaFilePersistenceService;
import com.horstmann.violet.framework.injection.bean.ManiocFramework.BeanFactory;
import com.horstmann.violet.framework.injection.bean.ManiocFramework.BeanInjector;
import com.horstmann.violet.framework.injection.bean.ManiocFramework.InjectedBean;
import com.horstmann.violet.framework.plugin.PluginLoader;
import com.horstmann.violet.framework.theme.ClassicMetalTheme;
import com.horstmann.violet.framework.theme.ITheme;
import com.horstmann.violet.framework.theme.ThemeManager;
import com.horstmann.violet.framework.theme.VistaBlueTheme;
import com.horstmann.violet.framework.userpreferences.AppletUserPreferencesDao;
import com.horstmann.violet.framework.userpreferences.IUserPreferencesDao;

/**
* A program for editing UML diagrams.
*/
public class UMLEditorApplet extends JApplet
{

/*
* Applet entry point (non-Javadoc)
*
* @see java.applet.Applet#init()
*/
public void init()
{
initBeanFactory();
BeanInjector.getInjector().inject(this);
createAppletWorkspace();
}

private void initBeanFactory() {
IUserPreferencesDao userPreferencesDao = new AppletUserPreferencesDao();
BeanFactory.getFactory().register(IUserPreferencesDao.class, userPreferencesDao);

ThemeManager themeManager = new ThemeManager();
ITheme theme1 = new ClassicMetalTheme();
ITheme theme2 = new VistaBlueTheme();
List<ITheme> themeList = new ArrayList<ITheme>();
themeList.add(theme1);
themeList.add(theme2);
themeManager.setInstalledThemes(themeList);
themeManager.setInstalledThemes(themeList);
BeanFactory.getFactory().register(ThemeManager.class, themeManager);
themeManager.applyPreferedTheme();

IFilePersistenceService filePersistenceService = new StandardJavaFilePersistenceService();
BeanFactory.getFactory().register(IFilePersistenceService.class, filePersistenceService);

DialogFactory dialogFactory = new DialogFactory(DialogFactoryMode.INTERNAL);
BeanFactory.getFactory().register(DialogFactory.class, dialogFactory);

IFileChooserService fileChooserService = new JFileChooserService();
BeanFactory.getFactory().register(IFileChooserService.class, fileChooserService);

}


/**
* Creates workspace when application works as an applet. It contains :<br>
* + plugins loading + GUI theme management + launging argments to open diagram<br>
*/
private void createAppletWorkspace()
{
installPlugins();
MainFrame mainFrame = new MainFrame();
mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
mainFrame.addWindowListener(new WindowAdapter()
{
public void windowClosed(WindowEvent e)
{
System.out.println("editor closed");
}
});
setContentPane(mainFrame.getContentPane());
setJMenuBar(mainFrame.getJMenuBar());
}

/**
* Install plugins
*/
private void installPlugins()
{
this.pluginLoader.installPlugins();
}

@InjectedBean
private PluginLoader pluginLoader;

}

0 comments on commit f58d1ea

Please sign in to comment.