src/main/java/net/timbusproject/extractors/utils
File was removed.
src/main/java/net/timbusproject/extractors/utils/ArchiUtils.java
File was removed.
src/main/java/net/timbusproject/extractors/modules/tavernaextractor/TavernaExtractor.java Diff Switch to side-by-side view
src/main/java/net/timbusproject/extractors/utils/Container.java to src/main/java/net/timbusproject/extractors/modules/tavernaextractor/Activator.java
--- a/src/main/java/net/timbusproject/extractors/utils/Container.java +++ b/src/main/java/net/timbusproject/extractors/modules/tavernaextractor/Activator.java @@ -1,67 +1,25 @@ -package net.timbusproject.extractors.utils; +package net.timbusproject.extractors.modules.tavernaextractor; -import uk.ac.bolton.archimate.model.IArchimateElement; +import net.timbusproject.extractors.core.IExtractor; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; -import java.awt.*; -import java.util.ArrayList; -import java.util.List; +/** + * Created by marco unterberger on 18.08.2014. + * munterberger@sba-research.org + */ +public class Activator implements BundleActivator { -public class Container { - public enum Orientation { - VERTICAL, HORIZONTAL; - } + @Override + public void start(BundleContext bundleContext) throws Exception { + IExtractor extractor = new TavernaExtractor(true); + bundleContext.registerService(TavernaExtractor.class.getName(), extractor, + null); + System.out.println("TavernaExtractor is registered."); + } - private List<IArchimateElement> elements; - private Point maxExtensions; - public Orientation orientation; + @Override + public void stop(BundleContext bundleContext) throws Exception { - // by default HORIZONTAL - public Container() { - this.orientation = Orientation.HORIZONTAL; - this.elements = new ArrayList<IArchimateElement>(); - this.maxExtensions = new Point(150, 150); - } - - public Container(Orientation orientation) { - this(); - this.orientation = orientation; - } - - public void add(IArchimateElement element) { - if (element != null) { - elements.add(element); - resize(); - } - } - - public List<IArchimateElement> getElements() { - return elements; - } - - public IArchimateElement getElementById(String id) { - for (IArchimateElement element : elements) { - if (element.getId().equals(id)) { - return element; - } - } - return null; - } - - public Point getContainerExtensions() { - return maxExtensions; - } - - public Orientation getOrientation() { - return orientation; - } - - private void resize() { - - if (orientation == Orientation.HORIZONTAL) { - maxExtensions.x += 100; - } else { - // it is vertical - maxExtensions.y += 100; - } } }