SolutionNode.java
Go to the documentation of this file.00001 package org.gecode.explorer.cocoa;
00002
00003 import com.apple.cocoa.foundation.*;
00004 import com.apple.cocoa.application.*;
00005
00006
00007 public class SolutionNode extends Node {
00008
00009 private static NSBezierPath bezierPath;
00010 private static NSColor insideColor;
00011 private static NSColor borderColor;
00012
00013 private static NSPoint p1 = new NSPoint( 0, 0);
00014 private static NSPoint p2 = new NSPoint( halfUnit, halfUnit);
00015 private static NSPoint p3 = new NSPoint( 0, unit);
00016 private static NSPoint p4 = new NSPoint(- halfUnit, halfUnit);
00017
00018 static {
00019 bezierPath = new NSBezierPath();
00020 bezierPath.moveToPoint(p1);
00021 bezierPath.lineToPoint(p2);
00022 bezierPath.lineToPoint(p3);
00023 bezierPath.lineToPoint(p4);
00024 bezierPath.lineToPoint(p1);
00025 bezierPath.closePath();
00026 insideColor = getDefaultColor("SolutionInside");
00027 borderColor = getDefaultColor("SolutionBorder");
00028 }
00029
00030 public SolutionNode() {
00031 super();
00032 }
00033
00034 public NSBezierPath getBezierPath() {
00035 return bezierPath;
00036 }
00037
00038 public NSColor getInsideColor() {
00039 return insideColor;
00040 }
00041
00042 public NSColor getBorderColor() {
00043 return borderColor;
00044 }
00045
00046 public NSPoint getTopConnector() {
00047 return p1;
00048 }
00049
00050 public NSPoint getBotConnector() {
00051 return p3;
00052 }
00053
00054 }