View Javadoc

    1   /*
    2    * @(#) EditableRenderable2D.java Aug 3, 2004
    3    *
    4    * Copyright (c) 2003 Delft University of Technology Jaffalaan 5, 2628 BX Delft,
    5    * the Netherlands All rights reserved.
    6    *
    7    * This software is proprietary information of Delft University of Technology
    8    * The code is published under the General Public License
    9    */
    10  package nl.tudelft.simulation.dsol.animation.D2;
    11
    12  import java.rmi.RemoteException;
    13
    14  import nl.tudelft.simulation.dsol.animation.Editable;
    15  import nl.tudelft.simulation.dsol.simulators.SimulatorInterface;
    16
    17  /***
    18   * EditableRenderable2D is an abstract class that implements
    19   * EditableRenderable2DInterface. This class can be extended by classes that
    20   * animate editable simulation objects.
    21   * <p>
    22   * (c) copyright 2003 <a href="http://www.simulation.tudelft.nl">Delft
    23   * University of Technology </a>, the Netherlands. <br>
    24   * See for project information <a
    25   * href="http://www.simulation.tudelft.nl">www.simulation.tudelft.nl </a> <br>
    26   * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
    27   * License (GPL) </a>, no warranty <br>
    28   *
    29   * @author <a href="http://www.tbm.tudelft.nl/webstaf/peterja/index.htm">Peter
    30   *         Jacobs </a>
    31   * @version 1.2 Aug 3, 2004
    32   * @since 1.4
    33   */
    34  public abstract class EditableRenderable2D extends Renderable2D implements
    35          EditableRenderable2DInterface
    36  {
    37      /*** the source of this renderable */
    38      protected Editable source = null;
    39
    40      /***
    41       * constructs a new EditableRenderable2D
    42       *
    43       * @param source
    44       *            the source and target
    45       * @param simulator
    46       *            the simulator
    47       */
    48      public EditableRenderable2D(final Editable source,
    49              final SimulatorInterface simulator)
    50      {
    51          super(source, simulator);
    52          this.source = source;
    53      }
    54
    55      /***
    56       * @see nl.tudelft.simulation.dsol.animation.D2.EditableRenderable2DInterface#isClosedShape()
    57       */
    58      public boolean isClosedShape() throws RemoteException
    59      {
    60          return true;
    61      }
    62
    63      /***
    64       * @see nl.tudelft.simulation.dsol.animation.D2.EditableRenderable2DInterface#allowMove()
    65       */
    66      public boolean allowMove() throws RemoteException
    67      {
    68          return true;
    69      }
    70
    71      /***
    72       * @see nl.tudelft.simulation.dsol.animation.D2.EditableRenderable2DInterface#allowRotate()
    73       */
    74      public boolean allowRotate() throws RemoteException
    75      {
    76          return true;
    77      }
    78
    79      /***
    80       * @see nl.tudelft.simulation.dsol.animation.D2.EditableRenderable2DInterface#allowScale()
    81       */
    82      public boolean allowScale() throws RemoteException
    83      {
    84          return true;
    85      }
    86
    87      /***
    88       * @see nl.tudelft.simulation.dsol.animation.D2.EditableRenderable2DInterface#allowEditPoints()
    89       */
    90      public boolean allowEditPoints() throws RemoteException
    91      {
    92          return true;
    93      }
    94
    95      /***
    96       * @see nl.tudelft.simulation.dsol.animation.D2.EditableRenderable2DInterface#allowDelete()
    97       */
    98      public boolean allowDelete() throws RemoteException
    99      {
    100         return true;
    101     }
    102
    103     /***
    104      * @see nl.tudelft.simulation.dsol.animation.D2.EditableRenderable2DInterface#allowAddOrDeletePoints()
    105      */
    106     public boolean allowAddOrDeletePoints() throws RemoteException
    107     {
    108         return true;
    109     }
    110
    111     /***
    112      * @see nl.tudelft.simulation.dsol.animation.D2.EditableRenderable2DInterface#getMaxNumberOfPoints()
    113      */
    114     public int getMaxNumberOfPoints() throws RemoteException
    115     {
    116         return Integer.MAX_VALUE;
    117     }
    118
    119     /***
    120      * @see nl.tudelft.simulation.dsol.animation.D2.EditableRenderable2DInterface#getMinNumberOfPoints()
    121      */
    122     public int getMinNumberOfPoints() throws RemoteException
    123     {
    124         return 1;
    125     }
    126 }