org.eclipse.draw2d_3.7.2.v20111017-2020

16:42:54.366 INFO  jd.cli.Main - Decompiling org.eclipse.draw2d_3.7.2.v20111017-2020.jar
package org.eclipse.draw2d;

import org.eclipse.draw2d.geometry.Point;

public class AbsoluteBendpoint
  extends Point
  implements Bendpoint
{
  public AbsoluteBendpoint(Point p)
  {
    super(p);
  }
  
  public AbsoluteBendpoint(int x, int y)
  {
    super(x, y);
  }
  
  public Point getLocation()
  {
    return this;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AbsoluteBendpoint
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import org.eclipse.draw2d.geometry.Insets;

public class AbstractBackground
  extends AbstractBorder
{
  public Insets getInsets(IFigure figure)
  {
    return IFigure.NO_INSETS;
  }
  
  public void paint(IFigure figure, Graphics graphics, Insets insets) {}
  
  public void paintBackground(IFigure figure, Graphics graphics, Insets insets) {}
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AbstractBackground
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Insets;
import org.eclipse.draw2d.geometry.Rectangle;

public abstract class AbstractBorder
  implements Border
{
  private static final Dimension EMPTY = new Dimension();
  protected static Rectangle tempRect = new Rectangle();
  
  protected static final Rectangle getPaintRectangle(IFigure figure, Insets insets)
  {
    tempRect.setBounds(figure.getBounds());
    return tempRect.crop(insets);
  }
  
  public Dimension getPreferredSize(IFigure f)
  {
    return EMPTY;
  }
  
  public boolean isOpaque()
  {
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AbstractBorder
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import java.util.List;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;

public abstract class AbstractConnectionAnchor
  extends ConnectionAnchorBase
  implements AncestorListener
{
  private IFigure owner;
  
  public AbstractConnectionAnchor() {}
  
  public AbstractConnectionAnchor(IFigure owner)
  {
    setOwner(owner);
  }
  
  public void addAnchorListener(AnchorListener listener)
  {
    if (listener == null) {
      return;
    }
    if (listeners.size() == 0) {
      getOwner().addAncestorListener(this);
    }
    super.addAnchorListener(listener);
  }
  
  public void ancestorMoved(IFigure figure)
  {
    fireAnchorMoved();
  }
  
  public void ancestorAdded(IFigure ancestor) {}
  
  public void ancestorRemoved(IFigure ancestor) {}
  
  public IFigure getOwner()
  {
    return owner;
  }
  
  public Point getReferencePoint()
  {
    if (getOwner() == null) {
      return null;
    }
    Point ref = getOwner().getBounds().getCenter();
    getOwner().translateToAbsolute(ref);
    return ref;
  }
  
  public void removeAnchorListener(AnchorListener listener)
  {
    super.removeAnchorListener(listener);
    if (listeners.size() == 0) {
      getOwner().removeAncestorListener(this);
    }
  }
  
  public void setOwner(IFigure owner)
  {
    this.owner = owner;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AbstractConnectionAnchor
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import org.eclipse.draw2d.geometry.Dimension;

public abstract class AbstractHintLayout
  extends AbstractLayout
{
  private Dimension minimumSize = null;
  private Dimension cachedPreferredHint = new Dimension(-1, -1);
  private Dimension cachedMinimumHint = new Dimension(-1, -1);
  
  protected Dimension calculateMinimumSize(IFigure container, int wHint, int hHint)
  {
    return getPreferredSize(container, wHint, hHint);
  }
  
  public Dimension getMinimumSize(IFigure container, int w, int h)
  {
    boolean flush = (cachedMinimumHint.width != w) && 
      (isSensitiveHorizontally(container));
    
    flush = flush | ((cachedMinimumHint.height != h) && (isSensitiveVertically(container)));
    if (flush)
    {
      minimumSize = null;
      cachedMinimumHint.width = w;
      cachedMinimumHint.height = h;
    }
    if (minimumSize == null) {
      minimumSize = calculateMinimumSize(container, w, h);
    }
    return minimumSize;
  }
  
  public final Dimension getPreferredSize(IFigure container, int w, int h)
  {
    boolean flush = (cachedPreferredHint.width != w) && 
      (isSensitiveHorizontally(container));
    
    flush = flush | ((cachedPreferredHint.height != h) && (isSensitiveVertically(container)));
    if (flush)
    {
      preferredSize = null;
      cachedPreferredHint.width = w;
      cachedPreferredHint.height = h;
    }
    return super.getPreferredSize(container, w, h);
  }
  
  public void invalidate()
  {
    minimumSize = null;
    super.invalidate();
  }
  
  protected boolean isSensitiveHorizontally(IFigure container)
  {
    return true;
  }
  
  protected boolean isSensitiveVertically(IFigure container)
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AbstractHintLayout
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public abstract class AbstractImageFigure
  extends Figure
  implements IImageFigure
{
  private List imageListeners = new ArrayList();
  
  public final void addImageChangedListener(IImageFigure.ImageChangedListener listener)
  {
    if (listener == null) {
      throw new IllegalArgumentException();
    }
    imageListeners.add(listener);
  }
  
  public final void removeImageChangedListener(IImageFigure.ImageChangedListener listener)
  {
    if (listener == null) {
      throw new IllegalArgumentException();
    }
    imageListeners.remove(listener);
  }
  
  protected final void notifyImageChanged()
  {
    for (Iterator itr = imageListeners.iterator(); itr.hasNext();) {
      ((IImageFigure.ImageChangedListener)itr.next()).imageChanged();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AbstractImageFigure
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Insets;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;

public abstract class AbstractLabeledBorder
  extends AbstractBorder
  implements LabeledBorder
{
  private Dimension textExtents;
  private String label;
  private Insets insets;
  private Color textColor = ColorConstants.black;
  private Font font;
  
  public AbstractLabeledBorder()
  {
    String className = getClass().getName();
    setLabel(className.substring(className.lastIndexOf('.') + 1, 
      className.length()));
  }
  
  public AbstractLabeledBorder(String s)
  {
    setLabel(s);
  }
  
  protected abstract Insets calculateInsets(IFigure paramIFigure);
  
  protected Font getFont(IFigure f)
  {
    if (font == null) {
      return f.getFont();
    }
    return font;
  }
  
  public Insets getInsets(IFigure fig)
  {
    if (insets == null) {
      insets = calculateInsets(fig);
    }
    return insets;
  }
  
  public String getLabel()
  {
    return label;
  }
  
  public Dimension getPreferredSize(IFigure fig)
  {
    return new Dimension(getTextExtents(fig));
  }
  
  public Color getTextColor()
  {
    return textColor;
  }
  
  protected Dimension getTextExtents(IFigure f)
  {
    if (textExtents == null) {
      textExtents = FigureUtilities.getTextExtents(label, getFont(f));
    }
    return textExtents;
  }
  
  protected void invalidate()
  {
    insets = null;
    textExtents = null;
  }
  
  public void setFont(Font font)
  {
    this.font = font;
    invalidate();
  }
  
  public void setLabel(String s)
  {
    label = (s == null ? "" : s);
    invalidate();
  }
  
  public void setTextColor(Color color)
  {
    textColor = color;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AbstractLabeledBorder
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import org.eclipse.draw2d.geometry.Dimension;

public abstract class AbstractLayout
  implements LayoutManager
{
  protected Dimension preferredSize;
  protected boolean isObservingVisibility = false;
  
  protected final void calculatePreferredSize(IFigure container) {}
  
  protected abstract Dimension calculatePreferredSize(IFigure paramIFigure, int paramInt1, int paramInt2);
  
  protected Dimension getBorderPreferredSize(IFigure container)
  {
    if (container.getBorder() == null) {
      return new Dimension();
    }
    return container.getBorder().getPreferredSize(container);
  }
  
  public Object getConstraint(IFigure child)
  {
    return null;
  }
  
  public final void getMinimumSize(IFigure container) {}
  
  public Dimension getMinimumSize(IFigure container, int wHint, int hHint)
  {
    return getPreferredSize(container, wHint, hHint);
  }
  
  public Dimension getPreferredSize(IFigure container, int wHint, int hHint)
  {
    if (preferredSize == null) {
      preferredSize = calculatePreferredSize(container, wHint, hHint);
    }
    return preferredSize;
  }
  
  public final void getPreferredSize(IFigure container) {}
  
  public void invalidate()
  {
    preferredSize = null;
  }
  
  protected void invalidate(IFigure child)
  {
    invalidate();
  }
  
  public boolean isObservingVisibility()
  {
    return isObservingVisibility;
  }
  
  public void remove(IFigure child)
  {
    invalidate();
  }
  
  public void setConstraint(IFigure child, Object constraint)
  {
    invalidate(child);
  }
  
  public void setObserveVisibility(boolean newValue)
  {
    if (isObservingVisibility == newValue) {
      return;
    }
    isObservingVisibility = newValue;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AbstractLayout
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;

public abstract class AbstractLocator
  implements Locator
{
  private int relativePosition = 2;
  private int gap;
  
  public int getGap()
  {
    return gap;
  }
  
  protected abstract Point getReferencePoint();
  
  protected Rectangle getNewBounds(Dimension size, Point center)
  {
    Rectangle bounds = new Rectangle(center, size);
    
    x -= width / 2;
    y -= height / 2;
    
    int xFactor = 0;int yFactor = 0;
    int position = getRelativePosition();
    if ((position & 0x1) != 0) {
      yFactor = -1;
    } else if ((position & 0x4) != 0) {
      yFactor = 1;
    }
    if ((position & 0x8) != 0) {
      xFactor = -1;
    } else if ((position & 0x10) != 0) {
      xFactor = 1;
    }
    x += xFactor * (width / 2 + getGap());
    y += yFactor * (height / 2 + getGap());
    
    return bounds;
  }
  
  public int getRelativePosition()
  {
    return relativePosition;
  }
  
  public void relocate(IFigure target)
  {
    Dimension prefSize = target.getPreferredSize();
    Point center = getReferencePoint();
    target.translateToRelative(center);
    target.setBounds(getNewBounds(prefSize, center));
  }
  
  public void setGap(int i)
  {
    gap = i;
  }
  
  public void setRelativePosition(int pos)
  {
    relativePosition = pos;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AbstractLocator
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import java.util.Iterator;
import java.util.List;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PointList;

public abstract class AbstractPointListShape
  extends Shape
{
  PointList points = new PointList();
  
  public boolean containsPoint(int x, int y)
  {
    if (!super.containsPoint(x, y)) {
      return false;
    }
    return (shapeContainsPoint(x, y)) || (childrenContainsPoint(x, y));
  }
  
  protected boolean childrenContainsPoint(int x, int y)
  {
    for (Iterator it = getChildren().iterator(); it.hasNext();)
    {
      IFigure nextChild = (IFigure)it.next();
      if (nextChild.containsPoint(x, y)) {
        return true;
      }
    }
    return false;
  }
  
  protected abstract boolean shapeContainsPoint(int paramInt1, int paramInt2);
  
  public void addPoint(Point pt)
  {
    points.addPoint(pt);
    repaint();
  }
  
  public Point getStart()
  {
    return points.getFirstPoint();
  }
  
  public Point getEnd()
  {
    return points.getLastPoint();
  }
  
  public PointList getPoints()
  {
    return points;
  }
  
  public void insertPoint(Point pt, int index)
  {
    points.insertPoint(pt, index);
    repaint();
  }
  
  public void removeAllPoints()
  {
    erase();
    points.removeAllPoints();
  }
  
  public void removePoint(int index)
  {
    erase();
    points.removePoint(index);
    repaint();
  }
  
  public void setStart(Point start)
  {
    if (points.size() == 0) {
      addPoint(start);
    } else {
      setPoint(start, 0);
    }
  }
  
  public void setEnd(Point end)
  {
    if (points.size() < 2) {
      addPoint(end);
    } else {
      setPoint(end, points.size() - 1);
    }
  }
  
  public void setEndpoints(Point start, Point end)
  {
    setStart(start);
    setEnd(end);
  }
  
  public void setPoint(Point pt, int index)
  {
    erase();
    points.setPoint(pt, index);
    repaint();
  }
  
  public void setPoints(PointList points)
  {
    erase();
    this.points = points;
    repaint();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AbstractPointListShape
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import org.eclipse.draw2d.geometry.Point;

public abstract class AbstractRouter
  implements ConnectionRouter
{
  private static final Point START = new Point();
  private static final Point END = new Point();
  
  public Object getConstraint(Connection connection)
  {
    return null;
  }
  
  protected Point getEndPoint(Connection connection)
  {
    Point ref = connection.getSourceAnchor().getReferencePoint();
    return END.setLocation(connection.getTargetAnchor().getLocation(ref));
  }
  
  protected Point getStartPoint(Connection conn)
  {
    Point ref = conn.getTargetAnchor().getReferencePoint();
    return START.setLocation(conn.getSourceAnchor().getLocation(ref));
  }
  
  public void invalidate(Connection connection) {}
  
  public void remove(Connection connection) {}
  
  public void setConstraint(Connection connection, Object constraint) {}
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AbstractRouter
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

public class AccessibleBase
{
  public final int getAccessibleID()
  {
    int value = super.hashCode();
    if (value < 0) {
      value -= 4;
    }
    return value;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AccessibleBase
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import java.util.EventObject;

public class ActionEvent
  extends EventObject
{
  private String actionName;
  
  public ActionEvent(Object source)
  {
    super(source);
  }
  
  public ActionEvent(Object source, String name)
  {
    super(source);
    actionName = name;
  }
  
  public String getActionName()
  {
    return actionName;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.ActionEvent
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

public abstract interface ActionListener
{
  public abstract void actionPerformed(ActionEvent paramActionEvent);
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.ActionListener
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

class AncestorHelper
  implements PropertyChangeListener, FigureListener
{
  protected final IFigure base;
  protected AncestorListener[] listeners;
  
  public AncestorHelper(IFigure baseFigure)
  {
    base = baseFigure;
    addAncestors(baseFigure);
  }
  
  public void addAncestorListener(AncestorListener listener)
  {
    if (listeners == null)
    {
      listeners = new AncestorListener[1];
      listeners[0] = listener;
    }
    else
    {
      int oldSize = listeners.length;
      AncestorListener[] newListeners = new AncestorListener[oldSize + 1];
      System.arraycopy(listeners, 0, newListeners, 0, oldSize);
      newListeners[oldSize] = listener;
      listeners = newListeners;
    }
  }
  
  protected void addAncestors(IFigure rootFigure)
  {
    for (IFigure ancestor = rootFigure; ancestor != null; ancestor = ancestor
          .getParent())
    {
      ancestor.addFigureListener(this);
      ancestor.addPropertyChangeListener("parent", this);
    }
  }
  
  public void dispose()
  {
    removeAncestors(base);
    listeners = null;
  }
  
  public void figureMoved(IFigure ancestor)
  {
    fireAncestorMoved(ancestor);
  }
  
  protected void fireAncestorMoved(IFigure ancestor)
  {
    if (listeners == null) {
      return;
    }
    for (int i = 0; i < listeners.length; i++) {
      listeners[i].ancestorMoved(ancestor);
    }
  }
  
  protected void fireAncestorAdded(IFigure ancestor)
  {
    if (listeners == null) {
      return;
    }
    for (int i = 0; i < listeners.length; i++) {
      listeners[i].ancestorAdded(ancestor);
    }
  }
  
  protected void fireAncestorRemoved(IFigure ancestor)
  {
    if (listeners == null) {
      return;
    }
    for (int i = 0; i < listeners.length; i++) {
      listeners[i].ancestorRemoved(ancestor);
    }
  }
  
  public boolean isEmpty()
  {
    return listeners == null;
  }
  
  public void propertyChange(PropertyChangeEvent event)
  {
    if (event.getPropertyName().equals("parent"))
    {
      IFigure oldParent = (IFigure)event.getOldValue();
      IFigure newParent = (IFigure)event.getNewValue();
      if (oldParent != null)
      {
        removeAncestors(oldParent);
        fireAncestorRemoved(oldParent);
      }
      if (newParent != null)
      {
        addAncestors(newParent);
        fireAncestorAdded(newParent);
      }
    }
  }
  
  public void removeAncestorListener(AncestorListener listener)
  {
    if (listeners == null) {
      return;
    }
    for (int index = 0; index < listeners.length; index++) {
      if (listeners[index] == listener)
      {
        int newSize = listeners.length - 1;
        AncestorListener[] newListeners = (AncestorListener[])null;
        if (newSize != 0)
        {
          newListeners = new AncestorListener[newSize];
          System.arraycopy(listeners, 0, newListeners, 0, index);
          System.arraycopy(listeners, index + 1, newListeners, index, 
            newSize - index);
        }
        listeners = newListeners;
        return;
      }
    }
  }
  
  protected void removeAncestors(IFigure rootFigure)
  {
    for (IFigure ancestor = rootFigure; ancestor != null; ancestor = ancestor
          .getParent())
    {
      ancestor.removeFigureListener(this);
      ancestor.removePropertyChangeListener("parent", this);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AncestorHelper
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

public class AncestorListener$Stub
  implements AncestorListener
{
  public void ancestorMoved(IFigure ancestor) {}
  
  public void ancestorAdded(IFigure ancestor) {}
  
  public void ancestorRemoved(IFigure ancestor) {}
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AncestorListener.Stub
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

public abstract interface AncestorListener
{
  public abstract void ancestorAdded(IFigure paramIFigure);
  
  public abstract void ancestorMoved(IFigure paramIFigure);
  
  public abstract void ancestorRemoved(IFigure paramIFigure);
  
  public static class Stub
    implements AncestorListener
  {
    public void ancestorMoved(IFigure ancestor) {}
    
    public void ancestorAdded(IFigure ancestor) {}
    
    public void ancestorRemoved(IFigure ancestor) {}
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AncestorListener
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

public abstract interface AnchorListener
{
  public abstract void anchorMoved(ConnectionAnchor paramConnectionAnchor);
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AnchorListener
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

class Animation$AnimPair
{
  final Animator animator;
  final IFigure figure;
  
  Animation$AnimPair(Animator animator, IFigure figure)
  {
    this.animator = animator;
    this.figure = figure;
  }
  
  public boolean equals(Object obj)
  {
    AnimPair pair = (AnimPair)obj;
    return (animator == animator) && (figure == figure);
  }
  
  public int hashCode()
  {
    return animator.hashCode() ^ figure.hashCode();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.Animation.AnimPair
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class Animation
{
  private static final int DEFAULT_DELAY = 250;
  private static Set figureAnimators;
  private static Map finalStates;
  private static Map initialStates;
  private static final int PLAYBACK = 3;
  private static float progress;
  private static final int RECORD_FINAL = 2;
  private static final int RECORD_INITIAL = 1;
  private static long startTime;
  private static int state;
  private static Set toCapture;
  private static UpdateManager updateManager;
  
  static class AnimPair
  {
    final Animator animator;
    final IFigure figure;
    
    AnimPair(Animator animator, IFigure figure)
    {
      this.animator = animator;
      this.figure = figure;
    }
    
    public boolean equals(Object obj)
    {
      AnimPair pair = (AnimPair)obj;
      return (animator == animator) && (figure == figure);
    }
    
    public int hashCode()
    {
      return animator.hashCode() ^ figure.hashCode();
    }
  }
  
  private static void capture()
  {
    Iterator keys = figureAnimators.iterator();
    while (keys.hasNext())
    {
      AnimPair pair = (AnimPair)keys.next();
      if (toCapture.contains(pair)) {
        animator.capture(figure);
      } else {
        keys.remove();
      }
    }
  }
  
  static void cleanup()
  {
    if (figureAnimators != null)
    {
      Iterator keys = figureAnimators.iterator();
      while (keys.hasNext())
      {
        AnimPair pair = (AnimPair)keys.next();
        animator.tearDown(figure);
      }
    }
    state = 0;
    step();
    
    initialStates = null;
    finalStates = null;
    figureAnimators = null;
    updateManager = null;
    toCapture = null;
    state = 0;
  }
  
  private static void doRun(int duration)
  {
    state = 2;
    findUpdateManager();
    updateManager.performValidation();
    capture();
    state = 3;
    progress = 0.1F;
    startTime = System.currentTimeMillis();
    
    notifyPlaybackStarting();
    while (progress != 0.0F)
    {
      step();
      updateManager.performUpdate();
      if (progress == 1.0D)
      {
        progress = 0.0F;
      }
      else
      {
        int delta = (int)(System.currentTimeMillis() - startTime);
        if (delta >= duration) {
          progress = 1.0F;
        } else {
          progress = 0.1F + 0.9F * delta / duration;
        }
      }
    }
  }
  
  private static void findUpdateManager()
  {
    AnimPair pair = (AnimPair)figureAnimators.iterator().next();
    updateManager = figure.getUpdateManager();
  }
  
  public static Object getFinalState(Animator animator, IFigure figure)
  {
    return finalStates.get(new AnimPair(animator, figure));
  }
  
  public static Object getInitialState(Animator animator, IFigure figure)
  {
    return initialStates.get(new AnimPair(animator, figure));
  }
  
  public static float getProgress()
  {
    return progress;
  }
  
  static void hookAnimator(IFigure figure, Animator animator)
  {
    AnimPair pair = new AnimPair(animator, figure);
    if (figureAnimators.add(pair)) {
      animator.init(figure);
    }
  }
  
  static void hookNeedsCapture(IFigure figure, Animator animator)
  {
    AnimPair pair = new AnimPair(animator, figure);
    if (figureAnimators.contains(pair)) {
      toCapture.add(pair);
    }
  }
  
  static boolean hookPlayback(IFigure figure, Animator animator)
  {
    if (toCapture.contains(new AnimPair(animator, figure))) {
      return animator.playback(figure);
    }
    return false;
  }
  
  public static boolean isAnimating()
  {
    return state == 3;
  }
  
  static boolean isFinalRecording()
  {
    return state == 2;
  }
  
  static boolean isInitialRecording()
  {
    return state == 1;
  }
  
  public static boolean markBegin()
  {
    if (state == 0)
    {
      state = 1;
      initialStates = new HashMap();
      finalStates = new HashMap();
      figureAnimators = new HashSet();
      toCapture = new HashSet();
      return true;
    }
    return false;
  }
  
  private static void notifyPlaybackStarting()
  {
    Iterator keys = figureAnimators.iterator();
    while (keys.hasNext())
    {
      AnimPair pair = (AnimPair)keys.next();
      animator.playbackStarting(figure);
    }
  }
  
  static void putFinalState(Animator animator, IFigure key, Object state)
  {
    finalStates.put(new AnimPair(animator, key), state);
  }
  
  static void putInitialState(Animator animator, IFigure key, Object state)
  {
    initialStates.put(new AnimPair(animator, key), state);
  }
  
  public static void run()
  {
    run(250);
  }
  
  public static void run(int duration)
  {
    if (state == 0) {
      return;
    }
    try
    {
      if (!figureAnimators.isEmpty()) {
        doRun(duration);
      }
    }
    finally
    {
      cleanup();
    }
  }
  
  private static void step()
  {
    Iterator iter = initialStates.keySet().iterator();
    while (iter.hasNext()) {
      nextfigure.revalidate();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.Animation
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

public abstract class Animator
{
  public void capture(IFigure figure)
  {
    recordFinalState(figure);
  }
  
  protected abstract Object getCurrentState(IFigure paramIFigure);
  
  protected boolean playback(IFigure figure)
  {
    return false;
  }
  
  public void playbackStarting(IFigure figure) {}
  
  protected void recordFinalState(IFigure figure)
  {
    Animation.putFinalState(this, figure, getCurrentState(figure));
  }
  
  protected void recordInitialState(IFigure figure)
  {
    Animation.putInitialState(this, figure, getCurrentState(figure));
  }
  
  public void init(IFigure figure)
  {
    recordInitialState(figure);
  }
  
  public void tearDown(IFigure figure) {}
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.Animator
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import org.eclipse.draw2d.geometry.Insets;

public class ArrowButton
  extends Button
  implements Orientable
{
  public ArrowButton()
  {
    createTriangle();
    setRequestFocusEnabled(false);
    setFocusTraversable(false);
  }
  
  public ArrowButton(int direction)
  {
    createTriangle();
    setRequestFocusEnabled(false);
    setFocusTraversable(false);
    
    setDirection(direction);
  }
  
  protected void createTriangle()
  {
    Triangle tri = new Triangle();
    tri.setOutline(true);
    tri.setBackgroundColor(ColorConstants.listForeground);
    tri.setForegroundColor(ColorConstants.listForeground);
    tri.setBorder(new MarginBorder(new Insets(2)));
    setContents(tri);
  }
  
  public void setDirection(int value)
  {
    setChildrenDirection(value);
  }
  
  public void setOrientation(int value)
  {
    setChildrenOrientation(value);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.ArrowButton
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import org.eclipse.draw2d.geometry.PointList;

public class ArrowLocator
  extends ConnectionLocator
{
  public ArrowLocator(Connection connection, int location)
  {
    super(connection, location);
  }
  
  public void relocate(IFigure target)
  {
    PointList points = getConnection().getPoints();
    RotatableDecoration arrow = (RotatableDecoration)target;
    arrow.setLocation(getLocation(points));
    if (getAlignment() == 2) {
      arrow.setReferencePoint(points.getPoint(1));
    } else if (getAlignment() == 3) {
      arrow.setReferencePoint(points.getPoint(points.size() - 2));
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.ArrowLocator
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

class AutomaticRouter$HashKey
{
  private ConnectionAnchor anchor1;
  private ConnectionAnchor anchor2;
  final AutomaticRouter this$0;
  
  AutomaticRouter$HashKey(AutomaticRouter paramAutomaticRouter, Connection conn)
  {
    anchor1 = conn.getSourceAnchor();
    anchor2 = conn.getTargetAnchor();
  }
  
  public boolean equals(Object object)
  {
    boolean isEqual = false;
    if ((object instanceof HashKey))
    {
      HashKey hashKey = (HashKey)object;
      ConnectionAnchor hkA1 = hashKey.getFirstAnchor();
      ConnectionAnchor hkA2 = hashKey.getSecondAnchor();
      
      isEqual = ((hkA1.equals(anchor1)) && (hkA2.equals(anchor2))) || (
        (hkA1.equals(anchor2)) && (hkA2.equals(anchor1)));
    }
    return isEqual;
  }
  
  public ConnectionAnchor getFirstAnchor()
  {
    return anchor1;
  }
  
  public ConnectionAnchor getSecondAnchor()
  {
    return anchor2;
  }
  
  public int hashCode()
  {
    return anchor1.hashCode() ^ anchor2.hashCode();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AutomaticRouter.HashKey
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import java.util.ArrayList;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.draw2d.internal.MultiValueMap;

public abstract class AutomaticRouter
  extends AbstractRouter
{
  private ConnectionRouter nextRouter;
  private MultiValueMap connections = new MultiValueMap();
  
  private class HashKey
  {
    private ConnectionAnchor anchor1;
    private ConnectionAnchor anchor2;
    
    HashKey(Connection conn)
    {
      anchor1 = conn.getSourceAnchor();
      anchor2 = conn.getTargetAnchor();
    }
    
    public boolean equals(Object object)
    {
      boolean isEqual = false;
      if ((object instanceof HashKey))
      {
        HashKey hashKey = (HashKey)object;
        ConnectionAnchor hkA1 = hashKey.getFirstAnchor();
        ConnectionAnchor hkA2 = hashKey.getSecondAnchor();
        
        isEqual = ((hkA1.equals(anchor1)) && (hkA2.equals(anchor2))) || (
          (hkA1.equals(anchor2)) && (hkA2.equals(anchor1)));
      }
      return isEqual;
    }
    
    public ConnectionAnchor getFirstAnchor()
    {
      return anchor1;
    }
    
    public ConnectionAnchor getSecondAnchor()
    {
      return anchor2;
    }
    
    public int hashCode()
    {
      return anchor1.hashCode() ^ anchor2.hashCode();
    }
  }
  
  public Object getConstraint(Connection connection)
  {
    if (next() != null) {
      return next().getConstraint(connection);
    }
    return null;
  }
  
  protected abstract void handleCollision(PointList paramPointList, int paramInt);
  
  public void invalidate(Connection conn)
  {
    if (next() != null) {
      next().invalidate(conn);
    }
    if ((conn.getSourceAnchor() == null) || (conn.getTargetAnchor() == null)) {
      return;
    }
    HashKey connectionKey = new HashKey(conn);
    ArrayList connectionList = connections.get(connectionKey);
    int affected = connections.remove(connectionKey, conn);
    if (affected != -1) {
      for (int i = affected; i < connectionList.size(); i++) {
        ((Connection)connectionList.get(i)).revalidate();
      }
    } else {
      connections.removeValue(conn);
    }
  }
  
  protected ConnectionRouter next()
  {
    return nextRouter;
  }
  
  public void remove(Connection conn)
  {
    if ((conn.getSourceAnchor() == null) || (conn.getTargetAnchor() == null)) {
      return;
    }
    HashKey connectionKey = new HashKey(conn);
    ArrayList connectionList = connections.get(connectionKey);
    if (connectionList != null)
    {
      int index = connections.remove(connectionKey, conn);
      for (int i = index + 1; i < connectionList.size(); i++) {
        ((Connection)connectionList.get(i)).revalidate();
      }
    }
    if (next() != null) {
      next().remove(conn);
    }
  }
  
  public void route(Connection conn)
  {
    if (next() != null)
    {
      next().route(conn);
    }
    else
    {
      conn.getPoints().removeAllPoints();
      setEndPoints(conn);
    }
    if (conn.getPoints().size() == 2)
    {
      PointList points = conn.getPoints();
      HashKey connectionKey = new HashKey(conn);
      ArrayList connectionList = connections.get(connectionKey);
      if (connectionList != null)
      {
        int index;
        int index;
        if (connectionList.contains(conn))
        {
          index = connectionList.indexOf(conn) + 1;
        }
        else
        {
          index = connectionList.size() + 1;
          connections.put(connectionKey, conn);
        }
        handleCollision(points, index);
        conn.setPoints(points);
      }
      else
      {
        connections.put(connectionKey, conn);
      }
    }
  }
  
  public void setConstraint(Connection connection, Object constraint)
  {
    invalidate(connection);
    if (next() != null) {
      next().setConstraint(connection, constraint);
    }
  }
  
  protected void setEndPoints(Connection conn)
  {
    PointList points = conn.getPoints();
    points.removeAllPoints();
    Point start = getStartPoint(conn);
    Point end = getEndPoint(conn);
    conn.translateToRelative(start);
    conn.translateToRelative(end);
    points.addPoint(start);
    points.addPoint(end);
    conn.setPoints(points);
  }
  
  public void setNextRouter(ConnectionRouter router)
  {
    nextRouter = router;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.AutomaticRouter
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import org.eclipse.draw2d.geometry.Point;

public abstract interface Bendpoint
{
  public abstract Point getLocation();
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.Bendpoint
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.draw2d.geometry.PrecisionPoint;

public class BendpointConnectionRouter
  extends AbstractRouter
{
  private Map constraints = new HashMap(11);
  private static final PrecisionPoint A_POINT = new PrecisionPoint();
  
  public Object getConstraint(Connection connection)
  {
    return constraints.get(connection);
  }
  
  public void remove(Connection connection)
  {
    constraints.remove(connection);
  }
  
  public void route(Connection conn)
  {
    PointList points = conn.getPoints();
    points.removeAllPoints();
    
    List bendpoints = (List)getConstraint(conn);
    if (bendpoints == null) {
      bendpoints = Collections.EMPTY_LIST;
    }
    Point ref2;
    Point ref1;
    Point ref2;
    if (bendpoints.isEmpty())
    {
      Point ref1 = conn.getTargetAnchor().getReferencePoint();
      ref2 = conn.getSourceAnchor().getReferencePoint();
    }
    else
    {
      ref1 = new Point(((Bendpoint)bendpoints.get(0)).getLocation());
      conn.translateToAbsolute(ref1);
      ref2 = new Point(
        ((Bendpoint)bendpoints.get(bendpoints.size() - 1))
        .getLocation());
      conn.translateToAbsolute(ref2);
    }
    A_POINT.setLocation(conn.getSourceAnchor().getLocation(ref1));
    conn.translateToRelative(A_POINT);
    points.addPoint(A_POINT);
    for (int i = 0; i < bendpoints.size(); i++)
    {
      Bendpoint bp = (Bendpoint)bendpoints.get(i);
      points.addPoint(bp.getLocation());
    }
    A_POINT.setLocation(conn.getTargetAnchor().getLocation(ref2));
    conn.translateToRelative(A_POINT);
    points.addPoint(A_POINT);
    conn.setPoints(points);
  }
  
  public void setConstraint(Connection connection, Object constraint)
  {
    constraints.put(connection, constraint);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.BendpointConnectionRouter
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PointList;

public class BendpointLocator
  extends ConnectionLocator
{
  private int index;
  
  public BendpointLocator(Connection c, int i)
  {
    super(c);
    index = i;
  }
  
  protected int getIndex()
  {
    return index;
  }
  
  protected Point getReferencePoint()
  {
    Point p = getConnection().getPoints().getPoint(Point.SINGLETON, 
      getIndex());
    getConnection().translateToAbsolute(p);
    return p;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.BendpointLocator
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Insets;

public abstract interface Border
{
  public abstract Insets getInsets(IFigure paramIFigure);
  
  public abstract Dimension getPreferredSize(IFigure paramIFigure);
  
  public abstract boolean isOpaque();
  
  public abstract void paint(IFigure paramIFigure, Graphics paramGraphics, Insets paramInsets);
}

/* Location:
 * Qualified Name:     org.eclipse.draw2d.Border
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.draw2d;

import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Insets;
import org.eclipse.draw2d.geometry.Rectangle;

public class BorderLayout
  extends AbstractHintLayout
{
  public static final Integer CENTER = new Integer(2);
  public static final Integer TOP = new Integer(8);
  public static final Integer BOTTOM = new Integer(32);
  public static final Integer LEFT = new Integer(1);
  public static final Integer RIGHT = new Integer(4);
  private IFigure center;
  private IFigure left;
  private IFigure top;
  private IFigure bottom;
  private IFigure right;
  private int vGap = 0;
  private int hGap = 0;
  
  protected Dimension calculateMinimumSize(IFigure container, int wHint, int hHint)
  {
    int minWHint = 0;int minHHint = 0;
    if (wHint < 0) {
      minWHint = -1;
    }
    if (hHint < 0) {
      minHHint = -1;
    }
    Insets border = container.getInsets();
    wHint = Math.max(minWHint, wHint - border.getWidth());
    hHint = Math.max(minHHint, hHint - border.getHeight());
    Dimension minSize = new Dimension();
    int middleRowWidth = 0;int middleRowHeight = 0;
    int rows = 0;int columns = 0;
    if ((top != null) && (top.isVisible()))
    {
      Dimension childSize = top.getMinimumSize(wHint, hHint);
      hHint = Math.max(minHHint, hHint - (height + vGap));
      minSize.setSize(childSize);
      rows++;
    }
    if ((bottom != null) 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd