1// BEGIN LICENSE BLOCK
2// Version: CMPL 1.1
3//
4// The contents of this file are subject to the Cisco-style Mozilla Public
5// License Version 1.1 (the "License"); you may not use this file except
6// in compliance with the License.  You may obtain a copy of the License
7// at www.eclipse-clp.org/license.
8//
9// Software distributed under the License is distributed on an "AS IS"
10// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See
11// the License for the specific language governing rights and limitations
12// under the License.
13//
14// The Original Code is  CPViz Constraint Visualization System
15// The Initial Developer of the Original Code is  Helmut Simonis
16// Portions created by the Initial Developer are
17// Copyright (C) 2009-2010 Helmut Simonis
18//
19// Contributor(s): 	Helmut Simonis, 4C, Univerity College Cork, Cork
20//
21//
22// END LICENSE BLOCK
23// ----------------------------------------------------------------------
24package ie.ucc.cccc.viz;
25import java.io.PrintWriter;
26
27
28/**
29 * A visualizer for a matrix of 0/1 variables derived from VisualizerMatrix
30 * @author hsimonis
31 *
32 */
33public class VisualizerBinaryMatrix extends VisualizerMatrix {
34
35	public VisualizerBinaryMatrix(VisualContext context) {
36		super(context);
37	}
38
39	/**
40	 * the drawing method displays 0/1 values by dedicated colors
41	 */
42	protected void drawMatrixEntry(PrintWriter out,Pair xy,
43			FullDomain list,FullDomain removed){
44		out.println("<!-- index "+xy.getX() + " "+ xy.getY() +" domain "+list+" -->");
45		unitSquareSVG(out,posX(xy),posY(xy),booleanColor(list,removed));
46		if (list.isFixed()){
47			textSVG(out,posX(xy),posY(xy),
48					list.getIntValue(),Colors.ASSIGNED_TEXT_COLOR);
49		}
50	}
51
52
53}
54