~ubuntu-branches/ubuntu/quantal/libjgraph-java/quantal

« back to all changes in this revision

Viewing changes to src/org/jgraph/graph/DefaultGraphCell.java

  • Committer: Bazaar Package Importer
  • Author(s): gregor herrmann
  • Date: 2007-09-17 18:45:29 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070917184529-3a2otncixn4dh2ye
Tags: 5.10.1.5.dfsg-1
* New upstream release.
* Clean up debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
        /**
116
116
         * Utility method to create a port for this cell. This method adds
117
117
         * a floating port.
 
118
         * @return the port created
118
119
         */
119
 
        public void addPort() {
120
 
                addPort(null);
 
120
        public Object addPort() {
 
121
                return addPort(null);
121
122
        }
122
123
 
123
124
        /**
125
126
         * at a fixed relative offset within the cell. If the offset is null
126
127
         * then a floating port is added.
127
128
         * @param offset the offset of the port within the cell
 
129
         * @return the port created
128
130
         */
129
 
        public void addPort(Point2D offset) {
130
 
                addPort(offset, null);
 
131
        public Object addPort(Point2D offset) {
 
132
                return addPort(offset, null);
131
133
        }
132
134
 
133
135
        /**
136
138
         * then a floating port is added.
137
139
         * @param offset the offset of the port within the cell
138
140
         * @param userObject the user object of the port cell
 
141
         * @return the port created
139
142
         */
140
 
        public void addPort(Point2D offset, Object userObject) {
 
143
        public Object addPort(Point2D offset, Object userObject) {
141
144
                DefaultPort port = new DefaultPort(userObject);
142
145
                if (offset == null) {
143
146
                        add(port);
145
148
                        GraphConstants.setOffset(port.getAttributes(), offset);
146
149
                        add(port);
147
150
                }
 
151
                return port;
148
152
        }
149
153
 
150
154
        /**