/* * MindSundew.java * * Ajatuskihokkipurkkaviritys GZZ 0.6.X:lle. * Mindmap scribble for GZigZag 0.6.X. * * @author asko.soukka@iki.fi * * Copyright (C) 2001 Asko Soukka, based on CompassView.java by Tuukka Hastrup * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * See the LICENSE.lgpl for the specific terms of the license. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. */ package org.gzigzag.module; import org.gzigzag.*; import java.awt.Dimension; import java.lang.Math; import java.awt.Color; import java.awt.Font; import java.awt.FontMetrics; import java.util.Vector; class MindSundew implements FlobView, ZOb { public static final String rcsid = "$Id: MindSundew.java,v 1.1.2.1 2002/02/16 15:19:25 tuukkah Exp $"; private int level = 0; private int levelA = 0; private int levelB = 0; public MindSundew() {} public String readParams(ZZCell c) { return null; }; public void raster(FlobSet into, FlobFactory fact, ZZCell view, String[] dims, ZZCell accursed) { /* ---- alustetaan kaikenlaista ---- */ // FlobDecorator linker = new StdLinks(); ZZCell stdim = ZZCursorReal.get(view.s("d.dims", 1)); Dimension d = into.getSize(); int midx = d.width / 2; int midy = d.height / 2; Dimension c = fact.getSize(null, 1); int cw = c.width; int ch = c.height; ZZUtil.showFlobDims(into, fact, view, 3); /* ---------------------------------------------------- */ /* ---- piirretään ulottuvuuksien värit ylänurkkaan ---- */ LineDecor.Builder line1 = new LineDecor.Builder(into, Color.black); LineDecor.Builder line2 = new LineDecor.Builder(into, Color.gray); LineDecor.Builder line3 = new LineDecor.Builder(into, Color.yellow); line1.startl(4, 1); line2.startl(4, 1); line3.startl(4, 1); line1.l(c.width/2, c.height/2, c.width*2, c.height/2); line2.l(c.width/2, c.height/2, c.width/2, c.height*2); line3.l(c.width/2, c.height/2, c.width*2, c.height*2); line1.endl(); line2.endl(); line3.endl(); /* ---------------------------------------------------- */ /* ---- kutsutaan ensimmäistä piirtokierrosta ---- */ drawLevel(into, fact, dims, accursed, d, c, stdim, midx, midy, cw, ch); //linker.decorate(into, "", view); /* ---------------------------------------------------- */ } private void drawLevel(FlobSet into, FlobFactory fact, String[] dims, ZZCell accursed, Dimension d, Dimension c, ZZCell stdim, int midx, int midy, int cw, int ch) { /* ---- asetetaan piirtokierroksen tasokohtaiset ---- */ level++; float kerroin = 1; // käytetään solujen piirtokoossa if (level > 1) { kerroin = (float)0.7; for (int i=2; i