Source code: javatools/util/Clippable.java
1 /*
2 * Clippable.java
3 *
4 * Created on 20 settembre 2002, 18.18
5 Javatools (modified version) - Some useful general classes.
6 Copyright (C) 2002-2003 Chris Bitmead (original) Antonio Petrelli (modified)
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
22 Contact me at: brenmcguire@users.sourceforge.net
23 */
24
25 package javatools.util;
26
27 /** It is an interface to be used in things that can be clipped (i.e. cut, copied,
28 * pasted).
29 * @author Antonio Petrelli
30 * @version 0.1.2
31 */
32 public interface Clippable {
33
34 /** Returns the type of the object.
35 * @return The type of the object.
36 */
37 public String getType();
38
39 /** Returns the value of the object.
40 * @return The value.
41 */
42 public Object getValue();
43
44 /** Returns the place that contains this object.
45 * @return The object that contains this object.
46 */
47 public Object getPlace();
48
49 /** Sets the place where the object is put.
50 * @param place The object that contains this object.
51 */
52 public void setPlace(Object place);
53
54 /** Cuts the object.
55 * @return The cut object.
56 */
57 public Clippable cut();
58
59 /** Copies this object.
60 * @return The copied object.
61 */
62 public Clippable copy();
63
64 /** It means that the status of the object must be reset.
65 */
66 public void unclip();
67
68 /** Pastes the object into another.
69 * @param newFather The object to paste this object into.
70 */
71 public void paste(Clippable newFather);
72
73 /** Attaches another object into this one.
74 * @param newSon The object to be pasted into this object.
75 */
76 public void attach(Clippable newSon);
77
78 /** Checks whether this object can be cut or not.
79 * @return <CODE>true</CODE>: the object can be cut;
80 * <CODE>false</CODE>: otherwise.
81 */
82 public boolean canBeCut();
83
84 /** Checks whether this object can be copied or not.
85 * @return <CODE>true</CODE>: the object can be copied;
86 * <CODE>false</CODE>: otherwise.
87 */
88 public boolean canBeCopied();
89
90 /** Checks whether the passed object can be attached into this one.
91 * @param newSon The new object that is going to be attached into this one.
92 * @return <CODE>true</CODE>: the object can be attached;
93 * <CODE>false</CODE>: otherwise.
94 */
95 public boolean canBeAttached(Clippable newSon);
96
97 /** Duplicates (clones) this object.
98 * @return The newly created object.
99 */
100 public Clippable duplicate();
101 }