The InnovationQ application will be updated on Sunday, May 31st from 10am-noon ET. You may experience brief service interruptions during that time.
Browse Prior Art Database

Technique in Java for drawing lines between Components within Panels

IP.com Disclosure Number: IPCOM000014595D
Original Publication Date: 1999-Oct-01
Included in the Prior Art Database: 2003-Jun-19

Publishing Venue


Related People

Douglas Shue Ferdinand Silva


Disclosed is a simple, flexible mechanism using Java 1.1 for drawing lines between Components embedded within different Panel objects. It facilitates the drawing of connecting lines when objects are organized within rows or columns, e.g. where a row or column is represented as a Panel object with embedded Components. A line connector object can be inserted between these Panel objects and appear as white space between these rows or columns. Connecting lines can then be dynamically drawn between objects in different rows or columns. Using a line connector object simplifies the design of the program and the Panel objects. In addition to the line connector object itself, this mechanism uses a related object which is used to identify an object that is either the source or target of a connecting line. This particular identifer object includes a simple name, the object's width and height, as well as two levels of positional information. The latter is so the object's position and its position within its parent Panel can be tracked. The connector object is an extension of a Canvas object and is considered in its base form to have two sides. The connector can be specified as being in a horizontal or vertical orientation. In its simplest form a line can be drawn between the midpoints of the left and right side or the top and bottom. A horizontal orientation implies that the connector occupies a row and lines will be drawn between its top and bottom. A vertical orientation implies that the connector occupies a column and that lines will be drawn between its left and right side. The connector arbitrarily specifies that the left or top side contains the identifier objects for "sources" and that the bottom or right sides contain the identifier objects for "targets". The basic line connector object has additional methods for creating a vector of sources and targets. The parent Panels will create the identifier objects which directly represent the embedded objects. They then invoke the line connector methods to stow the vectors of identifiers (as sources or targets, depending on where the Panel object is within the layout). When this stowing occurs the identifier objects' positional information is translated into the object coordinates on the particular side of the line connector object. The line connector thus draws lines between certain source and target objects. Note that in this case source and target are convenient names for the two different sides of the line connector. There is no other inherent meaning, especially as related to directionality. Other methods are provided that describe the relationships of objects on either side of the line connector. For instance, a caller can specify that identifier x and identifier y are to be line connected. The method looks for the source and target