Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Draw2d
3.3

org.eclipse.draw2d
Class MidpointLocator

java.lang.Object
  extended by

org.eclipse.draw2d.AbstractLocator
      extended by

org.eclipse.draw2d.ConnectionLocator
          extended by
org.eclipse.draw2d.MidpointLocator
All Implemented Interfaces:
Locator

public class MidpointLocator
extends ConnectionLocator

A ConnectionLocator that is used to place figures at the midpoint between two points on a Connection.


Field Summary
 
Fields inherited from class org.eclipse.draw2d. ConnectionLocator
END, MIDDLE, MIDPOINT, SOURCE, START, TARGET
 
Constructor Summary
MidpointLocator ( Connection c, int i)
          Constructs a MidpointLocator with associated Connection c and index i.
 
Method Summary
protected  int getIndex ()
          Returns this MidpointLocator's index.
protected   Point getReferencePoint ()
          Returns the point of reference associated with this locator.
 
Methods inherited from class org.eclipse.draw2d. ConnectionLocator
getAlignment, getConnection, getLocation, setAlignment, setConnection
 
Methods inherited from class org.eclipse.draw2d. AbstractLocator
getGap, getNewBounds, getRelativePosition, relocate, setGap, setRelativePosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MidpointLocator

public MidpointLocator(
Connection c,
                       int i)
Constructs a MidpointLocator with associated Connection c and index i. The points at index i and i+1 on the connection are used to calculate the midpoint of the line segment.

Parameters:
c - the connection associated with the locator
i - the point from where the connection's midpoint will be calculated.
Since:
2.0
Method Detail

getIndex

protected int getIndex()
Returns this MidpointLocator's index. This integer represents the position of the start point in this MidpointLocator's associated Connection from where midpoint calculation will be made.

Returns:
the locator's index
Since:
2.0

getReferencePoint

protected 
Point getReferencePoint()
Returns the point of reference associated with this locator. This point will be midway between points at 'index' and 'index' + 1.

Overrides:
getReferencePoint in class ConnectionLocator
Returns:
the reference point
Since:
2.0

Eclipse Draw2d
3.3

Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire