[skycastle-commits] SF.net SVN: skycastle: [481] trunk/skycastle/modules/ui/src

  • From: zzorn@xxxxxxxxxxxxxxxxxxxxx
  • To: skycastle-commits@xxxxxxxxxxxxx
  • Date: Sat, 26 Apr 2008 08:22:06 -0700

Revision: 481
          http://skycastle.svn.sourceforge.net/skycastle/?rev=481&view=rev
Author:   zzorn
Date:     2008-04-26 08:22:04 -0700 (Sat, 26 Apr 2008)

Log Message:
-----------
Moved main model up to base lebel

Modified Paths:
--------------
    
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/group/Group.java
    
trunk/skycastle/modules/ui/src/test/java/org/skycastle/sketch/model/SketchModelTest.java

Added Paths:
-----------
    
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/Sketch.java
    
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/SketchImpl.java

Removed Paths:
-------------
    
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/AbstractGroupElement.java
    
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/Group.java
    
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/GroupElement.java
    
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/GroupImpl.java
    
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/Sketch.java
    
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/SketchImpl.java
    
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/Stroke.java
    
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/StrokeImpl.java
    
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/StrokePoint.java
    
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/StrokePointImpl.java
    trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/sketch/
    
trunk/skycastle/modules/ui/src/test/java/org/skycastle/sketch/TestSketchModel.java

Deleted: 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/AbstractGroupElement.java
===================================================================
--- 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/AbstractGroupElement.java
       2008-04-26 15:20:43 UTC (rev 480)
+++ 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/AbstractGroupElement.java
       2008-04-26 15:22:04 UTC (rev 481)
@@ -1,49 +0,0 @@
-package org.skycastle.sketch.model;
-
-/**
- * @author Hans Haggstrom
- */
-public abstract class AbstractGroupElement
-        implements GroupElement
-{
-
-    //======================================================================
-    // Private Fields
-
-    private String myName = null;
-
-    //======================================================================
-    // Public Methods
-
-    //----------------------------------------------------------------------
-    // Constructors
-
-    public AbstractGroupElement()
-    {
-    }
-
-    public AbstractGroupElement( final String name )
-    {
-        setName( name );
-    }
-
-    //----------------------------------------------------------------------
-    // GroupElement Implementation
-
-    public final String getName()
-    {
-        return myName;
-    }
-
-    //----------------------------------------------------------------------
-    // Other Public Methods
-
-    /**
-     * @param name a user readable name for this element, or null if none 
available.
-     */
-    public final void setName( final String name )
-    {
-        myName = name;
-    }
-
-}

Deleted: 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/Group.java
===================================================================
--- 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/Group.java  
    2008-04-26 15:20:43 UTC (rev 480)
+++ 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/Group.java  
    2008-04-26 15:22:04 UTC (rev 481)
@@ -1,45 +0,0 @@
-package org.skycastle.sketch.model;
-
-import org.skycastle.util.listenable.collection.CollectionListener;
-
-import java.util.List;
-
-/**
- * A way to organize the contents of a {@link Sketch}.
- * <p/>
- * A {@link Group} can contain other {@link Group}s, or {@link Stroke}s.
- *
- * @author Hans Haggstrom
- */
-// IDEA: In the future, various effects could be applied on a group basis.
-public interface Group
-        extends GroupElement
-{
-
-    /**
-     * @param groupElement the {@link GroupElement} that should be added
-     */
-    void add( GroupElement groupElement );
-
-    /**
-     * @param groupElement the {@link GroupElement} that should be removed.
-     */
-    void remove( GroupElement groupElement );
-
-    /**
-     * @param groupElementCollectionListener a listener that is notified when 
{@link GroupElement}s are
-     *                                       added and removed to/from this 
{@link Group}.
-     */
-    void addGroupListener( CollectionListener<GroupElement> 
groupElementCollectionListener );
-
-    /**
-     * @param groupElementCollectionListener the listener to remove.
-     */
-    void removeGroupListener( CollectionListener<GroupElement> 
groupElementCollectionListener );
-
-    /**
-     * @return a read-only view on the {@link GroupElement}s in this {@link 
Group}.
-     */
-    List<GroupElement> getElements();
-
-}

Deleted: 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/GroupElement.java
===================================================================
--- 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/GroupElement.java
       2008-04-26 15:20:43 UTC (rev 480)
+++ 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/GroupElement.java
       2008-04-26 15:22:04 UTC (rev 481)
@@ -1,16 +0,0 @@
-package org.skycastle.sketch.model;
-
-/**
- * Somethign that can be contained in a {@link Group}.
- *
- * @author Hans Haggstrom
- */
-public interface GroupElement
-{
-
-    /**
-     * @return a user readable name for this element, or null if none 
available.
-     */
-    String getName();
-
-}

Deleted: 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/GroupImpl.java
===================================================================
--- 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/GroupImpl.java
  2008-04-26 15:20:43 UTC (rev 480)
+++ 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/GroupImpl.java
  2008-04-26 15:22:04 UTC (rev 481)
@@ -1,53 +0,0 @@
-package org.skycastle.sketch.model;
-
-import org.skycastle.util.listenable.collection.CollectionListener;
-import org.skycastle.util.listenable.collection.list.ListenableArrayList;
-import org.skycastle.util.listenable.collection.list.ListenableMutableList;
-
-import java.util.List;
-
-/**
- * @author Hans Haggstrom
- */
-public final class GroupImpl
-        extends AbstractGroupElement
-        implements Group
-{
-
-    //======================================================================
-    // Private Fields
-
-    private final ListenableMutableList<GroupElement> myElements = new 
ListenableArrayList<GroupElement>( 100 );
-
-    //======================================================================
-    // Public Methods
-
-    //----------------------------------------------------------------------
-    // Group Implementation
-
-    public void add( final GroupElement groupElement )
-    {
-        myElements.add( groupElement );
-    }
-
-    public void remove( final GroupElement groupElement )
-    {
-        myElements.remove( groupElement );
-    }
-
-    public void addGroupListener( final CollectionListener<GroupElement> 
groupElementCollectionListener )
-    {
-        myElements.addCollectionListener( groupElementCollectionListener );
-    }
-
-    public void removeGroupListener( final CollectionListener<GroupElement> 
groupElementCollectionListener )
-    {
-        myElements.removeCollectionListener( groupElementCollectionListener );
-    }
-
-    public List<GroupElement> getElements()
-    {
-        return myElements.getReadOnlyList();
-    }
-
-}

Deleted: 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/Sketch.java
===================================================================
--- 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/Sketch.java 
    2008-04-26 15:20:43 UTC (rev 480)
+++ 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/Sketch.java 
    2008-04-26 15:22:04 UTC (rev 481)
@@ -1,21 +0,0 @@
-package org.skycastle.sketch.model;
-
-/**
- * Holds the data of a drawing.
- * <p/>
- * Strokes can be added and removed.
- * <p/>
- * Strokes can be grouped into Layers.
- *
- * @author Hans Häggström
- */
-public interface Sketch
-{
-
-    /**
-     * @return the base {@link Group} for this {@link Sketch}.
-     *         Can be used to modify the contents of the {@link Sketch}.
-     */
-    Group getRootGroup();
-
-}

Copied: 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/Sketch.java 
(from rev 480, 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/sketch/Sketch.java)
===================================================================
--- 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/Sketch.java 
                            (rev 0)
+++ 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/Sketch.java 
    2008-04-26 15:22:04 UTC (rev 481)
@@ -0,0 +1,23 @@
+package org.skycastle.sketch.model;
+
+import org.skycastle.sketch.model.group.Group;
+
+/**
+ * Holds the data of a drawing.
+ * <p/>
+ * Strokes can be added and removed.
+ * <p/>
+ * Strokes can be grouped into Layers.
+ *
+ * @author Hans Häggström
+ */
+public interface Sketch
+{
+
+    /**
+     * @return the base {@link org.skycastle.sketch.model.group.Group} for 
this {@link Sketch}. Can be used to
+     *         modify the contents of the {@link Sketch}.
+     */
+    Group getRootGroup();
+
+}

Deleted: 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/SketchImpl.java
===================================================================
--- 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/SketchImpl.java
 2008-04-26 15:20:43 UTC (rev 480)
+++ 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/SketchImpl.java
 2008-04-26 15:22:04 UTC (rev 481)
@@ -1,36 +0,0 @@
-package org.skycastle.sketch.model;
-
-/**
- * @author Hans Häggström
- */
-public final class SketchImpl
-        implements Sketch
-{
-
-    //======================================================================
-    // Private Fields
-
-    private final Group myRootGroup = new GroupImpl();
-
-    //======================================================================
-    // Public Methods
-
-    //----------------------------------------------------------------------
-    // Constructors
-
-    /**
-     * Creates a new {@link SketchImpl}.
-     */
-    public SketchImpl()
-    {
-    }
-
-    //----------------------------------------------------------------------
-    // Sketch Implementation
-
-    public Group getRootGroup()
-    {
-        return myRootGroup;
-    }
-
-}

Copied: 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/SketchImpl.java
 (from rev 480, 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/sketch/SketchImpl.java)
===================================================================
--- 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/SketchImpl.java
                         (rev 0)
+++ 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/SketchImpl.java
 2008-04-26 15:22:04 UTC (rev 481)
@@ -0,0 +1,39 @@
+package org.skycastle.sketch.model;
+
+import org.skycastle.sketch.model.group.Group;
+import org.skycastle.sketch.model.group.GroupImpl;
+
+/**
+ * @author Hans Häggström
+ */
+public final class SketchImpl
+        implements Sketch
+{
+
+    //======================================================================
+    // Private Fields
+
+    private final Group myRootGroup = new GroupImpl();
+
+    //======================================================================
+    // Public Methods
+
+    //----------------------------------------------------------------------
+    // Constructors
+
+    /**
+     * Creates a new {@link SketchImpl}.
+     */
+    public SketchImpl()
+    {
+    }
+
+    //----------------------------------------------------------------------
+    // Sketch Implementation
+
+    public Group getRootGroup()
+    {
+        return myRootGroup;
+    }
+
+}

Deleted: 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/Stroke.java
===================================================================
--- 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/Stroke.java 
    2008-04-26 15:20:43 UTC (rev 480)
+++ 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/Stroke.java 
    2008-04-26 15:22:04 UTC (rev 481)
@@ -1,26 +0,0 @@
-package org.skycastle.sketch.model;
-
-/**
- * Immutable, except points can be added (and removed?), and the changes 
listened to.
- *
- * @author Hans Häggström
- */
-public interface Stroke
-        extends GroupElement
-{
-
-    /**
-     * Adds the specified {@link StrokePoint} to this {@link Stroke}.
-     *
-     * @param strokePoint should not be null or already added.
-     */
-    void addPoint( StrokePoint strokePoint );
-
-    /**
-     * Removes the specified {@link StrokePoint} from this {@link Stroke}.
-     *
-     * @param removedPoint should not be null, and should be present.
-     */
-    void removePoint( StrokePoint removedPoint );
-
-}

Deleted: 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/StrokeImpl.java
===================================================================
--- 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/StrokeImpl.java
 2008-04-26 15:20:43 UTC (rev 480)
+++ 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/StrokeImpl.java
 2008-04-26 15:22:04 UTC (rev 481)
@@ -1,48 +0,0 @@
-package org.skycastle.sketch.model;
-
-import org.skycastle.util.ParameterChecker;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Hans Haggstrom
- */
-public final class StrokeImpl
-        extends AbstractGroupElement
-        implements Stroke
-{
-
-    //======================================================================
-    // Private Fields
-
-    private final List<StrokePoint> myPoints = new ArrayList<StrokePoint>( 
INITIAL_POINT_CAPACITY_FOR_STROKE );
-
-    //======================================================================
-    // Private Constants
-
-    private static final int INITIAL_POINT_CAPACITY_FOR_STROKE = 100;
-
-    //======================================================================
-    // Public Methods
-
-    //----------------------------------------------------------------------
-    // Stroke Implementation
-
-    public void addPoint( StrokePoint strokePoint )
-    {
-        ParameterChecker.checkNotNull( strokePoint, "addedPoint" );
-        ParameterChecker.checkNotAlreadyContained( strokePoint, myPoints, 
"myPoints" );
-
-        myPoints.add( strokePoint );
-    }
-
-    public void removePoint( StrokePoint removedPoint )
-    {
-        ParameterChecker.checkNotNull( removedPoint, "removedPoint" );
-        ParameterChecker.checkContained( removedPoint, myPoints, "myPoints" );
-
-        myPoints.remove( removedPoint );
-    }
-
-}

Deleted: 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/StrokePoint.java
===================================================================
--- 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/StrokePoint.java
        2008-04-26 15:20:43 UTC (rev 480)
+++ 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/StrokePoint.java
        2008-04-26 15:22:04 UTC (rev 481)
@@ -1,47 +0,0 @@
-package org.skycastle.sketch.model;
-
-/**
- * A point on a {@link Stroke}
- * <p/>
- * Can be modified by filters when the stroke is created, but usually not 
modified in the final {@link Stroke}.
- *
- * @author Hans Häggström
- */
-public interface StrokePoint
-{
-
-    /**
-     * @return x coordinate of the point.
-     */
-    float getX();
-
-    /**
-     * @param x coordinate of the point.
-     */
-    void setX( float x );
-
-    /**
-     * @return y coordinate of the point.
-     */
-    float getY();
-
-    /**
-     * @param y coordinate of the point.
-     */
-    void setY( float y );
-
-    /**
-     * @param property     the property to get
-     * @param defaultValue value returned if the specified property is not 
available.
-     *
-     * @return the specified property of the stroke.
-     */
-    <T> T getProperty( String property, T defaultValue );
-
-    /**
-     * @param property the property to set
-     * @param value    the value to set the property to.
-     */
-    void setProperty( String property, Object value );
-
-}

Deleted: 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/StrokePointImpl.java
===================================================================
--- 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/StrokePointImpl.java
    2008-04-26 15:20:43 UTC (rev 480)
+++ 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/StrokePointImpl.java
    2008-04-26 15:22:04 UTC (rev 481)
@@ -1,95 +0,0 @@
-package org.skycastle.sketch.model;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Hans Häggström
- */
-public final class StrokePointImpl
-        implements StrokePoint
-{
-
-    //======================================================================
-    // Private Fields
-
-    private float myX = 0;
-    private float myY = 0;
-
-    private Map<String, Object> myProperties = null;
-
-    //======================================================================
-    // Public Methods
-
-    //----------------------------------------------------------------------
-    // Constructors
-
-    /**
-     * Creates a new {@link StrokePointImpl}.
-     */
-    public StrokePointImpl()
-    {
-        this( 0, 0 );
-    }
-
-    /**
-     * Creates a new {@link StrokePointImpl}.
-     *
-     * @param x x coordinate of point, in canvas coordinates.
-     * @param y y coordinate of point, in canvas coordinates.
-     */
-    public StrokePointImpl( float x, float y )
-    {
-        setX( x );
-        setY( y );
-    }
-
-    //----------------------------------------------------------------------
-    // StrokePoint Implementation
-
-    public float getX()
-    {
-        return myX;
-    }
-
-    public void setX( final float x )
-    {
-        myX = x;
-    }
-
-    public float getY()
-    {
-        return myY;
-    }
-
-    public void setY( final float y )
-    {
-        myY = y;
-    }
-
-
-    public <T> T getProperty( final String property, final T defaultValue )
-    {
-        if ( myProperties != null &&
-             myProperties.containsKey( property ) )
-        {
-            //noinspection unchecked
-            return (T) myProperties.get( property );
-        }
-        else
-        {
-            return defaultValue;
-        }
-    }
-
-    public void setProperty( final String property, final Object value )
-    {
-        if ( myProperties == null )
-        {
-            myProperties = new HashMap<String, Object>( 5 );
-        }
-
-        myProperties.put( property, value );
-    }
-
-}

Modified: 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/group/Group.java
===================================================================
--- 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/group/Group.java
        2008-04-26 15:20:43 UTC (rev 480)
+++ 
trunk/skycastle/modules/ui/src/main/java/org/skycastle/sketch/model/group/Group.java
        2008-04-26 15:22:04 UTC (rev 481)
@@ -5,7 +5,7 @@
 import java.util.List;
 
 /**
- * A way to organize the contents of a {@link 
org.skycastle.sketch.model.sketch.Sketch}.
+ * A way to organize the contents of a {@link 
org.skycastle.sketch.model.Sketch}.
  * <p/>
  * A {@link Group} can contain other {@link Group}s, or {@link 
org.skycastle.sketch.model.stroke.Stroke}s.
  *

Deleted: 
trunk/skycastle/modules/ui/src/test/java/org/skycastle/sketch/TestSketchModel.java
===================================================================
--- 
trunk/skycastle/modules/ui/src/test/java/org/skycastle/sketch/TestSketchModel.java
  2008-04-26 15:20:43 UTC (rev 480)
+++ 
trunk/skycastle/modules/ui/src/test/java/org/skycastle/sketch/TestSketchModel.java
  2008-04-26 15:22:04 UTC (rev 481)
@@ -1,37 +0,0 @@
-package org.skycastle.sketch;
-
-import junit.framework.TestCase;
-import org.skycastle.sketch.model.Sketch;
-import org.skycastle.sketch.model.SketchImpl;
-import org.skycastle.sketch.model.Stroke;
-import org.skycastle.sketch.model.StrokePointImpl;
-
-/**
- * @author Hans Häggström
- */
-public class TestSketchModel
-        extends TestCase
-{
-
-    public void testCreateStroke()
-            throws Exception
-    {
-
-        Sketch sketch = new SketchImpl();
-
-        final Stroke stroke = sketch.createStroke();
-
-        stroke.addPoint( new StrokePointImpl() );
-
-    }
-
-
-    /**
-     * Creates a new {@link org.skycastle.sketch.TestSketchModel}.
-     */
-    public TestSketchModel()
-    {
-        throw new UnsupportedOperationException( "Constructor not yet 
implemented." ); // IMPLEMENT
-    }
-
-}

Modified: 
trunk/skycastle/modules/ui/src/test/java/org/skycastle/sketch/model/SketchModelTest.java
===================================================================
--- 
trunk/skycastle/modules/ui/src/test/java/org/skycastle/sketch/model/SketchModelTest.java
    2008-04-26 15:20:43 UTC (rev 480)
+++ 
trunk/skycastle/modules/ui/src/test/java/org/skycastle/sketch/model/SketchModelTest.java
    2008-04-26 15:22:04 UTC (rev 481)
@@ -2,8 +2,6 @@
 
 import junit.framework.TestCase;
 import org.skycastle.sketch.model.point.StrokePointImpl;
-import org.skycastle.sketch.model.sketch.Sketch;
-import org.skycastle.sketch.model.sketch.SketchImpl;
 import org.skycastle.sketch.model.stroke.Stroke;
 import org.skycastle.sketch.model.stroke.StrokeImpl;
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

Other related posts:

  • » [skycastle-commits] SF.net SVN: skycastle: [481] trunk/skycastle/modules/ui/src