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 ChopboxAnchor

java.lang.Object
  extended by

org.eclipse.draw2d.ConnectionAnchorBase
      extended by

org.eclipse.draw2d.AbstractConnectionAnchor
          extended by
org.eclipse.draw2d.ChopboxAnchor
All Implemented Interfaces:
AncestorListener, ConnectionAnchor
Direct Known Subclasses:
LabelAnchor

public class ChopboxAnchor
extends AbstractConnectionAnchor

The ChopboxAnchor's location is found by calculating the intersection of a line drawn from the center point of its owner's box to a reference point on that box. Thus Connections using the ChopBoxAnchor will be oriented such that they point to their owner's center.


Nested Class Summary
 
Nested classes inherited from class org.eclipse.draw2d. AncestorListener
AncestorListener.Stub
 
Field Summary
 
Fields inherited from class org.eclipse.draw2d. ConnectionAnchorBase
listeners
 
Constructor Summary
protected ChopboxAnchor ()
          Constructs a new ChopboxAnchor.
  ChopboxAnchor ( IFigure owner)
          Constructs a ChopboxAnchor with the given owner figure.
 
Method Summary
 boolean equals (java.lang.Object obj)
          Returns true if the other anchor has the same owner and box.
protected   Rectangle getBox ()
          Returns the bounds of this ChopboxAnchor's owner.
  Point getLocation ( Point reference)
          Gets a Rectangle from getBox() and returns the Point where a line from the center of the Rectangle to the Point reference intersects the Rectangle.
  Point getReferencePoint ()
          Returns the anchor's reference point.
 int hashCode ()
          The owning figure's hashcode is used since equality is approximately based on the owner.
 
Methods inherited from class org.eclipse.draw2d. AbstractConnectionAnchor
addAnchorListener, ancestorAdded, ancestorMoved, ancestorRemoved, getOwner, removeAnchorListener, setOwner
 
Methods inherited from class org.eclipse.draw2d. ConnectionAnchorBase
fireAnchorMoved
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChopboxAnchor

protected ChopboxAnchor()
Constructs a new ChopboxAnchor.


ChopboxAnchor

public ChopboxAnchor(
IFigure owner)
Constructs a ChopboxAnchor with the given owner figure.

Parameters:
owner - The owner figure
Since:
2.0
Method Detail

getLocation

public 
Point getLocation(
Point reference)
Gets a Rectangle from getBox() and returns the Point where a line from the center of the Rectangle to the Point reference intersects the Rectangle.

Parameters:
reference - The reference point
Returns:
The anchor location

getBox

protected 
Rectangle getBox()
Returns the bounds of this ChopboxAnchor's owner. Subclasses can override this method to adjust the box the anchor can be placed on. For instance, the owner figure may have a drop shadow that should not be included in the box.

Returns:
The bounds of this ChopboxAnchor's owner
Since:
2.0

getReferencePoint

public 
Point getReferencePoint()
Returns the anchor's reference point. In the case of the ChopboxAnchor, this is the center of the anchor's owner.

Specified by:
getReferencePoint in interface ConnectionAnchor
Overrides:
getReferencePoint in class AbstractConnectionAnchor
Returns:
The reference point
See Also:
ConnectionAnchor.getReferencePoint()

equals

public boolean equals(java.lang.Object obj)
Returns true if the other anchor has the same owner and box.

Parameters:
obj - the other anchor
Returns:
true if equal

hashCode

public int hashCode()
The owning figure's hashcode is used since equality is approximately based on the owner.

Returns:
the hash code.

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