Generated on Fri Oct 6 16:26:43 2006 for Gecode/J by doxygen 1.4.7

UnknownNode.java

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Guido Tack <tack@gecode.org>
00004  *
00005  *  Copyright:
00006  *     Guido Tack, 2006
00007  *
00008  *  Last modified:
00009  *     $Date: 2006-02-09 16:32:56 +0100 (Thu, 09 Feb 2006) $ by $Author: tack $
00010  *     $Revision: 2943 $
00011  *
00012  *  This file is part of Gecode, the generic constraint
00013  *  development environment:
00014  *     http://www.gecode.org
00015  *
00016  *  See the file "LICENSE" for information on usage and
00017  *  redistribution of this file, and for a
00018  *     DISCLAIMER OF ALL WARRANTIES.
00019  *
00020  */
00021 
00022 package org.gecode.explorer.swing;
00023 
00024 import java.awt.*;
00025 import java.awt.geom.*;
00026 import org.gecode.explorer.*;
00027 
00028 class UnknownNode extends GraphicsNode {
00029 
00030     public UnknownNode() {}
00031 
00032     public void draw(Graphics2D g2, int x, int y, boolean hasShadow) {
00033         if (hasShadow) {
00034             int sx = x+shadowOff; int sy = y+shadowOff;
00035             Ellipse2D.Double myEllipse = new Ellipse2D.Double(sx-halfUnit, sy,
00036                                                               unit, unit);
00037             g2.setPaint(shadow);
00038             g2.fill(myEllipse);
00039             g2.setStroke(stroke);
00040             g2.draw(myEllipse);     
00041         }
00042         Ellipse2D.Double myEllipse = new Ellipse2D.Double(x-halfUnit, y,
00043                                                           unit, unit);
00044         g2.setPaint(bg);
00045         g2.fill(myEllipse);
00046         g2.setPaint(fg);
00047         g2.setStroke(stroke);
00048         g2.draw(myEllipse);
00049     }
00050     public void move(int xoff) {
00051 //         x_coord += xoff;
00052 //         Iterator childrenIterator = children.iterator();
00053 //         while (childrenIterator.hasNext()) {
00054 //             UINode child = (UINode) childrenIterator.next();
00055 //             child.move(xoff);
00056 //         }
00057 //         myEllipse.setFrameFromDiagonal(x_coord-10, y_coord,
00058 //                                        x_coord+10, y_coord+20);
00059     }
00060     public void connect(Graphics2D g2,
00061                         int x, int y,
00062                         int child_x, int child_y) {
00063         g2.setPaint(fg);
00064         g2.setStroke(stroke);
00065 
00066         g2.draw(new Line2D.Double(x, y+20, child_x, child_y));
00067     }
00068 
00069     Point getConnector(int x, int y) {
00070         return new Point(x, y);
00071     }
00072 
00073 
00074     public boolean containsPoint(Coordinate x) {
00075         return true;
00076     }
00077 }