KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thoughtriver > open > vectorvisuals > meta > connector > EndpointConfiguration


1 /*
2  * EndpointConfiguration.java
3  *
4  * Created on 14 July 2003, 15:23
5  */

6
7 package com.thoughtriver.open.vectorvisuals.meta.connector;
8
9 import java.awt.*;
10
11 import com.thoughtriver.open.vectorvisuals.*;
12
13 /**
14  * Instances of this class are used store the configuration settings for the
15  * endpoints of a <CODE>VisualConnectorObject</CODE>. Changes can be made to
16  * the configuration at any time, so endpoints can be configured without making
17  * API calls to the <CODE>VisualConnectorObject</CODE> itself.
18  *
19  * @author Brandon Franklin
20  * @version $Date: 2006/11/25 08:58:56 $
21  */

22 public class EndpointConfiguration {
23
24     /** The <CODE>Shape</CODE> that is rendered at the endpoint */
25     private Shape shape = null;
26
27     /** The <CODE>VisualObject</CODE> in which the endpoint is located */
28     private VisualObject object = null;
29
30     /** Whether or not the endpoint is "center" or "edge" */
31     private boolean edge = false;
32
33     /**
34      * Creates a new instance of <CODE>EndpointConfiguration</CODE> with the
35      * supplied initial settings.
36      *
37      * @param shape the <CODE>Shape</CODE> that is rendered at the endpoint
38      * @param object the <CODE>VisualObject</CODE> in which the endpoint is
39      * located
40      * @param edge whether or not the endpoint should lie on the outside edge of
41      * the <CODE>VisualObject</CODE>
42      */

43     public EndpointConfiguration(final Shape shape, final VisualObject object, final boolean edge) {
44         setShape(shape);
45         setObject(object);
46         setEdge(edge);
47     }
48
49     /**
50      * Returns the <CODE>Shape</CODE> that is rendered at the endpoint.
51      *
52      * @return the <CODE>Shape</CODE> that is rendered at the endpoint
53      */

54     public Shape getShape() {
55         return shape;
56     }
57
58     /**
59      * Sets the <CODE>Shape</CODE> that is rendered at the endpoint.
60      *
61      * @param shape the <CODE>Shape</CODE> that is rendered at the endpoint
62      */

63     public void setShape(final Shape shape) {
64         this.shape = shape;
65     }
66
67     /**
68      * Returns the <CODE>VisualObject</CODE> in which the endpoint is located.
69      *
70      * @return the <CODE>VisualObject</CODE> in which the endpoint is located
71      */

72     public VisualObject getObject() {
73         return object;
74     }
75
76     /**
77      * Sets the <CODE>VisualObject</CODE> in which the endpoint is located.
78      *
79      * @param object <CODE>VisualObject</CODE> in which the endpoint is
80      * located
81      */

82     public void setObject(final VisualObject object) {
83         this.object = object;
84     }
85
86     /**
87      * Returns whether or not this endpoint should lie along the outer edge of
88      * the associated <CODE>VisualObject</CODE>.
89      *
90      * @return true if this endpoint should lie along the outer edge of the
91      * associated <CODE>VisualObject</CODE>, false otherwise
92      */

93     public boolean isEdge() {
94         return edge;
95     }
96
97     /**
98      * Sets whether or not this endpoint should lie along the outer edge of the
99      * associated <CODE>VisualObject</CODE>.
100      *
101      * @param edge true if this endpoint should lie along the outer edge of the
102      * associated <CODE>VisualObject</CODE>, false otherwise
103      */

104     public void setEdge(final boolean edge) {
105         this.edge = edge;
106     }
107
108 }
109
Popular Tags