UnknownNode.java
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
00052
00053
00054
00055
00056
00057
00058
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 }